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

Re: "commit --author=..." does not work if global email and name is not set

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 9, 2019, 06:31 UTC
Message-ID
<xmqq7ec38zam.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CAA01CspJAPnBFsQsXP4Dpweeg6oBVj==TB0aEnK5o1Et5zS30Q@mail.gmail.com>
Piotr Krukowiecki <piotr.krukowiecki@gmail.com> writes:
Show 16 quoted lines
>> If a real person making commits uses their own account (just on that
>> machine), he or she can set up `user.name` and `user.email` settings in
>> the per-user Git configuration file
>
> There is one common "test" (Windows) account which is used both by
> automatic test scripts and by real people who log into that machine,
> so this is not possible.
> ...
> Do you mean following?
>
> 1. set default user (user.name, user.email) to "automatic test user"
> on that machine
> 2. set commit hook to prevent commits with "automatic test user" AUTHOR
> 3. scripts will set AUTHOR (--author) to for example "script X" or
> "automatic script user" - different than the default user
> 4. real users will set AUTHOR to their own identity (--author=me)

I do not think 4. is what Jakub meant, which is to make the author and committer identity for real humans come from the configuration that becomes in effect automatically by merely logging in.

If that cannot be arranged, something like 4. may have to serve as a rough approximation; that sound like the best you could do under that limitation without breaking the general usability of the system.

Previous: Piotr KrukowieckiNext: Piotr Krukowiecki
Message 8 of 10 in “"commit --author=..." does not work if global email and name is not set”
  1. Piotr KrukowieckiApr 5, 2019
  2. Junio C HamanoApr 5, 2019
  3. Jakub NarebskiApr 6, 2019
  4. Junio C HamanoApr 8, 2019
  5. Piotr KrukowieckiApr 8, 2019
  6. Jakub NarebskiApr 8, 2019
  7. Piotr KrukowieckiApr 8, 2019
  8. Junio C HamanoApr 9, 2019
  9. Piotr KrukowieckiApr 9, 2019
  10. Jakub NarebskiApr 9, 2019

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.