git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 09:30:44 -0800	[thread overview]
Message-ID: <xmqqfry1h7ej.fsf@gitster.g> (raw)
In-Reply-To: <5c25da43-c886-41d2-b057-b95a84b107ba@app.fastmail.com> (Kristoffer Haugsbakk's message of "Fri, 09 Feb 2024 12:02:43 +0100")

"Kristoffer Haugsbakk" <code@khaugsbakk.name> 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?

  reply	other threads:[~2024-02-09 17:30 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 [this message]
2024-02-09 17:38             ` Kristoffer Haugsbakk
2024-02-09 19:56               ` Junio C Hamano
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=xmqqfry1h7ej.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).