From a4bb1bf0342f3414f83c2cc4635c6ab13fffa93e Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Thu, 16 Jul 2026 14:50:26 -1000 Subject: Add a post-update hook for HTTP clones cgit's built-in clone support speaks the dumb HTTP protocol, which serves static files that only `git update-server-info` refreshes. Without this hook a clone can miss refs pushed after the repository was created. --- examples/hooks/post-update.update-server-info | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 examples/hooks/post-update.update-server-info diff --git a/examples/hooks/post-update.update-server-info b/examples/hooks/post-update.update-server-info new file mode 100755 index 0000000..d499ce5 --- /dev/null +++ b/examples/hooks/post-update.update-server-info @@ -0,0 +1,18 @@ +#!/bin/sh +# +# Example hook that keeps cgit's dumb HTTP clone data current. +# +# cgit can serve "git clone" over HTTP by itself using the dumb protocol, +# which is on by default through enable-http-clone. The dumb protocol +# reads a few static files that git refreshes only when you run +# "git update-server-info", so without this hook a fresh push can leave a +# clone unable to see the new refs and objects. +# +# You do not need this when you clone through git-http-backend (the smart +# protocol) or over ssh or git://. It matters only when cgit itself is the +# clone endpoint. +# +# To install it, copy or link this file to "hooks/post-update" in each +# repository and make sure it is executable. +# +exec git update-server-info -- cgit v2.8.0