commit 4d241afb1dae27b45d2127f3d4e992ca250dc277
parent d70c5dcceadb579de140acb04aa76d7d9c8d5e03
Author: Chris Bracken <chris@bracken.jp>
Date: Wed, 11 Aug 2021 16:39:36 +0000
Use git-daemon-export-ok to indicate public repos
Since the presence of this file is already used by the git daemon to
determine whether or not a repo should be served publicly, we re-use it
to determine which repos should be included in the index of public
sites.
Diffstat:
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/post-receive.d/stagit b/post-receive.d/stagit
@@ -5,7 +5,7 @@ export LC_CTYPE="en_US.UTF-8"
# HTML root directory into which stagit will write.
www_root="/jails/git_bracken_jp/usr/local/www/stagit"
-# Hooks are called from the repo directory.
+# Hooks are called from the repo directory.
repo_dir=$(pwd)
# The stagit cache file.
@@ -49,14 +49,14 @@ fi
# Generate the index page.
# Any repo containing a stagit-no-index file will be skipped.
echo "[stagit] Building repo index"
-find "${repos_root}/." -maxdepth 1 \
- -type d \
- -name "*.git" \
- -exec test ! -e "{}/stagit-no-index" \; \
- -print \
- | sort -f \
- | sed -e 's/"/"\\""/g' -e 's/.*/"&"/' \
- | xargs stagit-index \
+find "${repos_root}/." -maxdepth 1 \
+ -type d \
+ -name "*.git" \
+ -exec test -e "{}/git-daemon-export-ok" \; \
+ -print \
+ | sort -f \
+ | sed -e 's/"/"\\""/g' -e 's/.*/"&"/' \
+ | xargs stagit-index \
> "${www_root}/index.html"
# Build the pages. If $cachefile is not present, a full rebuild is performed.