Skip to content

Commit de828e7

Browse files
dschogitster
authored andcommitted
sequencer: offer helpful advice when a command was rescheduled
Previously, we did that just magically, and potentially left some users quite puzzled. Let's err on the safe side instead, telling the user what is happening, and how they are supposed to continue. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 843a783 commit de828e7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

sequencer.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2555,6 +2555,17 @@ static const char *reflog_message(struct replay_opts *opts,
25552555
return buf.buf;
25562556
}
25572557

2558+
static const char rescheduled_advice[] =
2559+
N_("Could not execute the todo command\n"
2560+
"\n"
2561+
" %.*s"
2562+
"\n"
2563+
"It has been rescheduled; To edit the command before continuing, please\n"
2564+
"edit the todo list first:\n"
2565+
"\n"
2566+
" git rebase --edit-todo\n"
2567+
" git rebase --continue\n");
2568+
25582569
static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
25592570
{
25602571
int res = 0;
@@ -2600,6 +2611,11 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
26002611
opts, is_final_fixup(todo_list));
26012612
if (is_rebase_i(opts) && res < 0) {
26022613
/* Reschedule */
2614+
advise(_(rescheduled_advice),
2615+
get_item_line_length(todo_list,
2616+
todo_list->current),
2617+
get_item_line(todo_list,
2618+
todo_list->current));
26032619
todo_list->current--;
26042620
if (save_todo(todo_list, opts))
26052621
return -1;

0 commit comments

Comments
 (0)