From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 009FB1A1E10 for ; Mon, 17 Oct 2016 09:48:34 -0700 (PDT) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP; 17 Oct 2016 09:48:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,357,1473145200"; d="scan'208";a="180680163" Received: from ahjahagi-mobl1.amr.corp.intel.com (HELO localhost) ([10.252.140.179]) by fmsmga004.fm.intel.com with ESMTP; 17 Oct 2016 09:48:34 -0700 MIME-Version: 1.0 To: Yonghong Zhu , edk2-devel@lists.01.org Message-ID: <147672291414.943.6276903307446370586@jljusten-ivb> From: Jordan Justen In-Reply-To: <1476692918-10716-3-git-send-email-yonghong.zhu@intel.com> Cc: "Liming Gao" References: <1476692918-10716-1-git-send-email-yonghong.zhu@intel.com> <1476692918-10716-3-git-send-email-yonghong.zhu@intel.com> User-Agent: alot/0.3.7 Date: Mon, 17 Oct 2016 09:48:34 -0700 Subject: Re: [Patch 2/3] BaseTools: Update PatchCheck to handle the two [] as prefix X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2016 16:48:35 -0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable A small (not too important) suggestion for the patch subject might be: BaseTools/PatchCheck.py: Update to handle the two [] as prefix On 2016-10-17 01:28:37, Yonghong Zhu wrote: > The bug is that only remove the first [] when it does the char count, > however sometimes we use [edk2][patch] as prefix, this patch fix this bug. > = > Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=3D113 > = Remove blank line after 'Fixes:'. > Cc: Liming Gao > Cc: Jordan Justen > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Yonghong Zhu > --- > BaseTools/Scripts/PatchCheck.py | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-) > = > diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchChe= ck.py > index 07fca68..05f8f6e 100755 > --- a/BaseTools/Scripts/PatchCheck.py > +++ b/BaseTools/Scripts/PatchCheck.py > @@ -434,10 +434,18 @@ class CheckOnePatch: > [\s\S\r\n]+ > ) > ''', > re.IGNORECASE | re.VERBOSE | re.MULTILINE) > = > + subject_prefix_re =3D \ > + re.compile(r'''^ > + \s* (\[ > + [^\[\]]* # Allow all non-brackets > + \])* \s* > + ''', > + re.VERBOSE) > + > def find_patch_pieces(self): > if sys.version_info < (3, 0): > patch =3D self.patch.encode('ascii', 'ignore') > else: > patch =3D self.patch > @@ -470,18 +478,11 @@ class CheckOnePatch: > self.stat =3D mo.group('stat') > self.commit_msg =3D mo.group('commit_message') > = > self.commit_subject =3D pmail['subject'].replace('\r\n', '') > self.commit_subject =3D self.commit_subject.replace('\n', '') > - > - pfx_start =3D self.commit_subject.find('[') > - if pfx_start >=3D 0: > - pfx_end =3D self.commit_subject.find(']') > - if pfx_end > pfx_start: > - self.commit_prefix =3D self.commit_subject[pfx_start + 1= : pfx_end] Since we no longer set self.commit_prefix, and you remove the other references to it in the script? Reviewed-by: Jordan Justen > - self.commit_subject =3D self.commit_subject[pfx_end + 1 = :].lstrip() > - > + self.commit_subject =3D self.subject_prefix_re.sub('', self.comm= it_subject, 1) > = > class CheckGitCommits: > """Reads patches from git based on the specified git revision range. > = > The patches are read from git, and then checked. > -- = > 2.6.1.windows.1 >=20