git-rev-parse: split "revs" and "non-revs"
[alt-git.git] / git-cvsimport-script
blob0ba67461da47a2fb0a0d31e955b184218734673b
1 #!/bin/sh
3 usage () {
4 echo "Usage: git cvsimport [-v] [-z fuzz] <cvsroot> <module>"
5 exit 1
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
20 export CVSROOT="$1"
21 export MODULE="$2"
22 if [ ! "$CVSROOT" ] || [ ! "$MODULE" ] ; then
23 usage
26 cvsps -h 2>&1 | grep -q "cvsps version 2.1" >& /dev/null || {
27 echo "I need cvsps version 2.1"
28 exit 1
31 mkdir "$MODULE" || exit 1
32 cd "$MODULE"
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