From 6f7519c62178247692056774bc188c8c86fd2dac Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 2 Oct 2026 07:26:00 +0300 Subject: ui-log: Add commit SHA column --- ui-log.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ui-log.c b/ui-log.c index ad15a50..5f32aa9 100644 --- a/ui-log.c +++ b/ui-log.c @@ -187,6 +187,7 @@ static void print_commit(struct commit *commit, struct rev_info *revs) int columns = revs->graph ? 4 : 3; struct strbuf graphbuf = STRBUF_INIT; struct strbuf msgbuf = STRBUF_INIT; + char *detail; struct signature_check signature_check; memset(&signature_check, 0, sizeof(signature_check)); @@ -195,6 +196,9 @@ static void print_commit(struct commit *commit, struct rev_info *revs) if (ctx.repo->enable_log_linecount) columns++; + /* SHA */ + columns++; + if (revs->graph) { /* Advance graph until current commit */ while (!graph_next_line(revs->graph, &graphbuf)) { @@ -295,6 +299,13 @@ static void print_commit(struct commit *commit, struct rev_info *revs) htmlf("-%d/" "+%d", rem_lines, add_lines); + /* Should repo_find_unique_abbrev_r be used instead? */ + detail = oid_to_hex(&commit->object.oid); + html(""); + html_txtf("%.7s", detail); + html("\n"); if ((revs->graph && !graph_is_commit_finished(revs->graph)) @@ -511,6 +522,8 @@ void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, char *pattern html("Lines"); columns++; } + html("SHA"); + columns++; html("\n"); if (ofs<0) -- cgit v1.3.1-23-gd82d