提交 861cb6f0 编写于 作者: T Tommy M. McGuire 提交者: Linus Torvalds

[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: NTommy McGuire <mcguire@crsr.net>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 667628d9
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册