Re: [PATCH] Per-path attribute based hunk header selection.
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jul 8, 2007, 11:58 UTC
- Message-ID
- <Pine.LNX.4.64.0707081254450.4248@racer.site>
- In-Reply-To
- <7v1wfj4auu.fsf@assigned-by-dhcp.cox.net>
Hi,
On Sun, 8 Jul 2007, Junio C Hamano wrote:
Show 17 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> >> > + if (!strcmp(ident, "tex"))
> >> > + return "^\\\\\\(sub\\)*section{";
> >
> > It is always easier, and will never require C skills, to put this into the
> > config. With Junio's current version:
> >
> > echo '*.tex funcname=tex' >> .gitattributes
> > echo '[funcname] tex = ^\(\\\(sub\)*section{.*\)' >> .git/config
> >
> > The problem is of course that the backslashes have to be escaped _both_ in
> > C and in regexps.
>
> I think giving a reasonable set of basic language support as
> built-in patterns is important for usability. Otherwise the
> users end up needing to have them in their $HOME/.gitconfig.I agree.
> I am not sure if Java and LaTeX qualify as the first two most important > cases, but they are what we already have demonstrated.
Java and LaTeX are the two languages I use, for which the inbuilt funcname default is absolutely unusable. Given that Java is the only language with a notable git-related code base, for which the default fails, Java is the prime (if not the only) reason I wanted this whole patch series in the first place.
> How about doing something like this?
I do not see how a table in diff.c could be easier to maintain than a small part in a small function in diff.c. It would make sense, though, to move the table to xdiff-interface.[ch].
Ciao, Dscho