Skip to content

Commit cb5206e

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 a01c2a5 commit cb5206e

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
@@ -2561,6 +2561,17 @@ static const char *reflog_message(struct replay_opts *opts,
25612561
return buf.buf;
25622562
}
25632563

2564+
static const char rescheduled_advice[] =
2565+
N_("Could not execute the todo command\n"
2566+
"\n"
2567+
" %.*s"
2568+
"\n"
2569+
"It has been rescheduled; To edit the command before continuing, please\n"
2570+
"edit the todo list first:\n"
2571+
"\n"
2572+
" git rebase --edit-todo\n"
2573+
" git rebase --continue\n");
2574+
25642575
static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
25652576
{
25662577
int res = 0;
@@ -2606,6 +2617,11 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
26062617
opts, is_final_fixup(todo_list));
26072618
if (is_rebase_i(opts) && res < 0) {
26082619
/* Reschedule */
2620+
advise(_(rescheduled_advice),
2621+
get_item_line_length(todo_list,
2622+
todo_list->current),
2623+
get_item_line(todo_list,
2624+
todo_list->current));
26092625
todo_list->current--;
26102626
if (save_todo(todo_list, opts))
26112627
return -1;

0 commit comments

Comments
 (0)