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

Re: Bug: Commit fails when no global email address is set even though --author is used

From
Kristoffer Haugsbakk <code@khaugsbakk.name>
Date
Feb 11, 2024, 18:16 UTC
Message-ID
<9c22f49a-538b-41eb-bdce-39e547c614ef@app.fastmail.com>
In-Reply-To
<xmqqfry1fm2e.fsf@gitster.g>
On Fri, Feb 9, 2024, at 20:56, Junio C Hamano wrote:
Show 19 quoted lines
>> I think a three-way switch looks good. With the amendment that it steers
>> you towards `user.*` instead of setting both `author.*` and
>> `committer.*`.
>>
>> Something like
>>
>> • Author is set, not committer
>>   • Message: author is set but not committer: you might want to set
>>     *user* instead (prints suggested config)
>>
>> I can try to make a patch later.
>
> Wait. I didn't realize this when I wrote the message you are
> responding to, but we *do* already suggest settig user.* variables.
>
> If the user chose to ignore that, then there isn't much we can do to
> help, is there?
>
> Puzzled, but I'll stop here.

Aye, good point. Maybe I misremembered and/or didn’t look carefully enough at the error message back when I set `author.*` instead of `user.*`.

Maybe the error could say (back to the multi-way switch):

``` Author identity known, but committer identity unknown

*** Please tell me who you are.
Run
  git config --global user.email "code@khaugsbakk.name"
  git config --global user.name "Kristoffer Haugsbakk"

to set your account's default identity. Omit --global to set the identity only in this repository.

fatal: empty ident name (for <>) not allowed ```

And then (see above) fill in the real information in the proposed config commands if the other identity is known. Maybe that could be accomplished with one more parameter to `ident_env_hint`:

``` static void ident_env_hint(enum want_ident whose_ident, char *other_ident) ```

(turned out to be a bit more tricky than I thought)

But that’s a slightly longer error message, which (again) can cause the already-discussed glaze-over effect caused by the “wall of text”.

-- 
Kristoffer Haugsbakk
Previous: Junio C Hamano
Message 13 of 13 in “Bug: Commit fails when no global email address is set even though --author is used”
  1. Marcus TillmannsFeb 8, 2024
  2. Phillip WoodFeb 8, 2024
  3. Marcus TillmannsFeb 9, 2024
  4. Konstantin KhomoutovFeb 9, 2024
  5. Kristoffer HaugsbakkFeb 9, 2024
  6. Marcus TillmannsFeb 9, 2024
  7. Kristoffer HaugsbakkFeb 9, 2024
  8. Junio C HamanoFeb 9, 2024
  9. Kristoffer HaugsbakkFeb 9, 2024
  10. Junio C HamanoFeb 9, 2024
  11. Marcus TillmannsFeb 10, 2024
  12. Junio C HamanoFeb 10, 2024
  13. Kristoffer HaugsbakkFeb 11, 2024

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.