On Thu, Apr 24, 2014 at 01:26:33PM -0500, Felipe Contreras wrote:

> Jonathan Nieder wrote:
> > Stefan Beller wrote:
> > 
> > > I may have missunderstood.
> > >
> > > So today you cannot commit if you don't provide an email address
> > > (usually the first time you try to commit, git asks to "git config
> > > --global author.email=<y...@mail.here>"), if I remember correctly, so
> > > there is definitely a valid (i.e. user approved) email address.
> > 
> > Not true.  But you do get a big wall of text when you make your
> > first commit without an EMAIL envvar or configured [user] section,
> > including
> Only if you don't have a fully qualified hostname.

No, we alway warn if the values weren't explicitly provided:

  $ git config --global --unset user.email
  $ git commit --allow-empty -m foo
  [master 1e987ba] foo
   Committer: Jeff King <p...@sigill.intra.peff.net>
  Your name and email address were configured automatically based
  on your username and hostname. Please check that they are accurate.
  You can suppress this message by setting them explicitly:
      git config --global user.name "Your Name"
      git config --global user.email y...@example.com
  After doing this, you may fix the identity used for this commit with:
      git commit --amend --reset-author

but we will consider several sources explicit, like
$GIT_COMMITTER_EMAIL, $EMAIL, and of course user.email:

  $ EMAIL=whate...@example.com git commit --allow-empty -m foo
  [master e75f17a] foo

We die when the values are implicitly derived from the system _and_ they
look bogus:

  $ sudo rm /etc/mailname
  $ sudo hostname bogus
  $ git commit --allow-empty -m foo

  *** Please tell me who you are.
    git config --global user.email "y...@example.com"
    git config --global user.name "Your Name"
  to set your account's default identity.
  Omit --global to set the identity only in this repository.
  fatal: unable to auto-detect email address (got 'peff@bogus.(none)')

To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to