summaryrefslogtreecommitdiffstats
path: root/git-hooks
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-01-23 15:01:17 +0100
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-01-28 14:39:54 +0000
commitd615ea50a0ab4e9657284573f4c7e31e747adeca (patch)
tree75ce5a438406c2c3ee805a055494ce8c6acfbddd /git-hooks
parenta1cb1f480823d82e4ffd0be10df4d788a241b41d (diff)
complain about multiple tasks in one task-number line
this specifically assumes that people use commas (which covers about 90% of the cases). catching spaces would be possible as well, but people tend to attach freestyle comments to the references, so the number of false positives would be prohibitive without an elaborate parser. Change-Id: If842d47d877c44867983e6696e2300e78470c344 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
Diffstat (limited to 'git-hooks')
-rwxr-xr-xgit-hooks/sanitize-commit5
1 files changed, 3 insertions, 2 deletions
diff --git a/git-hooks/sanitize-commit b/git-hooks/sanitize-commit
index 876a0d4..bc35314 100755
--- a/git-hooks/sanitize-commit
+++ b/git-hooks/sanitize-commit
@@ -281,8 +281,9 @@ while (<MSG>) {
$badrev = $lineno;
} elsif (/^Signed-off-by:/i) {
$badsign = $lineno;
- } elsif (/^Task-number:/i && !/^Task-number:/) {
- complain_ln("Capitalization of \"Task-number\" is wrong", "");
+ } elsif (/^Task-number: *(.*)/i) {
+ complain_ln("Multiple tasks in one footer", "") if ($1 =~ /,/);
+ complain_ln("Capitalization of \"Task-number\" is wrong", "") if (!/^Task-number:/);
}
if (!$badid && /\bI[0-9a-f]{40}\b/ && !/^Change-Id: /) {
complain_ln("Gerrit change id outside Change-Id footer", "changeid");