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

Re: [PATCH] config: read system-wide defaults from /etc/gitconfig

From
Jakub Narebski <jnareb@gmail.com>
Date
Feb 19, 2007, 01:47 UTC
Message-ID
<eravet$noq$1@sea.gmane.org>
In-Reply-To
<7vvei3d5n5.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano wrote:
Show 34 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
>> Okay for GIT_LOCAL_CONFIG. I do not remember off-hand who wanted it 
>> (Jakub? Pasky?), but it was in the context of gitweb.
>>
>> However, GIT_CONFIG is meant to parse arbitrary config files.
>> ...
>> But this "core.*" stuff is insane. Please no.
> 
> Ok, Eric's example and yours made it clear that GIT_CONFIG is an
> interface meant to reuse (or abuse) git-config to read some file
> that is not at all related to git, and should never be used by
> other plumbing.  As long as that is clear (could we have that in
> the documentation, by the way, please?), I have no problem with
> that.
> 
> In fact, I am very happy that we do not have to do that insane
> "core.*" stuff, which I thought was needed purely because
> somebody was trying to use GIT_CONFIG to prevent plumbing and
> porcelain from reading core configuration variables that are per
> repository in nature.
> 
> As I said in my other message, GIT_LOCAL_CONFIG is parallel to
> GIT_OBJECT_DIRECTORY and GIT_INDEX_FILE, and I am Ok with the
> way it is handled by the current code.
> 
> I mildly disagree with you on having an ability to disable
> /etc/gitconfig.  This is necessary in the real world (in the
> same sense as "adduser" can be told not to copy skeltons by
> creating an empty home directory beforehand), even if we do not
> consider the fact that it would help gaining repeatable results
> from our test scripts (remember, using GIT_CONFIG to make
> plumbing and porcelain read from there would set a bad example,
> even when it is pointing at .git/config).

Hmmm... documentation of GIT_CONFIG and GIT_LOCAL_CONFIG is a bit behind, I guess:

git-repo-config(1):
ENVIRONMENT
       GIT_CONFIG
              Take  the  configuration from the given file instead of .git/config.
              Using the "--global" option forces this to ~/.gitconfig.
       GIT_CONFIG_LOCAL
              Currently the same as $GIT_CONFIG; when Git will support global con-
              figuration  files, this will cause it to take the configuration from
              the global configuration file in addition to the given file.

In my opionoin the logic should be: first read /etc/gitconfig, or GIT_SYSTEM_CONFIG, if it exists, then ~/.gitconfig, if it exists, then $GIT_DIR/config or GIT_LOCAL_CONFIG; if GIT_CONFIG is set, read only this.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
Previous: Johannes SchindelinNext: Uwe Kleine-König
Message 27 of 30 in “/etc/gitconfig”
  1. Andy ParkinsFeb 14, 2007
  2. Peter BaumannFeb 14, 2007
  3. config: read system-wide defaults from /etc/gitconfigJohannes Schindelin, Feb 14, 2007
  4. Junio C HamanoFeb 14, 2007
  5. Johannes SchindelinFeb 14, 2007
  6. Junio C HamanoFeb 14, 2007
  7. Johannes SchindelinFeb 14, 2007
  8. Junio C HamanoFeb 14, 2007
  9. Nicolas PitreFeb 14, 2007
  10. Junio C HamanoFeb 14, 2007
  11. Andy ParkinsFeb 15, 2007
  12. Junio C HamanoFeb 15, 2007
  13. Han-Wen NienhuysFeb 14, 2007
  14. Junio C HamanoFeb 14, 2007
  15. Johannes SchindelinFeb 14, 2007
  16. Junio C HamanoFeb 14, 2007
  17. Johannes SchindelinFeb 14, 2007
  18. Johannes SchindelinFeb 14, 2007
  19. Junio C HamanoFeb 15, 2007
  20. Junio C HamanoFeb 15, 2007
  21. Eric WongFeb 15, 2007
  22. Eric WongFeb 15, 2007
  23. Junio C HamanoFeb 15, 2007
  24. Johannes SchindelinFeb 15, 2007
  25. Junio C HamanoFeb 15, 2007
  26. Johannes SchindelinFeb 15, 2007
  27. Jakub NarebskiFeb 19, 2007
  28. Uwe Kleine-KönigFeb 14, 2007
  29. Allow config files to be includedAlex Riesen, Feb 16, 2007
  30. Alex RiesenFeb 16, 2007

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.