Thread (1 message) 1 message, 1 author, 2020-12-10

Re: [PATCH 3/3] config: store "git -c" variables using more robust format

From: Junio C Hamano <hidden>
Date: 2020-12-10 23:08:57

Ævar Arnfjörð Bjarmason [off-list ref] writes:
On Wed, Dec 09 2020, Jeff King wrote:
...
quoted
+test_expect_success '--config-env handles keys with equals' '
+	echo value=with=equals >expect &&
+	ENVVAR=value=with=equals git \
+		--config-env=section.subsection=with=equals.key=ENVVAR \
+		config section.subsection=with=equals.key >actual &&
+	test_cmp expect actual
+'
+
Maybe worth adding a test for the strrchr() semantics here with:

    perl -we '$ENV{"Y=Z"}="why and zed"; system "Z=zed git --config-env=X=Y=Z ..."'

Which would show that we can't look up "Y=Z", but will always get "Z".
Yes, that was explained in the cover letter of these three patches
in [ref].  

We really should document that <envvar> can't contain an "=" sign,
but I do not see much point in casting that limitation in stone with
a test.  As long as we know things work correctly with environment
variables without '=' in their names, we should be happy.

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