Re: git show -m with a parent number
- From
Jeff King <peff@peff.net>
- Date
- Mar 28, 2016, 19:16 UTC
- Message-ID
- <20160328191608.GA22602@sigill.intra.peff.net>
- In-Reply-To
- <nd9gq6$412$1@ger.gmane.org>
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.
I am not sure of the workflow it would help. Personally, I use "-m" in two situations:
1. To puzzle out issues where "-c" or "--cc" do not show what I
expected. 2. With "--first-parent", to follow the linear history of a mainline
branch, showing merged topic branches as a single diff.For the first one, showing all diffs is what I want. For the second, it only makes sense to for the first parent case, as following other parents would zig-zag through history.
But perhaps you have some other use case in mind. In cases like these, I think it is a good idea to implement the feature, and run with it for a while, seeing how it can be used. And then if it proves useful, post the patch to the list describing your experiences.
-Peff