logo

utils

~/.local/bin tools and git-hooks git clone https://hacktivis.me/git/utils.git
commit: ef5ee243efa710debb038ff51b29e0f7822a1a4e
parent 7ab485dcaac600033dd8e251b15679040e425caa
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue,  9 May 2017 01:50:22 +0200

git-hooks/post-update: Copy from blog, with modifications

Diffstat:

Agit-hooks/post-update21+++++++++++++++++++++
1 file changed, 21 insertions(+), 0 deletions(-)

diff --git a/git-hooks/post-update b/git-hooks/post-update @@ -0,0 +1,21 @@ +#!/bin/sh +repo=$(pwd) +update_f=' * Updating %s…' +is_ok(){ echo ' [OK]'; } + +printf "$update_f" 'Garbage Collector' +git gc && is_ok + +printf "$update_f" info +git update-server-info && is_ok + +printf "$update_f" stagit +cd "$(pwd | sed s/.git$//)" && stagit -c "$repo.cache" "$repo" && 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" + exec $i +done