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

Re: [PATCH] commit: correct advice about aborting a cherry-pick

From
Jeff King <peff@peff.net>
Date
Jul 26, 2013, 23:19 UTC
Message-ID
<20130726231902.GA1674@sigill.intra.peff.net>
In-Reply-To
<20130726230857.GK14690@google.com>
On Fri, Jul 26, 2013 at 04:08:57PM -0700, Jonathan Nieder wrote:
Show 27 quoted lines
> Jeff King wrote:
> 
> > --- a/builtin/commit.c
> > +++ b/builtin/commit.c
> > @@ -63,8 +63,14 @@ N_("The previous cherry-pick is now empty, possibly due to conflict resolution.\
> >  "If you wish to commit it anyway, use:\n"
> >  "\n"
> >  "    git commit --allow-empty\n"
> > +"\n");
> > +static const char empty_cherry_pick_advice_skip_single[] =
> > +N_("Otherwise, please use 'git reset'\n");
> > +static const char empty_cherry_pick_advice_skip_multi[] =
> > +N_("If you wish to skip this commit, use:\n"
> >  "\n"
> > -"Otherwise, please use 'git reset'\n");
> > +"    git reset && git cherry-pick --continue\n"
> > +"\n");
> 
> Hmm, wouldn't it be more consistent to either say
> 
> 	If you wish to commit it anyway, use
> 
> 		git commit --allow-empty && git cherry-pick --continue
> 
> 	If you wish to skip this commit, use
> 
> 		git reset && git cherry-pick --continue

Good point. Clearly the original assumed that you knew to "cherry-pick --continue", since it is needed (and omitted) in both cases. And perhaps most people do, but certainly the lack of mentioning it confused both me and Ram about whether the "git reset" advice was meant to skip or abort.

Show 12 quoted lines
> Or
> 
> 	If you wish to commit it anyway, use
> 
> 		git commit --allow-empty
> 	
> 	If you wish to skip this commit, use
> 
> 		git reset
> 
> 	Then "git cherry-pick --continue" will resume cherry-picking
> 	the remaining commits.
I like this one better.

You could _almost_ just use the top bit for the single-commit case, but I hesitate to use the word "skip" in that case. Right now the single-commit case does not need to make the distinction between "skip this, and there is nothing else to do" and "abort the operation", because they are the same thing. Whichever way the user thinks about it is OK.

-Peff
Previous: Jonathan NiederNext: Jeff King
Message 11 of 18 in “commit: correct advice about aborting a cherry-pick”
  1. commit: correct advice about aborting a cherry-pickRamkumar Ramachandra, Jul 26, 2013
  2. Jeff KingJul 26, 2013
  3. Ramkumar RamachandraJul 26, 2013
  4. Jeff KingJul 26, 2013
  5. Ramkumar RamachandraJul 26, 2013
  6. Jonathan NiederJul 26, 2013
  7. Jeff KingJul 26, 2013
  8. Jeff KingJul 26, 2013
  9. Jeff KingJul 26, 2013
  10. Jonathan NiederJul 26, 2013
  11. Jeff KingJul 26, 2013
  12. Jeff KingJul 26, 2013
  13. Ramkumar RamachandraJul 27, 2013
  14. Junio C HamanoJul 29, 2013
  15. Jeff KingJul 29, 2013
  16. Junio C HamanoJul 29, 2013
  17. Junio C HamanoJul 29, 2013
  18. Ramkumar RamachandraJul 27, 2013

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.