* [PATCH] Teach "git diff" HTML funcname patterns
@ 2008-08-20 17:27 Johan Herland
2008-08-20 17:29 ` Mike Hommey
0 siblings, 1 reply; 3+ messages in thread
From: Johan Herland @ 2008-08-20 17:27 UTC (permalink / raw)
To: git
Finds lines with <h1>..<h6> tags. The pattern is adapted from the ruby one.
Signed-off-by: Johan Herland <johan@herland.net>
---
Documentation/gitattributes.txt | 2 ++
diff.c | 1 +
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index db16b0c..8bb05e6 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -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 --git a/diff.c b/diff.c
index a6c1432..13ae85d 100644
--- a/diff.c
+++ b/diff.c
@@ -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)
--
1.6.0.96.g2fad1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Teach "git diff" HTML funcname patterns
2008-08-20 17:27 [PATCH] Teach "git diff" HTML funcname patterns Johan Herland
@ 2008-08-20 17:29 ` Mike Hommey
2008-08-20 17:49 ` [PATCH v2] " Johan Herland
0 siblings, 1 reply; 3+ messages in thread
From: Mike Hommey @ 2008-08-20 17:29 UTC (permalink / raw)
To: Johan Herland; +Cc: git
On Wed, Aug 20, 2008 at 07:27:46PM +0200, Johan Herland wrote:
> Finds lines with <h1>..<h6> tags. The pattern is adapted from the ruby one.
Don't you want to catch <H1>...<H6> too ?
Mike
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2] Teach "git diff" HTML funcname patterns
2008-08-20 17:29 ` Mike Hommey
@ 2008-08-20 17:49 ` Johan Herland
0 siblings, 0 replies; 3+ messages in thread
From: Johan Herland @ 2008-08-20 17:49 UTC (permalink / raw)
To: git; +Cc: Mike Hommey
Finds lines with <h1>..<h6> tags. The pattern is adapted from the ruby one.
Signed-off-by: Johan Herland <johan@herland.net>
---
On Wednesday 20 August 2008, Mike Hommey wrote:
> On Wed, Aug 20, 2008 at 07:27:46PM +0200, Johan Herland wrote:
> > 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(-)
diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt
index db16b0c..8bb05e6 100644
--- a/Documentation/gitattributes.txt
+++ b/Documentation/gitattributes.txt
@@ -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 --git a/diff.c b/diff.c
index a6c1432..9d4b961 100644
--- a/diff.c
+++ b/diff.c
@@ -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)
--
1.6.0.96.g2fad1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-08-20 17:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-20 17:27 [PATCH] Teach "git diff" HTML funcname patterns Johan Herland
2008-08-20 17:29 ` Mike Hommey
2008-08-20 17:49 ` [PATCH v2] " Johan Herland
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).