Re: $GIT_CONFIG should either apply to all commands, or none at all
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 2, 2014, 17:51 UTC
- Message-ID
- <xmqqppeanywm.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <20141002011546.GR1175@google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 14 quoted lines
> Yep. One possibility would be to do something like the following (A): > > 1) advertise in the git-config(1) manpage that the GIT_CONFIG > environment variable only affects the behavior of the 'git config' > command > > 2) introduce an environment variable GIT_I_AM_PORCELAIN. (If doing > this, we could come up with a better name, but this is just an > illustration.) Set and export that envvar in git-sh-setup.sh. > When that environment variable is set, make git-config stop paying > attention to GIT_CONFIG. > > That way, git commands that happen to be scripts would not be > affected by the GIT_CONFIG setting any more.
At the places you plan to update porcelains to set and export GIT_I_AM_PORCELAIN, you could unset GIT_CONFIG if set. Would that achieve the same goal?
And you can stop there without doing 3 or 4, no?