summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Documentation/config.txt4
-rw-r--r--Documentation/git-commit-tree.txt1
-rw-r--r--Documentation/git.txt1
-rw-r--r--ident.c2
-rw-r--r--t/test-lib.sh1
5 files changed, 7 insertions, 2 deletions
diff --git a/Documentation/config.txt b/Documentation/config.txt
index e0aff5369f..c257cdf525 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -610,8 +610,8 @@ tar.umask::
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.
diff --git a/Documentation/git-commit-tree.txt b/Documentation/git-commit-tree.txt
index 1571dbbb74..504a3aa1b4 100644
--- a/Documentation/git-commit-tree.txt
+++ b/Documentation/git-commit-tree.txt
@@ -61,6 +61,7 @@ either `.git/config` file, or using the following environment variables.
GIT_COMMITTER_NAME
GIT_COMMITTER_EMAIL
GIT_COMMITTER_DATE
+ EMAIL
(nb "<", ">" and "\n"s are stripped)
diff --git a/Documentation/git.txt b/Documentation/git.txt
index 08ba53ae01..c5d02dacde 100644
--- a/Documentation/git.txt
+++ b/Documentation/git.txt
@@ -345,6 +345,7 @@ git Commits
'GIT_COMMITTER_NAME'::
'GIT_COMMITTER_EMAIL'::
'GIT_COMMITTER_DATE'::
+'EMAIL'::
see gitlink:git-commit-tree[1]
git Diffs
diff --git a/ident.c b/ident.c
index 88e7f74e88..69a04b827d 100644
--- a/ident.c
+++ b/ident.c
@@ -196,6 +196,8 @@ const char *fmt_ident(const char *name, const char *email,
if (!name)
name = git_default_name;
if (!email)
+ email = getenv("EMAIL");
+ if (!email)
email = git_default_email;
if (!*name) {
diff --git a/t/test-lib.sh b/t/test-lib.sh
index f2c6bd3b01..dee3ad7621 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -16,6 +16,7 @@ unset AUTHOR_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