Thread (2 messages) flat view 2 messages, 2 authors, 2020-09-09

Re: git add intent-to-add then git add patch no longer allows edit

From: Phillip Wood <hidden>
Date: 2020-09-09 09:40:10

Possibly related (same subject, not in this thread)

On 08/09/2020 23:00, Junio C Hamano wrote:
quoted hunk ↗ jump to hunk
Johannes Schindelin [off-list ref] writes:
quoted
quoted
Like this?  If the more specific one is specifically set, we do not
look at experimental bit, but otherwise we use the built-in version.
Looks fine to me,
Dscho
Thanks, with the proposed log message this time...

-- >8 --
Subject: [PATCH] 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 <redacted>
Signed-off-by: Junio C Hamano <redacted>
---
 builtin/add.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/builtin/add.c b/builtin/add.c
index b36a99eb7c..26b6ced09e 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;
Looks good to me as well, Thanks

Phillip
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help