From a5523eb298c3bab97002f3b53161cfd6c328044a Mon Sep 17 00:00:00 2001 From: Richard Hartmann Date: Thu, 1 Aug 2013 00:16:17 +0200 Subject: [PATCH 1/1] Introduce `vcsh commit` --- doc/vcsh.1.ronn | 3 +++ vcsh | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/doc/vcsh.1.ronn b/doc/vcsh.1.ronn index ee13b7f..b7f9725 100644 --- a/doc/vcsh.1.ronn +++ b/doc/vcsh.1.ronn @@ -81,6 +81,9 @@ an interactive user. * clone: Clone an existing repository. +* commit: + Commit in all repositories + * delete: Delete an existing repository. diff --git a/vcsh b/vcsh index 159feda..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 @@ -155,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 @@ -351,7 +364,8 @@ 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' ] || [ "$1" = 'push' ]; then -- 2.39.5