From: Junio C Hamano Date: Sat, 20 Aug 2005 08:05:12 +0000 (-0700) Subject: Make sample pre-commit hook output Emacs friendly. X-Git-Tag: v0.99.5~8^2~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=b779dd5ee38d103c74e15a7c361f78f1025a0872;p=git.git Make sample pre-commit hook output Emacs friendly. Use the common error message format, "filename:lineno: body"; this way, problematic lines can be jumped to from the Emacs compilation buffer by C-x `. Signed-off-by: Junio C Hamano --- diff --git a/templates/hooks--pre-commit b/templates/hooks--pre-commit index cb1c82d5..dad99bcf 100644 --- a/templates/hooks--pre-commit +++ b/templates/hooks--pre-commit @@ -28,7 +28,8 @@ perl -e ' print "* In $filename\n"; $reported_filename = $filename; } - print "* $why (line $lineno)\n$line\n"; + print "* $why (line $lineno)\n"; + print "$filename:$lineno:$line\n"; } open $fh, "-|", qw(git-diff-cache -p -M --cached HEAD); while (<$fh>) {