From d8a045c91469b1d121b8fd14dffaa367b194831d Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sun, 6 Sep 2026 21:46:52 -1000 Subject: Clean up the whole tree --- source/ui-commit.c | 42 +++++++++++++++--------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) (limited to 'source/ui-commit.c') diff --git a/source/ui-commit.c b/source/ui-commit.c index a35fcec..6055509 100644 --- a/source/ui-commit.c +++ b/source/ui-commit.c @@ -23,8 +23,8 @@ // many parents or more is shown without a diff at all. #define OCTOPUS_PARENTS 3 -static void print_ident_row(const char *role, const char *name, - const char *email, timestamp_t date, int tz) +static void print_ident_row(const char *role, const char *name, const char *email, + timestamp_t date, int tz) { htmlf("%s", role); cgit_open_filter(ctx.repo->email_filter, email, "commit"); @@ -41,8 +41,7 @@ static void print_ident_row(const char *role, const char *name, html("\n"); } -static int print_parent_rows(struct commit *commit, const char *rev, - const char *prefix) +static int print_parent_rows(struct commit *commit, const char *rev, const char *prefix) { struct commit_list *p; struct commit *parent; @@ -50,24 +49,20 @@ static int print_parent_rows(struct commit *commit, const char *rev, int parents = 0; for (p = commit->parents; p; p = p->next) { - parent = lookup_commit_reference(the_repository, - &p->item->object.oid); + parent = lookup_commit_reference(the_repository, &p->item->object.oid); if (!parent) { html(""); cgit_print_error("Error reading parent commit"); html("\n"); continue; } - html("parent" - ""); + html("parent"); parent_hex = label = oid_to_hex(&p->item->object.oid); if (ctx.repo->enable_subject_links) label = cgit_parse_commit(parent)->subject; - cgit_commit_link(label, NULL, NULL, ctx.qry.head, parent_hex, - prefix); + cgit_commit_link(label, NULL, NULL, ctx.qry.head, parent_hex, prefix); html(" ("); - cgit_diff_link("diff", NULL, NULL, ctx.qry.head, rev, - oid_to_hex(&p->item->object.oid), prefix); + cgit_diff_link("diff", NULL, NULL, ctx.qry.head, rev, oid_to_hex(&p->item->object.oid), prefix); html(")\n"); parents++; } @@ -95,14 +90,12 @@ void cgit_print_commit(char *hex, const char *prefix) hex = ctx.qry.head; if (repo_get_oid(the_repository, hex, &oid)) { - cgit_print_error_page(400, "Bad Request", - "Bad object id: %s", hex); + cgit_print_error_page(400, "Bad Request", "Bad object id: %s", hex); return; } commit = lookup_commit_reference(the_repository, &oid); if (!commit) { - cgit_print_error_page(404, "Not Found", - "Bad commit reference: %s", hex); + cgit_print_error_page(404, "Not Found", "Bad commit reference: %s", hex); return; } info = cgit_parse_commit(commit); @@ -116,15 +109,13 @@ void cgit_print_commit(char *hex, const char *prefix) cgit_print_diff_ctrls(); html("\n"); - print_ident_row("author", info->author, info->author_email, - info->author_date, info->author_tz); + print_ident_row("author", info->author, info->author_email, info->author_date, info->author_tz); print_ident_row("committer", info->committer, info->committer_email, - info->committer_date, info->committer_tz); + info->committer_date, info->committer_tz); html("\n"); @@ -135,12 +126,10 @@ void cgit_print_commit(char *hex, const char *prefix) html("\n"); @@ -169,8 +158,7 @@ void cgit_print_commit(char *hex, const char *prefix) if (parents < OCTOPUS_PARENTS) { if (parents) - first_parent = - oid_to_hex(&commit->parents->item->object.oid); + first_parent = oid_to_hex(&commit->parents->item->object.oid); else first_parent = NULL; cgit_print_diff(ctx.qry.oid, first_parent, prefix, 0, 0); -- cgit v2.8.0
commit"); commit_hex = oid_to_hex(&commit->object.oid); - cgit_commit_link(commit_hex, NULL, NULL, ctx.qry.head, commit_hex, - prefix); + cgit_commit_link(commit_hex, NULL, NULL, ctx.qry.head, commit_hex, prefix); html(" ("); cgit_patch_link("patch", NULL, NULL, NULL, commit_hex, prefix); html(")
tree"); tree_rev = xstrdup(hex); - cgit_tree_link(oid_to_hex(get_commit_tree_oid(commit)), NULL, NULL, - ctx.qry.head, tree_rev, NULL); + cgit_tree_link(oid_to_hex(get_commit_tree_oid(commit)), NULL, NULL, ctx.qry.head, tree_rev, NULL); if (prefix) { html(" /"); - cgit_tree_link(prefix, NULL, NULL, ctx.qry.head, tree_rev, - prefix); + cgit_tree_link(prefix, NULL, NULL, ctx.qry.head, tree_rev, prefix); } free(tree_rev); html("