aboutsummaryrefslogtreecommitdiffstats
path: root/ui-log.c
diff options
context:
space:
mode:
Diffstat (limited to 'ui-log.c')
-rw-r--r--ui-log.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/ui-log.c b/ui-log.c
index b67c2ef..6b12ca2 100644
--- a/ui-log.c
+++ b/ui-log.c
@@ -102,11 +102,10 @@ void print_commit(struct commit *commit, struct rev_info *revs)
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++;
107 if (ctx.repo->enable_log_linecount)
106 cols++; 108 cols++;
107 if (ctx.repo->enable_log_linecount)
108 cols++;
109 }
110 109
111 if (revs->graph) { 110 if (revs->graph) {
112 /* Advance graph until current commit */ 111 /* Advance graph until current commit */
@@ -173,18 +172,18 @@ void print_commit(struct commit *commit, struct rev_info *revs)
173 cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); 172 cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE);
174 } 173 }
175 174
176 if (ctx.repo->enable_log_filecount) { 175 if (ctx.repo->enable_log_filecount || ctx.repo->enable_log_linecount) {
177 files = 0; 176 files = 0;
178 add_lines = 0; 177 add_lines = 0;
179 rem_lines = 0; 178 rem_lines = 0;
180 cgit_diff_commit(commit, inspect_files, ctx.qry.vpath); 179 cgit_diff_commit(commit, inspect_files, ctx.qry.vpath);
181 html("</td><td>");
182 htmlf("%d", files);
183 if (ctx.repo->enable_log_linecount) {
184 html("</td><td>");
185 htmlf("-%d/+%d", rem_lines, add_lines);
186 }
187 } 180 }
181
182 if (ctx.repo->enable_log_filecount)
183 htmlf("</td><td>%d", files);
184 if (ctx.repo->enable_log_linecount)
185 htmlf("</td><td>-%d/+%d", rem_lines, add_lines);
186
188 html("</td></tr>\n"); 187 html("</td></tr>\n");
189 188
190 if (revs->graph || ctx.qry.showmsg) { /* Print a second table row */ 189 if (revs->graph || ctx.qry.showmsg) { /* Print a second table row */
@@ -373,10 +372,10 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
373 if (ctx.repo->enable_log_filecount) { 372 if (ctx.repo->enable_log_filecount) {
374 html("<th class='left'>Files</th>"); 373 html("<th class='left'>Files</th>");
375 columns++; 374 columns++;
376 if (ctx.repo->enable_log_linecount) { 375 }
377 html("<th class='left'>Lines</th>"); 376 if (ctx.repo->enable_log_linecount) {
378 columns++; 377 html("<th class='left'>Lines</th>");
379 } 378 columns++;
380 } 379 }
381 html("</tr>\n"); 380 html("</tr>\n");
382 381