8 command -v git
>/dev
/null
2>&1 ||
9 die
"neither chroot-git nor git could be found!"
13 git rev-parse
--verify "$1"
18 git rev-parse
--verify "$1" 2>/dev
/null
&& return
25 base
=$
(rev_parse
"$1" FETCH_HEAD ORIG_HEAD
) || die
"base commit not found"
26 tip
=$
(rev_parse
"$2" HEAD
) || die
"tip commit not found"
29 for cmt
in $
(git rev-list
--abbrev-commit $base..
$tip)
31 git cat-file commit
"$cmt" |
34 /^$/ && !msg { msg = 1; next }
35 /^author .*noreply/ && !msg {
36 print "::error title=Commit Lint::" C ": authored by noreply email";
39 /^author .*(localhost|localdomain|[(]none[)])/ && !msg {
40 print "::error title=Commit Lint::" C ": authored by localhost email";
44 # 3: long-line-is-banned-except-footnote-like-this-for-url
45 (NF > 2) && (length > 80) {
46 print "::error title=Commit Lint::" C ": long line: " $0
50 if (length > 50) { print "::warning title=Commit Lint::" C ": subject is a bit long" }
51 if (!($0 ~ ":" || $0 ~ "^Take over maintainership " || $0 ~ "^Orphan ")) { print "::error title=Commit Lint::" C ": subject does not follow CONTRIBUTING.md guildelines"; exit 1 }
52 # Below check is too noisy?
53 # if (!($0 ~ "^New package:" || $0 ~ ".*: update to")) {
54 # print "::warning title=Commit Lint::" C ": not new package/update/removal?"
58 /^$/ { body = 1; next }
60 print "::error title=Commit Lint::" C ": second line must be blank"