git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 3/3] bundle-uri: remove GIT_TEST_BUNDLE_URI env variable

From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Date
Dec 12, 2022, 17:33 UTC
Message-ID
<aafee168fbae2a1887f53febc4abd15522b12bc2.1670866407.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.1443.git.1670866407.gitgitgadget@gmail.com>
From: Derrick Stolee <derrickstolee@github.com>

The GIT_TEST_BUNDLE_URI environment variable is used in the t573* suite of tests that consume the bundle URIs advertised by the Git server. This variable is equivalent to setting transfer.bundleURI=true, so we can do that in these tests instead.

The environment variable has a name that implies it would be useful outside of these tests. It is not useful to set across all tests since it would do very little without some setup on the server side. Remove it.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
---
 t/lib-bundle-uri-protocol.sh | 12 ++++++++----
 t/t5601-clone.sh             |  8 ++++----
 transport.c                  |  5 ++---
 3 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/t/lib-bundle-uri-protocol.sh b/t/lib-bundle-uri-protocol.sh
index 73e2d45bc8b..a4a1af8d029 100644
--- a/t/lib-bundle-uri-protocol.sh
+++ b/t/lib-bundle-uri-protocol.sh
@@ -88,8 +88,8 @@ test_expect_success "clone with $BUNDLE_URI_PROTOCOL:// using protocol v2: reque
 	test_when_finished "rm -rf log* cloned*" &&
 
 	GIT_TRACE_PACKET="$PWD/log" \
-	GIT_TEST_BUNDLE_URI=0 \
 	git \
+		-c transfer.bundleURI=false \
 		-c protocol.version=2 \
 		clone "$BUNDLE_URI_REPO_URI" cloned \
 		>actual 2>err &&
@@ -137,6 +137,13 @@ test_expect_success "clone with $BUNDLE_URI_PROTOCOL:// using protocol v2: reque
 	! grep "> command=bundle-uri" log3
 '
 
+# The remaining tests will all assume transfer.bundleURI=true
+#
+# This test can be removed when transfer.bundleURI is enabled by default.
+test_expect_success 'enable transfer.bundleURI for remaining tests' '
+	git config --global transfer.bundleURI true
+'
+
 test_expect_success "test bundle-uri with $BUNDLE_URI_PROTOCOL:// using protocol v2" '
 	test_config -C "$BUNDLE_URI_PARENT" \
 		bundle.only.uri "$BUNDLE_URI_BUNDLE_URI_ESCAPED" &&
@@ -150,7 +157,6 @@ test_expect_success "test bundle-uri with $BUNDLE_URI_PROTOCOL:// using protocol
 		uri = $BUNDLE_URI_BUNDLE_URI_ESCAPED
 	EOF
 
-	GIT_TEST_BUNDLE_URI=1 \
 	test-tool bundle-uri \
 		ls-remote \
 		"$BUNDLE_URI_REPO_URI" \
@@ -174,7 +180,6 @@ test_expect_success "test bundle-uri with $BUNDLE_URI_PROTOCOL:// using protocol
 		uri = $BUNDLE_URI_BUNDLE_URI_ESCAPED
 	EOF
 
-	GIT_TEST_BUNDLE_URI=1 \
 	test-tool bundle-uri \
 		ls-remote \
 		"$BUNDLE_URI_REPO_URI" \
@@ -203,7 +208,6 @@ test_expect_success "test bundle-uri with $BUNDLE_URI_PROTOCOL:// using protocol
 		uri = $BUNDLE_URI_BUNDLE_URI_ESCAPED-3.bdl
 	EOF
 
-	GIT_TEST_BUNDLE_URI=1 \
 	test-tool bundle-uri \
 		ls-remote \
 		"$BUNDLE_URI_REPO_URI" \
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index a08a691ec4c..1928ea1dd7c 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -786,9 +786,9 @@ test_expect_success 'auto-discover bundle URI from HTTP clone' '
 	git -C "$HTTPD_DOCUMENT_ROOT_PATH/repo2.git" config \
 		bundle.everything.uri "$HTTPD_URL/everything.bundle" &&
 
-	GIT_TEST_BUNDLE_URI=1 \
 	GIT_TRACE2_EVENT="$(pwd)/trace.txt" \
-		git -c protocol.version=2 clone \
+		git -c protocol.version=2 \
+		    -c transfer.bundleURI=true clone \
 		$HTTPD_URL/smart/repo2.git repo2 &&
 	cat >pattern <<-EOF &&
 	"event":"child_start".*"argv":\["git-remote-https","$HTTPD_URL/everything.bundle"\]
@@ -815,9 +815,9 @@ test_expect_success 'auto-discover multiple bundles from HTTP clone' '
 	git -C "$HTTPD_DOCUMENT_ROOT_PATH/repo3.git" config \
 		bundle.new.uri "$HTTPD_URL/new.bundle" &&
 
-	GIT_TEST_BUNDLE_URI=1 \
 	GIT_TRACE2_EVENT="$(pwd)/trace.txt" \
-		git -c protocol.version=2 clone \
+		git -c protocol.version=2 \
+		    -c transfer.bundleURI=true clone \
 		$HTTPD_URL/smart/repo3.git repo3 &&
 
 	# We should fetch _both_ bundles
diff --git a/transport.c b/transport.c
index 957dca4923c..241f8a6ba2d 100644
--- a/transport.c
+++ b/transport.c
@@ -1533,10 +1533,9 @@ int transport_get_remote_bundle_uri(struct transport *transport)
 
 	/*
 	 * Don't request bundle-uri from the server unless configured to
-	 * do so by GIT_TEST_BUNDLE_URI=1 or transfer.bundleURI=true.
+	 * do so by the transfer.bundleURI=true config option.
 	 */
-	if (!git_env_bool("GIT_TEST_BUNDLE_URI", 0) &&
-	    (git_config_get_bool("transfer.bundleuri", &value) || !value))
+	if (git_config_get_bool("transfer.bundleuri", &value) || !value)
 		return 0;
 
 	if (!transport->bundles->baseURI)
-- 
gitgitgadget
Previous: Derrick StoleeNext: Ævar Arnfjörð Bjarmason
Message 5 of 17 in “Bundle URIs 4.5: fixups from part IV”
  1. 0/3 Bundle URIs 4.5: fixups from part IVDerrick Stolee via GitGitGadget, Dec 12, 2022
  2. 2/3 bundle-uri: advertise based on repo configDerrick Stolee via GitGitGadget, Dec 12, 2022
  3. Ævar Arnfjörð BjarmasonDec 19, 2022
  4. Derrick StoleeDec 20, 2022
  5. 3/3 bundle-uri: remove GIT_TEST_BUNDLE_URI env variableDerrick Stolee via GitGitGadget, Dec 12, 2022
  6. Ævar Arnfjörð BjarmasonDec 19, 2022
  7. Derrick StoleeDec 20, 2022
  8. Ævar Arnfjörð BjarmasonDec 20, 2022
  9. 1/3 bundle-uri: drop unused 'uri' parameterDerrick Stolee via GitGitGadget, Dec 12, 2022
  10. Ævar Arnfjörð BjarmasonDec 19, 2022
  11. Junio C HamanoDec 20, 2022
  12. Derrick StoleeDec 20, 2022
  13. Ævar Arnfjörð BjarmasonDec 20, 2022
  14. Derrick StoleeDec 20, 2022
  15. Ævar Arnfjörð BjarmasonDec 20, 2022
  16. Victoria DyeDec 12, 2022
  17. Jeff KingDec 12, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.