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

Re: [PATCH] Read configuration also from ~/.gitrc

From
Jakub Narebski <jnareb@gmail.com>
Date
May 29, 2006, 14:00 UTC
Message-ID
<e5euq2$10t$1@sea.gmane.org>
In-Reply-To
<Pine.LNX.4.63.0605290913330.8863@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin wrote:
Show 5 quoted lines
> But would this not break for the normal case? If you override one key in 
> the repository's config, with this patch, repo-config will barf. The 
> normal case is that you do not expect multiple values for the same key. 
> Your patch reads both ~/.gitrc and $GIT_DIR/config, and if a key has a 
> value in both (even if they are identical), repo-config will error out.
So the patch was to simplistic. Values from user's configuration file
~/.gitrc should be marked, to be overridden by $GIT_DIR/config per
repository configuration file.
 
> Further, storing a key will no longer work. This is an obscure side 
> effect of this patch not caring about storing anything in ~/.gitrc: If you 
> find the key section (or the key) in ~/.gitrc, the offset will be stored, 
> _and used on $GIT_DIR/config_!

I think that storing a key should (unless new option --user-config or --global is used) should store it in $GIT_DIR/config file; of course index has to be found there, and if not found it key should be created. Per configuration file offsets?

> I agree it is nice to have a global git configuration, but I have it: I 
> use templates.

There are system-wide templates. git-init-db(1) doesn't show default directory for _user_ templates...

And I guess that these are the issues why Junio C Hamano wrote:
Show 7 quoted lines
> * The 'pu' branch, in addition, has these.
> 
>  - $HOME/.gitrc (Petr Baudis)
>       Read configuration also from ~/.gitrc
> 
>    * I like this but it breaks the tests big time.  Not "next"
>      material yet, unfortunately.
-- 
Jakub Narebski
Warsaw, Poland
Previous: Johannes Schindelin
Message 19 of 19 in “~/.git/config ?”
  1. Anand KumriaMay 26, 2006
  2. Timo HirvonenMay 26, 2006
  3. Jakub NarebskiMay 26, 2006
  4. Petr BaudisMay 26, 2006
  5. Timo HirvonenMay 26, 2006
  6. Petr BaudisMay 26, 2006
  7. Pavel RoskinMay 27, 2006
  8. Petr BaudisMay 27, 2006
  9. Linus TorvaldsMay 27, 2006
  10. Linus TorvaldsMay 27, 2006
  11. Junio C HamanoMay 27, 2006
  12. Jakub NarebskiMay 27, 2006
  13. Junio C HamanoMay 27, 2006
  14. Nikolai WeibullMay 27, 2006
  15. Timo HirvonenMay 27, 2006
  16. Junio C HamanoMay 26, 2006
  17. Read configuration also from ~/.gitrcPetr Baudis, May 28, 2006
  18. Johannes SchindelinMay 29, 2006
  19. Jakub NarebskiMay 29, 2006

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.