|
diff --git a/ui-log.c b/ui-log.c index a39474b..72e2a4b 100644 --- a/ ui-log.c+++ b/ ui-log.c |
|
@@ -16,46 +16,46 @@ void count_lines(char *line, int size) |
16 | return; |
16 | return; |
17 | |
17 | |
18 | if (line[0] == '+') |
18 | if (line[0] == '+') |
19 | add_lines++; |
19 | add_lines++; |
20 | |
20 | |
21 | else if (line[0] == '-') |
21 | else if (line[0] == '-') |
22 | rem_lines++; |
22 | rem_lines++; |
23 | } |
23 | } |
24 | |
24 | |
25 | void inspect_files(struct diff_filepair *pair) |
25 | void inspect_files(struct diff_filepair *pair) |
26 | { |
26 | { |
27 | files++; |
27 | files++; |
28 | if (cgit_repo->enable_log_linecount) |
28 | if (ctx.repo->enable_log_linecount) |
29 | cgit_diff_files(pair->one->sha1, pair->two->sha1, count_lines); |
29 | cgit_diff_files(pair->one->sha1, pair->two->sha1, count_lines); |
30 | } |
30 | } |
31 | |
31 | |
32 | void print_commit(struct commit *commit) |
32 | void print_commit(struct commit *commit) |
33 | { |
33 | { |
34 | struct commitinfo *info; |
34 | struct commitinfo *info; |
35 | |
35 | |
36 | info = cgit_parse_commit(commit); |
36 | info = cgit_parse_commit(commit); |
37 | html("<tr><td>"); |
37 | html("<tr><td>"); |
38 | cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); |
38 | cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); |
39 | html("</td><td>"); |
39 | html("</td><td>"); |
40 | cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, |
40 | cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, |
41 | sha1_to_hex(commit->object.sha1)); |
41 | sha1_to_hex(commit->object.sha1)); |
42 | if (cgit_repo->enable_log_filecount) { |
42 | if (ctx.repo->enable_log_filecount) { |
43 | files = 0; |
43 | files = 0; |
44 | add_lines = 0; |
44 | add_lines = 0; |
45 | rem_lines = 0; |
45 | rem_lines = 0; |
46 | cgit_diff_commit(commit, inspect_files); |
46 | cgit_diff_commit(commit, inspect_files); |
47 | html("</td><td class='right'>"); |
47 | html("</td><td class='right'>"); |
48 | htmlf("%d", files); |
48 | htmlf("%d", files); |
49 | if (cgit_repo->enable_log_linecount) { |
49 | if (ctx.repo->enable_log_linecount) { |
50 | html("</td><td class='right'>"); |
50 | html("</td><td class='right'>"); |
51 | htmlf("-%d/+%d", rem_lines, add_lines); |
51 | htmlf("-%d/+%d", rem_lines, add_lines); |
52 | } |
52 | } |
53 | } |
53 | } |
54 | html("</td><td>"); |
54 | html("</td><td>"); |
55 | html_txt(info->author); |
55 | html_txt(info->author); |
56 | html("</td></tr>\n"); |
56 | html("</td></tr>\n"); |
57 | cgit_free_commitinfo(info); |
57 | cgit_free_commitinfo(info); |
58 | } |
58 | } |
59 | |
59 | |
60 | |
60 | |
61 | void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern, char *path, int pager) |
61 | void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern, char *path, int pager) |
@@ -85,27 +85,27 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern |
85 | rev.show_root_diff = 0; |
85 | rev.show_root_diff = 0; |
86 | setup_revisions(argc, argv, &rev, NULL); |
86 | setup_revisions(argc, argv, &rev, NULL); |
87 | if (rev.grep_filter) { |
87 | if (rev.grep_filter) { |
88 | rev.grep_filter->regflags |= REG_ICASE; |
88 | rev.grep_filter->regflags |= REG_ICASE; |
89 | compile_grep_patterns(rev.grep_filter); |
89 | compile_grep_patterns(rev.grep_filter); |
90 | } |
90 | } |
91 | prepare_revision_walk(&rev); |
91 | prepare_revision_walk(&rev); |
92 | |
92 | |
93 | html("<table summary='log' class='list nowrap'>"); |
93 | html("<table summary='log' class='list nowrap'>"); |
94 | html("<tr class='nohover'><th class='left'>Age</th>" |
94 | html("<tr class='nohover'><th class='left'>Age</th>" |
95 | "<th class='left'>Message</th>"); |
95 | "<th class='left'>Message</th>"); |
96 | |
96 | |
97 | if (cgit_repo->enable_log_filecount) { |
97 | if (ctx.repo->enable_log_filecount) { |
98 | html("<th class='right'>Files</th>"); |
98 | html("<th class='right'>Files</th>"); |
99 | if (cgit_repo->enable_log_linecount) |
99 | if (ctx.repo->enable_log_linecount) |
100 | html("<th class='right'>Lines</th>"); |
100 | html("<th class='right'>Lines</th>"); |
101 | } |
101 | } |
102 | html("<th class='left'>Author</th></tr>\n"); |
102 | html("<th class='left'>Author</th></tr>\n"); |
103 | |
103 | |
104 | if (ofs<0) |
104 | if (ofs<0) |
105 | ofs = 0; |
105 | ofs = 0; |
106 | |
106 | |
107 | for (i = 0; i < ofs && (commit = get_revision(&rev)) != NULL; i++) { |
107 | for (i = 0; i < ofs && (commit = get_revision(&rev)) != NULL; i++) { |
108 | free(commit->buffer); |
108 | free(commit->buffer); |
109 | commit->buffer = NULL; |
109 | commit->buffer = NULL; |
110 | free_commit_list(commit->parents); |
110 | free_commit_list(commit->parents); |
111 | commit->parents = NULL; |
111 | commit->parents = NULL; |
|