Re: Multiple user.name and user.email (possible feature request)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Apr 18, 2010 at 11:16:34AM -0700, Steven Michalske wrote:

> >For example, I'd be happy if I could put this in my global config:
> >
> > [user]
> >   name = "Eli Barzilay"
> >   email = "-"
> >
> >and then have git barf at me when I try to commit with these settings,
> >since I prefer being forced to set the appropriate address for each
> >repository rather than deal with the alternative confusion (or just
> >accepting the limitations and always using the same name/email).
> 
> Just set the variable in the repository, not the global config.

I think the key is that he wants git to barf if he forgets to set the
repo-only config, instead of quietly using the global config.

Sine 1.7.0, git will complain loudly if you simply don't have your
identity set at all. There is no way to make it actually refuse the
commit, but the warning is quite gigantic and hard to miss:

  $ git config --global --unset user.name
  $ git config --global --unset user.email
  $ git commit -m foo
  [master 7c2a927] foo
   Committer: Jeff King <peff@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
  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 you@xxxxxxxxxxx

  If the identity used for this commit is wrong, you can fix it with:

      git commit --amend --author='Your Name <you@xxxxxxxxxxx>'

   1 files changed, 1 insertions(+), 0 deletions(-)

So I expect that will serve Eli's purpose.

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

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]