Re: [PATCH 1/2] clone: respect the settings in $HOME/.gitconfig and /etc/gitconfig

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Daniel Barkalow
Date: Sunday, June 29, 2008 - 7:21 pm

On Sun, 29 Jun 2008, Junio C Hamano wrote:


Actually, (1) has never worked for either clone or init. Init always 
obeyed GIT_CONFIG as for where it put the output (in fact git-clone.sh 
used GIT_CONFIG to cause git-init to write to the created repo, IIRC). 
Clone always replaced GIT_CONFIG with the destination location before it 
read any configuration, so it wouldn't see configuration that was in the 
user's GIT_CONFIG (or in any pre-existing config file at all). 
Historically, these commands don't support (1) and aren't consistant with 
each other.

I think it would make sense if there were some way to provide custom 
configuration to a particular invocation of "git clone", but GIT_CONFIG as 
currently handled by config.c can't do it.


My patch makes "git clone" do what "git init; git remote; git fetch" do 
with respect to GIT_CONFIG. I don't think this behavior is really useful 
for any of those programs or for the combination, but at least having them 
match would be consistant. I think the sensible thing would be for 
config.c to always write to git_path("config") (or a variable used by 
"git config"), and read: git_path("config"), $GIT_CONFIG, ~/.gitconfig, 
/etc/gitconfig (in order of decreasing precedence); and further have 
builtin-config.c set the "file to write to" variable based on $GIT_CONFIG 
or "--file", "--global", or "--system".

But I don't really understand what the purpose of the feature was in the 
first place, aside from the narrow case of being able to read and write 
files that use the config file format with "git config".

	-Daniel
*This .sig left intentionally blank*
--
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
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Using url.insteadOf in git-clone, Pieter de Bie, (Fri Jun 27, 2:35 am)
[PATCH 1/2] clone: respect the settings in $HOME/.gitconfi ..., Johannes Schindelin, (Fri Jun 27, 5:55 am)
[PATCH 2/2] clone: respect url.insteadOf setting in global ..., Johannes Schindelin, (Fri Jun 27, 5:56 am)
Re: Using url.insteadOf in git-clone, Junio C Hamano, (Fri Jun 27, 10:11 am)
Re: Using url.insteadOf in git-clone, Pieter de Bie, (Sun Jun 29, 11:59 am)
Re: [PATCH 1/2] clone: respect the settings in $HOME/.gitc ..., Johannes Schindelin, (Sun Jun 29, 2:49 pm)
Re: [PATCH 2/2] clone: respect url.insteadOf setting in gl ..., Johannes Schindelin, (Sun Jun 29, 2:50 pm)
Re: [PATCH 1/2] clone: respect the settings in $HOME/.gitc ..., Johannes Schindelin, (Sun Jun 29, 5:41 pm)
Re: [PATCH 1/2] clone: respect the settings in $HOME/.gitc ..., Daniel Barkalow, (Sun Jun 29, 7:21 pm)
Re: [PATCH 1/2] clone: respect the settings in $HOME/.gitc ..., Johannes Schindelin, (Mon Jun 30, 4:37 am)
Re: [PATCH 1/2] clone: respect the settings in $HOME/.gitc ..., Johannes Schindelin, (Mon Jun 30, 4:57 am)