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

Re: Email address from username and hostname preferred over $EMAIL

From
Josh Triplett <josh@freedesktop.org>
Date
Jul 6, 2007, 03:44 UTC
Message-ID
<468DBA95.3070101@freedesktop.org>
In-Reply-To
<alpine.LFD.0.98.0707051357360.9434@woody.linux-foundation.org>
Linus Torvalds wrote:
Show 22 quoted lines
> On Thu, 5 Jul 2007, mkraai@beckman.com wrote:
>> Git prefers to use an email address constructed from the username and 
>> hostname to the value of the EMAIL environment variable.  I think it 
>> should prefer the latter to the former.  This problem was introduced by 
>> ec563e8153cba89728a271a26c8a94e7a42d8152.
> 
> It did that very much on purpose. "git_default_email" must take 
> precedence, because that's the one that is filled in by the config file 
> syntax.
> 
> So just use
> 
> 	[user]
> 		name = ..
> 		email = ..
> 
> and be happy. Only in the absense of that will git start guessing, and 
> yeah, it will not generally use EMAIL, unless it cannot get anything at 
> all from username/hostname.
> 
> If you want it to prefer $EMAIL, you'd need to change the initialization 
> of git_default_email, methinks.

When I originally wrote the patch, I did so intending that $EMAIL would always override git's guess of user@hostname. I set GIT_{AUTHOR,COMMITTER}_EMAIL in my environment specifically so that git would stop using guesses like josh@josh-mobile and start using my actual email address. I submitted the $EMAIL patch in hopes that eventually I could stop setting the git-specific email addresses and just set $EMAIL, which I already do for other tools. In order for that to work, $EMAIL should always override git's guesses.

- Josh Triplett
Previous: Brandon Casey
Message 8 of 8 in “Email address from username and hostname preferred over $EMAIL”
  1. mkraai@beckman.comJul 5, 2007
  2. Pierre HabouzitJul 5, 2007
  3. mkraai@beckman.comJul 5, 2007
  4. Linus TorvaldsJul 5, 2007
  5. Brandon CaseyJul 6, 2007
  6. Junio C HamanoJul 6, 2007
  7. Brandon CaseyJul 6, 2007
  8. Josh TriplettJul 6, 2007

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.