author | Lars Hjemli <hjemli@gmail.com> | 2008-11-29 17:58:31 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2008-11-29 17:58:31 (UTC) |
commit | 951f550b60befeacd7334aebd64c891e72be5ac4 (patch) (unidiff) | |
tree | 334c9bff80857a27a0daca9a0f78c760bb4be6f3 | |
parent | 0274b57d55a12ed38259757dbfae96b79cfa2e0b (diff) | |
download | cgit-951f550b60befeacd7334aebd64c891e72be5ac4.zip cgit-951f550b60befeacd7334aebd64c891e72be5ac4.tar.gz cgit-951f550b60befeacd7334aebd64c891e72be5ac4.tar.bz2 |
ui-log: (ab)use extra columns for commit message when showmsg=1
If the commit message has extra long lines it's better to use the author/
files/lines columns to show those lines than to push the columns of screen
and force the users to hscroll.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-log.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -32,12 +32,13 @@ void inspect_files(struct diff_filepair *pair) | |||
32 | } | 32 | } |
33 | 33 | ||
34 | void print_commit(struct commit *commit) | 34 | void print_commit(struct commit *commit) |
35 | { | 35 | { |
36 | struct commitinfo *info; | 36 | struct commitinfo *info; |
37 | char *tmp; | 37 | char *tmp; |
38 | int cols = 2; | ||
38 | 39 | ||
39 | info = cgit_parse_commit(commit); | 40 | info = cgit_parse_commit(commit); |
40 | html("<tr><td>"); | 41 | html("<tr><td>"); |
41 | tmp = fmt("id=%s", sha1_to_hex(commit->object.sha1)); | 42 | tmp = fmt("id=%s", sha1_to_hex(commit->object.sha1)); |
42 | tmp = cgit_pageurl(ctx.repo->url, "commit", tmp); | 43 | tmp = cgit_pageurl(ctx.repo->url, "commit", tmp); |
43 | html_link_open(tmp, NULL, NULL); | 44 | html_link_open(tmp, NULL, NULL); |
@@ -63,21 +64,21 @@ void print_commit(struct commit *commit) | |||
63 | html("</td><td>"); | 64 | html("</td><td>"); |
64 | htmlf("-%d/+%d", rem_lines, add_lines); | 65 | htmlf("-%d/+%d", rem_lines, add_lines); |
65 | } | 66 | } |
66 | } | 67 | } |
67 | html("</td></tr>\n"); | 68 | html("</td></tr>\n"); |
68 | if (ctx.qry.showmsg) { | 69 | if (ctx.qry.showmsg) { |
69 | html("<tr class='nohover'><td></td><td><div class='commit-msg'>"); | ||
70 | html_txt(info->msg); | ||
71 | html("</div><br/></td><td></td>"); | ||
72 | if (ctx.repo->enable_log_filecount) { | 70 | if (ctx.repo->enable_log_filecount) { |
73 | html("<td></td>"); | 71 | cols++; |
74 | if (ctx.repo->enable_log_linecount) | 72 | if (ctx.repo->enable_log_linecount) |
75 | html("<td></td>"); | 73 | cols++; |
76 | } | 74 | } |
77 | html("</tr>\n"); | 75 | htmlf("<tr class='nohover'><td></td><td colspan='%d'><div class='commit-msg'>", |
76 | cols); | ||
77 | html_txt(info->msg); | ||
78 | html("</div><br/></td></tr>\n"); | ||
78 | } | 79 | } |
79 | cgit_free_commitinfo(info); | 80 | cgit_free_commitinfo(info); |
80 | } | 81 | } |
81 | 82 | ||
82 | 83 | ||
83 | void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern, | 84 | void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern, |