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

Re: [PATCH 3/6] revert: don't let revert continue a cherry-pick

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jan 8, 2012, 20:22 UTC
Message-ID
<20120108202216.GL1942@burratino>
In-Reply-To
<CALkWK0=-AWy7HnVASB1rt8njavTYOhV7Zxsdq4TE+VShVZmEzQ@mail.gmail.com>
Ramkumar Ramachandra wrote:
> Jonathan Nieder wrote:
Show 9 quoted lines
>> I don't know --- it's not confusing to me.  Could you explain further
>> what harm the current behavior does?  E.g., could it cause me to
>> misunderstand some basic concepts, or could it lead me to run commands
>> that cause me to scratch my head or lose data?
>
> Junio explained this to me in [1].  It's very unnatural for a user to
> want to execute "git cherry-pick --continue" when the previous command
> was a "git revert": it probably means that she forgot about the
> in-progress "git revert".
[...]
> [1]: http://thread.gmane.org/gmane.comp.version-control.git/185355
I don't think that's what Junio said.

Did this actually happen, or is it a theoretical worry? I think I would be more likely to run "git cherry-pick <foo>..<bar>" than "git cherry-pick --continue" if I had forgotten about an in-progress revert. The former already errors out with a sensible message.

Or is the problem that I might run:
	git revert foo..bar
	git reset --merge; # conflict --- let's clean this up
	# ah, I remember reverting the patch that conflicted before;
	# let's reuse the resolution.
	git cherry-pick baz
	edit file.c; # another conflict, sigh
	git add file.c
	git cherry-pick --continue; # oops!

? That seems like a real worry, but the same problem could happen with cherry-pick used both for the multipick and single-pick, so I don't think your patch fundamentally addresses it.

In other words, this is a problem caused by the overloading of the same cherry-pick command for single-pick and multi-pick. I think it should be preventable by remembering which action failed when stopping a sequence and doing only a single-pick resume if CHERRY_PICK_HEAD/REVERT_HEAD/whatever doesn't match that.

The "oops" is bad since the operator might have been intending to run some more tests and amend as necessary before continuing the multi-pick. It is not _that_ bad, since more typically one would have already run some tests before running cherry-pick --continue to commit the resolution. Still probably worth fixing.

Show 5 quoted lines
> The problem becomes more serious when the
> sequencer grows more capabilities: a "git merge --continue" to
> continue a "git am" sounds much more absurd.  Ofcourse, we will
> provide a way to continue any sequencer operation in the future: "git
> continue" seems to be a good candidate.

I don't understand why "cherry-pick --continue" resuming a revert sequence implies that "merge --continue" would have to as well.

All that said, forbidding cherry-pick --continue from resuming a revert sequence would be fine with me, _as long as the semantics are clearly spelled out in the commit message and documentation_. What happens when there is a mixture of picks and reverts?

Thanks. Jonathan

Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 13 of 64 in “The move to sequencer.c”
  1. 0/6 The move to sequencer.cRamkumar Ramachandra, Jan 8, 2012
  2. 1/6 revert: move replay_action, replay_subcommand to headerRamkumar Ramachandra, Jan 8, 2012
  3. Jonathan NiederJan 8, 2012
  4. 2/6 revert: decouple sequencer actions from builtin commandsRamkumar Ramachandra, Jan 8, 2012
  5. Jonathan NiederJan 8, 2012
  6. Ramkumar RamachandraJan 8, 2012
  7. Jonathan NiederJan 8, 2012
  8. Ramkumar RamachandraJan 8, 2012
  9. Jonathan NiederJan 8, 2012
  10. 3/6 revert: don't let revert continue a cherry-pickRamkumar Ramachandra, Jan 8, 2012
  11. Jonathan NiederJan 8, 2012
  12. Ramkumar RamachandraJan 8, 2012
  13. Jonathan NiederJan 8, 2012
  14. Ramkumar RamachandraJan 8, 2012
  15. Jonathan NiederJan 8, 2012
  16. 4/6 revert: allow mixing "pick" and "revert" actionsRamkumar Ramachandra, Jan 8, 2012
  17. Jonathan NiederJan 8, 2012
  18. Ramkumar RamachandraJan 8, 2012
  19. Jonathan NiederJan 8, 2012
  20. Jonathan NiederJan 8, 2012
  21. Ramkumar RamachandraJan 10, 2012
  22. 5/6 revert: report fine-grained error messages from insn parserRamkumar Ramachandra, Jan 8, 2012
  23. Jonathan NiederJan 8, 2012
  24. Ramkumar RamachandraJan 8, 2012
  25. Jonathan NiederJan 8, 2012
  26. Ramkumar RamachandraJan 10, 2012
  27. 6/6 sequencer: factor code out of revert builtinRamkumar Ramachandra, Jan 8, 2012
  28. Jonathan NiederJan 8, 2012
  29. Ramkumar RamachandraJan 10, 2012
  30. Jonathan NiederJan 8, 2012
  31. Ramkumar RamachandraJan 8, 2012
  32. Jonathan NiederJan 8, 2012
  33. 0/8 The move to sequencer.cRamkumar Ramachandra, Jan 10, 2012
  34. 1/8 revert: prepare to move replay_action to headerRamkumar Ramachandra, Jan 10, 2012
  35. Jonathan NiederJan 10, 2012
  36. 2/8 revert: decouple sequencer actions from builtin commandsRamkumar Ramachandra, Jan 10, 2012
  37. Jonathan NiederJan 10, 2012
  38. Ramkumar RamachandraJan 11, 2012
  39. Ramkumar RamachandraJan 11, 2012
  40. Jonathan NiederJan 11, 2012
  41. Ramkumar RamachandraJan 11, 2012
  42. Ramkumar RamachandraJan 11, 2012
  43. Jonathan NiederJan 11, 2012
  44. Ramkumar RamachandraJan 11, 2012
  45. Jonathan NiederJan 11, 2012
  46. Ramkumar RamachandraJan 11, 2012
  47. Jonathan NiederJan 11, 2012
  48. Jonathan NiederJan 11, 2012
  49. Ramkumar RamachandraJan 11, 2012
  50. Jonathan NiederJan 11, 2012
  51. Ramkumar RamachandraJan 11, 2012
  52. 0/2 The move to sequencer.cRamkumar Ramachandra, Jan 11, 2012
  53. 1/2 revert: prepare to move replay_action to headerRamkumar Ramachandra, Jan 11, 2012
  54. 2/2 sequencer: factor code out of revert builtinRamkumar Ramachandra, Jan 11, 2012
  55. Jonathan NiederJan 11, 2012
  56. 3/8 revert: allow mixing "pick" and "revert" actionsRamkumar Ramachandra, Jan 10, 2012
  57. 4/8 revert: separate out parse errors logicallyRamkumar Ramachandra, Jan 10, 2012
  58. Jonathan NiederJan 10, 2012
  59. Ramkumar RamachandraJan 11, 2012
  60. 5/8 revert: report fine-grained errors from insn parserRamkumar Ramachandra, Jan 10, 2012
  61. Jonathan NiederJan 11, 2012
  62. 6/8 sha1_name: introduce getn_sha1() to take lengthRamkumar Ramachandra, Jan 10, 2012
  63. 7/8 revert: use getn_sha1() to simplify insn parsingRamkumar Ramachandra, Jan 10, 2012
  64. 8/8 sequencer: factor code out of revert builtinRamkumar Ramachandra, Jan 10, 2012

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.