aboutsummaryrefslogtreecommitdiff
path: root/contrib/gcc-changelog/git_email.py
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2022-12-19 12:12:16 +0100
committerTobias Burnus <tobias@codesourcery.com>2022-12-19 12:12:16 +0100
commit2b2cec58ff502966004f79d1c9a2862c756b8509 (patch)
treee3e8e5c423530a5fdafef77c587f0238dd90224c /contrib/gcc-changelog/git_email.py
parent03fb35f8753d87148b29b3f34b6154abe7db4c41 (diff)
downloadgcc-2b2cec58ff502966004f79d1c9a2862c756b8509.zip
gcc-2b2cec58ff502966004f79d1c9a2862c756b8509.tar.gz
gcc-2b2cec58ff502966004f79d1c9a2862c756b8509.tar.bz2
gcc-changelog: Add warning for auto-added files
git_email.py prints now a warning for files added automatically. git_check_commit.py does likewise but only with --verbose. It prints one line per ChangeLog file, either stating the file or if more than one the number of files. contrib/ChangeLog: * gcc-changelog/git_check_commit.py (__main__): With -v print a warning for the auto-added files. * gcc-changelog/git_commit.py (GitCommit.__init__): Add self.warnings. (GitCommit.check_mentioned_files): Add warning for auto-added files. (GitCommit.print_warnings): New function. * gcc-changelog/git_email.py (__main__): Remove bogus argument to GitEmail constructor; print auto-added-files warning. * gcc-changelog/test_email.py (test_auto_add_file_1, test_auto_add_file_2): New tests. * gcc-changelog/test_patches.txt: Add two test cases.
Diffstat (limited to 'contrib/gcc-changelog/git_email.py')
-rwxr-xr-xcontrib/gcc-changelog/git_email.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/gcc-changelog/git_email.py b/contrib/gcc-changelog/git_email.py
index f3773f1..5468efc 100755
--- a/contrib/gcc-changelog/git_email.py
+++ b/contrib/gcc-changelog/git_email.py
@@ -119,11 +119,13 @@ if __name__ == '__main__':
success = 0
for full in sorted(allfiles):
- email = GitEmail(full, False)
+ email = GitEmail(full)
print(email.filename)
if email.success:
success += 1
print(' OK')
+ for warning in email.warnings:
+ print(' WARN: %s' % warning)
else:
for error in email.errors:
print(' ERR: %s' % error)
@@ -135,6 +137,7 @@ if __name__ == '__main__':
if email.success:
print('OK')
email.print_output()
+ email.print_warnings()
else:
if not email.info.lines:
print('Error: patch contains no parsed lines', file=sys.stderr)