From 4373fd2c7f7307f970df73a943e636b2b9d272b6 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 9 Jun 2020 10:01:05 +0200 Subject: gcc-changelog: fix deduction for root ChangeLog contrib/ChangeLog: * gcc-changelog/git_commit.py: Fix ChangeLog regex in order to match the top-level ChangeLog. * gcc-changelog/test_email.py: Add test. * gcc-changelog/test_patches.txt: Likewise. --- contrib/gcc-changelog/git_commit.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'contrib/gcc-changelog/git_commit.py') diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py index 069900d..f85d4c8 100755 --- a/contrib/gcc-changelog/git_commit.py +++ b/contrib/gcc-changelog/git_commit.py @@ -150,7 +150,7 @@ misc_files = [ author_line_regex = \ re.compile(r'^(?P\d{4}-\d{2}-\d{2})\ {2}(?P.* <.*>)') additional_author_regex = re.compile(r'^\t(?P\ *)?(?P.* <.*>)') -changelog_regex = re.compile(r'^(?:[fF]or +)?([a-z0-9+-/]*)/ChangeLog:?') +changelog_regex = re.compile(r'^(?:[fF]or +)?([a-z0-9+-/]*)ChangeLog:?') pr_regex = re.compile(r'\tPR (?P[a-z+-]+\/)?([0-9]+)$') dr_regex = re.compile(r'\tDR ([0-9]+)$') star_prefix_regex = re.compile(r'\t\*(?P\ *)(?P.*)') @@ -359,7 +359,8 @@ class GitCommit: % LINE_LIMIT, line)) m = changelog_regex.match(line) if m: - last_entry = ChangeLogEntry(m.group(1), self.top_level_authors, + last_entry = ChangeLogEntry(m.group(1).rstrip('/'), + self.top_level_authors, self.top_level_prs) self.changelog_entries.append(last_entry) elif self.find_changelog_location(line): -- cgit v1.1