]> git.madduck.net Git - code/myrepos.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Add support for vcsh via lib/
authorRichard Hartmann <richih.mailinglist@gmail.com>
Tue, 29 Nov 2011 22:01:46 +0000 (23:01 +0100)
committerJoey Hess <joey@kitenet.net>
Tue, 29 Nov 2011 22:15:01 +0000 (18:15 -0400)
lib/vcsh [new file with mode: 0644]

diff --git a/lib/vcsh b/lib/vcsh
new file mode 100644 (file)
index 0000000..2e0677a
--- /dev/null
+++ b/lib/vcsh
@@ -0,0 +1,36 @@
+# To make mr use this file, add a line like this inside the [DEFAULT]
+# section of your ~/.mrconfig
+#include = cat /usr/share/mr/vcsh
+
+# And an example repo using it would look something like:
+#[$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_update = vcsh run "$MR_REPO" git pull "$@"
+
+vcsh_status = vcsh run "$MR_REPO" git status -s "$@" || true
+
+vcsh_commit = vcsh run "$MR_REPO" git commit -a "$@" && vcsh run "$MR_REPO" git push --all
+
+vcsh_record = vcsh run "$MR_REPO" git commit -a "$@"
+
+vcsh_push = vcsh run "$MR_REPO" git push "$@"
+
+vcsh_diff = vcsh run "$MR_REPO" git diff "$@"
+
+vcsh_log = vcsh run "$MR_REPO" git log "$@"
+
+vcsh_register =
+       url="`LC_ALL=C vcsh run "$MR_REPO" git config --get remote.origin.url`" || true
+       if [ -z "$url" ]; then
+               error "cannot determine git url"
+       fi
+       echo "Registering git url: $url in $MR_CONFIG"
+       mr -c "$MR_CONFIG" config "`pwd`" checkout="vcsh clone '$url' '$MR_REPO'"
+
+vcsh_trusted_checkout = vcsh run "$MR_REPO" git clone $url $repo