Re: git show -m with a parent number

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

 



Jeff King <peff@xxxxxxxx> writes:

> On Sun, Mar 27, 2016 at 08:46:02PM +0000, Anatoly Borodin wrote:
>
>> is there a good reason for `git show -m` to not accept the number of a
>> parent of a merge commit? I can run `git show --first-parent COMMIT`,
>> but need to write `git diff COMMIT^2 COMMIT` every time I want to diff
>> with the second parent!
>
> I think it could, but nobody has yet found it useful enough to
> implement.

For "git show" that does not traverse the history, there may be
occasions where showing a diff with the second parent might make
sense (e.g. the user merged two histories in a wrong direction in
the past and it is too late to rewrite).

I think there are two reasons behind the current state.  Because it
does not make any sense for "git log -m 2" to show diff with its
second parent while traversing many commits, the "git log" codepath
is not prepared to show diff with only nth parent.  Because "git
show" started its life merely as a thin wrapper around "git log",
"git show" does not use such an underlying machinery to show diff
with only nth parent that does not exist.


--
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]