diff options
| author | 2011-03-11 01:03:22 (JST) | |
|---|---|---|
| committer | 2011-03-26 23:20:55 (JST) | |
| commit | 2e6721edbb3c94a70f4ef0ead5e55b9da19fb806 (patch) | |
| tree | 74a7a13bb5ca5ec65dab1af28f44cb03ac16d328 | |
| parent | 5db02854e64fa41aa459ea7d13fc827063deda41 (diff) | |
| download | cgit-2e6721edbb3c94a70f4ef0ead5e55b9da19fb806.zip cgit-2e6721edbb3c94a70f4ef0ead5e55b9da19fb806.tar.gz | |
make enable-log-linecount independent of -filecount
You should be able to independently switch file and line count on and
off. This patch makes the code work like the documentation suggests: no
dependency for line counts to be displayed only when file counts are.
Signed-off-by: Julius Plenz <plenz@cis.fu-berlin.de>
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
| -rw-r--r-- | ui-log.c | 29 |
1 files changed, 14 insertions, 15 deletions
| @@ -100,11 +100,10 @@ void print_commit(struct commit *commit, struct rev_info *revs) | |||
| 100 | struct strbuf graphbuf = STRBUF_INIT; | 100 | struct strbuf graphbuf = STRBUF_INIT; |
| 101 | struct strbuf msgbuf = STRBUF_INIT; | 101 | struct strbuf msgbuf = STRBUF_INIT; |
| 102 | 102 | ||
| 103 | if (ctx.repo->enable_log_filecount) { | 103 | if (ctx.repo->enable_log_filecount) |
| 104 | cols++; | ||
| 105 | if (ctx.repo->enable_log_linecount) | ||
| 104 | cols++; | 106 | cols++; |
| 105 | if (ctx.repo->enable_log_linecount) | ||
| 106 | cols++; | ||
| 107 | } | ||
| 108 | 107 | ||
| 109 | if (revs->graph) { | 108 | if (revs->graph) { |
| 110 | /* Advance graph until current commit */ | 109 | /* Advance graph until current commit */ |
| @@ -179,18 +178,18 @@ void print_commit(struct commit *commit, struct rev_info *revs) | |||
| 179 | html_link_close(); | 178 | html_link_close(); |
| 180 | } | 179 | } |
| 181 | 180 | ||
| 182 | if (ctx.repo->enable_log_filecount) { | 181 | if (ctx.repo->enable_log_filecount || ctx.repo->enable_log_linecount) { |
| 183 | files = 0; | 182 | files = 0; |
| 184 | add_lines = 0; | 183 | add_lines = 0; |
| 185 | rem_lines = 0; | 184 | rem_lines = 0; |
| 186 | cgit_diff_commit(commit, inspect_files, ctx.qry.vpath); | 185 | cgit_diff_commit(commit, inspect_files, ctx.qry.vpath); |
| 187 | html("</td><td>"); | ||
| 188 | htmlf("%d", files); | ||
| 189 | if (ctx.repo->enable_log_linecount) { | ||
| 190 | html("</td><td>"); | ||
| 191 | htmlf("-%d/+%d", rem_lines, add_lines); | ||
| 192 | } | ||
| 193 | } | 186 | } |
| 187 | |||
| 188 | if (ctx.repo->enable_log_filecount) | ||
| 189 | htmlf("</td><td>%d", files); | ||
| 190 | if (ctx.repo->enable_log_linecount) | ||
| 191 | htmlf("</td><td>-%d/+%d", rem_lines, add_lines); | ||
| 192 | |||
| 194 | html("</td></tr>\n"); | 193 | html("</td></tr>\n"); |
| 195 | 194 | ||
| 196 | if (revs->graph || ctx.qry.showmsg) { /* Print a second table row */ | 195 | if (revs->graph || ctx.qry.showmsg) { /* Print a second table row */ |
| @@ -379,10 +378,10 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern | |||
| 379 | if (ctx.repo->enable_log_filecount) { | 378 | if (ctx.repo->enable_log_filecount) { |
| 380 | html("<th class='left'>Files</th>"); | 379 | html("<th class='left'>Files</th>"); |
| 381 | columns++; | 380 | columns++; |
| 382 | if (ctx.repo->enable_log_linecount) { | 381 | } |
| 383 | html("<th class='left'>Lines</th>"); | 382 | if (ctx.repo->enable_log_linecount) { |
| 384 | columns++; | 383 | html("<th class='left'>Lines</th>"); |
| 385 | } | 384 | columns++; |
| 386 | } | 385 | } |
| 387 | html("</tr>\n"); | 386 | html("</tr>\n"); |
| 388 | 387 | ||
