git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Ilya Kantor <iliakan@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: cherry-pick --no-commit does not work well with --continue in case of conflicts
Date: Sun, 06 May 2018 11:53:25 +0900	[thread overview]
Message-ID: <xmqqd0y9sdei.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CAFU8umjvEATZguGDmcRMcfAkqn4LW7vf_B9qpLD7uc-E_7qR9g@mail.gmail.com> (Ilya Kantor's message of "Sat, 5 May 2018 23:26:45 +0300")

Ilya Kantor <iliakan@gmail.com> writes:

> 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.

  reply	other threads:[~2018-05-06  2:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-05 20:26 cherry-pick --no-commit does not work well with --continue in case of conflicts Ilya Kantor
2018-05-06  2:53 ` Junio C Hamano [this message]
2018-05-06  5:17   ` Ilya Kantor
2018-05-08  5:53     ` Junio C Hamano

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=xmqqd0y9sdei.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=iliakan@gmail.com \
    /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).