summaryrefslogtreecommitdiff
path: root/git-hooks
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>2020-05-07 22:09:48 +0200
committerOswald Buddenhagen <oswald.buddenhagen@gmx.de>2020-05-08 12:41:50 +0000
commit062a16545b7c870e392ad9e6f0ce7976659d259e (patch)
treeadcb333223650fc16836776b28de77b359d4a043 /git-hooks
parentcd793f89a15478ed8ec5c0bbd9d1ca45440a9f84 (diff)
downloadqtrepotools-062a16545b7c870e392ad9e6f0ce7976659d259e.tar.gz
fix handling of bogus change-log footers
we cannot just pretend that a footer is a tag, as the semantics are entirely different, so there would be "interesting" follow-up effects. also, due to the cascading of the conditions, we'd never actually catch "Change-Log" footers. Change-Id: Ia4754316693e0afdac4d24d994b4d6c136977745 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'git-hooks')
-rwxr-xr-xgit-hooks/sanitize-commit11
1 files changed, 8 insertions, 3 deletions
diff --git a/git-hooks/sanitize-commit b/git-hooks/sanitize-commit
index 4a3f5fc..847f80a 100755
--- a/git-hooks/sanitize-commit
+++ b/git-hooks/sanitize-commit
@@ -479,11 +479,16 @@ while (<MSG>) {
$badsign = 0;
# cherry-pick lines count as footers as well.
$ftr = 1;
- } elsif (/^(?:[A-Z][A-Za-z]+(?:-[A-Za-z][a-z]+)+|F[Ii][Xx][Ee][Ss]): /) {
+ } elsif (/^(?:[A-Z][A-Za-z]+(?:-[A-Za-z][a-z]+)+|F[Ii][Xx][Ee][Ss]|C[Hh][Aa][Nn][Gg][Ee][Ll][Oo][Gg]): /) {
$ftr = 1;
- } elsif (/^(\[change-?log\]|change-?log: )/i && !defined($cfg{changelog})) {
+ if (/^Change-?Log:/i) {
+ complain_ln("Use [ChangeLog] tag instead", "changelog") if (!defined($cfg{changelog}));
+ }
+ } elsif (/^\[change-?log\]/i) {
$inchangelog = 1;
- complain_ln("Bad form of [ChangeLog] tag", "changelog") if (!/^\[ChangeLog\]/);
+ if (!/^\[ChangeLog\]/ && !defined($cfg{changelog})) {
+ complain_ln("Bad form of [ChangeLog] tag", "changelog");
+ }
}
if ($inchangelog && !$ftr) {
complain_ln("Missing space between ChangeLog tags and text", "changelog") if (/\][^\s\[]/);