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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Cheers,
Marcus


> On 9. Feb 2024, at 20:56, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> 
> [You don't often get email from gitster@xxxxxxxxx. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> "Kristoffer Haugsbakk" <code@xxxxxxxxxxxxxxx> writes:
> 
>> On Fri, Feb 9, 2024, at 18:30, Junio C Hamano wrote:
>>> 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?
>> 
>> 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.
> 





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux