From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2B1B0210DF5EC for ; Tue, 7 Aug 2018 18:28:39 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Aug 2018 18:28:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,456,1526367600"; d="scan'208";a="222807896" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga004.jf.intel.com with ESMTP; 07 Aug 2018 18:28:25 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 7 Aug 2018 18:28:25 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 7 Aug 2018 18:28:24 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.143]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.205]) with mapi id 14.03.0319.002; Wed, 8 Aug 2018 09:28:22 +0800 From: "Gao, Liming" To: "Carsey, Jaben" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH v1 1/1] PatchCheck - add error message for invalid parameter Thread-Index: AQHUKreE2QOsDhkcv0SPbYOzyPiD9aStx1og///UOACAB3z38A== Date: Wed, 8 Aug 2018 01:28:20 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E2D8B58@SHSMSX104.ccr.corp.intel.com> References: <35db4208c876291862f2d0a62d7064793ce08331.1533252046.git.jaben.carsey@intel.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E2C5578@SHSMSX104.ccr.corp.intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH v1 1/1] PatchCheck - add error message for invalid parameter X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Aug 2018 01:28:40 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Jaben: I verify this case. Your patch fixes it.=20 Tested-by: Liming Gao Thanks Liming >-----Original Message----- >From: Carsey, Jaben >Sent: Friday, August 03, 2018 11:07 PM >To: Gao, Liming ; edk2-devel@lists.01.org >Subject: RE: [edk2] [PATCH v1 1/1] PatchCheck - add error message for inva= lid >parameter > >Absolutely. I should have thought to add that. > >"Python ScriptCheck.py t" > >Assuming there is no commit or file called "t". Basically just anything t= hat is >not a commit identifier nor a filename. I found it when I tried to select= a >commit and misspelled it. > >-Jaben > >> -----Original Message----- >> From: Gao, Liming >> Sent: Friday, August 03, 2018 2:44 AM >> To: Carsey, Jaben ; edk2-devel@lists.01.org >> Subject: RE: [edk2] [PATCH v1 1/1] PatchCheck - add error message for >> invalid parameter >> Importance: High >> >> Jaben: >> Could you give me one failure case? Then, I can further understand the >> patch. >> >> Thanks >> Liming >> >-----Original Message----- >> >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of >> >Jaben Carsey >> >Sent: Friday, August 03, 2018 7:21 AM >> >To: edk2-devel@lists.01.org >> >Cc: Gao, Liming >> >Subject: [edk2] [PATCH v1 1/1] PatchCheck - add error message for inval= id >> >parameter >> > >> >Currently if an invalid parameter is passed, it gives a stack trace. >> >This changes it to an error message. >> > >> >Cc: Liming Gao >> >Cc: Yonghong Zhu >> >Contributed-under: TianoCore Contribution Agreement 1.1 >> >Signed-off-by: Jaben Carsey >> >--- >> > BaseTools/Scripts/PatchCheck.py | 9 ++++++--- >> > 1 file changed, 6 insertions(+), 3 deletions(-) >> > >> >diff --git a/BaseTools/Scripts/PatchCheck.py >> >b/BaseTools/Scripts/PatchCheck.py >> >index 7b7fba8b7044..96b3cdf1fd8a 100755 >> >--- a/BaseTools/Scripts/PatchCheck.py >> >+++ b/BaseTools/Scripts/PatchCheck.py >> >@@ -1,7 +1,7 @@ >> > ## @file >> > # Check a patch for various format issues >> > # >> >-# Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<= BR> >> >+# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<= BR> >> > # >> > # This program and the accompanying materials are licensed and made >> > # available under the terms and conditions of the BSD License which >> >@@ -528,6 +528,8 @@ class CheckGitCommits: >> > print('Checking git commit:', commit) >> > patch =3D self.read_patch_from_git(commit) >> > self.ok &=3D CheckOnePatch(commit, patch).ok >> >+ if not commits: >> >+ print("Couldn't find commit matching: '{}'".format(rev_spe= c)) >> > >> > def read_commit_list_from_git(self, rev_spec, max_count): >> > # Run git to get the commit patch >> >@@ -536,7 +538,7 @@ class CheckGitCommits: >> > cmd.append('--max-count=3D' + str(max_count)) >> > cmd.append(rev_spec) >> > out =3D self.run_git(*cmd) >> >- return out.split() >> >+ return out.split() if out else [] >> > >> > def read_patch_from_git(self, commit): >> > # Run git to get the commit patch >> >@@ -548,7 +550,8 @@ class CheckGitCommits: >> > p =3D subprocess.Popen(cmd, >> > stdout=3Dsubprocess.PIPE, >> > stderr=3Dsubprocess.STDOUT) >> >- return p.communicate()[0].decode('utf-8', 'ignore') >> >+ Result =3D p.communicate() >> >+ return Result[0].decode('utf-8', 'ignore') if Result[0] and >> >Result[0].find("fatal")!=3D0 else None >> > >> > class CheckOnePatchFile: >> > """Performs a patch check for a single file. >> >-- >> >2.16.2.windows.1 >> > >> >_______________________________________________ >> >edk2-devel mailing list >> >edk2-devel@lists.01.org >> >https://lists.01.org/mailman/listinfo/edk2-devel