git-cvsimport-scripton commit [PATCH] git-apply: Don't barf when --stat'ing a diff with no line changes. (69f956e)
   1#!/bin/sh
   2
   3usage () {
   4        echo "Usage: git cvsimport [-v] [-z fuzz] <cvsroot> <module>"
   5        exit 1
   6}
   7
   8CVS2GIT=""
   9CVSPS="--cvs-direct -x -A"
  10while 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
  18done
  19
  20export CVSROOT="$1"
  21export MODULE="$2"
  22if [ ! "$CVSROOT" ] || [ ! "$MODULE" ] ; then
  23        usage
  24fi
  25
  26cvsps -h 2>&1 | grep -q "cvsps version 2.1" >& /dev/null || {
  27        echo "I need cvsps version 2.1"
  28        exit 1
  29}
  30
  31mkdir "$MODULE" || exit 1
  32cd "$MODULE"
  33
  34TZ=UTC cvsps $CVSPS $MODULE > .git-cvsps-result
  35[ -s .git-cvsps-result ] || exit 1
  36git-cvs2git $CVS2GIT --cvsroot="$CVSROOT" --module="$MODULE" < .git-cvsps-result > .git-create-script || exit 1
  37sh .git-create-script
  38