\n");
html("author | ");
html_txt(info->author);
html(" ");
html_txt(info->author_email);
html(" | ");
- cgit_print_date(info->author_date, FMT_LONGDATE);
+ cgit_print_date(info->author_date, FMT_LONGDATE, ctx.cfg.local_time);
html(" |
\n");
html("committer | ");
html_txt(info->committer);
html(" ");
html_txt(info->committer_email);
html(" | ");
- cgit_print_date(info->committer_date, FMT_LONGDATE);
+ cgit_print_date(info->committer_date, FMT_LONGDATE, ctx.cfg.local_time);
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,
- cgit_query_head, tmp, NULL);
+ ctx.qry.head, tmp, NULL);
html(" |
\n");
for (p = commit->parents; p ; p = p->next) {
parent = lookup_commit_reference(p->item->object.sha1);
@@ -196,23 +69,20 @@ void cgit_print_commit(const char *hex)
continue;
}
html("parent | "
- ""
- "%s (diff) |
");
+ "");
+ cgit_commit_link(sha1_to_hex(p->item->object.sha1), NULL, NULL,
+ ctx.qry.head, sha1_to_hex(p->item->object.sha1));
+ html(" (");
+ cgit_diff_link("diff", NULL, NULL, ctx.qry.head, hex,
+ sha1_to_hex(p->item->object.sha1), NULL);
+ html(") | ");
+ parents++;
}
- if (cgit_repo->snapshots) {
- htmlf("download | %s |
", filename);
+ if (ctx.repo->snapshots) {
+ html("download | ");
+ cgit_print_snapshot_links(ctx.qry.repo, ctx.qry.head,
+ hex, ctx.repo->snapshots);
+ html(" |
");
}
html("
\n");
html("");
@@ -221,21 +91,12 @@ void cgit_print_commit(const char *hex)
html("
");
html_txt(info->msg);
html("
");
- if (!(commit->parents && commit->parents->next && commit->parents->next->next)) {
- html("");
- html("
");
- max_changes = 0;
- cgit_diff_commit(commit, inspect_filepair);
- for(i = 0; i");
- html("");
- htmlf("%d files changed, %d insertions, %d deletions (",
- files, total_adds, total_rems);
- query = fmt("h=%s", hex);
- html_link_open(cgit_pageurl(cgit_query_repo, "diff", query), NULL, NULL);
- html("show diff)");
- html("
");
+ if (parents < 3) {
+ if (parents)
+ tmp = sha1_to_hex(commit->parents->item->object.sha1);
+ else
+ tmp = NULL;
+ cgit_print_diff(ctx.qry.sha1, tmp, NULL);
}
cgit_free_commitinfo(info);
}