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

Add support for `vcsh push`

This pushes to the respective remotes of all vcsh repos.
parent 8f4a012b
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,10 @@ function _vcsh-pull () {
_nothing
}
function _vcsh-push () {
_nothing
}
function _vcsh-rename () {
(( CURRENT == 2 )) && __vcsh_repositories
(( CURRENT == 3 )) && _message "new repository name"
......
......@@ -23,6 +23,8 @@ vcsh(1) - Version Control System for $HOME - multiple Git repositories in $HOME
`vcsh` pull
`vcsh` push
`vcsh` rename <repo> <newname>
`vcsh` run <repo> <shell command>
......@@ -103,6 +105,9 @@ an interactive user.
* pull:
Pull from all vcsh remotes.
* push:
Push to all vcsh remotes.
* rename:
Rename a repository.
......
......@@ -101,6 +101,7 @@ help() {
list-tracked-by \\
<repo> List files tracked by a repository
pull Pull from all vcsh remotes
push Push to vcsh remotes
rename <repo> \\
<newname> Rename repository
run <repo> \\
......@@ -234,6 +235,17 @@ pull() {
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
}
rename() {
git_dir_exists
[ -d "$GIT_DIR_NEW" ] && fatal "'$GIT_DIR_NEW' exists" 54
......@@ -341,7 +353,8 @@ elif [ "$1" = 'delete' ] ||
[ "$VCSH_COMMAND" = 'write-gitignore' ]
elif [ "$1" = 'list' ] ||
[ "$1" = 'list-tracked' ] ||
[ "$1" = 'pull' ]; then
[ "$1" = 'pull' ] ||
[ "$1" = 'push' ]; then
export VCSH_COMMAND="$1"
elif [ -n "$2" ]; then
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