Skip to content

Commit 4520c23

Browse files
committed
Merge branch 'ab/rebase-in-c-escape-hatch'
The recently merged "rebase in C" has an escape hatch to use the scripted version when necessary, but it hasn't been documented, which has been corrected. * ab/rebase-in-c-escape-hatch: tests: add a special setup where rebase.useBuiltin is off rebase doc: document rebase.useBuiltin
2 parents 137c1f2 + 62c2393 commit 4520c23

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

Documentation/config/rebase.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
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.
14+
115
rebase.stat::
216
Whether to show a diffstat of what changed upstream since the last
317
rebase. False by default.

builtin/rebase.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ static int use_builtin_rebase(void)
4949
{
5050
struct child_process cp = CHILD_PROCESS_INIT;
5151
struct strbuf out = STRBUF_INIT;
52-
int ret;
52+
int ret, env = git_env_bool("GIT_TEST_REBASE_USE_BUILTIN", -1);
53+
54+
if (env != -1)
55+
return env;
5356

5457
argv_array_pushl(&cp.args,
5558
"config", "--bool", "rebase.usebuiltin", NULL);

t/README

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,10 @@ for the index version specified. Can be set to any valid version
339339
GIT_TEST_PRELOAD_INDEX=<boolean> exercises the preload-index code path
340340
by overriding the minimum number of cache entries required per thread.
341341

342+
GIT_TEST_REBASE_USE_BUILTIN=<boolean>, when false, disables the
343+
builtin version of git-rebase. See 'rebase.useBuiltin' in
344+
git-config(1).
345+
342346
GIT_TEST_INDEX_THREADS=<n> enables exercising the multi-threaded loading
343347
of the index for the whole test suite by bypassing the default number of
344348
cache entries and thread minimums. Setting this to 1 will make the

0 commit comments

Comments
 (0)