Define STAGE1_LIBS to link against libcl.a in stage1 on hpux.
[official-gcc.git] / contrib / gcc-changelog / git_check_commit.py
blob9a4c5d448fb1ceff095539381707e2af86754ed6
1 #!/usr/bin/env python3
3 # This file is part of GCC.
5 # GCC is free software; you can redistribute it and/or modify it under
6 # the terms of the GNU General Public License as published by the Free
7 # Software Foundation; either version 3, or (at your option) any later
8 # version.
10 # GCC is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 # for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with GCC; see the file COPYING3. If not see
17 # <http://www.gnu.org/licenses/>. */
19 import argparse
21 from git_repository import parse_git_revisions
23 parser = argparse.ArgumentParser(description='Check git ChangeLog format '
24 'of a commit')
25 parser.add_argument('revisions', default='HEAD', nargs='?',
26 help='Git revisions (e.g. hash~5..hash or just hash) - '
27 'if not specified: HEAD')
28 parser.add_argument('-g', '--git-path', default='.',
29 help='Path to git repository')
30 parser.add_argument('-p', '--print-changelog', action='store_true',
31 help='Print final changelog entires')
32 args = parser.parse_args()
34 retval = 0
35 for git_commit in parse_git_revisions(args.git_path, args.revisions):
36 res = 'OK' if git_commit.success else 'FAILED'
37 print('Checking %s: %s' % (git_commit.original_info.hexsha, res))
38 if git_commit.success:
39 if args.print_changelog:
40 git_commit.print_output()
41 else:
42 for error in git_commit.errors:
43 print('ERR: %s' % error)
44 retval = 1
46 exit(retval)