diff --git a/_vcsh b/_vcsh index 926dbc50bd11108da3bcd4f3354d8071eb80d02e..c77f2afb082c0e1d1d595723ee011bde18972c6a 100644 --- a/_vcsh +++ b/_vcsh @@ -43,6 +43,10 @@ function _vcsh-list-tracked-by () { (( CURRENT == 2 )) && __vcsh_repositories } +function _vcsh-pull () { + _nothing +} + function _vcsh-rename () { (( CURRENT == 2 )) && __vcsh_repositories (( CURRENT == 3 )) && _message "new repository name" @@ -88,6 +92,7 @@ function _vcsh () { "list:list all local vcsh repositories" "list-tracked:list all files tracked by vcsh" "list-tracked-by:list files tracked by a repository" + "pull:pull from all vcsh remotes" "rename:rename a repository" "run:run command with <\$GIT_DIR> and <\$GIT_WORK_TREE> set" "upgrade:upgrade repository to currently recommended settings" diff --git a/doc/vcsh.1.ronn b/doc/vcsh.1.ronn index 9f620674a081dc0ed3095a39bfb838b2201f8d91..1592d077ff9d36dfb6b56504a8fae7a8c6227a2e 100644 --- a/doc/vcsh.1.ronn +++ b/doc/vcsh.1.ronn @@ -21,6 +21,8 @@ vcsh(1) - Version Control System for $HOME - multiple Git repositories in $HOME `vcsh` list-tracked-by <repo> +`vcsh` pull + `vcsh` rename <repo> <newname> `vcsh` run <repo> <shell command> @@ -98,6 +100,9 @@ an interactive user. * list-tracked-by: List files tracked by a repository. +* pull: + Pull from all vcsh remotes. + * rename: Rename a repository. diff --git a/vcsh b/vcsh index d7781009388e59f43638adbdbe29f63aacbe8800..e6b93778e7f928f6eda9aabfc186207b178ec556 100755 --- a/vcsh +++ b/vcsh @@ -100,6 +100,7 @@ help() { list-tracked List all files tracked by vcsh list-tracked-by \\ <repo> List files tracked by a repository + pull Pull from all vcsh remotes rename <repo> \\ <newname> Rename repository run <repo> \\ @@ -222,6 +223,17 @@ list_tracked_by() { git ls-files | sort -u } +pull() { + hook pre-pull + for VCSH_REPO_NAME in $(list); do + echo -n "$VCSH_REPO_NAME: " + export GIT_DIR="$VCSH_REPO_D/$VCSH_REPO_NAME.git" + use + git pull + done + hook post-pull +} + rename() { git_dir_exists [ -d "$GIT_DIR_NEW" ] && fatal "'$GIT_DIR_NEW' exists" 54 @@ -328,7 +340,8 @@ elif [ "$1" = 'delete' ] || [ "$VCSH_COMMAND" = 'run' ] && shift 2 [ "$VCSH_COMMAND" = 'write-gitignore' ] elif [ "$1" = 'list' ] || - [ "$1" = 'list-tracked' ]; then + [ "$1" = 'list-tracked' ] || + [ "$1" = 'pull' ]; then export VCSH_COMMAND="$1" elif [ -n "$2" ]; then export VCSH_COMMAND='run'