summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorMarcel Koeppen <git-dev@marzelpan.de>2008-05-21 18:25:54 +0200
committerJunio C Hamano <gitster@pobox.com>2008-05-21 09:45:53 -0700
commit4be1fe1b944e568f47efcb9d1beb8639f50b723f (patch)
tree5d33d7b787b274a627bdc9bd5113e1760ccd96ed /templates
parent69239728238c8ec6296d94c4cd7490161f4c89b2 (diff)
downloadgit-4be1fe1b944e568f47efcb9d1beb8639f50b723f.tar.gz
Fix prepare-commit-msg hook and replace in-place sed
The patterns to the case statement could never be matched, so the hook was a noop. This patch also replaces the non-portable use of in-place sed. Signed-off-by: Marcel Koeppen <git-dev@marzelpan.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/hooks--prepare-commit-msg8
1 files changed, 4 insertions, 4 deletions
diff --git a/templates/hooks--prepare-commit-msg b/templates/hooks--prepare-commit-msg
index ff0f42a1d9..d3c1da34d2 100644
--- a/templates/hooks--prepare-commit-msg
+++ b/templates/hooks--prepare-commit-msg
@@ -20,11 +20,11 @@
# The third example adds a Signed-off-by line to the message, that can
# still be edited. This is rarely a good idea.
-case "$2 $3" in
- merge)
- sed -i '/^Conflicts:/,/#/!b;s/^/# &/;s/^# #/#/' "$1" ;;
+case "$2,$3" in
+ merge,)
+ perl -i -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;;
-# ""|template)
+# ,|template,)
# perl -i -pe '
# print "\n" . `git diff --cached --name-status -r`
# if /^#/ && $first++ == 0' "$1" ;;