git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Herland <johan@herland.net>
To: git@vger.kernel.org
Subject: [PATCH] Teach "git diff" HTML funcname patterns
Date: Wed, 20 Aug 2008 19:27:46 +0200	[thread overview]
Message-ID: <200808201927.47099.johan@herland.net> (raw)

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

             reply	other threads:[~2008-08-20 17:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-20 17:27 Johan Herland [this message]
2008-08-20 17:29 ` [PATCH] Teach "git diff" HTML funcname patterns Mike Hommey
2008-08-20 17:49   ` [PATCH v2] " Johan Herland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200808201927.47099.johan@herland.net \
    --to=johan@herland.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).