Skip to content

Commit

Permalink
Fix prepare-commit-msg hook and replace in-place sed
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Marcel Koeppen authored and Junio C Hamano committed May 21, 2008
1 parent 6923972 commit 4be1fe1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions templates/hooks--prepare-commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -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" ;;
Expand Down

0 comments on commit 4be1fe1

Please sign in to comment.