X-Git-Url: https://git.madduck.net/code/vcsh.git/blobdiff_plain/45fc3eb10b5bf03031edf96d1576bba77a0aaa96..e15ded9bbd12705f7cb81e4ddb9c5f81fdb03b16:/vcsh?ds=sidebyside diff --git a/vcsh b/vcsh index d778100..15ea098 100755 --- a/vcsh +++ b/vcsh @@ -100,6 +100,8 @@ help() { list-tracked List all files tracked by vcsh list-tracked-by \\ List files tracked by a repository + pull Pull from all vcsh remotes + push Push to vcsh remotes rename \\ Rename repository run \\ @@ -222,6 +224,33 @@ 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 +} + +push() { + hook pre-push + for VCSH_REPO_NAME in $(list); do + echo -n "$VCSH_REPO_NAME: " + export GIT_DIR="$VCSH_REPO_D/$VCSH_REPO_NAME.git" + use + git push + done + 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 @@ -328,7 +357,9 @@ elif [ "$1" = 'delete' ] || [ "$VCSH_COMMAND" = 'run' ] && shift 2 [ "$VCSH_COMMAND" = 'write-gitignore' ] elif [ "$1" = 'list' ] || - [ "$1" = 'list-tracked' ]; then + [ "$1" = 'list-tracked' ] || + [ "$1" = 'pull' ] || + [ "$1" = 'push' ]; then export VCSH_COMMAND="$1" elif [ -n "$2" ]; then export VCSH_COMMAND='run'