From: Kirill Smelkov Date: Wed, 20 Aug 2008 15:57:07 +0000 (+0400) Subject: Teach "git diff -p" Python funcname patterns X-Git-Tag: v1.6.1-rc1~324 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7c17205b64a0e668d8a6e59109043bd4f2af3a0c;p=git.git Teach "git diff -p" Python funcname patterns Find classes, functions, and methods definitions. Signed-off-by: Kirill Smelkov Signed-off-by: Junio C Hamano --- diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt index db16b0ca5..9279df534 100644 --- a/Documentation/gitattributes.txt +++ b/Documentation/gitattributes.txt @@ -316,6 +316,8 @@ patterns are available: - `pascal` suitable for source code in the Pascal/Delphi 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. diff --git a/diff.c b/diff.c index 5923fe281..221541644 100644 --- a/diff.c +++ b/diff.c @@ -1394,6 +1394,7 @@ static struct builtin_funcname_pattern { }, { "bibtex", "\\(@[a-zA-Z]\\{1,\\}[ \t]*{\\{0,1\\}[ \t]*[^ \t\"@',\\#}{~%]*\\).*$" }, { "tex", "^\\(\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*\\{0,1\\}{.*\\)$" }, + { "python", "^\\s*\\(\\(class\\|def\\)\\s.*\\)$" }, { "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$" }, };