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, 10:36 UTC
Message-ID
<7vodnvemi7.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20070215095903.GA6292@localdomain>
Eric Wong <normalperson@yhbt.net> writes:
Show 12 quoted lines
> Junio C Hamano <junkio@cox.net> wrote:
> ...
>> I am still not sure what good GIT_CONFIG would be to completely
>> override everything else, though.
>
> I just started using GIT_CONFIG in the experimental version of
> git-svn[1] which allows me to use .git/svn/config for tracking some
> metadata bits.
>
> I didn't want to pollute the users' .git/config with automatically read
> and state data in .git/config; so I started using .git/svn/config to
> avoid littering .git/svn/ with any tiny pieces of data I might need.

Ah, so the intended usage is to use git-config to store in and retrieve from a file that does not have anything to do with the core git data, and the using script would say:

	value=$(GIT_CONFIG=$that_extra_file git-config --get some.variable)
        ... do whatever with $value which does not have
        ... anything to do with git core itself
        gitvalue=$(git-config --get some.git.variable)
	... use gitvalue which has some relevance to git core
	GIT_CONFIG=$that_extra_file git-config some.variable $newvalue

I was more worried about the fact that the current GIT_CONFIG totally *ignores* the variables in .git/config. With a narrower-than-usual umask, not reading core.sharedrepository would result in quite an undesired result. But as long as the intended usage follows the patter like above, in other words, the user (a script) will never export GIT_CONFIG when using core git plumbing or porcelain, I think it is Ok.

Previous: Eric WongNext: Johannes Schindelin
Message 23 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.