From: Hiltjo Posthuma Date: Mon, 7 Dec 2015 22:22:45 +0000 (+0100) Subject: truncate message in log, shorter time format X-Git-Url: https://git.atheridis.org/?a=commitdiff_plain;h=1d9324a87ea6b0cc3e1252910c4d6b6ae26e6ea4;p=forks%2Fstagit.git truncate message in log, shorter time format --- diff --git a/urmoms.c b/urmoms.c index 76e168a..2c5593b 100644 --- a/urmoms.c +++ b/urmoms.c @@ -358,6 +358,7 @@ writelog(FILE *fp) struct commitinfo *ci; git_revwalk *w = NULL; git_oid id; + size_t len; int ret = 0; mkdir("commit", 0755); @@ -374,19 +375,23 @@ writelog(FILE *fp) if (!(ci = commitinfo_getbyoid(&id))) break; - fputs("", fp); + fputs("", fp); + if (ci->author) + printtimeshort(fp, &(ci->author->when)); + fputs("", fp); if (ci->summary) { fprintf(fp, "", relpath, ci->oid); - xmlencode(fp, ci->summary, strlen(ci->summary)); + if ((len = strlen(ci->summary)) > 79) { + xmlencode(fp, ci->summary, 76); + fputs("...", fp); + } else { + xmlencode(fp, ci->summary, len); + } fputs("", fp); } fputs("", fp); if (ci->author) xmlencode(fp, ci->author->name, strlen(ci->author->name)); - - fputs("", fp); - if (ci->author) - printtime(fp, &(ci->author->when)); fputs("", fp); fprintf(fp, "%zu", ci->filecount); fputs("", fp);