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

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

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jul 26, 2013, 18:12 UTC
Message-ID
<1374862320-22637-1-git-send-email-artagnon@gmail.com>
When a cherry-pick results in an empty commit, git prints:
  The previous cherry-pick is now empty, possibly due to conflict resolution.
  If you wish to commit it anyway, use:
      git commit --allow-empty
  Otherwise, please use 'git reset'

The last line is plain wrong in the case of a ranged pick, as a 'git reset' will fail to remove $GIT_DIR/sequencer, failing a subsequent cherry-pick or revert. Change the advice to:

  git cherry-pick --abort
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 Another candidate for maint?
 I'd also really like to squelch this with an advice.* variable; any
 suggestions?
 builtin/commit.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/builtin/commit.c b/builtin/commit.c
index 003bd7d..1b213f7 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -64,7 +64,10 @@ N_("The previous cherry-pick is now empty, possibly due to conflict resolution.\
 "\n"
 "    git commit --allow-empty\n"
 "\n"
-"Otherwise, please use 'git reset'\n");
+"Otherwise, use:\n"
+"\n"
+"    git cherry-pick --abort\n"
+"\n");
 
 static const char *use_message_buffer;
 static const char commit_editmsg[] = "COMMIT_EDITMSG";
-- 
1.8.4.rc0.1.g8f6a3e5.dirty
Next: Jeff King
Message 1 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.