summaryrefslogtreecommitdiffstats
path: root/git_hooks
diff options
context:
space:
mode:
authorPierre-Aime Agnel <pierre-aime.agnel@scilab-enterprises.com>2016-03-10 17:03:16 +0100
committerPierre-Aime Agnel <pierre-aime.agnel@scilab-enterprises.com>2016-03-10 17:10:49 +0100
commit580bfa8b88d1cd246565dd7c68e156a5e0c3a9e9 (patch)
treea2cb2b38deb713eb2aa5e494466102bcc75de77e /git_hooks
parentae562fad2195b65c4faef68f4e222b8f928ae5fb (diff)
downloadscilab-580bfa8b88d1cd246565dd7c68e156a5e0c3a9e9.zip
scilab-580bfa8b88d1cd246565dd7c68e156a5e0c3a9e9.tar.gz
modified hooks to ease merge commits
Change-Id: I334a1b16a47272c567f7a0f25bf3135150092e61
Diffstat (limited to 'git_hooks')
-rwxr-xr-xgit_hooks/prepare-commit-msg29
1 files changed, 20 insertions, 9 deletions
diff --git a/git_hooks/prepare-commit-msg b/git_hooks/prepare-commit-msg
index b2cf90d..050e17c 100755
--- a/git_hooks/prepare-commit-msg
+++ b/git_hooks/prepare-commit-msg
@@ -8,14 +8,25 @@ SOURCE="$2"
8COMMIT="$3" 8COMMIT="$3"
9 9
10case $SOURCE in 10case $SOURCE in
11'') 11 'merge')
12 TMP=`mktemp 2> /dev/null || mktemp -t 'mytmpdir'` && \ 12 # On merges adds the commit messages found in CHANGES
13 cat $FILE >$TMP && \ 13 TMP=`mktemp 2> /dev/null || mktemp -t 'mytmpdir'` && \
14 git diff --cached scilab/CHANGES* |sed -n '/^+/p' |sed -n '/^+++/!p' |sed 's/^.\{1\}//g' >$FILE && \ 14 cat $FILE >$TMP && \
15 cat $TMP >>$FILE && \ 15 sed -i '/^Merge.*/d' $TMP && \
16 rm $TMP 16 git diff --cached scilab/CHANGES* |sed -n '/^+/p' |sed -n '/^+++/!p' |sed 's/^.\{1\}//g' >$FILE && \
17 ;; 17 cat $TMP >>$FILE && \
18*) 18 rm $TMP
19 ;; 19 ;;
20
21 '')
22 # On normal commit add messages found in CHANGES
23 TMP=`mktemp 2> /dev/null || mktemp -t 'mytmpdir'` && \
24 cat $FILE >$TMP && \
25 git diff --cached scilab/CHANGES* |sed -n '/^+/p' |sed -n '/^+++/!p' |sed 's/^.\{1\}//g' >$FILE && \
26 cat $TMP >>$FILE && \
27 rm $TMP
28 ;;
29 *)
30 ;;
20esac 31esac
21 32