summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d441a71)
raw | patch | inline | side by side (parent: d441a71)
author | Jonas Fonseca <fonseca@diku.dk> | |
Tue, 22 Aug 2006 22:05:06 +0000 (00:05 +0200) | ||
committer | Jonas Fonseca <fonseca@antimatter.localdomain> | |
Tue, 22 Aug 2006 22:05:06 +0000 (00:05 +0200) |
If no author name is in the ident line fall-back to use the author email.
Set to "Unknown" if neither is found.
Set to "Unknown" if neither is found.
tig.c | patch | blob | history |
index 6a1f3d1280a894fc8afabd22d0a96f694c587824..f110dae0ec4e493777b5aa9d13d5919f9d85aa55 100644 (file)
--- a/tig.c
+++ b/tig.c
break;
if (end) {
+ char *email = end + 1;
+
for (; end > ident && isspace(end[-1]); end--) ;
+
+ if (end == ident && *email) {
+ ident = email;
+ end = strchr(ident, '>');
+ for (; end > ident && isspace(end[-1]); end--) ;
+ }
*end = 0;
}
+ /* End is NULL or ident meaning there's no author. */
+ if (end <= ident)
+ ident = "Unknown";
+
string_copy(commit->author, ident);
/* Parse epoch and timezone */