aboutsummaryrefslogtreecommitdiffstats
path: root/ui-log.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-log.c')
-rw-r--r--ui-log.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ui-log.c b/ui-log.c
index 857c05c..954d3e1 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -98,14 +98,14 @@ next:
98static void print_commit(struct commit *commit, struct rev_info *revs) 98static void print_commit(struct commit *commit, struct rev_info *revs)
99{ 99{
100 struct commitinfo *info; 100 struct commitinfo *info;
101 int cols = revs->graph ? 3 : 2; 101 int columns = revs->graph ? 4 : 3;
102 struct strbuf graphbuf = STRBUF_INIT; 102 struct strbuf graphbuf = STRBUF_INIT;
103 struct strbuf msgbuf = STRBUF_INIT; 103 struct strbuf msgbuf = STRBUF_INIT;
104 104
105 if (ctx.repo->enable_log_filecount) 105 if (ctx.repo->enable_log_filecount)
106 cols++; 106 columns++;
107 if (ctx.repo->enable_log_linecount) 107 if (ctx.repo->enable_log_linecount)
108 cols++; 108 columns++;
109 109
110 if (revs->graph) { 110 if (revs->graph) {
111 /* Advance graph until current commit */ 111 /* Advance graph until current commit */
@@ -113,7 +113,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
113 /* Print graph segment in otherwise empty table row */ 113 /* Print graph segment in otherwise empty table row */
114 html("<tr class='nohover'><td class='commitgraph'>"); 114 html("<tr class='nohover'><td class='commitgraph'>");
115 html(graphbuf.buf); 115 html(graphbuf.buf);
116 htmlf("</td><td colspan='%d' /></tr>\n", cols); 116 htmlf("</td><td colspan='%d' /></tr>\n", columns);
117 strbuf_setlen(&graphbuf, 0); 117 strbuf_setlen(&graphbuf, 0);
118 } 118 }
119 /* Current commit's graph segment is now ready in graphbuf */ 119 /* Current commit's graph segment is now ready in graphbuf */
@@ -232,7 +232,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs)
232 html("<td/>"); /* Empty 'Age' column */ 232 html("<td/>"); /* Empty 'Age' column */
233 233
234 /* Print msgbuf into remainder of table row */ 234 /* Print msgbuf into remainder of table row */
235 htmlf("<td colspan='%d'%s>\n", cols, 235 htmlf("<td colspan='%d'%s>\n", columns - (revs->graph ? 1 : 0),
236 ctx.qry.showmsg ? " class='logmsg'" : ""); 236 ctx.qry.showmsg ? " class='logmsg'" : "");
237 html_txt(msgbuf.buf); 237 html_txt(msgbuf.buf);
238 html("</td></tr>\n"); 238 html("</td></tr>\n");
@@ -283,7 +283,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
283 struct rev_info rev; 283 struct rev_info rev;
284 struct commit *commit; 284 struct commit *commit;
285 struct vector vec = VECTOR_INIT(char *); 285 struct vector vec = VECTOR_INIT(char *);
286 int i, columns = 3; 286 int i, columns = commit_graph ? 4 : 3;
287 char *arg; 287 char *arg;
288 288
289 /* First argv is NULL */ 289 /* First argv is NULL */
@@ -421,7 +421,7 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
421 } 421 }
422 html("</div>"); 422 html("</div>");
423 } else if ((commit = get_revision(&rev)) != NULL) { 423 } else if ((commit = get_revision(&rev)) != NULL) {
424 html("<tr class='nohover'><td colspan='3'>"); 424 htmlf("<tr class='nohover'><td colspan='%d'>", columns);
425 cgit_log_link("[...]", NULL, NULL, ctx.qry.head, NULL, 425 cgit_log_link("[...]", NULL, NULL, ctx.qry.head, NULL,
426 ctx.qry.vpath, 0, NULL, NULL, ctx.qry.showmsg); 426 ctx.qry.vpath, 0, NULL, NULL, ctx.qry.showmsg);
427 html("</td></tr>\n"); 427 html("</td></tr>\n");