summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-01-29 20:47:53 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-01-29 20:47:53 (GMT)
commitd9d9ab0876e5ba82996852e7033b2fb29c970914 (patch)
treecc49fab5940cb3370d3c701d46589c055a0bb1c5 /sequencer.c
parent61c51acf7d2e01b968745aaa53de877135be28ec (diff)
parent81ef8ee75d5f348d3c71ff633d13d302124e1a5e (diff)
downloadgit-d9d9ab0876e5ba82996852e7033b2fb29c970914.zip
git-d9d9ab0876e5ba82996852e7033b2fb29c970914.tar.gz
git-d9d9ab0876e5ba82996852e7033b2fb29c970914.tar.bz2
Merge branch 'js/rebase-i-redo-exec'
"git rebase -i" learned to re-execute a command given with 'exec' to run after it failed the last time. * js/rebase-i-redo-exec: rebase: introduce a shortcut for --reschedule-failed-exec rebase: add a config option to default to --reschedule-failed-exec rebase: introduce --reschedule-failed-exec
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sequencer.c b/sequencer.c
index f5370f4..213815d 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -158,6 +158,7 @@ static GIT_PATH_FUNC(rebase_path_strategy, "rebase-merge/strategy")
static GIT_PATH_FUNC(rebase_path_strategy_opts, "rebase-merge/strategy_opts")
static GIT_PATH_FUNC(rebase_path_allow_rerere_autoupdate, "rebase-merge/allow_rerere_autoupdate")
static GIT_PATH_FUNC(rebase_path_quiet, "rebase-merge/quiet")
+static GIT_PATH_FUNC(rebase_path_reschedule_failed_exec, "rebase-merge/reschedule-failed-exec")
static int git_sequencer_config(const char *k, const char *v, void *cb)
{
@@ -2394,6 +2395,9 @@ static int read_populate_opts(struct replay_opts *opts)
opts->signoff = 1;
}
+ if (file_exists(rebase_path_reschedule_failed_exec()))
+ opts->reschedule_failed_exec = 1;
+
read_strategy_opts(opts, &buf);
strbuf_release(&buf);
@@ -2475,6 +2479,8 @@ int write_basic_state(struct replay_opts *opts, const char *head_name,
write_file(rebase_path_gpg_sign_opt(), "-S%s\n", opts->gpg_sign);
if (opts->signoff)
write_file(rebase_path_signoff(), "--signoff\n");
+ if (opts->reschedule_failed_exec)
+ write_file(rebase_path_reschedule_failed_exec(), "%s", "");
return 0;
}
@@ -3632,9 +3638,10 @@ static int pick_commits(struct repository *r,
*end_of_arg = saved;
/* Reread the todo file if it has changed. */
- if (res)
- ; /* fall through */
- else if (stat(get_todo_path(opts), &st))
+ if (res) {
+ if (opts->reschedule_failed_exec)
+ reschedule = 1;
+ } else if (stat(get_todo_path(opts), &st))
res = error_errno(_("could not stat '%s'"),
get_todo_path(opts));
else if (match_stat_data(&todo_list->stat, &st)) {