]> ToastFreeware Gitweb - gregoa/movein.git/blobdiff - movein
Move core.bare before core.worktree.
[gregoa/movein.git] / movein
diff --git a/movein b/movein
index 8583032169bf58c59c5912415c45ecb59eb1fa52..2bea17c16f022f7091966f532e97e4e443bdf77a 100755 (executable)
--- a/movein
+++ b/movein
@@ -40,7 +40,7 @@ SYNOPSIS
 
 COMMANDS
   init 
-      create ~/.mrconfig
+      create ~/.moveinrc, create/update  ~/.mrconfig
 
   ls
   list
@@ -78,11 +78,6 @@ init() {
        usage
     fi
     
-    if [ -e $MRCONFIG ]; then
-       echo $MRCONFIG already exists
-       exit 1
-    fi
-    
     if [ -e $MOVEINRC ]; then
        echo $MOVEINRC already exists
        exit 1
@@ -123,11 +118,7 @@ EOF
        mkdir -p "$LOCAL_REPOS"
     fi
 
-    cat <<END > $MRCONFIG
-[DEFAULT]
-include = cat /usr/share/mr/git-fake-bare
-END
-
+    mr -c "$MRCONFIG" config DEFAULT include="cat /usr/share/mr/git-fake-bare"
     
 }
 
@@ -161,17 +152,13 @@ add() {
        git remote add origin $REPO_URL
        git config branch.master.remote origin
        git config branch.master.merge refs/heads/master
-       git config core.worktree ../../
        git config core.bare false
+       git config core.worktree ../../
        GIT_WORK_TREE="$PWD" git pull
        trap - 0
-       cat <<END >> $MRCONFIG
 
-[$LOCAL_REPO]
-checkout = git_fake_bare_checkout '$REPO_URL' '$REPO_NAME' '../../'
-END
+       mr -c "$MRCONFIG" config "$LOCAL_REPO" checkout="git_fake_bare_checkout '$REPO_URL' 'REPO_NAME' '../../'"
     fi
-
 }
 
 list() {
@@ -207,21 +194,16 @@ new() {
        git remote add origin $REPO_URL
        git config branch.master.remote origin
        git config branch.master.merge refs/heads/master
-       git config core.worktree ../../
        git config core.bare false
-#      for file in  ; do 
+       git config core.worktree ../../
        export GIT_WORK_TREE="$PWD"
-           git add "$@"
-#      done
+       git add "$@"
        git commit -m "initial checkin"
        git push --all
        
        trap - 0
-       cat <<END >> $MRCONFIG
 
-[$LOCAL_REPO]
-checkout = git_fake_bare_checkout '$REPO_URL' '$REPO_NAME' '../../'
-END
+       mr -c "$MRCONFIG" config "$LOCAL_REPO" checkout="git_fake_bare_checkout '$REPO_URL' 'REPO_NAME' '../../'"
     fi
 
 }