summaryrefslogtreecommitdiffstats
path: root/git_hooks/prepare-commit-msg
blob: 78a6f2384ebb1d3c2301d92733845830e0c6b0fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
#
# Hook used to produce a commit message based on CHANGES
#

FILE="$1"
SOURCE="$2"
COMMIT="$3"

case $SOURCE in
'')
    TMP=`mktemp 2> /dev/null || mktemp -t 'mytmpdir'` && \
    cat $FILE >$TMP && \
    git diff --cached scilab/CHANGES_* |sed -n '/^+/p' |sed -n '/^+++/!p' |sed 's/^.\{1\}//g' >$FILE && \
    cat $TMP >>$FILE && \
    rm $TMP
  ;;
*)
  ;;
esac