git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Anatoly Borodin <anatoly.borodin@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git show -m with a parent number
Date: Mon, 28 Mar 2016 15:16:08 -0400	[thread overview]
Message-ID: <20160328191608.GA22602@sigill.intra.peff.net> (raw)
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

  reply	other threads:[~2016-03-28 19:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-27 20:46 git show -m with a parent number Anatoly Borodin
2016-03-28 19:16 ` Jeff King [this message]
2016-03-28 19:31   ` Junio C Hamano
2016-03-30 12:31   ` Anatoly Borodin
2016-03-30 16:55     ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160328191608.GA22602@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=anatoly.borodin@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).