Code

userdiff/perl: catch BEGIN/END/... and POD as headers
authorJunio C Hamano <gitster@pobox.com>
Mon, 27 Dec 2010 17:19:38 +0000 (09:19 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Dec 2010 17:19:38 +0000 (09:19 -0800)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
userdiff.c

index fc2afe33a7640677fbf3a10bbdbec25b023f752c..c384b39e4daf1226a2c13c74dc2a4a2f75b8e63b 100644 (file)
@@ -63,7 +63,9 @@ PATTERNS("pascal",
         "|[^[:space:]]|[\x80-\xff]+"),
 PATTERNS("perl",
         "^[ \t]*package .*;\n"
-        "^[ \t]*sub .* \\{",
+        "^[ \t]*sub .* \\{\n"
+        "^[A-Z]+ \\{\n"        /* BEGIN, END, ... */
+        "^=head[0-9] ",        /* POD */
         /* -- */
         "[[:alpha:]_'][[:alnum:]_']*"
         "|0[xb]?[0-9a-fA-F_]*"