]> git.ipfire.org Git - thirdparty/git.git/commitdiff
add -i: default to the built-in implementation
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Tue, 30 Nov 2021 14:14:15 +0000 (14:14 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Dec 2021 22:34:43 +0000 (14:34 -0800)
In 9a5315edfdf (Merge branch 'js/patch-mode-in-others-in-c',
2020-02-05), Git acquired a built-in implementation of `git add`'s
interactive mode that could be turned on via the config option
`add.interactive.useBuiltin`.

The first official Git version to support this knob was v2.26.0.

In 2df2d81ddd0 (add -i: use the built-in version when
feature.experimental is set, 2020-09-08), this built-in implementation
was also enabled via `feature.experimental`. The first version with this
change was v2.29.0.

More than a year (and very few bug reports) later, it is time to declare
the built-in implementation mature and to turn it on by default.

We specifically leave the `add.interactive.useBuiltin` configuration in
place, to give users an "escape hatch" in the unexpected case should
they encounter a previously undetected bug in that implementation.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/add.txt
builtin/add.c
ci/run-build-and-tests.sh
t/README
t/t2016-checkout-patch.sh

index c9f748f81cb1c7c3b4a2cc2298b310ac85cb1d5c..3e859f34197bc43c8d266ec04d569e5353dae27e 100644 (file)
@@ -7,6 +7,6 @@ add.ignore-errors (deprecated)::
        variables.
 
 add.interactive.useBuiltin::
-       [EXPERIMENTAL] Set to `true` to use the experimental built-in
-       implementation of the interactive version of linkgit:git-add[1]
-       instead of the Perl script version. Is `false` by default.
+       Set to `false` to fall back to the original Perl implementation of
+       the interactive version of linkgit:git-add[1] instead of the built-in
+       version. Is `true` by default.
index ef6b619c45ed9e44266a04f425f6523d4d1da657..8ef230a345b184a1e40b58974033d3a5a60f81ec 100644 (file)
@@ -237,17 +237,12 @@ int run_add_interactive(const char *revision, const char *patch_mode,
        int use_builtin_add_i =
                git_env_bool("GIT_TEST_ADD_I_USE_BUILTIN", -1);
 
-       if (use_builtin_add_i < 0) {
-               int experimental;
-               if (!git_config_get_bool("add.interactive.usebuiltin",
-                                        &use_builtin_add_i))
-                       ; /* ok */
-               else if (!git_config_get_bool("feature.experimental", &experimental) &&
-                        experimental)
-                       use_builtin_add_i = 1;
-       }
+       if (use_builtin_add_i < 0 &&
+           git_config_get_bool("add.interactive.usebuiltin",
+                               &use_builtin_add_i))
+               use_builtin_add_i = 1;
 
-       if (use_builtin_add_i == 1) {
+       if (use_builtin_add_i != 0) {
                enum add_p_mode mode;
 
                if (!patch_mode)
index cc62616d8063cb5eadc18636d561b52a71253d90..660ebe8d1081edd37384760d707e2167a808e172 100755 (executable)
@@ -29,7 +29,7 @@ linux-gcc)
        export GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS=1
        export GIT_TEST_MULTI_PACK_INDEX=1
        export GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=1
-       export GIT_TEST_ADD_I_USE_BUILTIN=1
+       export GIT_TEST_ADD_I_USE_BUILTIN=0
        export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
        export GIT_TEST_WRITE_REV_INDEX=1
        export GIT_TEST_CHECKOUT_WORKERS=2
index 29f72354bf17e959abcc2e14243816b1a0262e52..2c22337d6e753245d44cab7bb82dd437ab82a288 100644 (file)
--- a/t/README
+++ b/t/README
@@ -419,7 +419,7 @@ the --sparse command-line argument.
 GIT_TEST_PRELOAD_INDEX=<boolean> exercises the preload-index code path
 by overriding the minimum number of cache entries required per thread.
 
-GIT_TEST_ADD_I_USE_BUILTIN=<boolean>, when true, enables the
+GIT_TEST_ADD_I_USE_BUILTIN=<boolean>, when false, disables the
 built-in version of git add -i. See 'add.interactive.useBuiltin' in
 git-config(1).
 
index 71c5a15be0022897cc4b70d74852d28fd2d4f847..bc3f69b4b1d2fdbb942498a3f4826655de22a1ee 100755 (executable)
@@ -4,7 +4,7 @@ test_description='git checkout --patch'
 
 . ./lib-patch-mode.sh
 
-if ! test_bool_env GIT_TEST_ADD_I_USE_BUILTIN false && ! test_have_prereq PERL
+if ! test_bool_env GIT_TEST_ADD_I_USE_BUILTIN true && ! test_have_prereq PERL
 then
        skip_all='skipping interactive add tests, PERL not set'
        test_done