Re: [PATCH] config: introduce GIT_GLOBAL_CONFIG to override ~/.gitconfig
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Sep 27, 2012, 20:51 UTC
- Message-ID
- <vpqzk4bfaua.fsf@grenoble-inp.fr>
- In-Reply-To
- <20120927173532.GD1547@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 8 quoted lines
> Also, have you considered using a config include? Like: > > $ echo '[include]path = ~/my-dotfiles/gitconfig' >~/.gitconfig > > It's a one-time setup, and then you get updates inside my-dotfiles > forever. The one-time setup is annoying, but you have to bootstrap > somehow (e.g., you're going to have to copy a .profile or similar to get > the GIT_GLOBAL_CONFIG variable set).
I also strongly prefer symlinks or include over environment variables. Relying on environment variables makes the setup a bit fragile, partly because I often mess things up with my shell (e.g. I once had different shell and environment variables in ~/.xsession and in actual shells, hence different configuration depending on whether I launch stuff from my window-manager or from a shell).
I could understand using environment variables for one-shot configuration change (e.g. HOME=/tmp/ git whatever), but then $HOME is sufficient in general.
-- Matthieu Moy http://www-verimag.imag.fr/~moy/