From: Richard Hartmann Date: Wed, 31 Jul 2013 22:19:02 +0000 (+0200) Subject: Merge branch 'feature--vcsh-commit' X-Git-Url: https://git.madduck.net/code/vcsh.git/commitdiff_plain/67b0da790e240f714bdd1c4256957c3261d5533a?ds=sidebyside;hp=--cc Merge branch 'feature--vcsh-commit' Conflicts: doc/vcsh.1.ronn vcsh --- 67b0da790e240f714bdd1c4256957c3261d5533a diff --cc doc/vcsh.1.ronn index 9532e65,b7f9725..01cadb5 --- a/doc/vcsh.1.ronn +++ b/doc/vcsh.1.ronn @@@ -83,9 -81,9 +83,12 @@@ an interactive user * clone: Clone an existing repository. + If you need to clone a bundle of repositories, look into the + `post-clone-retired` hook. + + * commit: + Commit in all repositories + * delete: Delete an existing repository. diff --cc vcsh index f2bbd7a,1918af4..85e20d8 --- a/vcsh +++ b/vcsh @@@ -154,10 -154,20 +155,22 @@@ clone() Once this situation has been resolved, run 'vcsh run $VCSH_REPO_NAME git pull' to finish cloning.\n" 17 git merge origin/master hook post-clone + retire + hook post-clone-retired } + 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 @@@ -380,14 -361,14 +393,15 @@@ elif [ "$1" = 'delete' ] | export VCSH_COMMAND="$1" export VCSH_REPO_NAME="$2" export GIT_DIR="$VCSH_REPO_D/$VCSH_REPO_NAME.git" - [ "$VCSH_COMMAND" = 'rename' ] && export GIT_DIR_NEW="$VCSH_REPO_D/$3.git" - [ "$VCSH_COMMAND" = 'run' ] && shift 2 - [ "$VCSH_COMMAND" = 'write-gitignore' ] + [ "$VCSH_COMMAND" = 'rename' ] && { export VCSH_REPO_NAME_NEW="$3"; + export GIT_DIR_NEW="$VCSH_REPO_D/$VCSH_REPO_NAME_NEW.git"; } + [ "$VCSH_COMMAND" = 'run' ] && shift 2 - elif [ "$1" = 'list' ] || + elif [ "$1" = 'commit' ] || + [ "$1" = 'list' ] || [ "$1" = 'list-tracked' ] || [ "$1" = 'pull' ] || - [ "$1" = 'push' ]; then + [ "$1" = 'push' ] || + [ "$1" = 'status' ]; then export VCSH_COMMAND="$1" elif [ -n "$2" ]; then export VCSH_COMMAND='run'