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

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

From
Junio C Hamano <junkio@cox.net>
Date
Feb 15, 2007, 08:46 UTC
Message-ID
<7v4ppnhkps.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7v1wkshtxg.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
Show 17 quoted lines
> I am not quite sure how $GIT_CONFIG and $GIT_CONFIG_LOCAL were
> meant to be used.  Are there any *real* users?  With lack of
> information on the intended uses of these two environment
> variables, I hacked up the following tweaks on top of the above
> defined semantics, to imitate what I _think_ was the original
> intention.  The hacked one goes like this:
>
>  - $GIT_CONFIG environment, if set, names a file to be read
>    first.  We read it first.
>
>  - If $GIT_CONFIG is unset, then $GIT_CONFIG_SYSTEM (or
>    /etc/gitconfig) and $HOME/.gitconfig are read, as above.
>
>  - Next file to be read is $GIT_CONFIG_LOCAL (if set) or
>    $GIT_DIR/config.  When reading this file, if we read from
>    $GIT_CONFIG earlier, we read only "core.*" section from it.
> ...
Addendum.

Judging from the way builtin-config.c::get_value() uses it, I think whoever invented $GIT_CONFIG_LOCAL as a parallel to $GIT_INDEX_FILE and $GIT_OBJECT_DIRECTORY, in other words, what usually appear under $GIT_DIR can be placed somewhere completely different. So I think the above "hack" I described still honors its intended use.

I am still not sure what good GIT_CONFIG would be to completely override everything else, though.

Previous: Junio C HamanoNext: Eric Wong
Message 20 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.