summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-04-25 12:28:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-26 03:28:42 (GMT)
commitcb5206eab196544a3b271afdff9865c103e6dbce (patch)
tree491641b34dfb4b6708446d016bcfdd879c2a0b29 /sequencer.c
parenta01c2a5f59cc0f28daeab33355ae4a45490ce7e6 (diff)
downloadgit-cb5206eab196544a3b271afdff9865c103e6dbce.zip
git-cb5206eab196544a3b271afdff9865c103e6dbce.tar.gz
git-cb5206eab196544a3b271afdff9865c103e6dbce.tar.bz2
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>
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sequencer.c b/sequencer.c
index eac1c34..f9c1ddb 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -2561,6 +2561,17 @@ static const char *reflog_message(struct replay_opts *opts,
return buf.buf;
}
+static const char rescheduled_advice[] =
+N_("Could not execute the todo command\n"
+"\n"
+" %.*s"
+"\n"
+"It has been rescheduled; To edit the command before continuing, please\n"
+"edit the todo list first:\n"
+"\n"
+" git rebase --edit-todo\n"
+" git rebase --continue\n");
+
static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
{
int res = 0;
@@ -2606,6 +2617,11 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
opts, is_final_fixup(todo_list));
if (is_rebase_i(opts) && res < 0) {
/* Reschedule */
+ advise(_(rescheduled_advice),
+ get_item_line_length(todo_list,
+ todo_list->current),
+ get_item_line(todo_list,
+ todo_list->current));
todo_list->current--;
if (save_todo(todo_list, opts))
return -1;