X-Git-Url: https://git.madduck.net/code/vcsh.git/blobdiff_plain/45fc3eb10b5bf03031edf96d1576bba77a0aaa96..a38e2f1749a80b9571d53a2328275b4741fe38e2:/vcsh?ds=inline diff --git a/vcsh b/vcsh index d778100..2764d3d 100755 --- a/vcsh +++ b/vcsh @@ -100,6 +100,7 @@ help() { 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 repository run \\ @@ -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 @@ -320,15 +332,16 @@ elif [ "$1" = 'delete' ] || [ "$1" = 'write-gitignore' ]; then [ -z $2 ] && fatal "$1: please specify repository to work on" 1 [ "$1" = 'rename' -a -z "$3" ] && fatal "$1: please specify a target name" 1 - [ "$1" = 'run' -a -z "$3" ] && fatal "$1: please specify a command" 1 + [ "$1" = 'run' -a -z "$3" ] && fatal "$1: please specify a command" 1 export VCSH_COMMAND="$1" export VCSH_REPO_NAME="$2" export GIT_DIR="$VCSH_REPO_D/$VCSH_REPO_NAME.git" - [ "$VCSH_COMMAND" = 'rename' ] && export GIT_DIR_NEW="$VCSH_REPO_D/$3.git" - [ "$VCSH_COMMAND" = 'run' ] && shift 2 + [ "$VCSH_COMMAND" = 'rename' ] && export GIT_DIR_NEW="$VCSH_REPO_D/$3.git" + [ "$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'