git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Steven Michalske <smichalske@gmail.com>
Cc: Eli Barzilay <eli@barzilay.org>, git@vger.kernel.org
Subject: Re: Multiple user.name and user.email (possible feature request)
Date: Sun, 18 Apr 2010 14:37:59 -0400	[thread overview]
Message-ID: <20100418183759.GA11366@coredump.intra.peff.net> (raw)
In-Reply-To: <F5BFE3BD-7416-4F13-AF7F-0775E3234C92@gmail.com>

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@c-71-185-130-222.hsd1.va.comcast.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 you@example.com

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

      git commit --amend --author='Your Name <you@example.com>'

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

So I expect that will serve Eli's purpose.

-Peff

  reply	other threads:[~2010-04-18 18:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-18  9:12 Multiple user.name and user.email (possible feature request) Eli Barzilay
2010-04-18 18:16 ` Steven Michalske
2010-04-18 18:37   ` Jeff King [this message]
2010-04-18 18:43     ` Sverre Rabbelier
2010-04-18 18:55       ` Jeff King
2010-04-18 20:11         ` Eli Barzilay
2010-04-18 20:53           ` Eli Barzilay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100418183759.GA11366@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=eli@barzilay.org \
    --cc=git@vger.kernel.org \
    --cc=smichalske@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).