git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Anatoly BorodinNext: Junio C Hamano
Message 2 of 5 in “git show -m with a parent number”
  1. Anatoly BorodinMar 27, 2016
  2. Jeff KingMar 28, 2016
  3. Junio C HamanoMar 28, 2016
  4. Anatoly BorodinMar 30, 2016
  5. Andreas SchwabMar 30, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.