Re: [PATCH] Per-path attribute based hunk header selection.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Fri, 6 Jul 2007, Junio C Hamano wrote:
>
> This makes"diff -p" hunk headers customizable via gitattributes mechanism.
> It is based on Johannes's earlier patch that allowed to define a single
> regexp to be used for everything.

Ok, I think this is really nice, but I do wonder a bit about the syntax.

In particular, the "funcname" thing is really a pretty ugly special-case 
approach.

Wouldn't it be nicer to consider the "funcname=java" to be less of a 
"special case for the built-in diff", and instead think of it as a more 
generic issue of "how do we want to generate diffs for java files?"

IOW, wouldn't this be much nicer to be thought about as a "custon diff 
driver" issue?

So I like your patches, but dislike the config syntax, and would suggest 
something like

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.

			Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux