aboutsummaryrefslogtreecommitdiff
path: root/contrib/gcc-changelog/git_commit.py
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2021-01-13 11:55:29 +0100
committerMartin Liska <mliska@suse.cz>2021-01-13 11:57:14 +0100
commitc23aea6edc9e28578992112503e6118e3450bea4 (patch)
treeee7f2df32202394f5c183de3febbbe65e42d2d53 /contrib/gcc-changelog/git_commit.py
parent2b356e689c334ca4765a9ffd95a76cf715447200 (diff)
downloadgcc-c23aea6edc9e28578992112503e6118e3450bea4.zip
gcc-c23aea6edc9e28578992112503e6118e3450bea4.tar.gz
gcc-c23aea6edc9e28578992112503e6118e3450bea4.tar.bz2
gcc-changelog: Allow modifications to old ChangeLogs without entry
contrib/ChangeLog: * gcc-changelog/git_commit.py: Allow modifications of older ChangeLog (or specific) files without need to make a ChangeLog entry. * gcc-changelog/test_email.py: Test it. * gcc-changelog/test_patches.txt: Add new patch.
Diffstat (limited to 'contrib/gcc-changelog/git_commit.py')
-rwxr-xr-xcontrib/gcc-changelog/git_commit.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
index ee19733..59f4786 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -308,7 +308,7 @@ class GitCommit:
self.info = self.commit_to_info_hook(self.revert_commit)
project_files = [f for f in self.info.modified_files
- if self.is_changelog_filename(f[0])
+ if self.is_changelog_filename(f[0], allow_suffix=True)
or f[0] in misc_files]
ignored_files = [f for f in self.info.modified_files
if self.in_ignored_location(f[0])]
@@ -343,8 +343,14 @@ class GitCommit:
return [x[0] for x in self.info.modified_files if x[1] == 'A']
@classmethod
- def is_changelog_filename(cls, path):
- return path.endswith('/ChangeLog') or path == 'ChangeLog'
+ def is_changelog_filename(cls, path, allow_suffix=False):
+ basename = os.path.basename(path)
+ if basename == 'ChangeLog':
+ return True
+ elif allow_suffix and basename.startswith('ChangeLog'):
+ return True
+ else:
+ return False
@classmethod
def find_changelog_location(cls, name):