summaryrefslogtreecommitdiffabout
path: root/ui-commit.c
Side-by-side diff
Diffstat (limited to 'ui-commit.c') (more/less context) (ignore whitespace changes)
-rw-r--r--ui-commit.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/ui-commit.c b/ui-commit.c
index 8019e36..dd36cc0 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -10,4 +10,5 @@
#include "html.h"
#include "ui-shared.h"
+#include "ui-diff.h"
static int files, slots;
@@ -175,4 +176,10 @@ void cgit_print_commit(char *hex)
cgit_print_date(info->committer_date, FMT_LONGDATE);
html("</td></tr>\n");
+ html("<tr><th>commit</th><td colspan='2' class='sha1'>");
+ tmp = sha1_to_hex(commit->object.sha1);
+ cgit_commit_link(tmp, NULL, NULL, ctx.qry.head, tmp);
+ html(" (");
+ cgit_patch_link("patch", NULL, NULL, NULL, tmp);
+ html(")</td></tr>\n");
html("<tr><th>tree</th><td colspan='2' class='sha1'>");
tmp = xstrdup(hex);
@@ -219,8 +226,9 @@ void cgit_print_commit(char *hex)
html("</table>");
html("<div class='diffstat-summary'>");
- htmlf("%d files changed, %d insertions, %d deletions (",
+ htmlf("%d files changed, %d insertions, %d deletions",
files, total_adds, total_rems);
- cgit_diff_link("show diff", NULL, NULL, ctx.qry.head, hex,
- NULL, NULL);
+ cgit_print_diff(ctx.qry.sha1,
+ sha1_to_hex(commit->parents->item->object.sha1),
+ NULL);
html(")</div>");
}