]> git.kaiwu.me - haproxy.git/commitdiff
DEV: patchbot: only display the first 8 chars of the commit id
authorWilly Tarreau <w@1wt.eu>
Mon, 6 Jul 2026 14:21:33 +0000 (16:21 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 7 Jul 2026 08:58:38 +0000 (10:58 +0200)
The commit id column doesn't need to show more than 8 chars to stay
unambiguous within a single page, and longer ids needlessly widen the
table. Everything that is keyed on the id (the commit link, the row's
name= attribute and the cid[] JS array) keeps the full id produced by
the pipeline, whatever its length, so this is a display-only change
which also gets us ready for a possible future move of the pipeline to
longer ids.

dev/patchbot/scripts/post-ai.sh

index 654a6a161cf6450bc636c8b0fad0fad0097fb5a5..8367912fa1d4905bbc0f1b04109b5f1ae54b6c56 100755 (executable)
@@ -404,7 +404,10 @@ for patch in "${PATCHES[@]}"; do
 
         echo -n "<TD nowrap align=center ${bkp[$cid]:+style='background-color:${BG_B}'}>$seq_num<BR/>"
         echo -n "<input type='radio' name='review' id='rv_$seq_num' onclick='updt($seq_num,\"r\");' ${do_check:+checked} title='Start review here'/></TD>"
-        echo -n "<TD nowrap ${bkp[$cid]:+style='background-color:${BG_B}'}><tt><a href='${GITURL}${cid}'>$cid</a></tt>${date:+<br/><small style='font-weight:normal'>$date</small>}</TD>"
+        # only the first 8 chars of the commit id are displayed (enough to be
+        # unambiguous on one page); everything keyed (href, name=, cid[])
+        # carries the full id produced by the pipeline, whatever its length.
+        echo -n "<TD nowrap ${bkp[$cid]:+style='background-color:${BG_B}'}><tt><a href='${GITURL}${cid}'>${cid:0:8}</a></tt>${date:+<br/><small style='font-weight:normal'>$date</small>}</TD>"
         echo -n "<TD nowrap><a href='${GITURL}${cid}'>${pnum:+$pnum }$subj</a>${author:+<br/><div align=right><small style='font-weight:normal'>$author</small></div>}</TD>"
         echo -n "<TD nowrap align=center>"
         echo -n "<input type='radio' onclick='updt($seq_num,\"n\");' id='bt_${seq_num}_n' class='n' name='$cid' value='n' title='Drop' $(         [ "$verdict" != no ]     || echo -n checked) />"