summaryrefslogtreecommitdiffstats
path: root/scripts/signed-off-by-in-branch.sh
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2017-08-27 21:51:49 +0200
committerMatthias Beyer <mail@beyermatthias.de>2017-09-01 20:37:53 +0200
commitb4a3765c2c85ab4cc80481c23993e2cf877c481e (patch)
tree2c9f38216097f4b2fa195a35d290e96cb26977f8 /scripts/signed-off-by-in-branch.sh
parent279afd1972827a288b3f2fd066dc91130fe97789 (diff)
Add script to check a branch for Signed-off-by lines in commits
Diffstat (limited to 'scripts/signed-off-by-in-branch.sh')
-rw-r--r--scripts/signed-off-by-in-branch.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/signed-off-by-in-branch.sh b/scripts/signed-off-by-in-branch.sh
new file mode 100644
index 00000000..480f5a0a
--- /dev/null
+++ b/scripts/signed-off-by-in-branch.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+
+# Checks whether all commit between $1 and $2 have a signed-off-by line
+
+RED='\e[0;31m' # Red
+NORMAL='\e[0m' # Text Reset
+
+faulty=$(git rev-list --grep "Signed-off-by" --invert-grep $1..$2 | wc -l)
+
+if [[ $faulty -eq 0 ]]
+then
+ echo >&2 "All good"
+else
+ echo -en >&2 "${RED}Got $faulty non Signed-off-by commits${NORMAL}"
+ echo -e >&2 "${RED}between $1 and $2${NORMAL}"
+fi
+