From: Jeff King <peff@peff.net>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Ramkumar Ramachandra <artagnon@gmail.com>,
Git List <git@vger.kernel.org>,
Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] commit: correct advice about aborting a cherry-pick
Date: Fri, 26 Jul 2013 18:43:59 -0400 [thread overview]
Message-ID: <20130726224359.GA3928@sigill.intra.peff.net> (raw)
In-Reply-To: <20130726214036.GB1388@sigill.intra.peff.net>
On Fri, Jul 26, 2013 at 05:40:36PM -0400, Jeff King wrote:
> > Jeff King wrote:
> >
> > > Your patch is just swapping out "git reset" for "cherry-pick --abort",
> > > so I think that is a good improvement in the meantime.
> >
> > Um, wasn't the idea of the original message that you can run "git
> > reset" and then "git cherry-pick --continue"?
>
> Maybe. :)
>
> I missed that subtlety. Of my "three things you would want to do", that
> means it was _trying_ say number 2, how to skip, rather than 3, how to
> abort. If that is the case, then it should probably explain the sequence
> of steps as "reset and then --continue" to make it more clear.
>
> I.e., a patch is needed, but Ram's is going in the opposite direction.
I played around a bit with the test cases that Ram showed. It seems like
the advice needed is different depending on whether you are in a single
or multi-commit cherry-pick.
So if we hit an empty commit and you want to:
1. Make an empty commit, then always run "git commit --allow-empty".
2. Skip this commit, then if:
a. this is a single commit cherry-pick, you run "git reset" (and
nothing more, the cherry pick is finished; running "cherry-pick
--continue" will yield an error).
b. this is a multi-commit cherry-pick, you run "git reset",
followed by "git cherry-pick --continue"
3. Abort the commit, run "git cherry-pick --abort"
Let's assume that the instructions we want to give the user are how to
do options 1 and 2. I do not mind omitting 3, as it should be reasonably
obvious that "cherry-pick --abort" is always good way to abort.
So we give good instructions for the single-commit case, but bad
instructions for the multi-commit case. Ram's patch suggests --abort
instead of reset, which is the same for the single-commit case, but
suggests 3 instead of 2 for the multi-patch.
I think instead we would want to leave the single-commit case alone, and
for the multi-commit case add "...and then cherry-pick --continue". That
message is generated from within git-commit, though; I guess it would
need to learn about the difference between single/multi cherry-picks.
-Peff
next prev parent reply other threads:[~2013-07-26 22:44 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-26 18:12 [PATCH] commit: correct advice about aborting a cherry-pick Ramkumar Ramachandra
2013-07-26 19:16 ` Jeff King
2013-07-26 21:17 ` Ramkumar Ramachandra
2013-07-26 21:24 ` Jeff King
2013-07-26 21:27 ` Ramkumar Ramachandra
2013-07-26 21:37 ` Jonathan Nieder
2013-07-26 21:40 ` Jeff King
2013-07-26 22:43 ` Jeff King [this message]
2013-07-26 23:05 ` Jeff King
2013-07-26 23:08 ` Jonathan Nieder
2013-07-26 23:19 ` Jeff King
2013-07-26 23:39 ` Jeff King
2013-07-27 8:07 ` Ramkumar Ramachandra
2013-07-29 15:18 ` Junio C Hamano
2013-07-29 15:23 ` Jeff King
2013-07-29 15:48 ` Junio C Hamano
2013-07-29 15:15 ` Junio C Hamano
2013-07-27 8:19 ` Ramkumar Ramachandra
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=20130726224359.GA3928@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=artagnon@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@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).