X-Git-Url: https://git.madduck.net/code/vcsh.git/blobdiff_plain/8f4a012b3bc70e1d33bdba17e5c319c00c829c2a..a5523eb298c3bab97002f3b53161cfd6c328044a:/vcsh?ds=inline diff --git a/vcsh b/vcsh index e6b9377..1918af4 100755 --- a/vcsh +++ b/vcsh @@ -92,6 +92,7 @@ help() { commands: clone \\ [] Clone from an existing repository + commit Commit in all repositories delete Delete an existing repository enter Enter repository; spawn new instance of \$SHELL help Display this help text @@ -101,6 +102,7 @@ help() { list-tracked-by \\ List files tracked by a repository pull Pull from all vcsh remotes + push Push to vcsh remotes rename \\ Rename repository run \\ @@ -154,6 +156,18 @@ clone() { hook post-clone } +commit() { + hook pre-commit + for VCSH_REPO_NAME in $(list); do + echo "$VCSH_REPO_NAME: " + export GIT_DIR="$VCSH_REPO_D/$VCSH_REPO_NAME.git" + use + git commit --untracked-files=no --quiet + echo + done + hook post-commit +} + delete() { cd "$VCSH_BASE" || fatal "could not enter '$VCSH_BASE'" 11 use @@ -234,6 +248,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 @@ -339,9 +364,11 @@ elif [ "$1" = 'delete' ] || [ "$VCSH_COMMAND" = 'rename' ] && export GIT_DIR_NEW="$VCSH_REPO_D/$3.git" [ "$VCSH_COMMAND" = 'run' ] && shift 2 [ "$VCSH_COMMAND" = 'write-gitignore' ] -elif [ "$1" = 'list' ] || +elif [ "$1" = 'commit' ] || + [ "$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'