summaryrefslogtreecommitdiffstats
path: root/git-hooks
diff options
context:
space:
mode:
authorMarc Mutz <[email protected]>2025-04-22 18:37:19 +0200
committerMarc Mutz <[email protected]>2025-06-04 05:49:23 +0000
commitbc3407b440b087db90fc84c817d5c6d1c920c676 (patch)
tree4dde8a86fa97a987227714e03ae79860935776d0 /git-hooks
parent5110c1f8d269dbec963847f285f89450308bca92 (diff)
sanitize-commit: Validate Coverity-Id footersHEADmaster
Like for other footers, complain if - the capitalization is wrong - more than one CID is listed per line - the CIDs are not numerical (catching Coverity-Id: CID-12345) - the CIDs start with a leading zero (012 could be interpreted as octal, and there's no tradition to use leading zeros for CIDs, unlike, e.g. for QUIPs) Change-Id: Ibb2fa705aad5a43b0e5d11895e019e2873cfdfe8 Reviewed-by: Edward Welbourne <[email protected]>
Diffstat (limited to 'git-hooks')
-rwxr-xr-xgit-hooks/sanitize-commit7
1 files changed, 6 insertions, 1 deletions
diff --git a/git-hooks/sanitize-commit b/git-hooks/sanitize-commit
index f60fcc3..5ec434e 100755
--- a/git-hooks/sanitize-commit
+++ b/git-hooks/sanitize-commit
@@ -549,8 +549,13 @@ while (<MSG>) {
complain_ln("Multiple QUIPs in one footer", "") if ($quip =~ /[ ,]/);
complain_ln("Non-numeric QUIP identifier", "") if ($quip =~ /^[^0-9]/);
complain_ln("Capitalization of \"QUIP\" is wrong", "") if (!/^QUIP:/);
- } elsif (/^Coverity-Id: /) {
+ } elsif (/^Coverity-Id: *(.*)/i) {
$cid = 1;
+ my $cidval = $1;
+ complain_ln("Multiple CIDs in one footer", "") if ($cidval =~ /[ ,]/);
+ complain_ln("Non-numeric CID", "") if ($cidval =~ /[^0-9 ,]/); # [ ,]: already checked above
+ complain_ln("Leading zero", "") if ($cidval =~ /^0/);
+ complain_ln("Capitalization of \"Coverity-Id\" is wrong", "") if (!/^Coverity-Id:/);
}
} elsif (/^\[change-?log\]/i) {
$inchangelog = 1;