diff options
| Commit | 272ba15d592db92dec57a42dfeedb1d4a0d734bb (patch) | |
|---|---|---|
| Author | 2026-10-02 07:26:28 +0300 | |
| Committer | 2026-10-02 07:26:28 +0300 | |
| Files | 2639623079d2085b440a4af02b6bdc4d916d72ab /ui-log.c | |
| cgit-272ba15d592db92dec57a42dfeedb1d4a0d734bb.tar cgit-272ba15d592db92dec57a42dfeedb1d4a0d734bb.tar.gz cgit-272ba15d592db92dec57a42dfeedb1d4a0d734bb.zip | ||
| Parent | 6f7519c62178247692056774bc188c8c86fd2dac (diff) | |
ui-log: Show commit detail in commit message title
1 files changed, 26 insertions, 1 deletions
| -rw-r--r-- | ui-log.c | 27 |
@@ -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("</td><td>"); cgit_open_filter(ctx.repo->email_filter, info->author_email, "log"); |
