Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-04-16 13:28:09 +0300
committerJunio C Hamano <gitster@pobox.com>2019-04-16 13:28:09 +0300
commit4f3036cfa1ffe2470f1afafe541fea8d58d9282b (patch)
treedd4302480920e861707b1617f86a0770b7c2330a /builtin
parent67e3ec10d0e3a8884660105d1787322acdfc6ee5 (diff)
parentd03ebd411c651641eab823f0807705f4af65c9b1 (diff)
Merge branch 'ab/drop-scripted-rebase'
Retire scripted "git rebase" implementation. * ab/drop-scripted-rebase: rebase: remove the rebase.useBuiltin setting
Diffstat (limited to 'builtin')
-rw-r--r--builtin/rebase.c50
1 files changed, 11 insertions, 39 deletions
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 551b72f52d..2e41ad5644 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -46,29 +46,6 @@ enum rebase_type {
REBASE_PRESERVE_MERGES
};
-static int use_builtin_rebase(void)
-{
- struct child_process cp = CHILD_PROCESS_INIT;
- struct strbuf out = STRBUF_INIT;
- int ret, env = git_env_bool("GIT_TEST_REBASE_USE_BUILTIN", -1);
-
- if (env != -1)
- return env;
-
- argv_array_pushl(&cp.args,
- "config", "--bool", "rebase.usebuiltin", NULL);
- cp.git_cmd = 1;
- if (capture_command(&cp, &out, 6)) {
- strbuf_release(&out);
- return 1;
- }
-
- strbuf_trim(&out);
- ret = !strcmp("true", out.buf);
- strbuf_release(&out);
- return ret;
-}
-
struct rebase_options {
enum rebase_type type;
const char *state_dir;
@@ -106,6 +83,7 @@ struct rebase_options {
char *strategy, *strategy_opts;
struct strbuf git_format_patch_opt;
int reschedule_failed_exec;
+ int use_legacy_rebase;
};
static int is_interactive(struct rebase_options *opts)
@@ -874,6 +852,11 @@ static int rebase_config(const char *var, const char *value, void *data)
return 0;
}
+ if (!strcmp(var, "rebase.usebuiltin")) {
+ opts->use_legacy_rebase = !git_config_bool(var, value);
+ return 0;
+ }
+
return git_default_config(var, value, data);
}
@@ -1148,22 +1131,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
};
int i;
- /*
- * NEEDSWORK: Once the builtin rebase has been tested enough
- * and git-legacy-rebase.sh is retired to contrib/, this preamble
- * can be removed.
- */
-
- if (!use_builtin_rebase()) {
- const char *path = mkpath("%s/git-legacy-rebase",
- git_exec_path());
-
- if (sane_execvp(path, (char **)argv) < 0)
- die_errno(_("could not exec %s"), path);
- else
- BUG("sane_execvp() returned???");
- }
-
if (argc == 2 && !strcmp(argv[1], "-h"))
usage_with_options(builtin_rebase_usage,
builtin_rebase_options);
@@ -1174,6 +1141,11 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
git_config(rebase_config, &options);
+ if (options.use_legacy_rebase ||
+ !git_env_bool("GIT_TEST_REBASE_USE_BUILTIN", -1))
+ warning(_("the rebase.useBuiltin support has been removed!\n"
+ "See its entry in 'git help config' for details."));
+
strbuf_reset(&buf);
strbuf_addf(&buf, "%s/applying", apply_dir());
if(file_exists(buf.buf))