|
diff --git a/ui-log.c b/ui-log.c index bb17e1d..8d774b0 100644 --- a/ ui-log.c+++ b/ ui-log.c |
|
@@ -10,53 +10,50 @@ |
10 | |
10 | |
11 | int files, lines; |
11 | int files, lines; |
12 | |
12 | |
13 | void count_lines(char *line, int size) |
13 | void count_lines(char *line, int size) |
14 | { |
14 | { |
15 | if (size>0 && (line[0] == '+' || line[0] == '-')) |
15 | if (size>0 && (line[0] == '+' || line[0] == '-')) |
16 | lines++; |
16 | lines++; |
17 | } |
17 | } |
18 | |
18 | |
19 | void inspect_files(struct diff_filepair *pair) |
19 | void inspect_files(struct diff_filepair *pair) |
20 | { |
20 | { |
21 | files++; |
21 | files++; |
22 | if (cgit_repo->enable_log_linecount) |
22 | if (cgit_repo->enable_log_linecount) |
23 | cgit_diff_files(pair->one->sha1, pair->two->sha1, count_lines); |
23 | cgit_diff_files(pair->one->sha1, pair->two->sha1, count_lines); |
24 | } |
24 | } |
25 | |
25 | |
26 | void print_commit(struct commit *commit) |
26 | void print_commit(struct commit *commit) |
27 | { |
27 | { |
28 | struct commitinfo *info; |
28 | struct commitinfo *info; |
29 | |
29 | |
30 | info = cgit_parse_commit(commit); |
30 | info = cgit_parse_commit(commit); |
31 | html("<tr><td>"); |
31 | html("<tr><td>"); |
32 | cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); |
32 | cgit_print_age(commit->date, TM_WEEK * 2, FMT_SHORTDATE); |
33 | html("</td><td>"); |
33 | html("</td><td>"); |
34 | char *qry = fmt("h=%s", sha1_to_hex(commit->object.sha1)); |
34 | cgit_commit_link(info->subject, NULL, NULL, cgit_query_head, |
35 | char *url = cgit_pageurl(cgit_query_repo, "commit", qry); |
35 | sha1_to_hex(commit->object.sha1)); |
36 | html_link_open(url, NULL, NULL); |
| |
37 | html_ntxt(cgit_max_msg_len, info->subject); |
| |
38 | html_link_close(); |
| |
39 | if (cgit_repo->enable_log_filecount) { |
36 | if (cgit_repo->enable_log_filecount) { |
40 | files = 0; |
37 | files = 0; |
41 | lines = 0; |
38 | lines = 0; |
42 | cgit_diff_commit(commit, inspect_files); |
39 | cgit_diff_commit(commit, inspect_files); |
43 | html("</td><td class='right'>"); |
40 | html("</td><td class='right'>"); |
44 | htmlf("%d", files); |
41 | htmlf("%d", files); |
45 | if (cgit_repo->enable_log_linecount) { |
42 | if (cgit_repo->enable_log_linecount) { |
46 | html("</td><td class='right'>"); |
43 | html("</td><td class='right'>"); |
47 | htmlf("%d", lines); |
44 | htmlf("%d", lines); |
48 | } |
45 | } |
49 | } |
46 | } |
50 | html("</td><td>"); |
47 | html("</td><td>"); |
51 | html_txt(info->author); |
48 | html_txt(info->author); |
52 | html("</td></tr>\n"); |
49 | html("</td></tr>\n"); |
53 | cgit_free_commitinfo(info); |
50 | cgit_free_commitinfo(info); |
54 | } |
51 | } |
55 | |
52 | |
56 | |
53 | |
57 | void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *path, int pager) |
54 | void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *path, int pager) |
58 | { |
55 | { |
59 | struct rev_info rev; |
56 | struct rev_info rev; |
60 | struct commit *commit; |
57 | struct commit *commit; |
61 | const char *argv[] = {NULL, tip, NULL, NULL, NULL}; |
58 | const char *argv[] = {NULL, tip, NULL, NULL, NULL}; |
62 | int argc = 2; |
59 | int argc = 2; |
|