*/
#ifndef VERSION
-#define VERSION "tig-0.3"
+#define VERSION "tig-0.4.git"
#endif
#ifndef DEBUG
"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 ""
{ "Down", KEY_DOWN },
{ "Insert", KEY_IC },
{ "Delete", KEY_DC },
+ { "Hash", '#' },
{ "Home", KEY_HOME },
{ "End", KEY_END },
{ "PageUp", KEY_PPAGE },
/* Check for comment markers, since read_properties() will
* only ensure opt and value are split at first " \t". */
- optlen = strcspn(opt, "#;");
+ optlen = strcspn(opt, "#");
if (optlen == 0)
return OK;
} else {
/* Look for comment endings in the value. */
- int len = strcspn(value, "#;");
+ int len = strcspn(value, "#");
if (len < valuelen) {
valuelen = len;
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 */
/* 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);
}