From: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Vas Sudanagunta <vas@commonkarma.org>,
Junio C Hamano <gitster@pobox.com>,
Johannes Schindelin <johannes.schindelin@gmx.de>
Subject: [PATCH 1/1] Let rebase.reschedulefailedexec only affect interactive rebases
Date: Thu, 27 Jun 2019 01:12:49 -0700 (PDT) [thread overview]
Message-ID: <fab124da41858b849ae74dfb1fe403bb834870f1.1561623167.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.253.git.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx.de>
It does not make sense to stop non-interactive rebases when that config
setting is set to `true`.
Reported by Vas Sudanagunta via:
https://github.com/git/git/commit/969de3ff0e0#commitcomment-33257187
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
builtin/rebase.c | 7 +++++--
t/t3418-rebase-continue.sh | 8 ++++++++
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 4839e52555..78c3bd0634 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -834,6 +834,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
struct string_list strategy_options = STRING_LIST_INIT_NODUP;
struct object_id squash_onto;
char *squash_onto_name = NULL;
+ int reschedule_failed_exec = -1;
struct option builtin_rebase_options[] = {
OPT_STRING(0, "onto", &options.onto_name,
N_("revision"),
@@ -929,7 +930,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
OPT_BOOL(0, "root", &options.root,
N_("rebase all reachable commits up to the root(s)")),
OPT_BOOL(0, "reschedule-failed-exec",
- &options.reschedule_failed_exec,
+ &reschedule_failed_exec,
N_("automatically re-schedule any `exec` that fails")),
OPT_END(),
};
@@ -1227,8 +1228,10 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
break;
}
- if (options.reschedule_failed_exec && !is_interactive(&options))
+ if (reschedule_failed_exec > 0 && !is_interactive(&options))
die(_("--reschedule-failed-exec requires an interactive rebase"));
+ if (reschedule_failed_exec >= 0)
+ options.reschedule_failed_exec = reschedule_failed_exec;
if (options.git_am_opts.argc) {
/* all am options except -q are compatible only with --am */
diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh
index bdaa511bb0..4eff14dae5 100755
--- a/t/t3418-rebase-continue.sh
+++ b/t/t3418-rebase-continue.sh
@@ -265,4 +265,12 @@ test_expect_success '--reschedule-failed-exec' '
test_i18ngrep "has been rescheduled" err
'
+test_expect_success 'rebase.reschedulefailedexec only affects `rebase -i`' '
+ test_config rebase.reschedulefailedexec true &&
+ test_must_fail git rebase -x false HEAD^ &&
+ grep "^exec false" .git/rebase-merge/git-rebase-todo &&
+ git rebase --abort &&
+ git rebase HEAD^
+'
+
test_done
--
gitgitgadget
next prev parent reply other threads:[~2019-06-27 8:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-27 8:12 [PATCH 0/1] Make rebase.reschedulefailedexec less overzealous Johannes Schindelin via GitGitGadget
2019-06-27 8:12 ` Johannes Schindelin via GitGitGadget [this message]
2019-06-27 18:32 ` [PATCH 1/1] Let rebase.reschedulefailedexec only affect interactive rebases Junio C Hamano
2019-06-28 11:49 ` Johannes Schindelin
2019-06-28 13:44 ` Phillip Wood
2019-06-28 22:08 ` Junio C Hamano
2019-06-28 23:52 ` Vas Sudanagunta
2019-06-30 10:03 ` Phillip Wood
2019-07-01 11:52 ` Johannes Schindelin
[not found] ` <0F745CE4-3203-4447-B1D5-937CCDCC64C7@commonkarma.org>
2019-07-01 11:48 ` Johannes Schindelin
2019-07-01 11:49 ` Johannes Schindelin
2019-07-01 11:58 ` [PATCH v2 0/1] Make rebase.reschedulefailedexec less overzealous Johannes Schindelin via GitGitGadget
2019-07-01 11:58 ` [PATCH v2 1/1] rebase --am: ignore rebase.reschedulefailedexec Johannes Schindelin via GitGitGadget
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fab124da41858b849ae74dfb1fe403bb834870f1.1561623167.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=johannes.schindelin@gmx.de \
--cc=vas@commonkarma.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).