X-Git-Url: https://git.madduck.net/code/myrepos.git/blobdiff_plain/6ac25115f169a706bf38c73c2cde2e27add8073f..1f9664072eba6ade88350eb595e67520993b8fd9:/lib/vcsh?ds=sidebyside diff --git a/lib/vcsh b/lib/vcsh index 2e0677a..6681efd 100644 --- a/lib/vcsh +++ b/lib/vcsh @@ -6,14 +6,14 @@ #[$HOME/.config/vcsh/repo.d/zsh.git] #checkout = vcsh clone git://github.com/RichiH/zshrc.git zsh -vcsh_test = - test -d "$MR_REPO"/refs/heads && test -d "$MR_REPO"/refs/tags && - test -d "$MR_REPO"/objects && test -f "$MR_REPO"/config && - test "`GIT_CONFIG="$MR_REPO"/config git config --get vcsh.vcsh`" = true +vcsh_test = perl: + -d "$ENV{MR_REPO}/refs/heads" && -d "$ENV{MR_REPO}/refs/tags" && + -d "$ENV{MR_REPO}/objects" && -f "$ENV{MR_REPO}/config" && + `GIT_CONFIG="$ENV{MR_REPO}"/config git config --get vcsh.vcsh` =~ /true/ vcsh_update = vcsh run "$MR_REPO" git pull "$@" -vcsh_status = vcsh run "$MR_REPO" git status -s "$@" || true +vcsh_status = cd $(vcsh run "$MR_REPO" git config --get core.worktree); vcsh run "$MR_REPO" git status -s "$@" || true vcsh_commit = vcsh run "$MR_REPO" git commit -a "$@" && vcsh run "$MR_REPO" git push --all @@ -25,6 +25,10 @@ vcsh_diff = vcsh run "$MR_REPO" git diff "$@" vcsh_log = vcsh run "$MR_REPO" git log "$@" +vcsh_run = vcsh run "$MR_REPO" "$@" + +vcsh_gc = vcsh run "$MR_REPO" git gc "$@" + vcsh_register = url="`LC_ALL=C vcsh run "$MR_REPO" git config --get remote.origin.url`" || true if [ -z "$url" ]; then