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

From: Junio C Hamano <[email-masked]>
Date: Fri, 09 Feb 2024 09:30:44 -0800

"Kristoffer Haugsbakk" <[email-masked]> writes:

> 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?