aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-11-18 18:23:59 +0900
committerJunio C Hamano <gitster@pobox.com>2018-11-18 18:23:59 +0900
commit4520c233742cca267e1c0ba55f04f35ef7e9baf7 (patch)
treec492d0450700e918465d75e01e924d18f9327b2a
parent137c1f2f51bceb8d1f1f457c52129be78c0ac86d (diff)
parent62c23938fae5b7a374388c64fbdf8ee9ecb51b92 (diff)
downloadgit-4520c233742cca267e1c0ba55f04f35ef7e9baf7.tar.gz
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
-rw-r--r--Documentation/config/rebase.txt14
-rw-r--r--builtin/rebase.c5
-rw-r--r--t/README4
3 files changed, 22 insertions, 1 deletions
diff --git a/Documentation/config/rebase.txt b/Documentation/config/rebase.txt
index 42e1ba7575..f079bf6b7e 100644
--- a/Documentation/config/rebase.txt
+++ b/Documentation/config/rebase.txt
@@ -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::
Whether to show a diffstat of what changed upstream since the last
rebase. False by default.
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 8353a71e21..1a2758756a 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -49,7 +49,10 @@ static int use_builtin_rebase(void)
{
struct child_process cp = CHILD_PROCESS_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,
"config", "--bool", "rebase.usebuiltin", NULL);
diff --git a/t/README b/t/README
index 242497455f..3df5d12e46 100644
--- a/t/README
+++ b/t/README
@@ -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
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
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