X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/a4d1ca1dc6ff8171694d9e2280b6075a1beced0c..9000bbf865cb3578ba5ed3810dc44253cb46ec7f:/ui-commit.c
diff --git a/ui-commit.c b/ui-commit.c
index 8019e36..12a96fb 100644
--- a/ui-commit.c
+++ b/ui-commit.c
@@ -9,6 +9,7 @@
#include "cgit.h"
#include "html.h"
#include "ui-shared.h"
+#include "ui-diff.h"
static int files, slots;
static int total_adds, total_rems, max_changes;
@@ -174,6 +175,12 @@ void cgit_print_commit(char *hex)
html("
");
cgit_print_date(info->committer_date, FMT_LONGDATE);
html(" | \n");
+ html("| commit | ");
+ 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(") |
\n");
html("| tree | ");
tmp = xstrdup(hex);
cgit_tree_link(sha1_to_hex(commit->tree->object.sha1), NULL, NULL,
@@ -218,11 +225,12 @@ void cgit_print_commit(char *hex)
print_fileinfo(&items[i]);
html("");
html(" ");
- 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);
- html(") ");
+ html("");
+ cgit_print_diff(ctx.qry.sha1,
+ sha1_to_hex(commit->parents->item->object.sha1),
+ NULL);
}
cgit_free_commitinfo(info);
}
|
|---|