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.
1 # An example of how to add a new revision control system type to mr.
2 # git fake bare repositories have a detached workspace. One potential
3 # application is storing dotfiles in git, keeping them checked out in
4 # one $HOME, but checked into different git repositories. This file adds
5 # support for them, separate from the normal git support.
7 # To make mr use this file, add a line like this inside the [DEFAULT]
8 # section of your ~/.mrconfig
9 #include = cat /usr/share/mr/git-fake-bare
11 # And an example repo using it would look something like:
13 #checkout = git_fake_bare_checkout git://... .dotfiles <worktree, eg. ..>
16 # git doesn't have an easy way to check out such a repo, so
18 git_fake_bare_checkout() {
22 git clone --no-checkout "$url" "$repo"
26 git checkout-index -a --prefix="$worktree" || true
27 git config core.worktree "$worktree"
33 test -d "$MR_REPO"/refs/heads && test -d "$MR_REPO"/refs/tags &&
34 test -d "$MR_REPO"/objects && test -f "$MR_REPO"/config &&
35 test "$(GIT_CONFIG="$MR_REPO"/config git-config --get core.bare)" = false
37 git_fake_bare_update =
39 [ -z "$args" ] && args="-t origin master"
40 eval GIT_DIR="$MR_REPO" git pull "$args"
42 git_fake_bare_status = git status "$@" || true
44 git_fake_bare_commit = error "commit does not work for fake bare git repositories (yet)."
46 git_fake_bare_diff = error "diff does not work for fake bare git repositories (yet)."
48 git_fake_bare_log = git log "$@"
50 git_fake_bare_register =
51 url="$(LC_MESSAGES=C GIT_CONFIG=config git-config --get remote.origin.url)" || true
52 if [ -z "$url" ]; then
53 error "cannot determine git url"
55 worktree="$(git-config --get core.worktree)" || true
56 if [ -z "$worktree" ]; then
57 error "git worktree is not set"
59 worktree="${worktree%%/}/"
60 if [ ! -d "$worktree" ]; then
61 error "git worktree $worktree does not exist"
63 echo "Registering git url: $url in $MR_CONFIG (with worktree $worktree)"
64 mr -c "$MR_CONFIG" config "`pwd`" \
65 checkout="git_fake_bare_checkout '$url' '$MR_REPO' '$worktree'"
67 # vim:sw=8:sts=0:ts=8:noet