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.93; helo=mga11.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 A2EFB210C5138 for ; Fri, 3 Aug 2018 02:45:10 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Aug 2018 02:45:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,438,1526367600"; d="scan'208";a="77018784" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga004.fm.intel.com with ESMTP; 03 Aug 2018 02:44:06 -0700 Received: from fmsmsx111.amr.corp.intel.com (10.18.116.5) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 3 Aug 2018 02:44:06 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx111.amr.corp.intel.com (10.18.116.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 3 Aug 2018 02:44:06 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.81]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.100]) with mapi id 14.03.0319.002; Fri, 3 Aug 2018 17:44:03 +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 Date: Fri, 3 Aug 2018 09:44:02 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E2C5578@SHSMSX104.ccr.corp.intel.com> References: <35db4208c876291862f2d0a62d7064793ce08331.1533252046.git.jaben.carsey@intel.com> In-Reply-To: <35db4208c876291862f2d0a62d7064793ce08331.1533252046.git.jaben.carsey@intel.com> 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: Fri, 03 Aug 2018 09:45:10 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Jaben: Could you give me one failure case? Then, I can further understand the pa= tch.=20 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 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 >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.
>+# Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
> # > # 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_spec)) > > 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