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

From: Junio C Hamano <[email-masked]>
Date: Sat, 10 Feb 2024 09:21:10 -0800

Marcus Tillmanns <[email-masked]> writes:

> For me the issue was that I knew already about the global config
> setting, but in my case I specifically did not want to set that.
>
> What pulled my attention away from the important part was the huge
> wall of text about how to setup global stuff etc, making the
> single word in the top left basically invisible to my eye. I was
> thinking "I already knew all that, I’ve set the author, so you
> complaining still with the same error message must be a bug”.
>
> I think, if a user tries to commit with “—author”, and git
> fails to figure out the comitter, it should have a specific error
> message about “hey, you’ve set the author, but we still have to
> figure out whom to set as the committer, or you can use
> “—authorAndComitter” if they should be the same”.
>
> That would make it obvious to the user what’s going on.

I guess so, provided that such an additional text would not trigger
the "I missed due to the huge wall of text" again.  So in short, you
are saying that the three-way message would help?

Can I get you intereseted enough to care to come up with a patch
;-)?

Thanks.

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