From: Junio C Hamano <junkio@cox.net>
To: Mark Wooding <mdw@distorted.org.uk>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] xdiff: Show function names in hunk headers.
Date: Tue, 28 Mar 2006 16:21:03 -0800 [thread overview]
Message-ID: <7v4q1ihzio.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <slrne2ik1i.s3g.mdw@metalzone.distorted.org.uk> (Mark Wooding's message of "Tue, 28 Mar 2006 15:03:14 +0000 (UTC)")
Mark Wooding <mdw@distorted.org.uk> writes:
> Junio C Hamano <junkio@cox.net> wrote:
>
>> GNU diff -p does "^[[:alpha:]$_]"; personally I think any line
>> that does not begin with a whitespace is good enough.
>...
> The second suggestion is slightly refined, but a little more
> complicated. We ask for a line which starts /either/ with two
> non-whitespace characters, or with an alphanumeric. Why? Because text
> documents have a tendency to have headings of the form `7 Heading!' and
> I want to catch them.
Asciidoc?
. enumerated one
this is one item
. enumerated two
this is another item
> I think I like option 2 best, as a nice compromise between stupidity and
> actually working. Opinions, anyone?
It's just a heuristic, so there are only two things we could
sensibly do. Either we keep it absolutely stupid to save our
code and sanity, or we give full configurability via -F regexp
to the end users.
I suspect feeping creaturism would eventually push us to go the
latter route, but for now I'd vote for doing exactly the same as
what default GNU does, by looking at the first letter without
using regexps. When we add regexps later, the users can
customize the pattern to match the languages they use, and we
might end up having to have a set of (file-suffix -> default
regexp) mappings, with full end user configurability via
.git/config -- gaaah but true X-<.
[diff]
functionline = "^\w" for .c
functionline = "^(?i)\s*(?:function|procedure)" for .f77
functionline = "^\(defun " for .el
...
next prev parent reply other threads:[~2006-03-29 0:21 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-28 2:23 [PATCH] xdiff: Show function names in hunk headers Mark Wooding
2006-03-28 5:54 ` Junio C Hamano
2006-03-28 9:50 ` Junio C Hamano
2006-03-28 10:13 ` Mark Wooding
2006-03-28 15:03 ` Mark Wooding
2006-03-29 0:21 ` Junio C Hamano [this message]
2006-03-29 9:57 ` Mark Wooding
2006-03-28 11:07 ` Andreas Ericsson
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=7v4q1ihzio.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=mdw@distorted.org.uk \
/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