Re: feature request - implement a "GIT_AUTHOR_EMAIL" equivalent, but processed BEFORE .gitconfig
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 30, 2014, 21:35 UTC
- Message-ID
- <xmqq1tvb7xw6.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <20140530200945.GB5513@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 21 quoted lines
> On Fri, May 30, 2014 at 02:58:47PM -0500, Nathan Neulinger wrote: > >> Not really, since there are lots of servers,... > > But I think anything you could set up in the environment could be set up > in an on-the-fly $HOME. For example, instead of: > > GIT_WEAK_AUTHOR_NAME=$name > GIT_WEAK_AUTHOR_EMAIL=$email > > do: > > HOME=$(mktemp -d gitenv.XXXXXX") > trap 'rm -rf "$HOME"' 0 > git config --global user.name "$name" > git config --global user.email "$email" > > You'd want to link in anything else you actually _want_ in $HOME, but > that also gives an opportunity to set up application-specific options > based on the user (e.g., if you could pull their .vimrc from some shared > storage or something).
Yes. I agree that "Not really, ..." was not very convincing to me.
Another thing that might be useful in general (i.e. I am not particularly trying to help the "shared" configuration on the topic of this thread) is to allow environment variable substitution in expand_user_path().
Nathan's installation can set a "GIT_MYSELF" and then have something like this in the shared $HOME/.gitconfig
[include]
path = /usr/local/users/$GIT_MYSELF/identwe could even make the whole thing fail when GIT_MYSELF is not set but I haven't thought things through ;-)