Fall back to $EMAIL for missing GIT_AUTHOR_EMAIL and GIT_COMMITTER_EMAIL
Some other programs get the user's email address from $EMAIL, so fall back to that if we don't have a Git-specific email address. Signed-off-by: Josh Triplett <josh@freedesktop.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
25dc5e2995
commit
28a94f885a
@ -610,8 +610,8 @@ tar.umask::
|
|||||||
|
|
||||||
user.email::
|
user.email::
|
||||||
Your email address to be recorded in any newly created commits.
|
Your email address to be recorded in any newly created commits.
|
||||||
Can be overridden by the 'GIT_AUTHOR_EMAIL' and 'GIT_COMMITTER_EMAIL'
|
Can be overridden by the 'GIT_AUTHOR_EMAIL', 'GIT_COMMITTER_EMAIL', and
|
||||||
environment variables. See gitlink:git-commit-tree[1].
|
'EMAIL' environment variables. See gitlink:git-commit-tree[1].
|
||||||
|
|
||||||
user.name::
|
user.name::
|
||||||
Your full name to be recorded in any newly created commits.
|
Your full name to be recorded in any newly created commits.
|
||||||
|
@ -61,6 +61,7 @@ either `.git/config` file, or using the following environment variables.
|
|||||||
GIT_COMMITTER_NAME
|
GIT_COMMITTER_NAME
|
||||||
GIT_COMMITTER_EMAIL
|
GIT_COMMITTER_EMAIL
|
||||||
GIT_COMMITTER_DATE
|
GIT_COMMITTER_DATE
|
||||||
|
EMAIL
|
||||||
|
|
||||||
(nb "<", ">" and "\n"s are stripped)
|
(nb "<", ">" and "\n"s are stripped)
|
||||||
|
|
||||||
|
@ -345,6 +345,7 @@ git Commits
|
|||||||
'GIT_COMMITTER_NAME'::
|
'GIT_COMMITTER_NAME'::
|
||||||
'GIT_COMMITTER_EMAIL'::
|
'GIT_COMMITTER_EMAIL'::
|
||||||
'GIT_COMMITTER_DATE'::
|
'GIT_COMMITTER_DATE'::
|
||||||
|
'EMAIL'::
|
||||||
see gitlink:git-commit-tree[1]
|
see gitlink:git-commit-tree[1]
|
||||||
|
|
||||||
git Diffs
|
git Diffs
|
||||||
|
2
ident.c
2
ident.c
@ -195,6 +195,8 @@ const char *fmt_ident(const char *name, const char *email,
|
|||||||
setup_ident();
|
setup_ident();
|
||||||
if (!name)
|
if (!name)
|
||||||
name = git_default_name;
|
name = git_default_name;
|
||||||
|
if (!email)
|
||||||
|
email = getenv("EMAIL");
|
||||||
if (!email)
|
if (!email)
|
||||||
email = git_default_email;
|
email = git_default_email;
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ unset AUTHOR_EMAIL
|
|||||||
unset AUTHOR_NAME
|
unset AUTHOR_NAME
|
||||||
unset COMMIT_AUTHOR_EMAIL
|
unset COMMIT_AUTHOR_EMAIL
|
||||||
unset COMMIT_AUTHOR_NAME
|
unset COMMIT_AUTHOR_NAME
|
||||||
|
unset EMAIL
|
||||||
unset GIT_ALTERNATE_OBJECT_DIRECTORIES
|
unset GIT_ALTERNATE_OBJECT_DIRECTORIES
|
||||||
unset GIT_AUTHOR_DATE
|
unset GIT_AUTHOR_DATE
|
||||||
GIT_AUTHOR_EMAIL=author@example.com
|
GIT_AUTHOR_EMAIL=author@example.com
|
||||||
|
Loading…
x
Reference in New Issue
Block a user