git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kristoffer Haugsbakk" <code@khaugsbakk.name>
To: "Junio C Hamano" <gitster@pobox.com>
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: Sun, 11 Feb 2024 19:16:05 +0100	[thread overview]
Message-ID: <9c22f49a-538b-41eb-bdce-39e547c614ef@app.fastmail.com> (raw)
In-Reply-To: <xmqqfry1fm2e.fsf@gitster.g>

On Fri, Feb 9, 2024, at 20:56, Junio C Hamano wrote:
>> 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.

Aye, good point. Maybe I misremembered and/or didn’t look carefully
enough at the error message back when I set `author.*` instead of
`user.*`.

Maybe the error could say (back to the multi-way switch):

```
Author identity known, but committer identity unknown

*** Please tell me who you are.

Run

  git config --global user.email "code@khaugsbakk.name"
  git config --global user.name "Kristoffer Haugsbakk"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: empty ident name (for <>) not allowed
```

And then (see above) fill in the real information in the proposed config
commands if the other identity is known. Maybe that could be
accomplished with one more parameter to `ident_env_hint`:

```
static void ident_env_hint(enum want_ident whose_ident, char *other_ident)
```

(turned out to be a bit more tricky than I thought)

But that’s a slightly longer error message, which (again) can cause the
already-discussed glaze-over effect caused by the “wall of text”.

-- 
Kristoffer Haugsbakk


      parent reply	other threads:[~2024-02-11 18:16 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
2024-02-10  9:42                 ` Marcus Tillmanns
2024-02-10 17:21                   ` Junio C Hamano
2024-02-11 18:16                 ` Kristoffer Haugsbakk [this message]

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=9c22f49a-538b-41eb-bdce-39e547c614ef@app.fastmail.com \
    --to=code@khaugsbakk.name \
    --cc=Marcus.Tillmanns@qt.io \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --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).