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

Re: git-cherry-pick and git-commit --amend in version 1.7.6.4

From
Jay Soffian <jaysoffian@gmail.com>
Date
Oct 5, 2011, 22:23 UTC
Message-ID
<CAG+J_Dysix9fOCuvm5+aU7-AC4wmsxH4-MOX+yhaHEqzeN1cPg@mail.gmail.com>
In-Reply-To
<7vpqib5ciw.fsf@alter.siamese.dyndns.org>
On Wed, Oct 5, 2011 at 5:55 PM, Junio C Hamano <gitster@pobox.com> wrote:
> I think the sequencer state needs to be removed when the command aborts.
Or written later in do_pick_commit().
> This needs to be fixed before 1.7.7.1.
Something like this?
diff --git i/builtin/revert.c w/builtin/revert.c
index 3117776c2c..f7fcc88871 100644
--- i/builtin/revert.c
+++ w/builtin/revert.c
@@ -384,6 +384,7 @@ static int do_pick_commit(void)
 	char *defmsg = NULL;
 	struct strbuf msgbuf = STRBUF_INIT;
 	int res;
+	int record_cherry_pick_head = 0;

 	if (no_commit) {
 		/*
@@ -477,7 +478,7 @@ static int do_pick_commit(void)
 			strbuf_addstr(&msgbuf, ")\n");
 		}
 		if (!no_commit)
-			write_cherry_pick_head();
+			record_cherry_pick_head = 1;
 	}

 	if (!strategy || !strcmp(strategy, "recursive") || action == REVERT) {
@@ -514,6 +515,9 @@ static int do_pick_commit(void)
 	free_message(&msg);
 	free(defmsg);

+	if (record_cherry_pick_head)
+		write_cherry_pick_head();
+
 	return res;
 }
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 16 in “git-cherry-pick and git-commit --amend in version 1.7.6.4”
  1. Nicolas DichtelOct 5, 2011
  2. Jay SoffianOct 5, 2011
  3. Nicolas DichtelOct 6, 2011
  4. Nicolas DichtelOct 6, 2011
  5. Jay SoffianOct 6, 2011
  6. Nicolas DichtelOct 6, 2011
  7. Jay SoffianOct 6, 2011
  8. Junio C HamanoOct 5, 2011
  9. Jay SoffianOct 5, 2011
  10. Junio C HamanoOct 5, 2011
  11. Jay SoffianOct 5, 2011
  12. Junio C HamanoOct 5, 2011
  13. Jay SoffianOct 6, 2011
  14. Junio C HamanoOct 5, 2011
  15. Junio C HamanoOct 5, 2011
  16. Junio C HamanoOct 6, 2011

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.