{"thread":{"id":"15411","subject":"[PATCH] Teach \"git diff -p\" to locate PHP class methods","startedAt":"2008-09-07T20:15:29Z","lastAt":"2008-09-07T20:15:29Z","messageCount":1,"participants":["Andreas Ericsson"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"90002","messageId":"48C43661.8010405@op5.se","threadId":"15411","inReplyTo":null,"subject":"[PATCH] Teach \"git diff -p\" to locate PHP class methods","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2008-09-07T20:15:29Z","receivedAt":"2008-09-07T20:15:29Z","isPatch":true,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Otherwise it will always print the class-name rather\nthan the name of the function inside that class.\n\nWhile we're at it, reorder the gitattributes manpage to\nlist the built-in funcname pattern names in alphabetical\norder.\n\nSigned-off-by: Andreas Ericsson <ae@op5.se>\n---\n Documentation/gitattributes.txt |    6 ++++--\n diff.c                          |    1 +\n 2 files changed, 5 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt\nindex 5fb5007..75124d2 100644\n--- a/Documentation/gitattributes.txt\n+++ b/Documentation/gitattributes.txt\n@@ -311,18 +311,20 @@ patterns are available:\n \n - `bibtex` suitable for files with BibTeX coded references.\n \n+- `html` suitable for HTML/XHTML documents.\n+\n - `java` suitable for source code in the Java lanugage.\n \n - `pascal` suitable for source code in the Pascal/Delphi language.\n \n+- `php` suitable for source code in the PHP language.\n+\n - `python` suitable for source code in the Python language.\n \n - `ruby` suitable for source code in the Ruby language.\n \n - `tex` suitable for source code for LaTeX documents.\n \n-- `html` suitable for HTML/XHTML documents.\n-\n \n Performing a three-way merge\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~\ndiff --git a/diff.c b/diff.c\nindex cbd151b..e7afbe2 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -1402,6 +1402,7 @@ static struct builtin_funcname_pattern {\n \t\t\t\"\\\\|\"\n \t\t\t\"^\\\\(.*=[ \\t]*\\\\(class\\\\|record\\\\).*\\\\)$\"\n \t\t\t},\n+\t{ \"php\", \"^[\\t ]*\\\\(\\\\(function\\\\|class\\\\).*\\\\)\" },\n \t{ \"python\", \"^\\\\s*\\\\(\\\\(class\\\\|def\\\\)\\\\s.*\\\\)$\" },\n \t{ \"ruby\", \"^\\\\s*\\\\(\\\\(class\\\\|module\\\\|def\\\\)\\\\s.*\\\\)$\" },\n \t{ \"tex\", \"^\\\\(\\\\\\\\\\\\(\\\\(sub\\\\)*section\\\\|chapter\\\\|part\\\\)\\\\*\\\\{0,1\\\\}{.*\\\\)$\" },\n-- \n1.6.0.1.196.g01914\n"}]}