set -e
-
usage() {
bn=$(basename $0)
cat <<EOF
-$0: manage .mrconfig
+$0: manage home directory using mr
NAME
$bn - a command to manage detached git repositories using mr
COMMANDS
init
- create .mrconfig
+ create ~/.mrconfig
add repository_name
checkout the repository from the remote host and add it to
GIT_HOST=flounder.vireo.org
REMOTE_REPOS=~/git
-LOCAL_REPOS=.fgits
+LOCAL_REPOS=~/.fgits
+MRCONFIG=~/.mrconfig
init() {
usage
fi
- if [ -e .mrconfig ]; then
- echo .mrconfig already exists
+ if [ -e $MRCONFIG ]; then
+ echo $MRCONFIG already exists
exit 1
fi
mkdir $LOCAL_REPOS
- cat <<END > .mrconfig
+ cat <<END > $MRCONFIG
[DEFAULT]
include = cat /usr/share/mr/git-fake-bare
END
git config core.bare false
GIT_WORK_TREE="$PWD" git pull
trap - 0
- cat <<END >> .mrconfig
+ cat <<END >> $MRCONFIG
[$LOCAL_REPO]
checkout = git_fake_bare_checkout '$REPO_URL' '$REPO_NAME' '../../'
git push --all
trap - 0
- cat <<END >> .mrconfig
+ cat <<END >> $MRCONFIG
[$LOCAL_REPO]
checkout = git_fake_bare_checkout '$REPO_URL' '$REPO_NAME' '../../'
new)
new $@
;;
-esac
\ No newline at end of file
+esac