git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Pierre Habouzit <madcoder@debian.org>
Date
Jun 5, 2007, 16:40 UTC
Message-ID
<11810616414135-git-send-email-madcoder@debian.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 <madcoder@debian.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
Message 1 of 1 in “$EMAIL is a last resort fallback, as it's system-wide.”
  1. $EMAIL is a last resort fallback, as it's system-wide.Pierre Habouzit, Jun 5, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.