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>
else:\r
blank_line = True\r
print('Checking git commit:', commit)\r
else:\r
blank_line = True\r
print('Checking git commit:', commit)\r
+ email = self.read_committer_email_address_from_git(commit)\r
+ self.ok &= EmailAddressCheck(email, 'Committer').ok\r
patch = self.read_patch_from_git(commit)\r
self.ok &= CheckOnePatch(commit, patch).ok\r
if not commits:\r
patch = self.read_patch_from_git(commit)\r
self.ok &= CheckOnePatch(commit, patch).ok\r
if not commits:\r
# Run git to get the commit patch\r
return self.run_git('show', '--pretty=email', '--no-textconv', commit)\r
\r
# Run git to get the commit patch\r
return self.run_git('show', '--pretty=email', '--no-textconv', commit)\r
\r
+ def read_committer_email_address_from_git(self, commit):\r
+ # Run git to get the committer email\r
+ return self.run_git('show', '--pretty=%cn <%ce>', '--no-patch', commit)\r
+\r
def run_git(self, *args):\r
cmd = [ 'git' ]\r
cmd += args\r
def run_git(self, *args):\r
cmd = [ 'git' ]\r
cmd += args\r