aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgit-hooks/commit-msg12
1 files changed, 12 insertions, 0 deletions
diff --git a/git-hooks/commit-msg b/git-hooks/commit-msg
new file mode 100755
index 0000000..6c188f8
--- /dev/null
+++ b/git-hooks/commit-msg
@@ -0,0 +1,12 @@
+#!/bin/sh
+RED=""
+NORMAL=""
+if [ -f ~/.term_colors ]; then
+ . ~/.term_colors
+fi
+
+if [ "1" != "$(grep -c '^Signed-off-by: ' "$1")" ]; then
+ printf >&2 "%sMissing Signed-off-by line.%s\n" "$RED" "$NORMAL"
+ printf >&2 "%sYou need to add --signoff or -s%s\n" "$RED" "$NORMAL"
+ exit 1
+fi