git_infra

Git infra scripts for git.bracken.jp
git clone https://git.bracken.jp/git_infra.git
Log | Files | Refs | LICENSE

commit 5954c9cf28aae78c4177699d7f69fccf067769c2
parent 66f7642052f95bce68f7249db7b6897750218100
Author: Chris Bracken <chris@bracken.jp>
Date:   Tue, 31 Aug 2021 09:50:25 -0700

Don't re-generate index for private repos

Previously, my private repos simply didn't include the stagit
post-receive hook, and therefore weren't indexed.

When using grm to manage repos, all repos implement the stagit
post-receive hook, including private repos. Private repos are tagged
with `stagit-no-index`. This updates the stagit post receive hook to
not re-generate pages when the repo sets this tag.

Diffstat:
Mpost-receive.d/stagit | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/post-receive.d/stagit b/post-receive.d/stagit @@ -61,8 +61,12 @@ find "${repos_root}/." -maxdepth 1 \ > "${www_root}/index.html" # Build the pages. If $cachefile is not present, a full rebuild is performed. -echo "[stagit] Building pages" -stagit -c "$cachefile" "$repo_dir" +if [ ! -e stagit-no-index ]; then + echo "[stagit] Building pages" + stagit -c "$cachefile" "$repo_dir" +else + echo "[stagit] Not building pages: private repo" +fi # use log as index page echo "[stagit] Linking assets"