BaseTools/PatchCheck.py: Check the committer email address
To avoid patches committed with incorrect email address, use the EmailAddressCheck class on the committer email too. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Philippe Mathieu-Daude <philmd@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
8ffa47fb3a
commit
8f38b08b50
@ -552,6 +552,8 @@ class CheckGitCommits:
|
|||||||
else:
|
else:
|
||||||
blank_line = True
|
blank_line = True
|
||||||
print('Checking git commit:', commit)
|
print('Checking git commit:', commit)
|
||||||
|
email = self.read_committer_email_address_from_git(commit)
|
||||||
|
self.ok &= EmailAddressCheck(email, 'Committer').ok
|
||||||
patch = self.read_patch_from_git(commit)
|
patch = self.read_patch_from_git(commit)
|
||||||
self.ok &= CheckOnePatch(commit, patch).ok
|
self.ok &= CheckOnePatch(commit, patch).ok
|
||||||
if not commits:
|
if not commits:
|
||||||
@ -570,6 +572,10 @@ class CheckGitCommits:
|
|||||||
# Run git to get the commit patch
|
# Run git to get the commit patch
|
||||||
return self.run_git('show', '--pretty=email', '--no-textconv', commit)
|
return self.run_git('show', '--pretty=email', '--no-textconv', commit)
|
||||||
|
|
||||||
|
def read_committer_email_address_from_git(self, commit):
|
||||||
|
# Run git to get the committer email
|
||||||
|
return self.run_git('show', '--pretty=%cn <%ce>', '--no-patch', commit)
|
||||||
|
|
||||||
def run_git(self, *args):
|
def run_git(self, *args):
|
||||||
cmd = [ 'git' ]
|
cmd = [ 'git' ]
|
||||||
cmd += args
|
cmd += args
|
||||||
|
Reference in New Issue
Block a user