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

From: Jakub Narebski <jnareb@gmail.com>
Date: 2006-05-30 00:00:36
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

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Tue May 30 00:02:22 2006

This archive was generated by hypermail 2.1.8 : 2006-05-30 00:02:49 EST