Skip to content

Commit

Permalink
Teach "git diff -p" to locate PHP class methods
Browse files Browse the repository at this point in the history
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 <ae@op5.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Andreas Ericsson authored and Junio C Hamano committed Sep 7, 2008
1 parent ec3a4ba commit af9ce1f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Documentation/gitattributes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
1 change: 1 addition & 0 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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\\}{.*\\)$" },
Expand Down

0 comments on commit af9ce1f

Please sign in to comment.