From: Richard Hartmann Date: Fri, 19 Jul 2013 06:16:45 +0000 (+0200) Subject: Merge branch 'retire' X-Git-Url: https://git.madduck.net/code/vcsh.git/commitdiff_plain/41f68579e858270d2b97deed93927922d46dde6d?hp=6faa6bcc4756b2d6fe305081bbfd6321b21ae9fe Merge branch 'retire' Conflicts: doc/hooks --- diff --git a/doc/hooks b/doc/hooks index 1a93fda..e7fdb94 100644 --- a/doc/hooks +++ b/doc/hooks @@ -1,4 +1,13 @@ Available hooks are: + +* pre-clone +* post-clone +* post-clone-retired + Use this if you need to operate on different git repositories after cloning. + This hook can be useful if your configuration needs some remote + repositories, but you do not want to include it into your vcsh + repository. For instance, if you use vim plugins manager (vundle, + NeoBundle), zsh configuration frameworks (oh-my-zsh, prezto), etc. * pre-command * post-command * pre-enter diff --git a/doc/vcsh.1.ronn b/doc/vcsh.1.ronn index 79a4063..b195707 100644 --- a/doc/vcsh.1.ronn +++ b/doc/vcsh.1.ronn @@ -81,6 +81,9 @@ an interactive user. * clone: Clone an existing repository. + If you need to clone a bundle of repositories, look into the + `post-clone-retired` hook. + * delete: Delete an existing repository. diff --git a/vcsh b/vcsh index 175a9d1..ced6909 100755 --- a/vcsh +++ b/vcsh @@ -153,6 +153,8 @@ clone() { Once this situation has been resolved, run 'vcsh run $VCSH_REPO_NAME git pull' to finish cloning.\n" 17 git merge origin/master hook post-clone + retire + hook post-clone-retired } delete() { @@ -246,6 +248,11 @@ push() { hook post-push } +retire() { + unset GIT_WORK_TREE + unset VCSH_DIRECTORY +} + rename() { git_dir_exists [ -d "$GIT_DIR_NEW" ] && fatal "'$GIT_DIR_NEW' exists" 54