]> git.ipfire.org Git - thirdparty/git.git/commitdiff
add -i: use the built-in version when feature.experimental is set
authorJunio C Hamano <gitster@pobox.com>
Tue, 8 Sep 2020 21:53:36 +0000 (14:53 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 8 Sep 2020 21:53:36 +0000 (14:53 -0700)
We have had parallel implementations of "add -i/-p" since 2.25 and
have been using them from various codepaths since 2.26 days, but
never made the built-in version the default.

We have found and fixed a handful of corner case bugs in the
built-in version, and it may be a good time to start switching over
the user base from the scripted version to the built-in version.
Let's enable the built-in version for those who opt into the
feature.experimental guinea-pig program to give wider exposure.

Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/add.c

index b36a99eb7c847fe3f67a716316b148c347d1792b..26b6ced09ea26d7eda4c63a930354d2bb580a547 100644 (file)
@@ -192,9 +192,15 @@ 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)
-               git_config_get_bool("add.interactive.usebuiltin",
-                                   &use_builtin_add_i);
+       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 == 1) {
                enum add_p_mode mode;