summaryrefslogtreecommitdiff
path: root/git-hooks
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@gmx.de>2020-05-07 23:43:14 +0200
committerOswald Buddenhagen <oswald.buddenhagen@gmx.de>2020-05-12 14:27:11 +0000
commitdb7851a1351d7cc499e327dde6222eb19e24fe85 (patch)
tree5009e2b6f9b984d3ea47a39e8d50d8a1f22ec28c /git-hooks
parent062a16545b7c870e392ad9e6f0ce7976659d259e (diff)
downloadqtrepotools-db7851a1351d7cc499e327dde6222eb19e24fe85.tar.gz
straighten out ChangeLog section state tracking
so far, footers in the middle of the changelog would suspend it, but not terminate it, which made no sense at all, given that the changelog is just a text section and footers separate text sections. Change-Id: I650c430700c8edc0c359ecc9c6b8b57f9632b5ae Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'git-hooks')
-rwxr-xr-xgit-hooks/sanitize-commit6
1 files changed, 5 insertions, 1 deletions
diff --git a/git-hooks/sanitize-commit b/git-hooks/sanitize-commit
index 847f80a..ab176ff 100755
--- a/git-hooks/sanitize-commit
+++ b/git-hooks/sanitize-commit
@@ -479,8 +479,10 @@ while (<MSG>) {
$badsign = 0;
# cherry-pick lines count as footers as well.
$ftr = 1;
+ $inchangelog = 0;
} 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;
+ $inchangelog = 0;
if (/^Change-?Log:/i) {
complain_ln("Use [ChangeLog] tag instead", "changelog") if (!defined($cfg{changelog}));
}
@@ -490,10 +492,12 @@ while (<MSG>) {
complain_ln("Bad form of [ChangeLog] tag", "changelog");
}
}
- if ($inchangelog && !$ftr) {
+ if ($inchangelog) {
complain_ln("Missing space between ChangeLog tags and text", "changelog") if (/\][^\s\[]/);
complain_ln("JIRA task referenced from ChangeLog", "changelog") if (/\[QT[A-Z]+-\d+\]/);
complain_ln("Redundant repository reference in ChangeLog", "", -1) if (/\[\Q$repo\E\]/i);
+ # Note that this is not mutually exclusive with the else-branch below -
+ # a ChangeLog section is just regular text.
}
if ($ftr && $doftr) {
if ($footer == STS_TEXT) {