aboutsummaryrefslogtreecommitdiff
path: root/contrib/gcc-changelog/git_commit.py
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2020-05-29 08:59:04 +0200
committerMartin Liska <mliska@suse.cz>2020-05-29 09:00:00 +0200
commit697eab1b3e8936fd6932cc81646934651337cc39 (patch)
tree207339fcfca49954db759792ff2ccdc718afb8c5 /contrib/gcc-changelog/git_commit.py
parent53ffb43a79780b6e33e1816831724c0fb3d2fa32 (diff)
downloadgcc-697eab1b3e8936fd6932cc81646934651337cc39.zip
gcc-697eab1b3e8936fd6932cc81646934651337cc39.tar.gz
gcc-697eab1b3e8936fd6932cc81646934651337cc39.tar.bz2
git_commit: fix duplicite email address.
The patch is about to handle situations like seen in 3ea6977d0f1813d982743a09660eec1760e981ec. contrib/ChangeLog: * gcc-changelog/git_commit.py: Properly handle duplicite authors. * gcc-changelog/test_email.py: New test. * gcc-changelog/test_patches.txt: New patch.
Diffstat (limited to 'contrib/gcc-changelog/git_commit.py')
-rwxr-xr-xcontrib/gcc-changelog/git_commit.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
index a24a251..084e83c 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -232,6 +232,12 @@ class ChangeLogEntry:
def is_empty(self):
return not self.lines and self.prs == self.initial_prs
+ def contains_author(self, author):
+ for author_lines in self.author_lines:
+ if author_lines[0] == author:
+ return True
+ return False
+
class GitCommit:
def __init__(self, hexsha, date, author, body, modified_files,
@@ -408,7 +414,7 @@ class GitCommit:
self.changelog_entries.append(last_entry)
will_deduce = True
elif author_tuple:
- if author_tuple not in last_entry.author_lines:
+ if not last_entry.contains_author(author_tuple[0]):
last_entry.author_lines.append(author_tuple)
continue