From a7ac3e92ecf251d5528eea4b46b5f42fd0168e43 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Fri, 12 Mar 2021 09:08:36 +0100 Subject: gcc-changelog: allow ChangeLog deletion in a commit contrib/ChangeLog: * gcc-changelog/git_commit.py: Allow deletion of ChangeLog files. * gcc-changelog/setup.cfg: Set line limit to 120 characters. * gcc-changelog/test_email.py: Add test. * gcc-changelog/test_patches.txt: Likewise. * gcc-changelog/git_email.py: Fix parsing of deleted files. --- contrib/gcc-changelog/git_commit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (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 e9dae0a..43fa7f4 100755 --- a/contrib/gcc-changelog/git_commit.py +++ b/contrib/gcc-changelog/git_commit.py @@ -314,8 +314,9 @@ class GitCommit: if self.revert_commit: self.info = self.commit_to_info_hook(self.revert_commit) + # Allow complete deletion of ChangeLog files in a commit project_files = [f for f in self.info.modified_files - if self.is_changelog_filename(f[0], allow_suffix=True) + if (self.is_changelog_filename(f[0], allow_suffix=True) and f[1] != 'D') or f[0] in misc_files] ignored_files = [f for f in self.info.modified_files if self.in_ignored_location(f[0])] -- cgit v1.1