aboutsummaryrefslogtreecommitdiff
path: root/contrib/gcc-changelog/git_commit.py
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2020-05-26 09:01:41 +0200
committerMartin Liska <mliska@suse.cz>2020-05-26 09:02:43 +0200
commit4945b4c2c8628bdd61b348ea5bd1f9b72537a36e (patch)
tree495bf6fee75c983302016e664ee3940d04546242 /contrib/gcc-changelog/git_commit.py
parentb3d566f570f4416299240b51654b70c74f6cba6a (diff)
downloadgcc-4945b4c2c8628bdd61b348ea5bd1f9b72537a36e.zip
gcc-4945b4c2c8628bdd61b348ea5bd1f9b72537a36e.tar.gz
gcc-4945b4c2c8628bdd61b348ea5bd1f9b72537a36e.tar.bz2
Allow ChangeLog entries for ignored location.
We should be able to generate ChangeLog entries for commits like b3d566f570f4416299240b51654b70c74f6cba6a. I'm going to install the patch. contrib/ChangeLog: * gcc-changelog/git_commit.py: Parse changelog entries for ignored locations. * gcc-changelog/test_email.py: Add new test for it. * gcc-changelog/test_patches.txt: Likewise.
Diffstat (limited to 'contrib/gcc-changelog/git_commit.py')
-rwxr-xr-xcontrib/gcc-changelog/git_commit.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
index 2cfdbc8..edd8834 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -233,8 +233,9 @@ class GitCommit:
project_files = [f for f in self.modified_files
if self.is_changelog_filename(f[0])
- or f[0] in misc_files
- or self.in_ignored_location(f[0])]
+ or f[0] in misc_files]
+ ignored_files = [f for f in self.modified_files
+ if self.in_ignored_location(f[0])]
if len(project_files) == len(self.modified_files):
# All modified files are only MISC files
return
@@ -244,7 +245,9 @@ class GitCommit:
'separately from normal commits'))
return
- self.parse_lines()
+ all_are_ignored = (len(project_files) + len(ignored_files)
+ == len(self.modified_files))
+ self.parse_lines(all_are_ignored)
if self.changes:
self.parse_changelog()
self.deduce_changelog_locations()
@@ -292,7 +295,7 @@ class GitCommit:
modified_files.append((parts[2], 'A'))
return modified_files
- def parse_lines(self):
+ def parse_lines(self, all_are_ignored):
body = self.lines
for i, b in enumerate(body):
@@ -303,8 +306,9 @@ class GitCommit:
or dr_regex.match(b) or author_line_regex.match(b)):
self.changes = body[i:]
return
- self.errors.append(Error('cannot find a ChangeLog location in '
- 'message'))
+ if not all_are_ignored:
+ self.errors.append(Error('cannot find a ChangeLog location in '
+ 'message'))
def parse_changelog(self):
last_entry = None