X-Git-Url: https://git.distorted.org.uk/~mdw/tig/blobdiff_plain/0f11e3a9f4d936964061dd9106652167c7cb0cba..cbbf2d1be57f0bbd9eda37f3d5ab7e30d3ae179b:/tig.c diff --git a/tig.c b/tig.c index 01cc75c..f110dae 100644 --- a/tig.c +++ b/tig.c @@ -80,7 +80,7 @@ static size_t utf8_length(const char *string, size_t max_width, int *coloffset, "git log --cc --stat -n100 %s" #define TIG_MAIN_CMD \ - "git log --topo-order --stat --pretty=raw %s" + "git log --topo-order --pretty=raw %s" /* XXX: Needs to be defined to the empty string. */ #define TIG_HELP_CMD "" @@ -2286,10 +2286,22 @@ main_read(struct view *view, char *line) 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 */ @@ -2583,6 +2595,8 @@ init_display(void) /* Leave stdin and stdout alone when acting as a pager. */ FILE *io = fopen("/dev/tty", "r+"); + if (!io) + die("Failed to open /dev/tty"); cursed = !!newterm(NULL, io, io); }