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.
3 # mrsetup - set up an account using mr
5 # Copyright © 2008 martin f. krafft <madduck@madduck.net>
6 # Released under the terms of the Artistic Licence 2.0
10 MY_GIT_SERVER=git.madduck.net
12 MY_ACCOUNT_GIT_REPO=$MY_GIT_REPOS/accounts/$(whoami)@$(hostname --fqdn).git
13 MY_GIT_URL_BASE=ssh://$MY_GIT_SERVER
14 MY_MR_REPO_URL=$MY_GIT_URL_BASE/$MY_GIT_REPOS/pub/etc/mr.git
15 MY_ACCOUNT_REPO_URL=$MY_GIT_URL_BASE/$MY_ACCOUNT_GIT_REPO
16 MR_REPO_URL=git://git.kitenet.net/mr
22 if [ ! -x "$(command -v git)" ]; then
23 echo E: git is not installed. >&2
27 if [ -e .mrconfig ]; then
28 echo E: .mrconfig already exists. >&2
32 if [ -d "$MR_FGIT" ]; then
33 echo E: "$MR_FGIT" already exists. >&2
37 if [ -d ".git" ]; then
38 echo E: .git already exists. >&2
42 if [ -d code/mr ]; then
43 if [ -x code/mr/mr ]; then
44 echo W: code/mr already exists, let us hope for the best... >&2
46 echo E: code/mr already exists. >&2
50 echo I: cloning mr into ${MR_CODE}...
51 mkdir --parent ${MR_CODE%/*}
52 git clone $MR_REPO_URL $MR_CODE
54 ln -s ../${MR_CODE}/mr $BIN_DIR/mr
58 cat <<_eof > .mrconfig
60 include = cat $MR_CODE/lib/*
63 checkout = git_fake_bare_checkout $MY_MR_REPO_URL ${MR_FGIT##*/} ../../
65 echo I: initial .mrconfig:
69 echo I: cloning mr configuration...
73 echo I: bootstrapping default .mrconfig...
74 cp $MR/templ/.mrconfig .
76 echo I: setting up base...
79 if ssh $MY_GIT_SERVER "test -d $MY_ACCOUNT_GIT_REPO"; then
80 echo I: checking out local git repository...
81 dir="$(mktemp -d home.XXXXXXXX)"
83 git clone --no-checkout $MY_ACCOUNT_REPO_URL "$dir"/co
85 git checkout-index --quiet --index --all
89 echo I: creating remote git repository for this account...
90 ssh $MY_GIT_SERVER "GIT_DIR=${MY_ACCOUNT_GIT_REPO} git --bare init"
91 echo I: setting up local git repository...
93 git remote add origin $MY_ACCOUNT_REPO_URL
94 git config branch.master.remote origin
95 git config branch.master.merge refs/heads/master
97 git commit -m'initial checkin'