git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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/ident

we could even make the whole thing fail when GIT_MYSELF is not set but I haven't thought things through ;-)

Previous: Jeff KingNext: Jeff King
Message 7 of 8 in “feature request - implement a "GIT_AUTHOR_EMAIL" equivalent, but processed BEFORE .gitconfig”
  1. Nathan NeulingerMay 30, 2014
  2. Jonathan NiederMay 30, 2014
  3. Nathan NeulingerMay 30, 2014
  4. Junio C HamanoMay 30, 2014
  5. Nathan NeulingerMay 30, 2014
  6. Jeff KingMay 30, 2014
  7. Junio C HamanoMay 30, 2014
  8. Jeff KingJun 2, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.