userdiff/perl: match full line of POD headers
The builtin perl userdiff driver is not greedy enough about catching POD header lines. Capture the whole line, so instead of just declaring that we are in some "@@ =head1" section, diff/grep output can explain that the enclosing section is about "@@ =head1 OPTIONS". Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Nieder committed
May 21, 2011 at 14:35 UTC
12f0967a8a1e3c11c678de181f77d1c7883b37cf
2 files changed
+5
-1
t/t4018-diff-funcname.sh
+4
@@ -125,6 +125,10 @@ test_expect_success 'perl pattern is not distracted by sub within POD' '
125
test_expect_funcname "=head" perl
126
'
127
128
+test_expect_success 'perl pattern gets full line of POD header' '
129
+ test_expect_funcname "=head1 SYNOPSIS\$" perl
130
+'
131
+
132
test_expect_success 'custom pattern' '
133
test_config diff.java.funcname "!static
134
!String
userdiff.c
+1
-1
@@ -63,7 +63,7 @@ PATTERNS("perl",
63
"^package .*;\n"
64
"^sub .* \\{\n"
65
"^[A-Z]+ \\{\n" /* BEGIN, END, ... */
66
- "^=head[0-9] ", /* POD */
66
+ "^=head[0-9] .*", /* POD */
67
/* -- */
68
"[[:alpha:]_'][[:alnum:]_']*"
69
"|0[xb]?[0-9a-fA-F_]*"