stagit

my fork of stagit that runs this site
git clone git://git.jakekoroman.com/stagit
Log | Files | Refs | README | LICENSE

commit 0c17b9386f58b1f35ddc2d21ed9eea88799c3341
parent d0bc1d349e1f29116d5d8824dd196d94586d61d6
Author: Jake Koroman <jakekoroman@gmail.com>
Date:   Wed, 27 Mar 2024 20:05:06 -0400

added my post-receive script

Diffstat:
Apost-receive | 24++++++++++++++++++++++++
1 file changed, 24 insertions(+), 0 deletions(-)

diff --git a/post-receive b/post-receive @@ -0,0 +1,24 @@ +#!/bin/sh + +# detect git push -f +force=0 +while read -r old new ref; do + hasrevs=$(git rev-list "$old" "^$new" | sed 1q) + if test -n "$hasrevs"; then + force=1 + break + fi +done + +pagedir="/var/www/stagit/{REPO_DIR}" + +# remove commits and .cache on git push -f +if test "$force" = "1"; then + #rm -rf $pagedir/.cache + echo "force is on" +fi + +repodir=$(pwd) +cd $pagedir && stagit -c "$pagedir/.cache" -u "https://git.jakekoroman.xyz/$d/" "$repodir" + +echo "Updated stagit"