Re: General support for ! in git-config values
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 1, 2012, 22:21 UTC
- Message-ID
- <7v62fq2o03.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CACBZZX5mX55Rh8b2GYv7wKbCCypCkrn5AiM9BpXydgcYxHWdQA@mail.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 6 quoted lines
>> I.e., everything pertaining to "!" happens after we get the config >> string. So what is it that you want "git config --with-exec" to do? > > I agree that that's how it should work, I just suggested --with-exec > in case anyone complained about the backwards compatibility issue of > changing the meaning of "!" for existing configs.
Now you made me utterly confused.
What "backwards compatibility" issue do you have in mind? If I name myself '!me' with "user.name = !me", do I suddenly break backwards compatibility of Git with previous versions somehow? If so how?
The --with-exec option you talk about seems to me the option about the backward compatibility of the _calling script_ of "git config". The old version of git-blorl script may have used foo.bar as a mere string, but a new version of it may (optionally) interpret foo.bar's value in a special way when it begins with a "!", introducing a backward compatibility issues to git-blorl script, and users who want to take advantage of that feature may want to run it as "git-blorl --with-exec", and the relevant part of the "git-blorl" script might look like this:
foo_bar=$(git config foo.bar)
case "$with_exec,$foo_bar" in
yes,\!*)
foo_bar=$(eval ${foo_bar#\!}) ;;
esac
... then do something interesting using $foo_bar ...