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

[PATCH 1/2] rebase -i: fix reflog message

From
PWPhillip Wood <phillip.wood@talktalk.net>
Date
May 18, 2017, 10:02 UTC
Message-ID
<20170518100233.30559-2-phillip.wood@talktalk.net>
In-Reply-To
<20170518100233.30559-1-phillip.wood@talktalk.net>
From: Phillip Wood <phillip.wood@dunelm.org.uk>

When rebase -i was converted to C a bug was introduced into the code that creates the reflog message. Instead of saying rebase -i (finish): <head-name> onto <onto> it says rebase -i (finish): <head-name> onto <orig-head><onto> as the strbuf is not reset between reading the value of <orig-head> and <onto>.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
---
 sequencer.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/sequencer.c b/sequencer.c
index 0fa3fb14f7c1df5f11ba0ef7e4e46a44a32817bd..f8bc18badf1a3fb1b39656501c5a316e229968d2 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -2089,6 +2089,7 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
 				res = error(_("could not read orig-head"));
 				goto cleanup_head_ref;
 			}
+			strbuf_reset(&buf);
 			if (!read_oneliner(&buf, rebase_path_onto(), 0)) {
 				res = error(_("could not read 'onto'"));
 				goto cleanup_head_ref;
-- 
2.13.0
Previous: Phillip WoodNext: Phillip Wood
Message 2 of 6 in “Fix a couple of minor rebase -i regressions”
  1. 0/2 Fix a couple of minor rebase -i regressionsPhillip Wood, May 18, 2017
  2. 1/2 rebase -i: fix reflog messagePhillip Wood, May 18, 2017
  3. 2/2 rebase -i: silence stash applyPhillip Wood, May 18, 2017
  4. Johannes SchindelinMay 18, 2017
  5. Phillip WoodMay 18, 2017
  6. Johannes SchindelinMay 18, 2017

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.