From: Andreas Ericsson Date: Sun, 7 Sep 2008 20:15:29 +0000 (+0200) Subject: Teach "git diff -p" to locate PHP class methods X-Git-Tag: v1.6.1-rc1~267 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=af9ce1ffc6de9774e90a91f27fb1febd027f74f1;p=git.git Teach "git diff -p" to locate PHP class methods Otherwise it will always print the class-name rather than the name of the function inside that class. While we're at it, reorder the gitattributes manpage to list the built-in funcname pattern names in alphabetical order. Signed-off-by: Andreas Ericsson Signed-off-by: Junio C Hamano --- diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt index 5fb500741..75124d261 100644 --- a/Documentation/gitattributes.txt +++ b/Documentation/gitattributes.txt @@ -311,18 +311,20 @@ patterns are available: - `bibtex` suitable for files with BibTeX coded references. +- `html` suitable for HTML/XHTML documents. + - `java` suitable for source code in the Java lanugage. - `pascal` suitable for source code in the Pascal/Delphi language. +- `php` suitable for source code in the PHP language. + - `python` suitable for source code in the Python language. - `ruby` suitable for source code in the Ruby language. - `tex` suitable for source code for LaTeX documents. -- `html` suitable for HTML/XHTML documents. - Performing a three-way merge ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/diff.c b/diff.c index cbd151bbc..e7afbe28c 100644 --- a/diff.c +++ b/diff.c @@ -1402,6 +1402,7 @@ static struct builtin_funcname_pattern { "\\|" "^\\(.*=[ \t]*\\(class\\|record\\).*\\)$" }, + { "php", "^[\t ]*\\(\\(function\\|class\\).*\\)" }, { "python", "^\\s*\\(\\(class\\|def\\)\\s.*\\)$" }, { "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$" }, { "tex", "^\\(\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*\\{0,1\\}{.*\\)$" },