Re: [PATCH] Teach 'git apply' to look at $GIT_DIR/config
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Feb 18, 2007, 00:06 UTC
- Message-ID
- <Pine.LNX.4.63.0702180105000.22628@wbgn013.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <20070217232603.GB30839@coredump.intra.peff.net>
Hi,
On Sat, 17 Feb 2007, Jeff King wrote:
Show 15 quoted lines
> On Sat, Feb 17, 2007 at 01:12:52PM -0800, Junio C Hamano wrote:
>
> > + prefix = setup_git_directory_gently(&is_not_gitdir);
> > + prefix_length = prefix ? strlen(prefix) : 0;
> > + if (!is_not_gitdir) {
> > + git_config(git_apply_config);
> > + if (apply_default_whitespace)
> > + parse_whitespace_option(apply_default_whitespace);
> > + }
> > +
>
> If I read this correctly, running 'git apply' inside a git repository
> will parse $GIT_DIR/config and $HOME/.gitconfig. However, outside of a
> repository it will parse neither. It would make more sense to me to
> still parse $HOME/.gitconfig to pick up the user's global options.In git-config we solve the problem by running git_config regardless of is_not_gitdir. However, I suspect you have to 'cd' back to prefix, or else the patch gets applied in the repo root, right? (Disclaimer: I did not read the patch.)
Ciao, Dscho