threads / discuss / 12516

How to force explicit user info

Subject: How to force explicit user info

## tl;dr

5 messages between Mar 5, 2008 and Mar 5, 2008.

replies: 4people: 3as markdown or json

Santi Béjar· Mar 5, 2008, 13:39 UTC · lore
Hi  *,
  how can I forbid the gecos info and always force git to ask for an
explicit user.name and user.email?
  I use a different email for personal projects and for work projects,
using the same machine. So I set user.email locally in each
repository. But when I forget setting this I get
userid@hostname.(none) as the email. Is there a way to just die and
ask for this info (maybe user.AlwaysExplicit or something like that)?
  Thanks
  Santi
Jakub Narebski· Mar 5, 2008, 14:38 UTC · re: Santi Béjar · lore

Re: How to force explicit user info

"Santi Béjar" <sbejar@gmail.com> writes:
Show 8 quoted lines
>   How can I forbid the gecos info and always force git to ask for an
> explicit user.name and user.email?
> 
>   I use a different email for personal projects and for work projects,
> using the same machine. So I set user.email locally in each
> repository. But when I forget setting this I get
> userid@hostname.(none) as the email. Is there a way to just die and
> ask for this info (maybe user.AlwaysExplicit or something like that)?

I don't think there is a way to get exactly what you want... unless you would "scratch that itch"... :-)

You can set default user.name and user.email in the ~/.gitconfig global (user) git configuration, and in /etc/gitconfig for system-wide git config, though. HTH.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Santi Béjar· Mar 5, 2008, 14:46 UTC · re: Jakub Narebski · lore

Re: How to force explicit user info

On Wed, Mar 5, 2008 at 3:38 PM, Jakub Narebski <jnareb@gmail.com> wrote:
Show 14 quoted lines
>
> "Santi Béjar" <sbejar@gmail.com> writes:
>
>  >   How can I forbid the gecos info and always force git to ask for an
>  > explicit user.name and user.email?
>  >
>  >   I use a different email for personal projects and for work projects,
>  > using the same machine. So I set user.email locally in each
>  > repository. But when I forget setting this I get
>  > userid@hostname.(none) as the email. Is there a way to just die and
>  > ask for this info (maybe user.AlwaysExplicit or something like that)?
>
>  I don't think there is a way to get exactly what you want... unless
>  you would "scratch that itch"... :-)
Yes, I'll add this to my todo.
>
>  You can set default user.name and user.email in the ~/.gitconfig
>  global (user) git configuration, and in /etc/gitconfig for system-wide
>  git config, though. HTH.
But I don't want a default user.{name,email}.
Santi
Show 6 quoted lines
>
>  --
>  Jakub Narebski
>  Poland
>  ShadeHawk on #git
>
Daniel Barkalow· Mar 5, 2008, 14:45 UTC · re: Santi Béjar · lore

Re: How to force explicit user info

On Wed, 5 Mar 2008, Santi Béjar wrote:
Show 11 quoted lines
> Hi  *,
> 
> 
>   how can I forbid the gecos info and always force git to ask for an
> explicit user.name and user.email?
> 
>   I use a different email for personal projects and for work projects,
> using the same machine. So I set user.email locally in each
> repository. But when I forget setting this I get
> userid@hostname.(none) as the email. Is there a way to just die and
> ask for this info (maybe user.AlwaysExplicit or something like that)?
It doesn't work now, but I think a global:
[user]
	name
Could usefully be made to disable the default.
	-Daniel
*This .sig left intentionally blank*
Santi Béjar· Mar 5, 2008, 14:48 UTC · re: Daniel Barkalow · lore

Re: How to force explicit user info

On Wed, Mar 5, 2008 at 3:45 PM, Daniel Barkalow <barkalow@iabervon.org> wrote:
Show 22 quoted lines
>
> On Wed, 5 Mar 2008, Santi Béjar wrote:
>
>  > Hi  *,
>  >
>  >
>  >   how can I forbid the gecos info and always force git to ask for an
>  > explicit user.name and user.email?
>  >
>  >   I use a different email for personal projects and for work projects,
>  > using the same machine. So I set user.email locally in each
>  > repository. But when I forget setting this I get
>  > userid@hostname.(none) as the email. Is there a way to just die and
>  > ask for this info (maybe user.AlwaysExplicit or something like that)?
>
>  It doesn't work now, but I think a global:
>
>  [user]
>         name
>
>  Could usefully be made to disable the default.
>

Yes, in fact I tried it. I think it makes sense as a way to disable the default name, instead of another config option.

Santi

← back to recent threads