Skip to contentSkip to conversation

Teach "git diff" HTML funcname patterns

PATCH In review Johan Herland 2 participants 3 messages Jun 15, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Teach "git diff" HTML funcname patterns

Finds lines with <h1>..<h6> tags. The pattern is adapted from the ruby one.

---
 Documentation/gitattributes.txt |    2 ++
 diff.c                          |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)
Documentation/gitattributes.txt +2 -0
index db16b0c..8bb05e6 100644
@@ -320,6 +320,8 @@ patterns are available:
 
 - `tex` suitable for source code for LaTeX documents.
 
+- `html` suitable for HTML/XHTML documents.
+
 
 Performing a three-way merge
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff.c +1 -0
index a6c1432..13ae85d 100644
@@ -1382,6 +1382,7 @@ static struct builtin_funcname_pattern {
 	{ "bibtex", "\\(@[a-zA-Z]\\{1,\\}[ \t]*{\\{0,1\\}[ \t]*[^ \t\"@',\\#}{~%]*\\).*$" },
 	{ "tex", "^\\(\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*\\{0,1\\}{.*\\)$" },
 	{ "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$" },
+	{ "html", "^\\s*\\(<h[1-6]\\s.*>.*\\)$" },
 };
 
 static const char *diff_funcname_pattern(struct diff_filespec *one)
Signature · 1 line
1.6.0.96.g2fad1
#1 lore raw
Quoted 1 line · Johan Herland

Finds lines with <h1>..<h6> tags. The pattern is adapted from the ruby one.

Don't you want to catch <H1>...<H6> too ?

Mike

#2 lore raw

PATCH v2 1/1 Teach "git diff" HTML funcname patterns

Finds lines with <h1>..<h6> tags. The pattern is adapted from the ruby one.

---

Quoted 4 lines · Mike Hommey
Quoted 2 lines · Johan Herland

Finds lines with <h1>..<h6> tags. The pattern is adapted from the ruby one.

Don't you want to catch <H1>...<H6> too ?

Yes. Thanks.

Have fun!

...Johan

 Documentation/gitattributes.txt |    2 ++
 diff.c                          |    1 +
 2 files changed, 3 insertions(+), 0 deletions(-)
Documentation/gitattributes.txt +2 -0
index db16b0c..8bb05e6 100644
@@ -320,6 +320,8 @@ patterns are available:
 
 - `tex` suitable for source code for LaTeX documents.
 
+- `html` suitable for HTML/XHTML documents.
+
 
 Performing a three-way merge
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff.c +1 -0
index a6c1432..9d4b961 100644
@@ -1382,6 +1382,7 @@ static struct builtin_funcname_pattern {
 	{ "bibtex", "\\(@[a-zA-Z]\\{1,\\}[ \t]*{\\{0,1\\}[ \t]*[^ \t\"@',\\#}{~%]*\\).*$" },
 	{ "tex", "^\\(\\\\\\(\\(sub\\)*section\\|chapter\\|part\\)\\*\\{0,1\\}{.*\\)$" },
 	{ "ruby", "^\\s*\\(\\(class\\|module\\|def\\)\\s.*\\)$" },
+	{ "html", "^\\s*\\(<[Hh][1-6]\\s.*>.*\\)$" },
 };
 
 static const char *diff_funcname_pattern(struct diff_filespec *one)
Signature · 1 line
1.6.0.96.g2fad1