diff options
author | Philippe Mathieu-Daude <philmd@redhat.com> | 2020-01-09 18:55:46 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-01-10 04:06:42 +0000 |
commit | 8f38b08b506c0ea602444a09eda2f5ef1099498a (patch) | |
tree | 32cd6917d8f3c64da7dcee1c1cf5e686f1a88c36 /BaseTools/Scripts | |
parent | 8ffa47fb3abd58ded6fe852ee9f518d19f9f9858 (diff) | |
download | edk2-8f38b08b506c0ea602444a09eda2f5ef1099498a.tar.gz |
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>
Diffstat (limited to 'BaseTools/Scripts')
-rwxr-xr-x | BaseTools/Scripts/PatchCheck.py | 6 |
1 files changed, 6 insertions, 0 deletions
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
|