From: Geoffrey Thomas Date: Tue, 3 Mar 2009 00:07:36 +0000 (-0500) Subject: the git-rcsimport wrapper X-Git-Url: https://snippets.scripts.mit.edu/gitweb.cgi/Scripts/git/.git/commitdiff_plain/82262a5c1cd4acdc57056c4325f2b0557e9800c7 the git-rcsimport wrapper Signed-off-by: Geoffrey Thomas --- diff --git a/git-rcsimport b/git-rcsimport new file mode 100755 index 0000000..80714d8 --- /dev/null +++ b/git-rcsimport @@ -0,0 +1,22 @@ +#!/bin/sh +# This is a trivial wrapper around git-cvsimport. + +dir="$1" +shift +if [ -z "$dir" ]; then + echo "Usage: git-rcsimport path/to/dir" + exit 1 +fi +if [ ! -d "$dir/RCS" ]; then + echo "$dir/RCS does not exist." + exit 1 +fi + +tmpdir=`mktemp -d` +mkdir "$tmpdir/CVSROOT" +mkdir "$tmpdir/locks" +echo "LockDir=$tmpdir/locks" > "$tmpdir/CVSROOT/config" +ln -s "`readlink -f "$dir"`/RCS" "$tmpdir/RCS" +CVSROOT="$tmpdir" git cvsimport RCS "$@" +rm "$tmpdir/RCS" # a bit paranoid about rm -r's competence +rm -r "$tmpdir"