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
Junio C Hamano <gitster@pobox.com>
Date
Feb 9, 2024, 17:30 UTC
Message-ID
<xmqqfry1h7ej.fsf@gitster.g>
In-Reply-To
<5c25da43-c886-41d2-b057-b95a84b107ba@app.fastmail.com>
"Kristoffer Haugsbakk" <code@khaugsbakk.name> writes:
Show 26 quoted lines
> So when a user gets this error:
>
> ```
> Committer identity unknown
>
> *** Please tell me who you are.
> ```
>
> And have never heard of “committer” before… what is she to think? I
> think it’s very natural to conclude that “author” and “committer” are
> the same thing. So she thinks:
>
>   “ Okay, so the program is complaining about the author not being
>     set. (It calls it “committer” here for some reason.) But I have set
>     the author…
>
> Maybe this is another case of: it all makes perfect sense if you already
> know all the concepts.
>
>>> Your report would have been more clear if you included the error:
>>
>> Had I had any idea that the report was different between with / without
>> —author I probably would have added it, or found out what the issue was.
>
> You don’t know what you don’t know. That’s why it’s best to include all
> context.

So, now, let's be productive. When somebody who does not know much about Git tries to commit without configuring anything and hits the error, what is a more appropriate message to guide who does not know what he or she does not know?

The user claims that "committer identity unknown, please tell me who you are" were not helpful enough. Would it make it more helpful if we append how to "tell who they are" after that message, perhaps with "git config" on user.email and user.name variables, or something?

Or do we need three-way switch that does
	if (neither is known) {
        	printf("neither author or committer is known");
	} else if (author is known but committer is not known) {
		printf("author is known but committer is not"):
	} else if (author is not known but committer is known) {
		printf("committer is known but author is not"):
	} else {
		return happy;
	}
	printf("please tell us who you are...");
perhaps?
Previous: Kristoffer HaugsbakkNext: Kristoffer Haugsbakk
Message 8 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.