Comment.
[git-tools-moved-to-github.git] / id-cvs-to-git.sh
1 #!/bin/sh
2 # id-cvs-to-git.sh: Uploads new Git Project to public (bare)
3 #
4 # Usage:
5 #  id-cvs-to-git.sh source project description
6 # source: is a GIT project source or 'CVS'
7 # project: is the GIT project name (destination) and project source (If CVS)
8 # description: description for the project
9
10 # Convert YAZ from CVS to Git and upload:
11 #  id-cvs-to-git.sh CVS yaz "Yet another Z39.50 toolkit"
12 # Upload new project 'newproject' from repository ../newproject
13 #  ic-cvs-to-git.sh ../newproject newproject "My new project"
14 SRC=$1
15 P=$2
16 DESC="$3"
17
18 if test -z "$SRC"; then
19         echo "Missing Source (CVS=get from CVS)"
20         exit 1
21 fi
22 if test -z "$P"; then
23         echo "Missing Project"
24         exit 1
25 fi
26 if test -z "$DESC"; then
27         echo "Missing Description"
28         exit 1
29 fi
30 if test "$SRC" = "CVS"; then
31         rm -fr import_project
32         mkdir import_project
33         cd import_project
34         git-cvsimport -A ../import.names -v $P
35         cd ..
36         git clone --bare import_project ${P}.git
37 else
38         git clone --bare ${SRC} ${P}.git
39 fi
40 touch ${P}.git/git-daemon-export-ok
41 echo $DESC > ${P}.git/description
42 scp -r ${P}.git git.indexdata.com:/home/git/pub