Skip to content

Commit b779dd5

Browse files
author
Junio C Hamano
committed
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>
1 parent 51890a6 commit b779dd5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

templates/hooks--pre-commit

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ perl -e '
2828
print "* In $filename\n";
2929
$reported_filename = $filename;
3030
}
31-
print "* $why (line $lineno)\n$line\n";
31+
print "* $why (line $lineno)\n";
32+
print "$filename:$lineno:$line\n";
3233
}
3334
open $fh, "-|", qw(git-diff-cache -p -M --cached HEAD);
3435
while (<$fh>) {

0 commit comments

Comments
 (0)