~matthiasbeyer/imag

ref: 9b48dc27cd00fcc75917c2702dc8dc4c6493e8d3 imag/scripts/hooks/commit-msg.checkstyle.sh -rw-r--r-- 561 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
18
19
20
21
22
23
24
25
#!/usr/bin/env bash
#
# An hook script to check the commit message for style
#
# To enable this hook, copy this file to ".git/hooks/commit-msg" and make it
# executable.

. git-sh-setup


#
#
# Check for "WIP" in commit message and add "[skip ci]" if commit message
# contains a WIP.
#
#

if grep -q -i -e "WIP" -e "work in progress" $1; then
    read -p "You're about to add a WIP commit, do you want to run the CI? [y|n] " -n 1 -r < /dev/tty
    echo
    if echo $REPLY | grep -E '^[Nn]$' > /dev/null; then
        sed -i '1,1s,.*,[ci skip] &,' $1
    fi
fi