{"thread":{"id":"8899","subject":"[PATCH] Prefer $EMAIL over auto-generated user@hostname.","startedAt":"2007-07-06T16:14:46Z","lastAt":"2007-07-06T16:14:46Z","messageCount":1,"participants":["Brandon Casey"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"46642","messageId":"468E6A76.6060806@nrlssc.navy.mil","threadId":"8899","inReplyTo":null,"subject":"[PATCH] Prefer $EMAIL over auto-generated user@hostname.","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2007-07-06T16:14:46Z","receivedAt":"2007-07-06T16:14:46Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"This makes $EMAIL the second to last resort ahead of\nusername@hostname rather than the last resort when\nGIT_AUTHOR_EMAIL or GIT_COMMITER_EMAIL and user.email\nare not set.\n\nSigned-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n\n\nAlex Riesen wrote:\n> On 7/6/07, Brandon Casey <casey@nrlssc.navy.mil> wrote:\n>>\n>> Is the recommended tab stop 8 characters as it is for linux? or 4?\n>>\n> \n> Tab is always 8 spaces. It is indentation which can be 8, 4, 3, 2, and\n> even 1.\n> It is 8 in Git.\n\nHere's an updated patch using tabs.\n\n-brandon\n\n\n ident.c |    6 ++++--\n 1 files changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/ident.c b/ident.c\nindex 3d49608..be5efcd 100644\n--- a/ident.c\n+++ b/ident.c\n@@ -73,6 +73,7 @@ static void copy_email(const struct passwd *pw)\n static void setup_ident(void)\n {\n \tstruct passwd *pw = NULL;\n+\tchar *email;\n \n \t/* Get the name (\"gecos\") */\n \tif (!git_default_name[0]) {\n@@ -82,6 +83,9 @@ static void setup_ident(void)\n \t\tcopy_gecos(pw, git_default_name, sizeof(git_default_name));\n \t}\n \n+\tif (!git_default_email[0] && (email = getenv(\"EMAIL\")) != NULL)\n+\t\tstrlcpy(git_default_email, email, sizeof(git_default_email));\n+\n \tif (!git_default_email[0]) {\n \t\tif (!pw)\n \t\t\tpw = getpwuid(getuid());\n@@ -197,8 +201,6 @@ const char *fmt_ident(const char *name, const char *email,\n \t\tname = git_default_name;\n \tif (!email)\n \t\temail = git_default_email;\n-\tif (!email)\n-\t\temail = getenv(\"EMAIL\");\n \n \tif (!*name) {\n \t\tstruct passwd *pw;\n-- \n1.5.3.rc0.30.g114f-dirty\n"}]}