First argument is source: CVS or GIT repository.
authorAdam Dickmeiss <adam@indexdata.dk>
Sat, 29 Sep 2007 15:47:18 +0000 (17:47 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Sat, 29 Sep 2007 15:47:18 +0000 (17:47 +0200)
id-cvs-to-git.sh

index aee9f22..a7ce39b 100755 (executable)
@@ -1,6 +1,13 @@
 #!/bin/sh
-P=$1
-DESC="$2"
+# Upload NEW Git Project to master.
+SRC=$1
+P=$2
+DESC="$3"
+
+if test -z "$SRC"; then
+       echo "Missing Source (CVS=get from CVS)"
+       exit 1
+fi
 if test -z "$P"; then
        echo "Missing Project"
        exit 1
@@ -9,12 +16,16 @@ if test -z "$DESC"; then
        echo "Missing Description"
        exit 1
 fi
-rm -fr import_project
-mkdir import_project
-cd import_project
-git-cvsimport -A ../import.names -v $P
-cd ..
-git clone --bare import_project ${P}.git
+if test "$SRC" = "CVS"; then
+       rm -fr import_project
+       mkdir import_project
+       cd import_project
+       git-cvsimport -A ../import.names -v $P
+       cd ..
+       git clone --bare import_project ${P}.git
+else
+       git clone --bare ${SRC} ${P}.git
+fi
 touch ${P}.git/git-daemon-export-ok
 echo $DESC > ${P}.git/description
 scp -r ${P}.git git.indexdata.com:/var/cache/git