Add script to check a branch for Signed-off-by lines in commits

This commit is contained in:
Matthias Beyer 2017-08-27 21:51:49 +02:00
parent 279afd1972
commit b4a3765c2c

View file

@ -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