~matthiasbeyer/imag

ref: 9b48dc27cd00fcc75917c2702dc8dc4c6493e8d3 imag/scripts/signed-off-by-in-branch.sh -rw-r--r-- 406 bytes
9b48dc27Matthias Beyer libimagentryref: Move from error-chain to failure 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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