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

Re: cherry-pick --no-commit does not work well with --continue in case of conflicts

From
Junio C Hamano <gitster@pobox.com>
Date
May 6, 2018, 02:53 UTC
Message-ID
<xmqqd0y9sdei.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CAFU8umjvEATZguGDmcRMcfAkqn4LW7vf_B9qpLD7uc-E_7qR9g@mail.gmail.com>
Ilya Kantor <iliakan@gmail.com> writes:
Show 16 quoted lines
> Somewhy cherry-pick --no-commit does not work well with --continue.
>
> Let's say I'm copying changes w/o committing and get a conflict:
>
>> git cherry-pick -n master..feature
> error: could not apply 2c11f12... Run work
>
> Then I fix the conflict, but cherry-pick refuses to go on:
>
>> git add .
>> git cherry-pick --continue
> error: your local changes would be overwritten by cherry-pick.
> fatal: cherry-pick failed
>
> It could continue *if* I committed, but I'm --no-commit for a reason,
> so I shouldn't have to commit to go on with cherry-pick.

Of course you shouldn't have to, and cherry-pick --continue shouldn't commit either.

Once you resolve the conflicts, there is no more things to do for cherry-pick command, so --continue does not make any sense, I would think, when using --no-commit.

For that matter, "cherry-pick --no-commit A..B", unless you are absolutely sure A..B consists of only one commit (in which case you should just be saying "cherry-pick --no-commit B" instead), makes no sense, either.

So perhaps these are what we should be fixing? I.e. reject range-pick when --no-commit is given, and reject --continue when working in --no-commit mode.

Previous: Ilya KantorNext: Ilya Kantor
Message 2 of 4 in “cherry-pick --no-commit does not work well with --continue in case of conflicts”
  1. Ilya KantorMay 5, 2018
  2. Junio C HamanoMay 6, 2018
  3. Ilya KantorMay 6, 2018
  4. Junio C HamanoMay 8, 2018

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.