path: root/git-cvsimport-script
diff options
authorTommy M. McGuire <>2005-06-10 06:27:47 (GMT)
committerLinus Torvalds <>2005-06-13 03:48:18 (GMT)
commit861cb6f02c91b66cdec572dd443ae947e795824a (patch)
tree9632dd3b30e00d259c687cde04230927626ace0e /git-cvsimport-script
parent667628d97a5baf18ffa0c701cab6d00e7d812741 (diff)
[PATCH] git cvsimport sanity checking
This patch adds some sanity checking to git-cvsimport-script, specifically forcing the use of cvsps -x (to get the latest information from the repository, rather than whatever is in the cache) and aborting early if cvsps does not produce any output. I debated removing the $MODULE directory following an abort, but I eventually decided leaving stuff behind would make debugging easier. On the other hand, this patch should help with the "cvsimport left me with an empty repository" complaints. Call cvsps with the -x flag, to get the current state of the repository, and abort the cvs import early if cvsps does not produce any output. Signed-off-by: Tommy McGuire <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'git-cvsimport-script')
1 files changed, 3 insertions, 1 deletions
diff --git a/git-cvsimport-script b/git-cvsimport-script
index 936ed88..6cd21fa 100755
--- a/git-cvsimport-script
+++ b/git-cvsimport-script
@@ -20,6 +20,8 @@ cvsps -h 2>&1 | grep -q "cvsps version 2.1" >& /dev/null || {
mkdir "$MODULE" || exit 1
cd "$MODULE"
-TZ=UTC cvsps -A $MODULE | git-cvs2git $ARGS --cvsroot="$CVSROOT" --module="$MODULE" > .git-create-script || exit 1
+TZ=UTC cvsps -x -A $MODULE > .git-cvsps-result
+[ -s .git-cvsps-result ] || exit 1
+git-cvs2git $ARGS --cvsroot="$CVSROOT" --module="$MODULE" < .git-cvsps-result > .git-create-script || exit 1
sh .git-create-script