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. This file adds
3 # support for them, separate from the normal git support.
5 # To make mr use this file, add a line like this inside the [DEFAULT]
6 # section of your ~/.mrconfig
7 #include = cat /path/to/mrconfig.git-fake-bare
10 test -d "$MR_REPO"/refs/heads && test -d "$MR_REPO"/refs/tags &&
11 test -d "$MR_REPO"/objects && test -f "$MR_REPO"/config &&
12 test "$(GIT_CONFIG="$MR_REPO"/config git-config --get core.bare)" = false
14 git_fake_bare_update =
15 # all this is because of a bug in git-fetch, which requires GIT_DIR set
16 local git_dir_override; git_dir_override=.git
17 case "$(get_git_repo_type "$MR_REPO")" in
18 fake-bare) git_dir_override="$MR_REPO";;
21 [ -z "$args" ] && args="-t origin master"
22 eval GIT_DIR="$git_dir_override" git pull "$args"
24 git_fake_bare_status = git status "$@" || true
26 git_fake_bare_commit = error "commit does not work for fake bare git repositories (yet)."
28 git_fake_bare_diff = error "diff does not work for fake bare git repositories (yet)."
30 git_fake_bare_log = git log "$@"
32 git_fake_bare_register =
33 url="$(LANG=C GIT_CONFIG=config git-config --get remote.origin.url)" || true
34 if [ -z "$url" ]; then
35 error "cannot determine git url"
37 worktree="$(git-config --get core.worktree)" || true
38 if [ -z "$worktree" ]; then
39 error "git worktree is not set"
41 worktree="${worktree%%/}/"
42 if [ ! -d "$worktree" ]; then
43 error "git worktree $worktree does not exist"
45 mr -c "$MR_CONFIG" config "`pwd`" \
46 lib="GIT_WORK_TREE=$work_tree; export GIT_WORK_TREE"
47 echo "Registering git url: $url in $MR_CONFIG (with worktree $worktree)"
48 mr -c "$MR_CONFIG" config "`pwd`" \
50 git clone --no-checkout $url $MR_REPO && \
52 git read-tree HEAD && \
53 git checkout-index -a --prefix='$work_tree' || true; \
54 git config core.worktree '$worktree' && \