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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Apr 25, 2018 at 14:28 UTC cb5206eab196544a3b271afdff9865c103e6dbce
1 file changed +16
sequencer.c
+16
@@ -2561,6 +2561,17 @@ static const char *reflog_message(struct replay_opts *opts,
2561 return buf.buf;
2562 }
2563
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 +
2575 static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
2576 {
2577 int res = 0;
@@ -2606,6 +2617,11 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
2617 opts, is_final_fixup(todo_list));
2618 if (is_rebase_i(opts) && res < 0) {
2619 /* 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));
2625 todo_list->current--;
2626 if (save_todo(todo_list, opts))
2627 return -1;