Skip to content

Commit d03ebd4

Browse files
avargitster
authored andcommitted
rebase: remove the rebase.useBuiltin setting
Remove the rebase.useBuiltin setting, which was added as an escape hatch to disable the builtin version of rebase first released with Git 2.20. See [1] for the initial implementation of rebase.useBuiltin, and [2] and [3] for the documentation and corresponding GIT_TEST_REBASE_USE_BUILTIN option. Carrying the legacy version is a maintenance burden as seen in 7e097e2 ("legacy-rebase: backport -C<n> and --whitespace=<option> checks", 2018-11-20) and 9aea5e9 ("rebase: fix regression in rebase.useBuiltin=false test mode", 2019-02-13). Since the built-in version has been shown to be stable enough let's remove the legacy version. As noted in [3] having use_builtin_rebase() shell out to get its config doesn't make any sense anymore, that was done for the purposes of spawning the legacy rebase without having modified any global state. Let's instead handle this case in rebase_config(). There's still a bunch of references to git-legacy-rebase in po/*.po, but those will be dealt with in time by the i18n effort. Even though this configuration variable only existed two releases let's not entirely delete the entry from the docs, but note its absence. Individual versions of git tend to be around for a while due to distro packaging timelines, so e.g. if we're "lucky" a given version like 2.21 might be installed on say OSX for half a decade. That'll mean some people probably setting this in config, and then when they later wonder if it's needed they can Google search the config option name or check it in git-config. It also allows us to refer to the docs from the warning for details. 1. 55071ea ("rebase: start implementing it as a builtin", 2018-08-07) 2. d8d0a54 ("rebase doc: document rebase.useBuiltin", 2018-11-14) 3. 62c2393 ("tests: add a special setup where rebase.useBuiltin is off", 2018-11-14) 3. https://public-inbox.org/git/[email protected]/ Acked-by: Johannes Schindelin <[email protected]> Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0e94f7a commit d03ebd4

File tree

8 files changed

+35
-833
lines changed

8 files changed

+35
-833
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@
8282
/git-init-db
8383
/git-interpret-trailers
8484
/git-instaweb
85-
/git-legacy-rebase
8685
/git-log
8786
/git-ls-files
8887
/git-ls-remote

Documentation/config/rebase.txt

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
rebase.useBuiltin::
2-
Set to `false` to use the legacy shellscript implementation of
3-
linkgit:git-rebase[1]. Is `true` by default, which means use
4-
the built-in rewrite of it in C.
5-
+
6-
The C rewrite is first included with Git version 2.20. This option
7-
serves an an escape hatch to re-enable the legacy version in case any
8-
bugs are found in the rewrite. This option and the shellscript version
9-
of linkgit:git-rebase[1] will be removed in some future release.
10-
+
11-
If you find some reason to set this option to `false` other than
12-
one-off testing you should report the behavior difference as a bug in
13-
git.
2+
Unused configuration variable. Used in Git versions 2.20 and
3+
2.21 as an escape hatch to enable the legacy shellscript
4+
implementation of rebase. Now the built-in rewrite of it in C
5+
is always used. Setting this will emit a warning, to alert any
6+
remaining users that setting this now does nothing.
147

158
rebase.stat::
169
Whether to show a diffstat of what changed upstream since the last

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,6 @@ SCRIPT_SH += git-merge-one-file.sh
632632
SCRIPT_SH += git-merge-resolve.sh
633633
SCRIPT_SH += git-mergetool.sh
634634
SCRIPT_SH += git-quiltimport.sh
635-
SCRIPT_SH += git-legacy-rebase.sh
636635
SCRIPT_SH += git-remote-testgit.sh
637636
SCRIPT_SH += git-request-pull.sh
638637
SCRIPT_SH += git-stash.sh

builtin/rebase.c

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -46,29 +46,6 @@ enum rebase_type {
4646
REBASE_PRESERVE_MERGES
4747
};
4848

49-
static int use_builtin_rebase(void)
50-
{
51-
struct child_process cp = CHILD_PROCESS_INIT;
52-
struct strbuf out = STRBUF_INIT;
53-
int ret, env = git_env_bool("GIT_TEST_REBASE_USE_BUILTIN", -1);
54-
55-
if (env != -1)
56-
return env;
57-
58-
argv_array_pushl(&cp.args,
59-
"config", "--bool", "rebase.usebuiltin", NULL);
60-
cp.git_cmd = 1;
61-
if (capture_command(&cp, &out, 6)) {
62-
strbuf_release(&out);
63-
return 1;
64-
}
65-
66-
strbuf_trim(&out);
67-
ret = !strcmp("true", out.buf);
68-
strbuf_release(&out);
69-
return ret;
70-
}
71-
7249
struct rebase_options {
7350
enum rebase_type type;
7451
const char *state_dir;
@@ -106,6 +83,7 @@ struct rebase_options {
10683
char *strategy, *strategy_opts;
10784
struct strbuf git_format_patch_opt;
10885
int reschedule_failed_exec;
86+
int use_legacy_rebase;
10987
};
11088

11189
static int is_interactive(struct rebase_options *opts)
@@ -869,6 +847,11 @@ static int rebase_config(const char *var, const char *value, void *data)
869847
return 0;
870848
}
871849

850+
if (!strcmp(var, "rebase.usebuiltin")) {
851+
opts->use_legacy_rebase = !git_config_bool(var, value);
852+
return 0;
853+
}
854+
872855
return git_default_config(var, value, data);
873856
}
874857

@@ -1143,22 +1126,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
11431126
};
11441127
int i;
11451128

1146-
/*
1147-
* NEEDSWORK: Once the builtin rebase has been tested enough
1148-
* and git-legacy-rebase.sh is retired to contrib/, this preamble
1149-
* can be removed.
1150-
*/
1151-
1152-
if (!use_builtin_rebase()) {
1153-
const char *path = mkpath("%s/git-legacy-rebase",
1154-
git_exec_path());
1155-
1156-
if (sane_execvp(path, (char **)argv) < 0)
1157-
die_errno(_("could not exec %s"), path);
1158-
else
1159-
BUG("sane_execvp() returned???");
1160-
}
1161-
11621129
if (argc == 2 && !strcmp(argv[1], "-h"))
11631130
usage_with_options(builtin_rebase_usage,
11641131
builtin_rebase_options);
@@ -1169,6 +1136,11 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
11691136

11701137
git_config(rebase_config, &options);
11711138

1139+
if (options.use_legacy_rebase ||
1140+
!git_env_bool("GIT_TEST_REBASE_USE_BUILTIN", -1))
1141+
warning(_("the rebase.useBuiltin support has been removed!\n"
1142+
"See its entry in 'git help config' for details."));
1143+
11721144
strbuf_reset(&buf);
11731145
strbuf_addf(&buf, "%s/applying", apply_dir());
11741146
if(file_exists(buf.buf))

0 commit comments

Comments
 (0)