commit: 6dc013c60bfa73be20a7520e1e32186e9e170594
parent: a44338cc0b08192d45c6e1926ec52e13c5db85e6
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Wed, 28 Jun 2017 08:36:56 +0200
git-hooks/post-update: SPOT rule
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/git-hooks/post-update b/git-hooks/post-update
@@ -1,5 +1,5 @@
#!/bin/sh
-repo=$(pwd)
+base=$(pwd|sed 's/.git//')
update_f=' * Updating %s…'
is_ok(){ echo ' [OK]'; }
@@ -9,13 +9,16 @@ git gc && is_ok
printf "$update_f" info
git update-server-info && is_ok
+printf "$update_f" work
+GIT_INDEX_FILE="${base}.work/.git/index" git --work-tree="${base}.work" --git-dir="${base}.git" checkout -f && is_ok
+
printf "$update_f" stagit
-cd "$(pwd | sed s/.git$//)" && stagit -c "$repo.cache" "$repo" && is_ok
+mkdir ${base} && cd "${base}" && stagit -c "${base}.cache" "${base}.git" && is_ok
printf "$update_f" stagit-index
cd /git && stagit-index *.git > /git/index.html && is_ok
for i in post-update.*; do
- printf "$update_f" "running other hook: $i"
+ printf "$update_f" "$i"
exec $i
done