# [PATCH] $EMAIL is a last resort fallback, as it's system-wide.

2 messages from 2007-06-05 to 2007-06-05. Participants: Pierre Habouzit.
Thread: https://gitlist.dev/t/8455

## Pierre Habouzit, 2007-06-05 22:25

Subject: [PATCH] $EMAIL is a last resort fallback, as it's system-wide.
Message-ID: <11810823351883-git-send-email-madcoder@debian.org>
URL: https://gitlist.dev/e/11810823351883-git-send-email-madcoder%40debian.org

```
From: Pierre Habouzit <pierre.habouzit@m4x.org>

  Rationale: $EMAIL is a system-wide setup that is used for many many many
applications. If the git user chose a specific user.email setup, then _this_
should be honoured rather than $EMAIL.

Signed-off-by: Pierre Habouzit <pierre.habouzit@m4x.org>
---
 ident.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/ident.c b/ident.c
index 69a04b8..3d49608 100644
--- a/ident.c
+++ b/ident.c
@@ -196,9 +196,9 @@ 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 (!email)
+		email = getenv("EMAIL");
 
 	if (!*name) {
 		struct passwd *pw;
-- 
1.5.2.1

```

## Pierre Habouzit, 2007-06-05 22:27

Subject: Re: [PATCH] $EMAIL is a last resort fallback, as it's system-wide.
Message-ID: <20070605222746.GA5165@artemis>
URL: https://gitlist.dev/e/20070605222746.GA5165%40artemis
In-Reply-To: <11810823351883-git-send-email-madcoder@debian.org>

```
  Eeeew sorry for the repost, I sent the bad patch with git send-email.
my mistake.

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

```
