From: Philippe Mathieu-Daude Date: Thu, 9 Jan 2020 10:55:46 +0000 (+0800) Subject: BaseTools/PatchCheck.py: Check the committer email address X-Git-Tag: edk2-stable202002~249 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=8f38b08b506c0ea602444a09eda2f5ef1099498a 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 Cc: Liming Gao Reviewed-by: Bob Feng Signed-off-by: Philippe Mathieu-Daude --- diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py index 3b6d77081e..174d442aa7 100755 --- a/BaseTools/Scripts/PatchCheck.py +++ b/BaseTools/Scripts/PatchCheck.py @@ -552,6 +552,8 @@ class CheckGitCommits: else: blank_line = True 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) self.ok &= CheckOnePatch(commit, patch).ok if not commits: @@ -570,6 +572,10 @@ class CheckGitCommits: # Run git to get the commit patch 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): cmd = [ 'git' ] cmd += args