From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.61]) by mx.groups.io with SMTP id smtpd.web11.2068.1578306950637382217 for ; Mon, 06 Jan 2020 02:35:50 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AXzkEfNN; spf=pass (domain: redhat.com, ip: 205.139.110.61, mailfrom: philmd@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578306949; 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=VTET8KMBjf5Squkuyt87AjSsEe5YgaEs46Fi9rTIEhE=; b=AXzkEfNNReOnFhkJazDVaatkJoOKSnCSIXsQA6avARqVQhyV5Ni7/Lt8k4zuAwb/8OG1FV Je9p+1wHnLQE4c95gRxmFijav8s/nWHvcOo+HpWqj8OaScu+DUqBG/9lCW/ZzyStfBMSnx lKS62nRLwWmvxuF6Q526UKsS7evrLGI= 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-162-aqGmy-_NNxefC0DAH9ubVw-1; Mon, 06 Jan 2020 05:35:48 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8B419107ACE3; Mon, 6 Jan 2020 10:35:47 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-53.brq.redhat.com [10.40.204.53]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 13F805D9E1; Mon, 6 Jan 2020 10:35:44 +0000 (UTC) From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= To: devel@edk2.groups.io Cc: Michael D Kinney , Laszlo Ersek , Philippe Mathieu-Daude , Liming Gao , Jordan Justen Subject: [PATCH v2 4/4] BaseTools/PatchCheck.py: Check the committer email address Date: Mon, 6 Jan 2020 11:35:28 +0100 Message-Id: <20200106103528.5438-5-philmd@redhat.com> In-Reply-To: <20200106103528.5438-1-philmd@redhat.com> References: <20200106103528.5438-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-MC-Unique: aqGmy-_NNxefC0DAH9ubVw-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 --- v2: Do not use "" because we use subprocess.Popen (Jordan Justen) --- BaseTools/Scripts/PatchCheck.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck= .py index f0e661bfd6e3..c5f2f89e4d4c 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.1