summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-09-08 21:53:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-09-08 21:53:36 (GMT)
commit2df2d81ddd068cf2e8a65743b258d0a263b84ae6 (patch)
tree0dd771029c32c46ef27e0d5357a06a6ce03bdf15 /builtin
parent3a238e539bcdfe3f9eb5010fd218640c1b499f7a (diff)
downloadgit-2df2d81ddd068cf2e8a65743b258d0a263b84ae6.zip
git-2df2d81ddd068cf2e8a65743b258d0a263b84ae6.tar.gz
git-2df2d81ddd068cf2e8a65743b258d0a263b84ae6.tar.bz2
add -i: use the built-in version when feature.experimental is set
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>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/add.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/builtin/add.c b/builtin/add.c
index b36a99e..26b6ced 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -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;