"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Mark Jamsek <mark@jamsek.com>
Subject:
gotwebd: show id prefix in commit briefs
To:
gameoftrees@openbsd.org
Date:
Sun, 18 Aug 2024 23:35:39 +1000

Download raw body.

Thread
This is a small change to display a prefix of the commit id in the
commit briefs. You can see what it looks like here:
https://git.bsdbox.org/?action=summary&path=got.git

I find it convenient to have this information on the commit briefs page.


M  gotwebd/files/htdocs/gotwebd/gotweb.css  |  8+  1-
M  gotwebd/pages.tmpl                       |  7+  0-

2 files changed, 15 insertions(+), 1 deletion(-)

commit - 09d38fee11b9a19a2baef6995366389723745baa
commit + f2b8247373fbd72acc82506cae0796e7bf2c7be6
blob - 0396f8f393157184209c75b979ff008558821c57
blob + d58e49303616a5d26897f57e773f0b3772da1554
--- gotwebd/files/htdocs/gotwebd/gotweb.css
+++ gotwebd/files/htdocs/gotwebd/gotweb.css
@@ -173,7 +173,7 @@ header.subtitle h2 {
 	flex-grow: 0;
 	flex-shrink: 0;
 }
-.briefs_age, .briefs_author {
+.briefs_age, .briefs_author, .briefs_id {
 	display: inline-block;
 	vertical-align: middle;
 }
@@ -189,6 +189,13 @@ header.subtitle h2 {
 	width: 8.5em;
 	font-style: italic;
 }
+.briefs_id {
+	padding-top: 5px;
+	padding-bottom: 5px;
+	width: 8.5em;
+	font-family: monospace;
+	font-size: 14px;
+}
 .briefs_log {
 	padding-left: 10px;
 	padding-right: 10px;
blob - 7e3a469f9bb4c106b37b9e2d3f14cb5ec223d67b
blob + 88d466006c3f9cc20c0947b4833ad8808e0f96e2
--- gotwebd/pages.tmpl
+++ gotwebd/pages.tmpl
@@ -396,6 +396,13 @@ nextsep(char *s, char **t)
           {{ render datetime(tp, rc->committer_time, TM_DIFF) }}
         </span>
         {{" "}}
+        <span class='briefs_id'>
+          {!
+		if (tp_writef(tp, "%.10s", rc->commit_id) == -1)
+			return -1;
+          !}
+        </span>
+        {{" "}}
         <span class="briefs_author">
           {{ rc->committer }}
         </span>


-- 
Mark Jamsek <https://bsdbox.org>
GPG: F2FF 13DE 6A06 C471 CA80  E6E2 2930 DC66 86EE CF68