[PATCH] Fix local pull that uses packs.
[gitweb.git] / ident.c
diff --git a/ident.c b/ident.c
index faff44175bb32eb1982f1eaf1de70d960ae2b65c..9ef636ee879ad977a3db3a95500eec0b91316567 100644 (file)
--- a/ident.c
+++ b/ident.c
@@ -26,13 +26,13 @@ int setup_ident(void)
        /* Get the name ("gecos") */
        len = strlen(pw->pw_gecos);
        if (len >= sizeof(real_name))
-               die("Your parents must have hated you");
+               die("Your parents must have hated you!");
        memcpy(real_name, pw->pw_gecos, len+1);
 
        /* Make up a fake email address (name + '@' + hostname [+ '.' + domainname]) */
        len = strlen(pw->pw_name);
        if (len > sizeof(real_email)/2)
-               die("Your parents must have hated you");
+               die("Your sysadmin must hate you!");
        memcpy(real_email, pw->pw_name, len);
        real_email[len++] = '@';
        gethostname(real_email + len, sizeof(real_email) - len);
@@ -136,3 +136,13 @@ char *get_ident(const char *name, const char *email, const char *date_str)
        buffer[i] = 0;
        return buffer;
 }
+
+char *git_author_info(void)
+{
+       return get_ident(gitenv("GIT_AUTHOR_NAME"), gitenv("GIT_AUTHOR_EMAIL"), gitenv("GIT_AUTHOR_DATE"));
+}
+
+char *git_committer_info(void)
+{
+       return get_ident(gitenv("GIT_COMMITTER_NAME"), gitenv("GIT_COMMITTER_EMAIL"), gitenv("GIT_COMMITTER_DATE"));
+}