mirror of
https://git.zx2c4.com/cgit
synced 2024-11-25 18:08:41 +00:00
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>
This commit is contained in:
parent
5db02854e6
commit
2e6721edbb
19
ui-log.c
19
ui-log.c
@ -100,11 +100,10 @@ void print_commit(struct commit *commit, struct rev_info *revs)
|
|||||||
struct strbuf graphbuf = STRBUF_INIT;
|
struct strbuf graphbuf = STRBUF_INIT;
|
||||||
struct strbuf msgbuf = STRBUF_INIT;
|
struct strbuf msgbuf = STRBUF_INIT;
|
||||||
|
|
||||||
if (ctx.repo->enable_log_filecount) {
|
if (ctx.repo->enable_log_filecount)
|
||||||
cols++;
|
cols++;
|
||||||
if (ctx.repo->enable_log_linecount)
|
if (ctx.repo->enable_log_linecount)
|
||||||
cols++;
|
cols++;
|
||||||
}
|
|
||||||
|
|
||||||
if (revs->graph) {
|
if (revs->graph) {
|
||||||
/* Advance graph until current commit */
|
/* Advance graph until current commit */
|
||||||
@ -179,18 +178,18 @@ void print_commit(struct commit *commit, struct rev_info *revs)
|
|||||||
html_link_close();
|
html_link_close();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx.repo->enable_log_filecount) {
|
if (ctx.repo->enable_log_filecount || ctx.repo->enable_log_linecount) {
|
||||||
files = 0;
|
files = 0;
|
||||||
add_lines = 0;
|
add_lines = 0;
|
||||||
rem_lines = 0;
|
rem_lines = 0;
|
||||||
cgit_diff_commit(commit, inspect_files, ctx.qry.vpath);
|
cgit_diff_commit(commit, inspect_files, ctx.qry.vpath);
|
||||||
html("</td><td>");
|
|
||||||
htmlf("%d", files);
|
|
||||||
if (ctx.repo->enable_log_linecount) {
|
|
||||||
html("</td><td>");
|
|
||||||
htmlf("-%d/+%d", rem_lines, add_lines);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ctx.repo->enable_log_filecount)
|
||||||
|
htmlf("</td><td>%d", files);
|
||||||
|
if (ctx.repo->enable_log_linecount)
|
||||||
|
htmlf("</td><td>-%d/+%d", rem_lines, add_lines);
|
||||||
|
|
||||||
html("</td></tr>\n");
|
html("</td></tr>\n");
|
||||||
|
|
||||||
if (revs->graph || ctx.qry.showmsg) { /* Print a second table row */
|
if (revs->graph || ctx.qry.showmsg) { /* Print a second table row */
|
||||||
@ -379,11 +378,11 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern
|
|||||||
if (ctx.repo->enable_log_filecount) {
|
if (ctx.repo->enable_log_filecount) {
|
||||||
html("<th class='left'>Files</th>");
|
html("<th class='left'>Files</th>");
|
||||||
columns++;
|
columns++;
|
||||||
|
}
|
||||||
if (ctx.repo->enable_log_linecount) {
|
if (ctx.repo->enable_log_linecount) {
|
||||||
html("<th class='left'>Lines</th>");
|
html("<th class='left'>Lines</th>");
|
||||||
columns++;
|
columns++;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
html("</tr>\n");
|
html("</tr>\n");
|
||||||
|
|
||||||
if (ofs<0)
|
if (ofs<0)
|
||||||
|
Loading…
Reference in New Issue
Block a user