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>
user.email::
Your email address to be recorded in any newly created commits.
- Can be overridden by the 'GIT_AUTHOR_EMAIL' and 'GIT_COMMITTER_EMAIL'
- environment variables. See gitlink:git-commit-tree[1].
+ Can be overridden by the 'GIT_AUTHOR_EMAIL', 'GIT_COMMITTER_EMAIL', and
+ 'EMAIL' environment variables. See gitlink:git-commit-tree[1].
user.name::
Your full name to be recorded in any newly created commits.
GIT_COMMITTER_NAME
GIT_COMMITTER_EMAIL
GIT_COMMITTER_DATE
+ EMAIL
(nb "<", ">" and "\n"s are stripped)
'GIT_COMMITTER_NAME'::
'GIT_COMMITTER_EMAIL'::
'GIT_COMMITTER_DATE'::
+'EMAIL'::
see gitlink:git-commit-tree[1]
git Diffs
setup_ident();
if (!name)
name = git_default_name;
+ if (!email)
+ email = getenv("EMAIL");
if (!email)
email = git_default_email;
unset AUTHOR_NAME
unset COMMIT_AUTHOR_EMAIL
unset COMMIT_AUTHOR_NAME
+unset EMAIL
unset GIT_ALTERNATE_OBJECT_DIRECTORIES
unset GIT_AUTHOR_DATE
GIT_AUTHOR_EMAIL=author@example.com