Depend on inkscape
[git-tools-moved-to-github.git] / id-cvs-to-git.sh
index aee9f22..761b57f 100755 (executable)
@@ -1,20 +1,50 @@
 #!/bin/sh
-P=$1
-DESC="$2"
+# id-cvs-to-git.sh: Creates new bare Git Project from CVS
+#
+usage() {
+       cat  <<EOF
+Usage:
+id-cvs-to-git.sh source project description
+
+ source: is a GIT project source or 'CVS'
+ project: is the GIT project name (destination) and project source (If CVS)
+ description: description for the project
+ Convert YAZ from CVS to Git
+  id-cvs-to-git.sh CVS yaz "Yet another Z39.50 toolkit"
+
+ Make bare new Git project from existing Git repo ../newproject
+  id-cvs-to-git.sh ../newproject newproject "My new project"
+EOF
+}
+
+SRC=$1
+P=$2
+DESC="$3"
+
+if test -z "$SRC"; then
+       usage
+       exit 1
+fi
 if test -z "$P"; then
-       echo "Missing Project"
+       echo "Error: Missing Project"
+       usage
        exit 1
 fi
 if test -z "$DESC"; then
-       echo "Missing Description"
+       echo "Error: Missing Description"
+       usage
        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 -u -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