Skip to content

Commit af9ce1f

Browse files
agericgitster
authored andcommitted
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 <ae@op5.se> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent ec3a4ba commit af9ce1f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Documentation/gitattributes.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,18 +311,20 @@ patterns are available:
311311

312312
- `bibtex` suitable for files with BibTeX coded references.
313313

314+
- `html` suitable for HTML/XHTML documents.
315+
314316
- `java` suitable for source code in the Java lanugage.
315317

316318
- `pascal` suitable for source code in the Pascal/Delphi language.
317319

320+
- `php` suitable for source code in the PHP language.
321+
318322
- `python` suitable for source code in the Python language.
319323

320324
- `ruby` suitable for source code in the Ruby language.
321325

322326
- `tex` suitable for source code for LaTeX documents.
323327

324-
- `html` suitable for HTML/XHTML documents.
325-
326328

327329
Performing a three-way merge
328330
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

diff.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,6 +1402,7 @@ static struct builtin_funcname_pattern {
14021402
"\\|"
14031403
"^\\(.*=[ \t]*\\(class\\|record\\).*\\)$"
14041404
},
1405+
{ "php", "^[\t ]*\\(\\(function\\|class\\).*\\)" },
14051406
{ "python", "^\\s*\\(\\(class\\|def\\)\\s.*\\)$" },
14061407
{ "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$" },
14071408
{ "tex", "^\\(\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*\\{0,1\\}{.*\\)$" },

0 commit comments

Comments
 (0)