aboutsummaryrefslogtreecommitdiff
path: root/contrib/gcc-changelog/git_commit.py
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc-changelog/git_commit.py')
-rwxr-xr-xcontrib/gcc-changelog/git_commit.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
index d1646bd..0373614 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -326,6 +326,8 @@ class GitCommit:
if not self.info:
return
+ self.check_commit_email()
+
# Extract PR numbers form the subject line
# Match either [PRnnnn] / (PRnnnn) or PR component/nnnn
if self.info.lines and not self.revert_commit:
@@ -803,3 +805,11 @@ class GitCommit:
print('Errors:')
for error in self.errors:
print(error)
+
+ def check_commit_email(self):
+ # Parse 'Martin Liska <mliska@suse.cz>'
+ email = self.info.author.split(' ')[-1].strip('<>')
+
+ # Verify that all characters are ASCII
+ if len(email) != len(email.encode()):
+ self.errors.append(Error(f'non-ASCII characters in git commit email address ({email})'))