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

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?
Previous: Jeff King
Message 3 of 3 in “Re: $GIT_CONFIG should either apply to all commands, or none at all”
  1. Jonathan NiederOct 2, 2014
  2. Jeff KingOct 2, 2014
  3. Junio C HamanoOct 2, 2014

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.