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

Re: GIT_CONFIG - what's the point?

From
Matthew Persico <matthew.persico@gmail.com>
Date
Apr 1, 2016, 14:31 UTC
Message-ID
<CAL20dLDkmjpXdmHv0MdoUEe43s9TjqrOLS2ud8HHGCF2vahWNQ@mail.gmail.com>
In-Reply-To
<20160401123830.GB12019@sigill.intra.peff.net>

Let me explain my scenario. I have an nfs mounted home directory. It is used across multiple machines. I use different colored xterms for each machine. But that means that the one set of colors in my one .gitconfig file don't work against all my screen backgrounds. I'm trying to find a way to tune the git colors per login. The ability to set colors in an environment variable (like most UNIX utils support) would be the easiest way to do this. Failing that, I was hoping that by setting GIT_CONFIG per login, I could tune the color schemes with different config files.

Since that is not how GIT_CONFIG is used, I have simply decided to squint where necessary, or open up a neutral colored xterm for the diff, regardless of machine.

Yes, I could probably do diffs in many other ways, but git diff at the command line is usually the most expedient.

Unless I wanted to define a GIT_CONFIG_OVER environment variable upon login, place inside it the appropriate -c<name>=<value> overrides for colors, and then define a bash function git as

git () {
   $(which git) $GIT_CONFIG_OVER "$@"
   return $?
}
which seems silly.
Thanks anyway.
On Fri, Apr 1, 2016 at 8:38 AM, Jeff King <peff@peff.net> wrote:
Show 16 quoted lines
> On Thu, Mar 31, 2016 at 08:54:26PM -0400, Matthew Persico wrote:
>
>> So, what's the point of GIT_CONFIG if only git-config uses it? Or did
>> I miss a step?
>
> There isn't a point to it. It's historical cruft that has been left in
> to avoid breaking older scripts. The same thing is generally better
> accomplished by using git-config's "--file" parameter. We should
> probably do a better job of making that clear in the documentation.
>
> Or possibly deprecate it and eventually remove it entirely, as discussed
> in:
>
>   http://thread.gmane.org/gmane.linux.debian.devel.bugs.general/1195694/focus=257770
>
> -Peff
-- 
Matthew O. Persico
Previous: Jeff KingNext: Jeff King
Message 4 of 7 in “GIT_CONFIG - what's the point?”
  1. Matthew PersicoApr 1, 2016
  2. Christian CouderApr 1, 2016
  3. Jeff KingApr 1, 2016
  4. Matthew PersicoApr 1, 2016
  5. Jeff KingApr 1, 2016
  6. SZEDER GáborApr 1, 2016
  7. Matthew PersicoApr 3, 2016

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.