~mdw
/
tig
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve handling of 'bogus' author lines
[tig]
/
tig.c
diff --git
a/tig.c
b/tig.c
index
01cc75c
..
f110dae
100644
(file)
--- 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 --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 ""
/* 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) {
break;
if (end) {
+ char *email = end + 1;
+
for (; end > ident && isspace(end[-1]); end--) ;
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 = 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 */
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+");
/* 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);
}
cursed = !!newterm(NULL, io, io);
}