logo

utils

~/.local/bin tools and git-hooks
commit: b00980f2af3e82c0d6c358d0ad00b4a534c1e861
parent: 522f92292e2a3ee9bfa00d31bef128b29354b828
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue, 17 Apr 2018 01:29:39 +0200

git-hooks: Move stagit specific parts to a dedicated file

Diffstat:

Agit-hooks/.post-update.swp0
Mgit-hooks/post-update6------
Agit-hooks/post-update.stagit10++++++++++
3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/git-hooks/.post-update.swp b/git-hooks/.post-update.swp Binary files differ. diff --git a/git-hooks/post-update b/git-hooks/post-update @@ -12,12 +12,6 @@ git update-server-info && is_ok printf "$update_f" work mkdir -p "${base}.work/.git" && GIT_INDEX_FILE="${base}.work/.git/index" git --work-tree="${base}.work" --git-dir="${base}.git" checkout -f && is_ok -printf "$update_f" stagit -mkdir -p ${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 ${base}.git/hooks/post-update.*; do [[ -x $i ]] && echo "${PS4:-+}${i}" && exec $i done diff --git a/git-hooks/post-update.stagit b/git-hooks/post-update.stagit @@ -0,0 +1,10 @@ +#!/bin/sh +base=$(pwd|sed 's|\.git$||') +update_f=' * Updating %s…' +is_ok(){ echo ' [OK]'; } + +printf "$update_f" stagit +mkdir -p ${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