gcc/contrib/gcc-changelog
Tobias Burnus d554f43c98 contrib/gcc-changelog: Check that PR in subject is in changelog
This patch checks that a '[PRnnnn]' and '(PRnnnn)' also appears as PR in the
changelog part of the commit message.  And it does likewise for 'PR comp/nnnn'
except that then also the component name is checked.  (Note that the reverse
is permitted, i.e. PR(s) only appearing in the changelog.)
To avoid false positives, PR numbers in the subject line are ignored,
if 'revert' appears.
Additionally, reject commits with a nonempty second line.

contrib/ChangeLog:

	* gcc-changelog/git_commit.py (pr_regex): Add ?P<pr> for group('pr').
	(subject_pr_regex, subject_pr2_regex): New.
	(GitInfo.__init__, GitCommit.parse_changelog): Check subject PRs.
	* gcc-changelog/git_email.py (SUBJECT_PREFIX, subject_patch_regex): New.
	(GitEmail.__init__): Parse 'Subject:' and pass it to GitInfo.
	* gcc-changelog/test_email.py (test_pr_only_in_subject,
	test_wrong_pr_comp_in_subject, test_copyright_years): New.
	* gcc-changelog/test_patches.txt (0030-PR-c-92746, pr-check1.patch):
	Update to avoid triggering the new check.
	(0001-rs6000-Support-doubleword, pr-wrong-comp.patch,
	copyright-years.patch): New.
2021-06-13 07:46:54 +02:00
..
git_check_commit.py gcc-changelog: Remove non-strict mode. 2021-05-11 10:55:07 +02:00
git_commit.py contrib/gcc-changelog: Check that PR in subject is in changelog 2021-06-13 07:46:54 +02:00
git_email.py contrib/gcc-changelog: Check that PR in subject is in changelog 2021-06-13 07:46:54 +02:00
git_repository.py gcc-changelog: Remove non-strict mode. 2021-05-11 10:55:07 +02:00
git_update_version.py gcc-changelog: Ignore one more commit. 2021-06-11 10:13:54 +02:00
setup.cfg gcc-changelog: allow ChangeLog deletion in a commit 2021-03-12 09:29:05 +01:00
test_email.py contrib/gcc-changelog: Check that PR in subject is in changelog 2021-06-13 07:46:54 +02:00
test_patches.txt contrib/gcc-changelog: Check that PR in subject is in changelog 2021-06-13 07:46:54 +02:00