Skip to content

Commit 4f3036c

Browse files
committed
Merge branch 'ab/drop-scripted-rebase'
Retire scripted "git rebase" implementation. * ab/drop-scripted-rebase: rebase: remove the rebase.useBuiltin setting
2 parents 67e3ec1 + d03ebd4 commit 4f3036c

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
@@ -613,7 +613,6 @@ SCRIPT_SH += git-merge-one-file.sh
613613
SCRIPT_SH += git-merge-resolve.sh
614614
SCRIPT_SH += git-mergetool.sh
615615
SCRIPT_SH += git-quiltimport.sh
616-
SCRIPT_SH += git-legacy-rebase.sh
617616
SCRIPT_SH += git-remote-testgit.sh
618617
SCRIPT_SH += git-request-pull.sh
619618
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)
@@ -874,6 +852,11 @@ static int rebase_config(const char *var, const char *value, void *data)
874852
return 0;
875853
}
876854

855+
if (!strcmp(var, "rebase.usebuiltin")) {
856+
opts->use_legacy_rebase = !git_config_bool(var, value);
857+
return 0;
858+
}
859+
877860
return git_default_config(var, value, data);
878861
}
879862

@@ -1148,22 +1131,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
11481131
};
11491132
int i;
11501133

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

11751142
git_config(rebase_config, &options);
11761143

1144+
if (options.use_legacy_rebase ||
1145+
!git_env_bool("GIT_TEST_REBASE_USE_BUILTIN", -1))
1146+
warning(_("the rebase.useBuiltin support has been removed!\n"
1147+
"See its entry in 'git help config' for details."));
1148+
11771149
strbuf_reset(&buf);
11781150
strbuf_addf(&buf, "%s/applying", apply_dir());
11791151
if(file_exists(buf.buf))

0 commit comments

Comments
 (0)