From: Alvaro Aleman <aaleman@redhat.com>
To: git@vger.kernel.org
Subject: --author arg on commit only works if there is an email configured already
Date: Fri, 21 Aug 2020 12:15:49 -0400 [thread overview]
Message-ID: <CAOW=8D2J3t3cE32q2xNqSOPTa6gxR5gSuJUCCj5MSj58ccc3Cg@mail.gmail.com> (raw)
Hello everyone,
It seems the `--author` arg on the `git commit` command only works if
an author email is configured already somewhere:
Sample that I would expect to work and that does not work:
```
$ docker run --rm -it golang /bin/bash -c 'cd $(mktemp -d); git init;
touch test; git add test; git commit -m message --author "A U Thor
<author@example.com>"'
Initialized empty Git repository in /tmp/tmp.TiNqOZsw9C/.git/
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address (got 'root@aedfbe0df193.(none)')
```
When configuring any mail first, this works and uses the mail
specified in the `--author` arg:
```
$ docker run --rm -it golang /bin/bash -c 'cd $(mktemp -d); git init;
touch test; git add test; git config --local user.email
"mail@domain.com"; git commit -m message --author "A U Thor
<author@example.com>"'
Initialized empty Git repository in /tmp/tmp.1drhE2Rgmh/.git/
[master (root-commit) b3dad37] message
Author: A U Thor <author@example.com>
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 test
```
The git version:
$ docker run --rm -it golang git --version
git version 2.20
next reply other threads:[~2020-08-21 17:20 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-21 16:15 Alvaro Aleman [this message]
2020-08-21 18:28 ` --author arg on commit only works if there is an email configured already Andreas Schwab
2020-08-21 18:46 ` Junio C Hamano
2020-08-21 19:55 ` Alvaro Aleman
2020-08-21 20:36 ` [PATCH] ident: say whose identity is missing when giving user.name hint Junio C Hamano
2020-08-21 20:52 ` Eric Sunshine
2020-08-21 21:13 ` Junio C Hamano
2020-08-21 21:31 ` Alvaro Aleman
2020-08-21 21:37 ` Eric Sunshine
2020-08-21 22:35 ` Junio C Hamano
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAOW=8D2J3t3cE32q2xNqSOPTa6gxR5gSuJUCCj5MSj58ccc3Cg@mail.gmail.com' \
--to=aaleman@redhat.com \
--cc=git@vger.kernel.org \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).