Skip to content
Snippets Groups Projects
Commit 8f4a012b authored by Richard Hartmann's avatar Richard Hartmann
Browse files

Add support for `vcsh pull`

This pulls all vcsh repos one after the other.
parent 80176dc2
Branches
Tags
No related merge requests found
...@@ -43,6 +43,10 @@ function _vcsh-list-tracked-by () { ...@@ -43,6 +43,10 @@ function _vcsh-list-tracked-by () {
(( CURRENT == 2 )) && __vcsh_repositories (( CURRENT == 2 )) && __vcsh_repositories
} }
function _vcsh-pull () {
_nothing
}
function _vcsh-rename () { function _vcsh-rename () {
(( CURRENT == 2 )) && __vcsh_repositories (( CURRENT == 2 )) && __vcsh_repositories
(( CURRENT == 3 )) && _message "new repository name" (( CURRENT == 3 )) && _message "new repository name"
...@@ -88,6 +92,7 @@ function _vcsh () { ...@@ -88,6 +92,7 @@ function _vcsh () {
"list:list all local vcsh repositories" "list:list all local vcsh repositories"
"list-tracked:list all files tracked by vcsh" "list-tracked:list all files tracked by vcsh"
"list-tracked-by:list files tracked by a repository" "list-tracked-by:list files tracked by a repository"
"pull:pull from all vcsh remotes"
"rename:rename a repository" "rename:rename a repository"
"run:run command with <\$GIT_DIR> and <\$GIT_WORK_TREE> set" "run:run command with <\$GIT_DIR> and <\$GIT_WORK_TREE> set"
"upgrade:upgrade repository to currently recommended settings" "upgrade:upgrade repository to currently recommended settings"
......
...@@ -21,6 +21,8 @@ vcsh(1) - Version Control System for $HOME - multiple Git repositories in $HOME ...@@ -21,6 +21,8 @@ vcsh(1) - Version Control System for $HOME - multiple Git repositories in $HOME
`vcsh` list-tracked-by <repo> `vcsh` list-tracked-by <repo>
`vcsh` pull
`vcsh` rename <repo> <newname> `vcsh` rename <repo> <newname>
`vcsh` run <repo> <shell command> `vcsh` run <repo> <shell command>
...@@ -98,6 +100,9 @@ an interactive user. ...@@ -98,6 +100,9 @@ an interactive user.
* list-tracked-by: * list-tracked-by:
List files tracked by a repository. List files tracked by a repository.
* pull:
Pull from all vcsh remotes.
* rename: * rename:
Rename a repository. Rename a repository.
......
...@@ -100,6 +100,7 @@ help() { ...@@ -100,6 +100,7 @@ help() {
list-tracked List all files tracked by vcsh list-tracked List all files tracked by vcsh
list-tracked-by \\ list-tracked-by \\
<repo> List files tracked by a repository <repo> List files tracked by a repository
pull Pull from all vcsh remotes
rename <repo> \\ rename <repo> \\
<newname> Rename repository <newname> Rename repository
run <repo> \\ run <repo> \\
...@@ -222,6 +223,17 @@ list_tracked_by() { ...@@ -222,6 +223,17 @@ list_tracked_by() {
git ls-files | sort -u 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() { rename() {
git_dir_exists git_dir_exists
[ -d "$GIT_DIR_NEW" ] && fatal "'$GIT_DIR_NEW' exists" 54 [ -d "$GIT_DIR_NEW" ] && fatal "'$GIT_DIR_NEW' exists" 54
...@@ -328,7 +340,8 @@ elif [ "$1" = 'delete' ] || ...@@ -328,7 +340,8 @@ elif [ "$1" = 'delete' ] ||
[ "$VCSH_COMMAND" = 'run' ] && shift 2 [ "$VCSH_COMMAND" = 'run' ] && shift 2
[ "$VCSH_COMMAND" = 'write-gitignore' ] [ "$VCSH_COMMAND" = 'write-gitignore' ]
elif [ "$1" = 'list' ] || elif [ "$1" = 'list' ] ||
[ "$1" = 'list-tracked' ]; then [ "$1" = 'list-tracked' ] ||
[ "$1" = 'pull' ]; then
export VCSH_COMMAND="$1" export VCSH_COMMAND="$1"
elif [ -n "$2" ]; then elif [ -n "$2" ]; then
export VCSH_COMMAND='run' export VCSH_COMMAND='run'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment