From 272ba15d592db92dec57a42dfeedb1d4a0d734bb Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 2 Oct 2026 07:26:28 +0300 Subject: ui-log: Show commit detail in commit message title --- ui-log.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'ui-log.c') diff --git a/ui-log.c b/ui-log.c index 5f32aa9..c9634c1 100644 --- a/ui-log.c +++ b/ui-log.c @@ -181,6 +181,29 @@ static int show_commit(struct commit *commit, struct rev_info *revs) return found; } +// Taken from ui-blame.c:emit_suspect_detail() +static char *emit_commit_detail(struct commitinfo *info) { + struct strbuf detail = STRBUF_INIT; + + strbuf_addf(&detail, "author %s", info->author); + if (!ctx.cfg.noplainemail) + strbuf_addf(&detail, " %s", info->author_email); + strbuf_addf(&detail, " %s\n", + show_date(info->author_date, info->author_tz, + cgit_date_mode(DATE_ISO8601))); + + strbuf_addf(&detail, "committer %s", info->committer); + if (!ctx.cfg.noplainemail) + strbuf_addf(&detail, " %s", info->committer_email); + strbuf_addf(&detail, " %s\n\n", + show_date(info->committer_date, info->committer_tz, + cgit_date_mode(DATE_ISO8601))); + + strbuf_addstr(&detail, info->subject); + + return strbuf_detach(&detail, NULL); +} + static void print_commit(struct commit *commit, struct rev_info *revs) { struct commitinfo *info; @@ -253,8 +276,10 @@ static void print_commit(struct commit *commit, struct rev_info *revs) strlcpy(info->subject + i, wrap_symbol, subject_len - i + 1); } } - cgit_commit_link(info->subject, NULL, NULL, ctx.qry.head, + detail = emit_commit_detail(info); + cgit_commit_link(info->subject, detail, NULL, ctx.qry.head, oid_to_hex(&commit->object.oid), ctx.qry.vpath); + free(detail); show_commit_decorations(commit); html(""); cgit_open_filter(ctx.repo->email_filter, info->author_email, "log"); -- cgit v1.3.1-23-gd82d