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

From:
Omar Polo <op@omarpolo.com>
Subject:
Re: gotwebd: show id prefix in commit briefs
To:
gameoftrees@openbsd.org, Mark Jamsek <mark@jamsek.com>
Date:
Sun, 18 Aug 2024 16:10:22 +0200

Download raw body.

Thread
looks fine to me, only one nit: you could use {{ printf "%.10s", rc->commit_id }} instead of opening a raw code block and tp_writef(), it boils down to the exact same code but may be nicer.

Il 18 agosto 2024 15:35:39 CEST, Mark Jamsek <mark@jamsek.com> ha scritto:
>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
>