From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.938.1578092347979397113 for ; Fri, 03 Jan 2020 14:59:08 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: jordan.l.justen@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jan 2020 14:59:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,392,1571727600"; d="scan'208";a="420143968" Received: from kdejong-mobl1.amr.corp.intel.com (HELO localhost) ([10.252.133.68]) by fmsmga005.fm.intel.com with ESMTP; 03 Jan 2020 14:59:06 -0800 MIME-Version: 1.0 In-Reply-To: <20200102152553.11976-5-philmd@redhat.com> References: <20200102152553.11976-1-philmd@redhat.com> <20200102152553.11976-5-philmd@redhat.com> From: "Jordan Justen" Cc: Laszlo Ersek , Michael D Kinney , Philippe Mathieu-Daude , Liming Gao Subject: Re: [RFC PATCH 4/4] BaseTools/PatchCheck.py: Check the committer email address To: Philippe Mathieu-Daude , devel@edk2.groups.io Message-ID: <157809234606.2557980.3513866584435812764@jljusten-skl> User-Agent: alot/0.8 Date: Fri, 03 Jan 2020 14:59:06 -0800 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On 2020-01-02 07:25:53, Philippe Mathieu-Daude wrote: > To avoid patches committed with incorrect email address, > use the EmailAddressCheck class on the committer email too. >=20 > Cc: Liming Gao > Cc: Jordan Justen > Signed-off-by: Philippe Mathieu-Daude > --- > RFC because I haven't checked --pretty=3D"%cn <%ce>" works on Windows she= ll. >=20 > BaseTools/Scripts/PatchCheck.py | 6 ++++++ > 1 file changed, 6 insertions(+) >=20 > diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchChe= ck.py > index f0e661bfd6e3..3baeb3de7ba2 100755 > --- a/BaseTools/Scripts/PatchCheck.py > +++ b/BaseTools/Scripts/PatchCheck.py > @@ -560,6 +560,8 @@ class CheckGitCommits: > else: > blank_line =3D True > print('Checking git commit:', commit) > + email =3D self.read_committer_email_address_from_git(commit) > + self.ok &=3D EmailAddressCheck(email, 'Committer').ok > patch =3D self.read_patch_from_git(commit) > self.ok &=3D CheckOnePatch(commit, patch).ok > if not commits: > @@ -578,6 +580,10 @@ class CheckGitCommits: > # Run git to get the commit patch > return self.run_git('show', '--pretty=3Demail', '--no-textconv',= commit) > =20 > + def read_committer_email_address_from_git(self, commit): > + # Run git to get the committer email > + return self.run_git('show', '--pretty=3D"%cn <%ce>"', '--no-patc= h', commit) I think '--pretty=3D%cn <%ce>' ought to work without double-quotes because the argument is separately sent via the subprocess.Popen call. I'm not certain it will work, but it ought to. :) -Jordan > + > def run_git(self, *args): > cmd =3D [ 'git' ] > cmd +=3D args > --=20 > 2.21.0 >=20