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

Re: [PATCH] cherry-pick: do not error on non-merge commits when '-m 1' is specified

From
Jeff King <peff@peff.net>
Date
Mar 26, 2019, 22:20 UTC
Message-ID
<20190326222052.GD1445@sigill.intra.peff.net>
In-Reply-To
<CABPp-BF7cd2+4jr=zGVP8x_QLdFbyOoGRWUgMtgiGDCdqZdjFA@mail.gmail.com>
On Tue, Mar 26, 2019 at 03:07:42PM -0700, Elijah Newren wrote:
Show 26 quoted lines
> On Tue, Mar 26, 2019 at 9:35 AM Jeff King <peff@peff.net> wrote:
> >
> > On Mon, Mar 25, 2019 at 09:43:09AM +0300, Sergey Organov wrote:
> >
> > > How about changing "git show -p M" to output "diff -p M^ M" rather than
> > > "diff-tree --cc M" for merge commits? It's really surprising specifying
> > > -p has no visible effect.
> >
> > That's because "-p" is already the default, and the format selection is
> > orthogonal to the handling of merge commits. Providing "-m" would
> > actually override the "--cc" default (though "--first-parent -m" is
> > likely to be less noisy, per this discussion).
> >
> > As far as defaults go, I dunno. The idea is that "--cc" would give you a
> > nice summary of what the merge _itself_ had to touch. I think that's
> > valuable, too. If we were starting from scratch, I think there could be
> > a discussion about whether one default is better than the other. But at
> > this point I have a hard time finding one so much obviously better than
> > the other to merit changing the behavior.
> 
> Indeed, some of us would view a first parent diff default for merges
> as problematic.  However, I'd like to point out (or remind) that these
> two options aren't the only ways you could view a merge.  Thomas
> Rast's --remerge-diff[1] is another (even if not yet part of git.git).
> Gerrit uses something similar-ish for its default way of showing a
> merge.

Heh, I almost mentioned remerge-diff, but since it's not actually part of Git, I didn't want to get into a tangent. But since you mention it, yes, I actually find it quite a useful way of looking at the diff, especially when I want to see what the person resolving the conflicts actually _did_. The --cc combined diff is too eager to throw away hunks that resolved purely to one side (which _most_ of the time is what you want, but when you're hunting a possible error in the merge, it's quite confusing).

How close is merge-recursive.c to actually doing a pure in-memory merge?

I seem to recall that was a (the?) sticking point for the original remerge-diff.

-Peff
Previous: Elijah NewrenNext: Elijah Newren
Message 20 of 22 in “cherry-pick: do not error on non-merge commits when '-m 1' is specified”
  1. cherry-pick: do not error on non-merge commits when '-m 1' is specifiedSergey Organov, May 25, 2018
  2. Junio C HamanoJun 21, 2018
  3. Sergey OrganovJun 22, 2018
  4. Sergey OrganovDec 12, 2018
  5. Junio C HamanoDec 13, 2018
  6. Sergey OrganovDec 13, 2018
  7. Sergey OrganovDec 13, 2018
  8. Junio C HamanoDec 14, 2018
  9. 0/4 Allow 'cherry-pick -m 1' for non-merge commitsSergey Organov, Dec 14, 2018
  10. 1/4 t3510: stop using '-m 1' to force failure mid-sequence of cherry-picksSergey Organov, Dec 14, 2018
  11. 2/4 cherry-pick: do not error on non-merge commits when '-m 1' is specifiedSergey Organov, Dec 14, 2018
  12. 3/4 t3502: validate '-m 1' argument is now accepted for non-merge commitsSergey Organov, Dec 14, 2018
  13. 4/4 t3506: validate '-m 1 -ff' is now accepted for non-merge commitsSergey Organov, Dec 14, 2018
  14. Sergey OrganovMar 19, 2019
  15. Junio C HamanoMar 20, 2019
  16. Jeff KingMar 20, 2019
  17. Sergey OrganovMar 25, 2019
  18. Jeff KingMar 26, 2019
  19. Elijah NewrenMar 26, 2019
  20. Jeff KingMar 26, 2019
  21. Elijah NewrenMar 27, 2019
  22. Sergey OrganovMar 27, 2019

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.