Re: [PATCH 3/3] config: store "git -c" variables using more robust format
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 10, 2020, 21:49 UTC
- Message-ID
- <xmqqsg8dtjpz.fsf@gitster.c.googlers.com>
- In-Reply-To
- <87pn3hwfd5.fsf@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 16 quoted lines
> On Wed, Dec 09 2020, Jeff King wrote:
> ...
>> +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 <X9D23LQv34A5Q5DC@coredump.intra.peff.net>.
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.