[PATCH] ssh-push.c: Fix handling of ssh://host/path URLs
[git.git] / git-cvsimport-script
1 #!/bin/sh
2
3 usage () {
4         echo "Usage: git cvsimport [-v] [-z fuzz] <cvsroot> <module>"
5         exit 1
6 }
7
8 CVS2GIT=""
9 CVSPS="--cvs-direct -x -A"
10 while true; do
11         case "$1" in
12         -v) CVS2GIT="$1" ;;
13         -z) shift; CVSPS="$CVSPS -z $1" ;;
14         -*) usage ;;
15         *)  break ;;
16         esac
17         shift
18 done
19
20 export CVSROOT="$1"
21 export MODULE="$2"
22 if [ ! "$CVSROOT" ] || [ ! "$MODULE" ] ; then
23         usage
24 fi
25
26 cvsps -h 2>&1 | grep -q "cvsps version 2.1" >& /dev/null || {
27         echo "I need cvsps version 2.1"
28         exit 1
29 }
30
31 mkdir "$MODULE" || exit 1
32 cd "$MODULE"
33
34 TZ=UTC cvsps $CVSPS $MODULE > .git-cvsps-result
35 [ -s .git-cvsps-result ] || exit 1
36 git-cvs2git $CVS2GIT --cvsroot="$CVSROOT" --module="$MODULE" < .git-cvsps-result > .git-create-script || exit 1
37 sh .git-create-script
38