From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 6E9AC210DF5F6 for ; Tue, 7 Aug 2018 20:39:51 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Aug 2018 20:39:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,456,1526367600"; d="scan'208";a="79843090" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga001.jf.intel.com with ESMTP; 07 Aug 2018 20:39:49 -0700 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 7 Aug 2018 20:39:48 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 7 Aug 2018 20:39:48 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.240]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.143]) with mapi id 14.03.0319.002; Wed, 8 Aug 2018 11:39:44 +0800 From: "Zhu, Yonghong" To: "Carsey, Jaben" , "Gao, Liming" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH v1 1/1] PatchCheck - add error message for invalid parameter Thread-Index: AQHUKreTvZLqefo65E6BGowyh+WVDqStQXkAgABaGQCAB6HcMA== Date: Wed, 8 Aug 2018 03:39:44 +0000 Message-ID: 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 03:39:51 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yonghong Zhu =20 Best Regards, Zhu Yonghong -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Cars= ey, 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 inval= id 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 th= at is not a commit identifier nor a filename. I found it when I tried to s= elect 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=20 > invalid parameter > Importance: High >=20 > Jaben: > Could you give me one failure case? Then, I can further understand=20 > the patch. >=20 > Thanks > Liming > >-----Original Message----- > >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf=20 > >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=20 > >invalid 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=20 > >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=20 > >- 2017, Intel Corporation. All rights reserved.
> >+# Copyright (c) 2015 - 2018, Intel Corporation. All rights=20 > >+reserved.
> > # > > # This program and the accompanying materials are licensed and made =20 > ># available under the terms and conditions of the BSD License which=20 > >@@ -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:=20 > >+ '{}'".format(rev_spec)) > > > > def read_commit_list_from_git(self, rev_spec, max_count): > > # Run git to get the commit patch @@ -536,7 +538,7 @@ class=20 > >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=20 > >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 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel