From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web12.12920.1577978771556823763 for ; Thu, 02 Jan 2020 07:26:11 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AgD3nDRm; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: philmd@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1577978770; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=a31h700I5P9y8yLlpLyLx+xSU/+0CdqI7EOkOdOwCS8=; b=AgD3nDRmp4LofcRdAVgdZAJLPobjqeX9vsr7D/M6JIH8nnRT12JZNIPVvIXc363iStxA24 pvLJunoQMHIE7arPVayT/d9EYDMNQydaoSO48RZ4HnrcNaQZ2vrlM9Rb4oc0W+5TKA5gmD zB6EsQ+avlK4s60h8JP2e0jm+Ltlgzs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-204-N3xZVrFNOSGINt1mw1ealg-1; Thu, 02 Jan 2020 10:26:09 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2E90E18A6EF4; Thu, 2 Jan 2020 15:26:08 +0000 (UTC) Received: from x1w.redhat.com (ovpn-116-83.ams2.redhat.com [10.36.116.83]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7368577E8D; Thu, 2 Jan 2020 15:26:06 +0000 (UTC) From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= To: devel@edk2.groups.io Cc: Laszlo Ersek , Michael D Kinney , Philippe Mathieu-Daude , Liming Gao , Jordan Justen Subject: [RFC PATCH 4/4] BaseTools/PatchCheck.py: Check the committer email address Date: Thu, 2 Jan 2020 16:25:53 +0100 Message-Id: <20200102152553.11976-5-philmd@redhat.com> In-Reply-To: <20200102152553.11976-1-philmd@redhat.com> References: <20200102152553.11976-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: N3xZVrFNOSGINt1mw1ealg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable To avoid patches committed with incorrect email address, use the EmailAddressCheck class on the committer email too. 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 shell= . BaseTools/Scripts/PatchCheck.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck= .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', c= ommit) =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-patch'= , commit) + def run_git(self, *args): cmd =3D [ 'git' ] cmd +=3D args --=20 2.21.0