From: Junio C Hamano <gitster@pobox.com>
To: "Kristoffer Haugsbakk" <code@khaugsbakk.name>
Cc: "Marcus Tillmanns" <Marcus.Tillmanns@qt.io>,
"git@vger.kernel.org" <git@vger.kernel.org>,
"Phillip Wood" <phillip.wood@dunelm.org.uk>
Subject: Re: Bug: Commit fails when no global email address is set even though --author is used
Date: Fri, 09 Feb 2024 11:56:57 -0800 [thread overview]
Message-ID: <xmqqfry1fm2e.fsf@gitster.g> (raw)
In-Reply-To: <d59a0e25-81c4-4ecd-826e-ef4b23423575@app.fastmail.com> (Kristoffer Haugsbakk's message of "Fri, 09 Feb 2024 18:38:37 +0100")
"Kristoffer Haugsbakk" <code@khaugsbakk.name> 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.
next prev parent reply other threads:[~2024-02-09 19:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-08 15:26 Bug: Commit fails when no global email address is set even though --author is used Marcus Tillmanns
2024-02-08 15:50 ` Phillip Wood
2024-02-09 7:43 ` Marcus Tillmanns
2024-02-09 8:21 ` Konstantin Khomoutov
2024-02-09 8:37 ` Kristoffer Haugsbakk
2024-02-09 8:46 ` Marcus Tillmanns
2024-02-09 11:02 ` Kristoffer Haugsbakk
2024-02-09 17:30 ` Junio C Hamano
2024-02-09 17:38 ` Kristoffer Haugsbakk
2024-02-09 19:56 ` Junio C Hamano [this message]
2024-02-10 9:42 ` Marcus Tillmanns
2024-02-10 17:21 ` Junio C Hamano
2024-02-11 18:16 ` Kristoffer Haugsbakk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqfry1fm2e.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=Marcus.Tillmanns@qt.io \
--cc=code@khaugsbakk.name \
--cc=git@vger.kernel.org \
--cc=phillip.wood@dunelm.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).