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

From: Jakub Narebski <[email-masked]>
Date: Mon, 29 May 2006 16:00:36 +0200

Johannes Schindelin wrote:

> 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:

> * 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