From: Junio C Hamano Date: Sat, 07 Jul 2007 02:00:36 GMT Subject: Re: [PATCH] Per-path attribute based hunk header selection. Message-ID: <7v8x9tdlbv.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Linus Torvalds writes: > In .gitattributes: > > *.java diff=java > *.perl diff=perl > *.doc diff=doc > > In .git/config > > [diff "java"] > command = internal > funcname = ... # ugly and complicated regexp to override the built-in one. > > [diff "perl"] > command = internal > funcname = ... > > [diff "doc"] > command = ms-doc-diff > > Doesn't this make more sense and mesh much better with the already > existing custom diff driver? > > (And yeah, maybe we could instead of "command=internal" just have the rule > that "internal" is the default, and you'd not have a command at all when > you want to run the internal diff. > > Just an idea. I don't have any code. Yeah, I'd be lying if I said that this did not cross my mind when I saw existing diff.*.command handling. About the comment from Johannes regarding hunk_header vs funcname, I would actually prefer hunk_header, since that is what this is about ("funcname" and "find_func" were misnomer from the beginning), but I'd rename hunk_header to funcname for the sake of consistency and minimizing the diff. Will find time to look at this over the weekend.