Add default revisions argument for git_check_commit.py.

* gcc-changelog/git_check_commit.py: Add default argument HEAD
	for revisions and improve error message output.
This commit is contained in:
Martin Liska 2020-05-13 14:44:22 +02:00
parent b8333fc6f8
commit e4f0e06b2f
No known key found for this signature in database
GPG Key ID: 4DC182DC0FA73785
2 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2020-05-13 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_check_commit.py: Add default argument HEAD
for revisions and improve error message output.
2020-05-13 Martin Liska <mliska@suse.cz> 2020-05-13 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_commit.py: Restore print_output syntax * gcc-changelog/git_commit.py: Restore print_output syntax

View File

@ -22,7 +22,7 @@ from git_repository import parse_git_revisions
parser = argparse.ArgumentParser(description='Check git ChangeLog format ' parser = argparse.ArgumentParser(description='Check git ChangeLog format '
'of a commit') 'of a commit')
parser.add_argument('revisions', parser.add_argument('revisions', default='HEAD', nargs='?',
help='Git revisions (e.g. hash~5..hash or just hash)') help='Git revisions (e.g. hash~5..hash or just hash)')
parser.add_argument('-g', '--git-path', default='.', parser.add_argument('-g', '--git-path', default='.',
help='Path to git repository') help='Path to git repository')
@ -36,9 +36,9 @@ args = parser.parse_args()
retval = 0 retval = 0
for git_commit in parse_git_revisions(args.git_path, args.revisions, for git_commit in parse_git_revisions(args.git_path, args.revisions,
not args.allow_non_strict_mode): not args.allow_non_strict_mode):
print('Checking %s' % git_commit.hexsha) res = 'OK' if git_commit.success else 'FAILED'
print('Checking %s: %s' % (git_commit.hexsha, res))
if git_commit.success: if git_commit.success:
print('OK')
if args.print_changelog: if args.print_changelog:
git_commit.print_output() git_commit.print_output()
else: else: