~matthiasbeyer/imag

ref: 9b48dc27cd00fcc75917c2702dc8dc4c6493e8d3 imag/scripts/hooks/pre-commit.signoffby-missing-warn.sh -rw-r--r-- 394 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

#
# The following snippet can be used to _WARN_ if a Signed-off-by line is missing
# in the commit message
#

RED='\e[0;31m' # Red
NORMAL='\e[0m' # Text Reset

if [ "1" != "$(grep -c '^Signed-off-by: ' "$1")" ]; then
    printf >&2 "%sMissing Signed-off-by line.%s\n" "$RED" "$NORMAL"

    # To not only warn, but abort the commit, uncomment the next line
    # exit 1
fi