git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phillip Wood <phillip.wood123@gmail.com>
To: Marcus Tillmanns <Marcus.Tillmanns@qt.io>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Bug: Commit fails when no global email address is set even though --author is used
Date: Thu, 8 Feb 2024 15:50:21 +0000	[thread overview]
Message-ID: <51599394-3f75-4b75-a4c0-f13f117e73bc@gmail.com> (raw)
In-Reply-To: <F7D40DCD-2331-44D8-B4BF-8E6CD9EE64A6@qt.io>

Hi Marcus

On 08/02/2024 15:26, Marcus Tillmanns wrote:
> What did you do before the bug happened? (Steps to reproduce your issue)
> 
> * Set your machines hostname to a name that does not contain "." (e.g. "ihavenodotinmyhostname")
> * Make sure you have no name or email configured in your global git config
> * Create a new repository and "git add" a file
> * Run: git commit -m "Test" --author "My Name <my@email.com>"
> 
> What did you expect to happen? (Expected behavior)
> 
> A commit should be created with author name "My Name", and author email "my@email.com"
> 
> What happened instead? (Actual behavior)
> 
> An error is thrown, complaining about not being able to determine the email address

This is expected as "git commit" needs an identity to use for the 
committer as well as for the author. To set the committer you can use 
the GIT_COMMITTER_NAME and GIT_COMMITTER_EMAIL environment variables if 
you don't have the relevant config set and git cannot extract a domain 
from your hostname.

Best Wishes

Phillip

  reply	other threads:[~2024-02-08 15:50 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 [this message]
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

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=51599394-3f75-4b75-a4c0-f13f117e73bc@gmail.com \
    --to=phillip.wood123@gmail.com \
    --cc=Marcus.Tillmanns@qt.io \
    --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).