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

Re: [PATCH] user.default: New config to prevent using the default values for user.*

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 6, 2008, 00:29 UTC
Message-ID
<7v3ar4itk9.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<8aa486160803051539v6813bf98kc0cd0408bb0c65a@mail.gmail.com>
"Santi Béjar" <sbejar@gmail.com> writes:
Show 28 quoted lines
> On Thu, Mar 6, 2008 at 12:29 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> "Santi Béjar" <sbejar@gmail.com> writes:
>>
>> >>  > I would still need something to prevent doing a commit without a
>>  >>  > locally specified name/email.
>>  >>
>>  >>  Yes, but that something could simply be "echo '[user] name'
>>  >>  >.git/config" in that hook, for example.
>>  >
>>  > But I want a different locally specified name in each repository,
>>  > because I use different emails for different projects
>>  > (private/work/...).
>>
>>  You changed your mind then?  You said you wanted to have something that
>>  prevents a commit from being made immediately after git-init before
>>  per-repo user.name is properly configured.  Doesn't that echo achieve that
>>  goal?
>
> But that was in the context of the initial patch where I said that I
> wanted different name/emails in each repository.
>
> To summarize, the problem is that I work in different projects
> (private/work/git/...) using the same account, but I want different
> identifies (name/email) in each. So I set user.name and user.email in
> each repository, but when I forget to set them git uses the default
> ones (userid@hostname.(none)).
>
> Hope I have explained it well.
Try:
        $ mkdir -p /var/tmp/junk && cd /var/tmp/junk
        $ git init
        $ echo '[user] name' >>.git/config
        $ >foo
        $ git add
and tell me what you see.

That's why I gave you the example of setting "[user] name" (notice I did not say [user] name = 'Santi's name for this project') to force you to configure it to whatever you want.

Previous: Santi BéjarNext: Santi Béjar
Message 22 of 23 in “user.default: New config to prevent using the default values for user.*”
  1. user.default: New config to prevent using the default values for user.*Santi Béjar, Mar 5, 2008
  2. Jon LoeligerMar 5, 2008
  3. Santi BéjarMar 5, 2008
  4. Johannes SchindelinMar 5, 2008
  5. Daniel BarkalowMar 5, 2008
  6. Santi BéjarMar 5, 2008
  7. Alex RiesenMar 5, 2008
  8. Santi BéjarMar 6, 2008
  9. Alex RiesenMar 7, 2008
  10. Santi BéjarMar 8, 2008
  11. Johannes SchindelinMar 8, 2008
  12. Junio C HamanoMar 8, 2008
  13. Johannes SchindelinMar 8, 2008
  14. Jakub NarebskiMar 5, 2008
  15. Santi BéjarMar 5, 2008
  16. Junio C HamanoMar 5, 2008
  17. Santi BéjarMar 5, 2008
  18. Junio C HamanoMar 5, 2008
  19. Santi BéjarMar 5, 2008
  20. Junio C HamanoMar 5, 2008
  21. Santi BéjarMar 5, 2008
  22. Junio C HamanoMar 6, 2008
  23. Santi BéjarMar 6, 2008

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.