path: root/userdiff.c
diff options
authorBjörn Steinbrink <>2010-05-23 18:05:40 (GMT)
committerJunio C Hamano <>2010-05-27 14:12:07 (GMT)
commit6d2f208c3dd39493f4d45ea67c55a1b7fe06626a (patch)
treeac713eae000afe4ba92fd2c641c389f307b202b7 /userdiff.c
parente498257d650529812ffe1872b3cd62e2bd604287 (diff)
diff: Support visibility modifiers in the PHP hunk header regexp
Starting with PHP5, class methods can have a visibility modifier, which caused the methods not to be matched by the existing regexp, so extend the regexp to match those modifiers. And while we're at it, allow the "static" modifier as well. Since the "static" modifier can appear either before or after the visibility modifier, let's just allow any number of modifiers to appear in any order, as that simplifies the regexp and shouldn't cause any false positives. Signed-off-by: Björn Steinbrink <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'userdiff.c')
1 files changed, 3 insertions, 1 deletions
diff --git a/userdiff.c b/userdiff.c
index df99249..38563da 100644
--- a/userdiff.c
+++ b/userdiff.c
@@ -44,7 +44,9 @@ PATTERNS("pascal",
-PATTERNS("php", "^[\t ]*((function|class).*)",
+ "^[\t ]*(((public|protected|private|static)[\t ]+)*function.*)$\n"
+ "^[\t ]*(class.*)$",
/* -- */