Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit6f7519c62178247692056774bc188c8c86fd2dac (patch)
Author
 Syndamia <kamen@syndamia.com>
2026-10-02 07:26:00 +0300
Committer
 Syndamia <kamen@syndamia.com>
2026-10-02 07:26:00 +0300
Files72ee2e77c14ea4e017a44da89f66050785b47c60
cgit-6f7519c62178247692056774bc188c8c86fd2dac.tar
cgit-6f7519c62178247692056774bc188c8c86fd2dac.tar.gz
cgit-6f7519c62178247692056774bc188c8c86fd2dac.zip
Parent2c8b8462fc5d0266b08eed0c868cab32360679c3 (diff)
ui-log: Add commit SHA column
1 files changed, 13 insertions, 0 deletions
-rw-r--r--ui-log.c13
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("</td><td><span class='deletions'>-%d</span>/"
"<span class='insertions'>+%d</span>", rem_lines, add_lines);
+ /* Should repo_find_unique_abbrev_r be used instead? */
+ detail = oid_to_hex(&commit->object.oid);
+ html("</td><td title='");
+ html_txtf("%s", detail);
+ html("'>");
+ html_txtf("%.7s", detail);
+
html("</td></tr>\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("<th class='left'>Lines</th>");
columns++;
}
+ html("<th class='left'>SHA</th>");
+ columns++;
html("</tr>\n");
if (ofs<0)