- pw = getpwuid(getuid());
- if (!pw)
- die("You don't exist. Go away!");
- realgecos = pw->pw_gecos;
- len = strlen(pw->pw_name);
- memcpy(realemail, pw->pw_name, len);
- realemail[len] = '@';
- gethostname(realemail+len+1, sizeof(realemail)-len-1);
- if (!strchr(realemail+len+1, '.')) {
- strcat(realemail, ".");
- getdomainname(realemail+strlen(realemail), sizeof(realemail)-strlen(realemail)-1);
- }
-
- datestamp(realdate, sizeof(realdate));
- strcpy(date, realdate);
-
- commitgecos = gitenv("GIT_COMMITTER_NAME") ? : realgecos;
- commitemail = gitenv("GIT_COMMITTER_EMAIL") ? : realemail;
- gecos = gitenv("GIT_AUTHOR_NAME") ? : realgecos;
- email = gitenv("GIT_AUTHOR_EMAIL") ? : realemail;
- audate = gitenv("GIT_AUTHOR_DATE");
- if (audate)
- parse_date(audate, date, sizeof(date));
-
- remove_special(gecos); remove_special(realgecos); remove_special(commitgecos);
- remove_special(email); remove_special(realemail); remove_special(commitemail);