Re: git diff-files weirdness (bug?)

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

 




On Fri, 23 May 2008, Linus Torvalds wrote:
> 
> And I think "setup_diff_no_index()" is broken exactly because it sees that 
> '--' and then totally ignores it and says "if I see two paths, we'll say 
> it's the non-index case".

Actually, I think it's broken not so much because it ignores '--', but 
because it's just way too eager to do the "non-git" case.

Basically, it is trying to act like a traditional "diff", but in doing so 
it disables the normal "git diff" semantics. Which is incorrect, when you 
actually _want_ the normal "git diff" behaviour.

So I would suggest that we make it *much* harder to trigger the "make it 
act like a traditional 'diff'" thing.

I would suggest that we *not* invoce the traditional 'diff' behaviour 
when:

 - we're called as "git-diff-files". That's clearly a git thing. Don't try 
   to make it act like an external non-git diff. Only do the special case 
   for plain "git diff" itself.

 - even for plain "git diff", make it much harder to trigger non-git 
   behaviour. Don't do it if the files don't exist. Don't do it if there 
   is '--' there.

In fact, maybe we should remove that thing entirely, or *require* a flag 
to enable it (at least if we're in a git directory). It's a cute hack, but 
when the cute hack actually makes it impossible to do certain real git 
operations, it's a cute hack that is detrimental.

		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