commit d9d218838ee1f5f55053cf64f528624d8d2a55c8
Author: Kévin Le Gouguec <kevin.legouguec@gmail.com>
Date: Sat, 13 Dec 2025 00:38:15 +0100
Start tracking things down
Missing:
* libgit & stagit setup (build, installation under .tools)
* repo setup: hook, www remote setup, url file
Diffstat:
3 files changed, 68 insertions(+), 0 deletions(-)
diff --git a/stagit/.tools.env b/stagit/.tools.env
@@ -0,0 +1,19 @@
+# Hey Emacs! -*- shell-script -*- please.
+
+_toolsdir="${BASH_SOURCE[0]%.env}"/install
+
+_toolsadd ()
+{
+ # TODO bash≥4.3: local -n
+ local -r var=$1
+ local -r val="${_toolsdir}"/$2
+
+ local -r old=${!var:-}
+
+ eval "export ${var}=${val}${old:+:${old}}"
+}
+
+_toolsadd PATH bin
+_toolsadd LD_LIBRARY_PATH lib64
+_toolsadd LIBRARY_PATH lib64
+_toolsadd CPATH include
diff --git a/stagit/README.org b/stagit/README.org
@@ -0,0 +1,26 @@
+* File layout
+- HOME/git
+ - REPO
+ - <bare repo content>
+ - hooks
+ - post-receive → ../../.tools/hooks/post-receive
+ - .tools
+ - hooks
+ - post-receive
+ - .tools.env
+- WWW/git.DOMAIN
+ - index.html
+ - REPO
+ - <bare repo content>
+ - <stagit content>
+ - url
+* post-receive
+- git push www
+- cd WWW/git.DOMAIN/REPO
+- update-server-info
+- stagit
+- stagit-index
+* HTTP server config
+https://manual.uberspace.de/web-documentroot/
+https://a3nm.net/blog/cgit_stagit.html
+https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html#rewriterule
diff --git a/stagit/post-receive b/stagit/post-receive
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+set -eu
+
+wwwdir=$(git remote get-url www)
+hooksdir=$(dirname "$(realpath "$0")")
+toolsdir=$(dirname "${hooksdir}")
+toolsenv=${toolsdir}.env
+
+. "${toolsenv}"
+
+v () {( set -x ; "$@" )}
+
+v git push --all --force www
+
+cd "${wwwdir}"
+v git update-server-info
+v stagit ${PWD}
+
+cd ..
+# TODO bash≥4.4: readarray -d '' < <(dirname -z */HEAD)
+v find -name HEAD -exec dirname -z '{}' '+' |
+ v xargs -t0 stagit-index > index.html