X-Git-Url: https://git.madduck.net/code/vcsh.git/blobdiff_plain/c189913f6c8eebaa6f2dcfcd666ccc4b17ec6c26..bd783af3498a856d27eb0aa616dd09f6b2215fda:/vcsh diff --git a/vcsh b/vcsh index bf97cbf..f922cea 100755 --- a/vcsh +++ b/vcsh @@ -115,9 +115,9 @@ git_dir_exists() { } hook() { - for f in $VCSH_HOOK_D/$1* $VCSH_HOOK_D/$VCSH_REPO_NAME.$1*; do - [ -x "$f" ] || continue - "$f" + for hook in $VCSH_HOOK_D/$1* $VCSH_HOOK_D/$VCSH_REPO_NAME.$1*; do + [ -x "$hook" ] || continue + "$hook" done } @@ -167,11 +167,13 @@ run() { } setup() { + hook pre-setup use git config core.worktree "$GIT_WORK_TREE" git config core.excludesfile ".gitignore.d/$VCSH_REPO_NAME" git config vcsh.vcsh 'true' [ -e "$VCSH_BASE/.gitignore.d/$VCSH_REPO_NAME" ] && git add -f "$VCSH_BASE/.gitignore.d/$VCSH_REPO_NAME" + hook post-setup } use() { @@ -281,5 +283,7 @@ done verbose "$VCSH_COMMAND begin" export VCSH_COMMAND=$(echo $VCSH_COMMAND | sed 's/-/_/g') +hook pre-command $VCSH_COMMAND +hook post-command verbose "$VCSH_COMMAND end, exiting"