Re: Bug: Commit fails when no global email address is set even though --author is used
- From
Kristoffer Haugsbakk <code@khaugsbakk.name>
- Date
- Feb 9, 2024, 11:02 UTC
- Message-ID
- <5c25da43-c886-41d2-b057-b95a84b107ba@app.fastmail.com>
- In-Reply-To
- <26317088-7020-43EF-8B60-41D719A6D145@qt.io>
On Fri, Feb 9, 2024, at 09:46, Marcus Tillmanns wrote:
Show 5 quoted lines
> Everything you said is true. But it misses the point. > > If I try to commit for the first time, don’t want to set the global > config, look at man git-commit and search for “author", it says > “—author” to specify the author.
That reminds me of a mistake I once did. I was setting things up on a different machine and I set `author.*` in my config. Then I got very confused when `git commit` complained. I totally failed to see that I need to set `user.*`, not `author.*`.
Ideally I think I should have gotten this error:
``` Committer identity unknown
The `author` config is set but not `committer`.
Did you mean to set `user` (author and committer)? ```
Show 5 quoted lines
> Since “comitter” is such a hidden feature that even long time users of > git don’t necessarily know about it, when I then specify “—author” and > get the “same” error message again, I have no clue what’s going on, > since I just specified my user name and email, and still I’m told it > cannot be determined.
This is a very good point. The _committer_ is pretty well-hidden in normal workflows. And probably irrelevant.
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.
Cheers
-- Kristoffer Haugsbakk