This makes $EMAIL the second to last resort ahead of username@hostname rather than the last resort when GIT_AUTHOR_EMAIL or GIT_COMMITER_EMAIL and user.email are not set. Signed-off-by: Brandon Casey <casey@xxxxxxxxxxxxxxx> --- Alex Riesen wrote: > On 7/6/07, Brandon Casey <casey@xxxxxxxxxxxxxxx> wrote: >> >> Is the recommended tab stop 8 characters as it is for linux? or 4? >> > > Tab is always 8 spaces. It is indentation which can be 8, 4, 3, 2, and > even 1. > It is 8 in Git. Here's an updated patch using tabs. -brandon ident.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ident.c b/ident.c index 3d49608..be5efcd 100644 --- a/ident.c +++ b/ident.c @@ -73,6 +73,7 @@ static void copy_email(const struct passwd *pw) static void setup_ident(void) { struct passwd *pw = NULL; + char *email; /* Get the name ("gecos") */ if (!git_default_name[0]) { @@ -82,6 +83,9 @@ static void setup_ident(void) copy_gecos(pw, git_default_name, sizeof(git_default_name)); } + if (!git_default_email[0] && (email = getenv("EMAIL")) != NULL) + strlcpy(git_default_email, email, sizeof(git_default_email)); + if (!git_default_email[0]) { if (!pw) pw = getpwuid(getuid()); @@ -197,8 +201,6 @@ const char *fmt_ident(const char *name, const char *email, name = git_default_name; if (!email) email = git_default_email; - if (!email) - email = getenv("EMAIL"); if (!*name) { struct passwd *pw; -- 1.5.3.rc0.30.g114f-dirty - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html