author | Jonathan Nieder <jrnieder@gmail.com> | |
Sun, 26 Dec 2010 09:07:31 +0000 (03:07 -0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 27 Dec 2010 16:47:21 +0000 (08:47 -0800) | ||
commit | 71a5d4bc0e4025b3fbdeed76052b39fcef284e8c | |
tree | 4d26bd18d48ba8f87f3e3e3a05be3ff48af3f44b | tree | snapshot |
parent | 73e7b2ef6c62b3ec345b557acb71a8da4798c70d | commit | diff |
diff: funcname and word patterns for perl
The default function name discovery already works quite well for Perl
code... with the exception of here-documents (or rather their ending).
sub foo {
print <<END
here-document
END
return 1;
}
The default funcname pattern treats the unindented END line as a
function declaration and puts it in the @@ line of diff and "grep
--show-function" output.
With a little knowledge of perl syntax, we can do better. You can
try it out by adding "*.perl diff=perl" to the gitattributes file.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The default function name discovery already works quite well for Perl
code... with the exception of here-documents (or rather their ending).
sub foo {
print <<END
here-document
END
return 1;
}
The default funcname pattern treats the unindented END line as a
function declaration and puts it in the @@ line of diff and "grep
--show-function" output.
With a little knowledge of perl syntax, we can do better. You can
try it out by adding "*.perl diff=perl" to the gitattributes file.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/gitattributes.txt | diff | blob | history | |
t/t4018-diff-funcname.sh | diff | blob | history | |
userdiff.c | diff | blob | history |