Re: Strange behaviour of git diff branch1 ... branch2
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 12, 2012, 17:46 UTC
- Message-ID
- <7vbof2iuic.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CACsJy8BkKRxp9AQW0M0vDSL8Mb16VGSrZ1OnQpwCrERWKVLSyA@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
Show 15 quoted lines
> On Sat, Oct 27, 2012 at 7:33 PM, Junio C Hamano <gitster@pobox.com> wrote: >> >> Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote: >>> >>>Notice the --cc in the first line, which is combined diff. Usually >>>combined-diff is between two points and one parent. Though somehow git >>>passes 4 parents down combined-diff.c:show_combined_header, as you can >>>see in the "index" line. I think we should fix rev parsing code as it >>>does not make sense to pass 4 identical parents this way. >> >> The two heads home from HEAD...HEAD the user has on the command line. >> >> The user is getting exactly what she asked; there is nothing to fix. > > Is there any use case where HEAD...HEAD (or "..." alone) is actually useful?
That is an invalid question, implying a proposal that will introduce more confusion to the users while hurting the code.
There is no use case where "cat A >>A" is actually useful, either, but it does not mean "cat A >>A" should be special cased to do something different from what it happens to do in line with the case where "cat A >>B" does. I think "diff ..." or "diff HEAD...HEAD" are the same as that example.