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
This commit is contained in:
Junio C Hamano
2018-11-18 18:23:59 +09:00
3 changed files with 22 additions and 1 deletions

View File

@ -1,3 +1,17 @@
rebase.useBuiltin::
Set to `false` to use the legacy shellscript implementation of
linkgit:git-rebase[1]. Is `true` by default, which means use
the built-in rewrite of it in C.
+
The C rewrite is first included with Git version 2.20. This option
serves an an escape hatch to re-enable the legacy version in case any
bugs are found in the rewrite. This option and the shellscript version
of linkgit:git-rebase[1] will be removed in some future release.
+
If you find some reason to set this option to `false` other than
one-off testing you should report the behavior difference as a bug in
git.
rebase.stat:: rebase.stat::
Whether to show a diffstat of what changed upstream since the last Whether to show a diffstat of what changed upstream since the last
rebase. False by default. rebase. False by default.

View File

@ -49,7 +49,10 @@ static int use_builtin_rebase(void)
{ {
struct child_process cp = CHILD_PROCESS_INIT; struct child_process cp = CHILD_PROCESS_INIT;
struct strbuf out = STRBUF_INIT; struct strbuf out = STRBUF_INIT;
int ret; int ret, env = git_env_bool("GIT_TEST_REBASE_USE_BUILTIN", -1);
if (env != -1)
return env;
argv_array_pushl(&cp.args, argv_array_pushl(&cp.args,
"config", "--bool", "rebase.usebuiltin", NULL); "config", "--bool", "rebase.usebuiltin", NULL);

View File

@ -339,6 +339,10 @@ for the index version specified. Can be set to any valid version
GIT_TEST_PRELOAD_INDEX=<boolean> exercises the preload-index code path GIT_TEST_PRELOAD_INDEX=<boolean> exercises the preload-index code path
by overriding the minimum number of cache entries required per thread. by overriding the minimum number of cache entries required per thread.
GIT_TEST_REBASE_USE_BUILTIN=<boolean>, when false, disables the
builtin version of git-rebase. See 'rebase.useBuiltin' in
git-config(1).
GIT_TEST_INDEX_THREADS=<n> enables exercising the multi-threaded loading GIT_TEST_INDEX_THREADS=<n> enables exercising the multi-threaded loading
of the index for the whole test suite by bypassing the default number of of the index for the whole test suite by bypassing the default number of
cache entries and thread minimums. Setting this to 1 will make the cache entries and thread minimums. Setting this to 1 will make the