{! #include "../ui-diff.h" !} {% page cgit_print_commit %} {! char *hex = ctx.qry.oid; if (!hex) { hex = ctx.qry.head; } struct object_id oid; if (repo_get_oid(the_repository, hex, &oid)) { die("Bad object id"); } struct commit *commit = lookup_commit_reference(the_repository, &oid); if (!commit) { die("Bad commit reference"); } struct commitinfo *info = cgit_parse_commit(commit); ctx.page.title = fmtalloc("%s - %s", info->subject, ctx.page.title); !} {! page_start(); !} {! repo_header(); !}
{# Main content #} {! repo_description_panel(); !} {! repo_summary_bar(); !}
{# Commit info box #}
{{ info->author }} {! cgit_print_age_themed(info->committer_date, info->committer_tz, TM_MONTH * 12); !}
{% for struct commit_list *p = commit->parents; p; p = p->next %} {! struct commit *parent = lookup_commit_reference(the_repository, &p->item->object.oid); !} {% if parent %} parent item->object.oid), ctx.qry.vpath); !}" class="font-mono text-blue-500 hover:text-blue-600 hover:underline"> {! short_commit_id(oid_to_hex(&p->item->object.oid)); !} · {% endif %} {% endfor %} commit object.oid), ctx.qry.vpath); !}" class="font-mono text-blue-500 hover:text-blue-600 hover:underline"> {! short_commit_id(oid_to_hex(&commit->object.oid)); !}
{# Diff panel #} {! cgit_print_diff(ctx.qry.oid, NULL, NULL, 0, 0); !}
{! cgit_free_commitinfo(info); !} {! page_end(); !} {% endpage %}