# If '.git-HEAD' is appended to the version, you are seeing an unreleased
# version of vcsh; the master branch is supposed to be clean at all times
# so you can most likely just use it nonetheless
-VERSION='1.20141025'
+VERSION='1.20141026'
SELF=$(basename $0)
fatal() {
echo "$SELF: fatal: $1" >&2
- [ -z $2] && exit 1
+ [ -z $2 ] && exit 1
exit $2
}
git config branch."$VCSH_BRANCH".remote origin
git config branch."$VCSH_BRANCH".merge refs/heads/"$VCSH_BRANCH"
if [ $(git ls-remote origin "$VCSH_BRANCH" 2> /dev/null | wc -l ) -lt 1 ]; then
- info "remote is empty, not merging anything"
+ info "remote is empty, not merging anything.
+ You should add files to your new repository."
exit
fi
git fetch origin "$VCSH_BRANCH"
hook post-enter
}
+foreach() {
+ hook pre-foreach
+ for VCSH_REPO_NAME in $(list); do
+ echo "$VCSH_REPO_NAME:"
+ GIT_DIR=$VCSH_REPO_D/$VCSH_REPO_NAME.git; export GIT_DIR
+ use
+ git "$@"
+ done
+ hook post-foreach
+}
+
git_dir_exists() {
[ -d "$GIT_DIR" ] || fatal "no repository found for '$VCSH_REPO_NAME'" 12
}
[ x"$VCSH_COMMAND" = x'rename' ] && { VCSH_REPO_NAME_NEW=$3; export VCSH_REPO_NAME_NEW;
GIT_DIR_NEW=$VCSH_REPO_D/$VCSH_REPO_NAME_NEW.git; export GIT_DIR_NEW; }
[ x"$VCSH_COMMAND" = x'run' ] && shift 2
+elif [ x"$VCSH_COMMAND" = x'foreach' ]; then
+ [ -z "$2" ] && fatal "$VCSH_COMMAND: please specify a command" 1
+ shift 1
elif [ x"$VCSH_COMMAND" = x'commit' ] ||
[ x"$VCSH_COMMAND" = x'list' ] ||
[ x"$VCSH_COMMAND" = x'list-tracked' ] ||