]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/config.c
Read configuration also from $HOME/.gitconfig
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>
Mon, 19 Jun 2006 23:48:03 +0000 (01:48 +0200)
committerJunio C Hamano <junkio@cox.net>
Tue, 20 Jun 2006 00:53:13 +0000 (17:53 -0700)
commit5f1a63e0efc750c54a25644a36cf2905495a9b93
tree45773aa356b3cabd718f9cbb9b32d08c79fd70fa
parent9c3796fc0474ac6fc77da4886a246a37a7fbe856
Read configuration also from $HOME/.gitconfig

This patch is based on Pasky's, with three notable differences:

- I did not yet update the documentation
- I named it .gitconfig, not .gitrc
- git-repo-config does not barf when a unique key is overridden locally

The last means that if you have something like

[alias]
l = log --stat -M

in ~/.gitconfig, and

[alias]
l = log --stat -M next..

in $GIT_DIR/config, then

git-repo-config alias.l

returns only one value, namely the value from $GIT_DIR/config.

If you set the environment variable GIT_CONFIG, $HOME/.gitconfig is not
read, and neither $GIT_DIR/config, but $GIT_CONFIG instead.

If you set GIT_CONFIG_LOCAL instead, it is interpreted instead of
$GIT_DIR/config, but $HOME/.gitconfig is still read.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
config.c
repo-config.c