X-Git-Url: https://git.toastfreeware.priv.at/gregoa/movein.git/blobdiff_plain/0c658fa07c706200da979d0b0131cb1250010ce2..250102fa954a17e9399f6aa7edf8c8186ca6b3ef:/movein diff --git a/movein b/movein index c6c5137..f236b14 100755 --- a/movein +++ b/movein @@ -39,6 +39,7 @@ SYNOPSIS $bn add repository_name $bn new repository_name file1 [file2 file3...] $bn login repository_name + $bn exec repository_name command [arg1 arg2...] COMMANDS init @@ -64,6 +65,11 @@ COMMANDS login repository_name start a subshell in repository_name + exec repository_name command [arg1 arg2...] + execute a command in the context of repository_name, for example: + $bn exec myrepo git status + $bn exec myrepo git ls-files + EOF exit 1 @@ -140,6 +146,20 @@ login() { GIT_PS1_SHOWUNTRACKEDFILES= PSMOVEIN="movein:${1}" $SHELL -i || : } +execin() { + local REPO + if [ $# -lt 1 ]; then + usage + fi + + REPO=$1;shift + + export GIT_DIR="$LOCAL_REPOS/${REPO}.git" + export GIT_WORK_TREE="$GIT_DIR/$(git config --get core.worktree)" + + "$@" +} + add() { if [ $# -ne 1 ]; then usage @@ -238,6 +258,9 @@ case "$command" in login) login $@ ;; + exec) + execin "$@" + ;; ls) list ;;