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>
Johan Herland committed
Aug 20, 2008 at 19:49 UTC
1a1fcf4abeb2ed4ef6075970788711cf62405158
2 files changed
+5
-2
Documentation/gitattributes.txt
+2
@@ -322,6 +322,8 @@ patterns are available:
322
323
- `tex` suitable for source code for LaTeX documents.
324
325
+- `html` suitable for HTML/XHTML documents.
326
+
327
328
Performing a three-way merge
329
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff.c
+3
-2
@@ -1381,6 +1381,8 @@ static struct builtin_funcname_pattern {
1381
const char *name;
1382
const char *pattern;
1383
} builtin_funcname_pattern[] = {
1384
+ { "bibtex", "\\(@[a-zA-Z]\\{1,\\}[ \t]*{\\{0,1\\}[ \t]*[^ \t\"@',\\#}{~%]*\\).*$" },
1385
+ { "html", "^\\s*\\(<[Hh][1-6]\\s.*>.*\\)$" },
1386
{ "java", "!^[ ]*\\(catch\\|do\\|for\\|if\\|instanceof\\|"
1387
"new\\|return\\|switch\\|throw\\|while\\)\n"
1388
"^[ ]*\\(\\([ ]*"
@@ -1392,10 +1394,9 @@ static struct builtin_funcname_pattern {
1394
"\\|"
1395
"^\\(.*=[ \t]*\\(class\\|record\\).*\\)$"
1396
},
1395
- { "bibtex", "\\(@[a-zA-Z]\\{1,\\}[ \t]*{\\{0,1\\}[ \t]*[^ \t\"@',\\#}{~%]*\\).*$" },
1396
- { "tex", "^\\(\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*\\{0,1\\}{.*\\)$" },
1397
{ "python", "^\\s*\\(\\(class\\|def\\)\\s.*\\)$" },
1398
{ "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$" },
1399
+ { "tex", "^\\(\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*\\{0,1\\}{.*\\)$" },
1400
};
1401
1402
static const char *diff_funcname_pattern(struct diff_filespec *one)