From 4ab867b8fc8c19ae99c5414ffcbf57fb1609c94f Mon Sep 17 00:00:00 2001 From: Phillip Wood Date: Thu, 18 May 2017 11:02:32 +0100 Subject: rebase -i: fix reflog message 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): onto it says rebase -i (finish): onto as the strbuf is not reset between reading the value of and . Signed-off-by: Phillip Wood Acked-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- sequencer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sequencer.c b/sequencer.c index d76dc9cb2b..907319d089 100644 --- a/sequencer.c +++ b/sequencer.c @@ -2058,6 +2058,7 @@ cleanup_head_ref: 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; -- cgit v1.2.3 From 79a62269815264165da265eeb8a65feb47dcf671 Mon Sep 17 00:00:00 2001 From: Phillip Wood Date: Thu, 18 May 2017 11:02:33 +0100 Subject: rebase -i: silence stash apply The shell version of rebase -i silences the status output from 'git stash apply' when restoring the autostashed changes. The C version does not. Having the output from git stash apply on the screen is distracting as it makes it difficult to find the message from git rebase saying that the rebase succeeded. Also the status information that git stash prints talks about looking in .git/rebase-merge/done to see which commits have been applied. As .git/rebase-merge is removed shortly after the message is printed before rebase -i exits this is confusing. Signed-off-by: Phillip Wood Acked-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- sequencer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sequencer.c b/sequencer.c index 907319d089..2456246822 100644 --- a/sequencer.c +++ b/sequencer.c @@ -1898,6 +1898,8 @@ static int apply_autostash(struct replay_opts *opts) strbuf_trim(&stash_sha1); child.git_cmd = 1; + child.no_stdout = 1; + child.no_stderr = 1; argv_array_push(&child.args, "stash"); argv_array_push(&child.args, "apply"); argv_array_push(&child.args, stash_sha1.buf); -- cgit v1.2.3 From d096d7f1ef81f5c52d0c9d3070ad82b66de9c981 Mon Sep 17 00:00:00 2001 From: Phillip Wood Date: Fri, 19 May 2017 15:32:48 +0100 Subject: rebase -i: add missing newline to end of message The message that's printed when auto-stashed changes are successfully restored was missing '\n' at the end. Signed-off-by: Phillip Wood Acked-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- sequencer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sequencer.c b/sequencer.c index 2456246822..dc7573940a 100644 --- a/sequencer.c +++ b/sequencer.c @@ -1904,7 +1904,7 @@ static int apply_autostash(struct replay_opts *opts) argv_array_push(&child.args, "apply"); argv_array_push(&child.args, stash_sha1.buf); if (!run_command(&child)) - printf(_("Applied autostash.")); + printf(_("Applied autostash.\n")); else { struct child_process store = CHILD_PROCESS_INIT; -- cgit v1.2.3