summaryrefslogtreecommitdiff
path: root/templates/hooks--pre-commit
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-08-20 08:05:12 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-08-20 08:05:12 (GMT)
commitb779dd5ee38d103c74e15a7c361f78f1025a0872 (patch)
tree004d2bc28b41b064858cf021770168a79b0c2fc2 /templates/hooks--pre-commit
parent51890a64eb152fb914d0dd3676f549ab8d8cc49a (diff)
downloadgit-b779dd5ee38d103c74e15a7c361f78f1025a0872.zip
git-b779dd5ee38d103c74e15a7c361f78f1025a0872.tar.gz
git-b779dd5ee38d103c74e15a7c361f78f1025a0872.tar.bz2
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 <junkio@cox.net>
Diffstat (limited to 'templates/hooks--pre-commit')
-rw-r--r--templates/hooks--pre-commit3
1 files changed, 2 insertions, 1 deletions
diff --git a/templates/hooks--pre-commit b/templates/hooks--pre-commit
index cb1c82d..dad99bc 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>) {