mirror of
https://github.com/git/git.git
synced 2024-11-20 12:54:00 +01:00
Teach "git diff -p" HTML funcname patterns
Find lines with <h1>..<h6> tags. [jc: while at it, reordered entries to sort alphabetically.] Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
7c17205b64
commit
1a1fcf4abe
@ -322,6 +322,8 @@ patterns are available:
|
|||||||
|
|
||||||
- `tex` suitable for source code for LaTeX documents.
|
- `tex` suitable for source code for LaTeX documents.
|
||||||
|
|
||||||
|
- `html` suitable for HTML/XHTML documents.
|
||||||
|
|
||||||
|
|
||||||
Performing a three-way merge
|
Performing a three-way merge
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
5
diff.c
5
diff.c
@ -1381,6 +1381,8 @@ static struct builtin_funcname_pattern {
|
|||||||
const char *name;
|
const char *name;
|
||||||
const char *pattern;
|
const char *pattern;
|
||||||
} builtin_funcname_pattern[] = {
|
} builtin_funcname_pattern[] = {
|
||||||
|
{ "bibtex", "\\(@[a-zA-Z]\\{1,\\}[ \t]*{\\{0,1\\}[ \t]*[^ \t\"@',\\#}{~%]*\\).*$" },
|
||||||
|
{ "html", "^\\s*\\(<[Hh][1-6]\\s.*>.*\\)$" },
|
||||||
{ "java", "!^[ ]*\\(catch\\|do\\|for\\|if\\|instanceof\\|"
|
{ "java", "!^[ ]*\\(catch\\|do\\|for\\|if\\|instanceof\\|"
|
||||||
"new\\|return\\|switch\\|throw\\|while\\)\n"
|
"new\\|return\\|switch\\|throw\\|while\\)\n"
|
||||||
"^[ ]*\\(\\([ ]*"
|
"^[ ]*\\(\\([ ]*"
|
||||||
@ -1392,10 +1394,9 @@ static struct builtin_funcname_pattern {
|
|||||||
"\\|"
|
"\\|"
|
||||||
"^\\(.*=[ \t]*\\(class\\|record\\).*\\)$"
|
"^\\(.*=[ \t]*\\(class\\|record\\).*\\)$"
|
||||||
},
|
},
|
||||||
{ "bibtex", "\\(@[a-zA-Z]\\{1,\\}[ \t]*{\\{0,1\\}[ \t]*[^ \t\"@',\\#}{~%]*\\).*$" },
|
|
||||||
{ "tex", "^\\(\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*\\{0,1\\}{.*\\)$" },
|
|
||||||
{ "python", "^\\s*\\(\\(class\\|def\\)\\s.*\\)$" },
|
{ "python", "^\\s*\\(\\(class\\|def\\)\\s.*\\)$" },
|
||||||
{ "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$" },
|
{ "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$" },
|
||||||
|
{ "tex", "^\\(\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*\\{0,1\\}{.*\\)$" },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *diff_funcname_pattern(struct diff_filespec *one)
|
static const char *diff_funcname_pattern(struct diff_filespec *one)
|
||||||
|
Loading…
Reference in New Issue
Block a user