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

Re: git-cherry-pick and git-commit --amend in version 1.7.6.4

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 5, 2011, 23:03 UTC
Message-ID
<7v62k359ee.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAG+J_Dysix9fOCuvm5+aU7-AC4wmsxH4-MOX+yhaHEqzeN1cPg@mail.gmail.com>
Jay Soffian <jaysoffian@gmail.com> writes:
> On Wed, Oct 5, 2011 at 5:55 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> I think the sequencer state needs to be removed when the command aborts.
>
> Or written later in do_pick_commit().

As a general direction, I think it makes tons of sense ot delay writing out these state files before you really commit that the user will be in the cherry-pick (or revert) sequence.

I am not sure if do_pick_commit() is the best place to do so. Wouldn't it be necessary to special case the first round at least? The pick can fail in one of two ways:

 - It does not even start. This is the case I illustrated in the earlier
   message, and we do not want to leave sequencer state.
 - It stops with conflict. At this point, it probably is OK to say that
   the user is committed to go with the sequencer flow and the next step
   would be to help Git resolve conflicts and proceed, and in this case we
   do want the sequencer state.

And once we picked/reverted at least one commit, if there are more, the user knows the sequencer flow is in progress, and it is perfectly fine to see the error message from "commit --amend".

It's just the "commit --amend" message that says I cannot amend felt utterly out of place, immediately after seeing "cherry-pick" that tried to pick only one commit did _not_ even start.

Previous: Jay SoffianNext: Junio C Hamano
Message 14 of 16 in “git-cherry-pick and git-commit --amend in version 1.7.6.4”
  1. Nicolas DichtelOct 5, 2011
  2. Jay SoffianOct 5, 2011
  3. Nicolas DichtelOct 6, 2011
  4. Nicolas DichtelOct 6, 2011
  5. Jay SoffianOct 6, 2011
  6. Nicolas DichtelOct 6, 2011
  7. Jay SoffianOct 6, 2011
  8. Junio C HamanoOct 5, 2011
  9. Jay SoffianOct 5, 2011
  10. Junio C HamanoOct 5, 2011
  11. Jay SoffianOct 5, 2011
  12. Junio C HamanoOct 5, 2011
  13. Jay SoffianOct 6, 2011
  14. Junio C HamanoOct 5, 2011
  15. Junio C HamanoOct 5, 2011
  16. Junio C HamanoOct 6, 2011

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.