From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.81]) by mx.groups.io with SMTP id smtpd.web10.7052.1578567367421275217 for ; Thu, 09 Jan 2020 02:56:07 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=G1B/ERZ+; spf=pass (domain: redhat.com, ip: 207.211.31.81, mailfrom: philmd@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1578567366; 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=08CzGSup4Tq1ZovoYAKwAn6ESjj1TzTXJx8IBvUwhO8=; b=G1B/ERZ+TlZtsa1m7ADTIpGp9TyTwI2my5bgJJDNKqpynxcqlbFnDztFfEXQzV4jUvzRN+ 7DxMseCo9Bhk2YS8qYTRBfMNUqnQz0fZTzMmNUp0fsoRVjR9SAQGYsMSFqn1ljsrJ2QDuH +ZzCKgi6le1eCIZxgvIF73wbuk5IrOk= 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-267-n5CFlZxVN9SBvPOoy5QDlQ-1; Thu, 09 Jan 2020 05:56:05 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 572E610054E3; Thu, 9 Jan 2020 10:56:04 +0000 (UTC) Received: from x1w.redhat.com (ovpn-204-107.brq.redhat.com [10.40.204.107]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D4A0460BE0; Thu, 9 Jan 2020 10:56:02 +0000 (UTC) From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= To: Liming Gao , Bob Feng , devel@edk2.groups.io Cc: Philippe Mathieu-Daude Subject: [PATCH v4 4/4] BaseTools/PatchCheck.py: Check the committer email address Date: Thu, 9 Jan 2020 11:55:46 +0100 Message-Id: <20200109105546.30768-5-philmd@redhat.com> In-Reply-To: <20200109105546.30768-1-philmd@redhat.com> References: <20200109105546.30768-1-philmd@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: n5CFlZxVN9SBvPOoy5QDlQ-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: Bob Feng Cc: Liming Gao Reviewed-by: Bob Feng Signed-off-by: Philippe Mathieu-Daude --- BaseTools/Scripts/PatchCheck.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck= .py index e7b3c3bae47a..fe8e6a64f2bb 100755 --- a/BaseTools/Scripts/PatchCheck.py +++ b/BaseTools/Scripts/PatchCheck.py @@ -561,6 +561,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: @@ -579,6 +581,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