]> sipb.mit.edu Git - ikiwiki.git/blobdiff - ikiwiki-makerepo
Merge branch 'master' of ssh://git.ikiwiki.info/srv/git/ikiwiki.info
[ikiwiki.git] / ikiwiki-makerepo
index dd23b4638a88b76367e638719d4e58247b8edfed..b733bd13ab96d1801db4e31d0cc01f1f7e890f4a 100755 (executable)
@@ -4,7 +4,7 @@ set -e
 rcs="$1"
 srcdir="$2"
 repository="$3"
-       
+
 usage () {
        echo "usage: ikiwiki-makerepo svn|git srcdir repository" >&2
        echo "       ikiwiki-makerepo bzr|mercurial srcdir" >&2
@@ -21,11 +21,15 @@ if [ ! -d "$srcdir" ]; then
 fi
 
 if [ "$rcs" != mercurial ] && [ "$rcs" != bzr ]; then
+       if [ -z "$repository" ]; then
+               echo "you need to specify both a srcdir and a repository for $rcs" >&2
+               usage
+       fi
        if [ -e "$repository" ]; then
                echo "repository $repository already exists, aborting" >&2 
                exit 1
        fi
-       repository="$(perl -e 'use Cwd q{abs_path}; print abs_path(shift)' $repository)"
+       repository="$(perl -e 'use Cwd q{abs_path}; $r=shift; $r=~s/\/*$//; print abs_path($r)' $repository)"
        if [ -z "$repository" ]; then
                echo "internal error finding repository abs_path" >&2
                exit 1
@@ -58,10 +62,12 @@ git)
        cd "$srcdir"
        git init
        echo /.ikiwiki > .gitignore
+       echo /recentchanges >> .gitignore
        git add .
        git commit -m "initial commit"
        git remote add origin "$repository"
        git config branch.master.merge refs/heads/master
+       git config branch.master.remote origin
        git push --all
        echo "Directory $srcdir is now a clone of $rcs repository $repository"
 ;;