David Hendricks has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/35295 )
Change subject: util/git-hooks: Check for Signed-off-by line ......................................................................
util/git-hooks: Check for Signed-off-by line
Enforce the DCO. The logic comes from coreboot's commit-msg hook, and I've added a pointer to flashrom's development guidelines.
Change-Id: Iea49a06c2d4824be073eff98c8aae1cbc5b145e4 Signed-off-by: David Hendricks david.hendricks@gmail.com --- M util/git-hooks/commit-msg 1 file changed, 11 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/95/35295/1
diff --git a/util/git-hooks/commit-msg b/util/git-hooks/commit-msg index 346c08f..fff0e29 100755 --- a/util/git-hooks/commit-msg +++ b/util/git-hooks/commit-msg @@ -28,6 +28,8 @@ CHANGE_ID_AFTER="Bug|Depends-On|Issue|Test|Feature|Fixes|Fixed|Staging-ID" MSG="$1"
+DEV_GUIDELINES_URL="https://www.flashrom.org/Development_Guidelines" + # Check for, and add if missing, a unique Change-Id # add_ChangeId() { @@ -201,8 +203,17 @@ } }
+test_sign_off() { + if ! grep -qi '^[[:space:]]*+Signed-off-by:' "$MSG"; then + printf "\nError: No Signed-off-by line in the commit message.\n" + printf "See: ${DEV_GUIDELINES_URL}\n" + exit 1 + fi +} + main() { test_duplicate_signoffs_acks + test_sign_off add_ChangeId }
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/35295
to look at the new patch set (#2).
Change subject: util/git-hooks: Check for Signed-off-by line ......................................................................
util/git-hooks: Check for Signed-off-by line
Enforce the DCO. The logic comes from coreboot's commit-msg hook, and I've added a pointer to flashrom's development guidelines.
Change-Id: Iea49a06c2d4824be073eff98c8aae1cbc5b145e4 Signed-off-by: David Hendricks david.hendricks@gmail.com --- A foo M util/git-hooks/commit-msg 2 files changed, 11 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/95/35295/2
Hello Stefan T, Angel Pons, build bot (Jenkins), Nico Huber,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/flashrom/+/35295
to look at the new patch set (#3).
Change subject: util/git-hooks: Check for Signed-off-by line ......................................................................
util/git-hooks: Check for Signed-off-by line
Enforce the DCO. The logic comes from coreboot's commit-msg hook, and I've added a pointer to flashrom's development guidelines.
Change-Id: Iea49a06c2d4824be073eff98c8aae1cbc5b145e4 Signed-off-by: David Hendricks david.hendricks@gmail.com --- M util/git-hooks/commit-msg 1 file changed, 11 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/95/35295/3
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/35295 )
Change subject: util/git-hooks: Check for Signed-off-by line ......................................................................
Patch Set 3: Code-Review+2
(1 comment)
https://review.coreboot.org/c/flashrom/+/35295/3/util/git-hooks/commit-msg File util/git-hooks/commit-msg:
https://review.coreboot.org/c/flashrom/+/35295/3/util/git-hooks/commit-msg@1... PS3, Line 198: + Nit, this + seems spurious, what does it refer to? To me this translates to:
* ^ start of line * [[:space:]]* zero or more whitespace * + one or more <nothing>?
David Hendricks has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/35295 )
Change subject: util/git-hooks: Check for Signed-off-by line ......................................................................
Patch Set 3:
(1 comment)
https://review.coreboot.org/c/flashrom/+/35295/3/util/git-hooks/commit-msg File util/git-hooks/commit-msg:
https://review.coreboot.org/c/flashrom/+/35295/3/util/git-hooks/commit-msg@1... PS3, Line 198: +
Nit, this + seems spurious, what does it refer to? […]
Yeah, I can't think of a reason + is necessary in this case. If there's a good reason to remove it then we should fix it in coreboot as well.
David Hendricks has submitted this change. ( https://review.coreboot.org/c/flashrom/+/35295 )
Change subject: util/git-hooks: Check for Signed-off-by line ......................................................................
util/git-hooks: Check for Signed-off-by line
Enforce the DCO. The logic comes from coreboot's commit-msg hook, and I've added a pointer to flashrom's development guidelines.
Change-Id: Iea49a06c2d4824be073eff98c8aae1cbc5b145e4 Signed-off-by: David Hendricks david.hendricks@gmail.com Reviewed-on: https://review.coreboot.org/c/flashrom/+/35295 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Nico Huber nico.h@gmx.de --- M util/git-hooks/commit-msg 1 file changed, 11 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved
diff --git a/util/git-hooks/commit-msg b/util/git-hooks/commit-msg index 346c08f..d43eb45 100755 --- a/util/git-hooks/commit-msg +++ b/util/git-hooks/commit-msg @@ -28,6 +28,8 @@ CHANGE_ID_AFTER="Bug|Depends-On|Issue|Test|Feature|Fixes|Fixed|Staging-ID" MSG="$1"
+DEV_GUIDELINES_URL="https://www.flashrom.org/Development_Guidelines" + # Check for, and add if missing, a unique Change-Id # add_ChangeId() { @@ -192,6 +194,14 @@ git hash-object -t commit --stdin }
+test_signoff() { + if ! grep -qi '^[[:space:]]*+Signed-off-by:' "$MSG"; then + printf "\nError: No Signed-off-by line in the commit message.\n" + printf "See: ${DEV_GUIDELINES_URL}\n" + exit 1 + fi +} + # Test for duplicate signoffs/acks test_duplicate_signoffs_acks() { test "" = "$(grep -i '^(Signed-off-by|Acked-by): ' "$MSG" | @@ -202,6 +212,7 @@ }
main() { + test_signoff test_duplicate_signoffs_acks add_ChangeId }