* [PATCH] git cvsimport sanity checking
2005-06-10 6:22 ` [PATCH] " Tommy M. McGuire
@ 2005-06-10 6:27 ` Tommy M. McGuire
2005-06-10 6:33 ` [PATCH] cvs-migration.txt Tommy M. McGuire
2005-06-10 6:38 ` [PATCH] git cvsimport fuzz argument Tommy M. McGuire
2 siblings, 0 replies; 6+ messages in thread
From: Tommy M. McGuire @ 2005-06-10 6:27 UTC (permalink / raw)
To: Tommy M. McGuire; +Cc: Linus Torvalds, Git Mailing List
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.
Signed-off-by: Tommy McGuire <mcguire@crsr.net>
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.
---
commit 2e670826cec5642a11e2e7d6adcb48e02225ba6d
tree 25e4f590772b9c0bc8ac37f8a57f4a08435ed5c6
parent 21b4b44a5deee7985f14d0f4776ad0d489092a96
author Tommy M. McGuire <mcguire@crsr.net> Fri, 10 Jun 2005 01:38:42 -0500
committer Tommy M. McGuire <mcguire@crsr.net> Fri, 10 Jun 2005 01:38:42 -0500
git-cvsimport-script | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/git-cvsimport-script b/git-cvsimport-script
--- a/git-cvsimport-script
+++ b/git-cvsimport-script
@@ -20,6 +20,8 @@ cvsps -h 2>&1 | grep -q "cvsps version 2
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
\f
!-------------------------------------------------------------flip-
--
Tommy McGuire
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] cvs-migration.txt
2005-06-10 6:22 ` [PATCH] " Tommy M. McGuire
2005-06-10 6:27 ` [PATCH] git cvsimport sanity checking Tommy M. McGuire
@ 2005-06-10 6:33 ` Tommy M. McGuire
2005-06-10 6:38 ` [PATCH] git cvsimport fuzz argument Tommy M. McGuire
2 siblings, 0 replies; 6+ messages in thread
From: Tommy M. McGuire @ 2005-06-10 6:33 UTC (permalink / raw)
To: Tommy M. McGuire; +Cc: Linus Torvalds, Git Mailing List
The way I figure it, telling someone why cvsimport is taking so long
will improve their overall user experience. :-)
Signed-off-by: Tommy McGuire <mcguire@crsr.net>
Slightly expand the cvsimport description, and make a couple of syntax edits.
---
commit 9a861c244e79634abf3c8436d720e77140d0e0e3
tree 32155e131933b2e48383644a3e3198f541f6d4b8
parent 2e670826cec5642a11e2e7d6adcb48e02225ba6d
author Tommy M. McGuire <mcguire@crsr.net> Fri, 10 Jun 2005 02:11:14 -0500
committer Tommy M. McGuire <mcguire@crsr.net> Fri, 10 Jun 2005 02:11:14 -0500
Documentation/cvs-migration.txt | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/Documentation/cvs-migration.txt b/Documentation/cvs-migration.txt
--- a/Documentation/cvs-migration.txt
+++ b/Documentation/cvs-migration.txt
@@ -14,7 +14,7 @@ does a lot of things differently.
One particular suckage of CVS is very hard to work around: CVS is
basically a tool for tracking _file_ history, while git is a tool for
tracking _project_ history. This sometimes causes problems if you are
-used to doign very strange things in CVS, in particular if you're doing
+used to doing very strange things in CVS, in particular if you're doing
things like making branches of just a subset of the project. Git can't
track that, since git never tracks things on the level of an individual
file, only on the whole project level.
@@ -35,8 +35,8 @@ that you're actually working in (your wo
working directories _are_ the repositories. However, you can easily
emulate the CVS model by having one special "global repository", which
people can synchronize with. See details later, but in the meantime
-just keep in mind that with git, every checked out working tree will be
-a full revision control of its own.
+just keep in mind that with git, every checked out working tree will
+have a full revision control history of its own.
Importing a CVS archive
@@ -69,10 +69,12 @@ which will do exactly what you'd think i
archive of the named CVS module. The new archive will be created in a
subdirectory named <module>.
-It can take some time to actually do the conversion for a large archive,
+It can take some time to actually do the conversion for a large archive
+since it involves checking out from CVS every revision of every file,
and the conversion script can be reasonably chatty, but on some not very
scientific tests it averaged about eight revisions per second, so a
-medium-sized project should not take more than a couple of minutes.
+medium-sized project should not take more than a couple of minutes. For
+larger projects or remote repositories, the process may take longer.
Emulating CVS behaviour
\f
!-------------------------------------------------------------flip-
--
Tommy McGuire
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] git cvsimport fuzz argument
2005-06-10 6:22 ` [PATCH] " Tommy M. McGuire
2005-06-10 6:27 ` [PATCH] git cvsimport sanity checking Tommy M. McGuire
2005-06-10 6:33 ` [PATCH] cvs-migration.txt Tommy M. McGuire
@ 2005-06-10 6:38 ` Tommy M. McGuire
2 siblings, 0 replies; 6+ messages in thread
From: Tommy M. McGuire @ 2005-06-10 6:38 UTC (permalink / raw)
To: Tommy M. McGuire; +Cc: Linus Torvalds, Git Mailing List
Give the user the option of specifying the timestamp fuzz passed to
cvsps. Looking at the other arguments to it, I can't see anything else
that would be sane to play with. Also, use --cvs-direct, which speeds
up cvsps for remote repositories and doesn't seem to do anything bad to
local repositories.
Signed-off-by: Tommy McGuire <mcguire@crsr.net>
Add "-z fuzz" argument, passed to cvsps, and clean up argument processing.
Also, use "cvsps --cvs-direct", which is is somewhat faster.
---
commit 018aee88d1b71f96ce9ecdfba77608566f51c860
tree 623c7a40ea20ef8b68cf896605d55432cd0469ac
parent 9a861c244e79634abf3c8436d720e77140d0e0e3
author Tommy M. McGuire <mcguire@crsr.net> Fri, 10 Jun 2005 02:51:34 -0500
committer Tommy M. McGuire <mcguire@crsr.net> Fri, 10 Jun 2005 02:51:34 -0500
git-cvsimport-script | 27 +++++++++++++++++++--------
1 files changed, 19 insertions(+), 8 deletions(-)
diff --git a/git-cvsimport-script b/git-cvsimport-script
--- a/git-cvsimport-script
+++ b/git-cvsimport-script
@@ -1,15 +1,26 @@
#!/bin/sh
-ARGS=""
-if [ "$1" == "-v" ]; then
- ARGS=$1
+
+usage () {
+ echo "Usage: git cvsimport [-v] [-z fuzz] <cvsroot> <module>"
+ exit 1
+}
+
+CVS2GIT=""
+CVSPS="--cvs-direct -x -A"
+while true; do
+ case "$1" in
+ -v) CVS2GIT="$1" ;;
+ -z) shift; CVSPS="$CVSPS -z $1" ;;
+ -*) usage ;;
+ *) break ;;
+ esac
shift
-fi
+done
export CVSROOT="$1"
export MODULE="$2"
if [ ! "$CVSROOT" ] || [ ! "$MODULE" ] ; then
- echo "Usage: git cvsimport <cvsroot> <module>"
- exit 1
+ usage
fi
cvsps -h 2>&1 | grep -q "cvsps version 2.1" >& /dev/null || {
@@ -20,8 +31,8 @@ cvsps -h 2>&1 | grep -q "cvsps version 2
mkdir "$MODULE" || exit 1
cd "$MODULE"
-TZ=UTC cvsps -x -A $MODULE > .git-cvsps-result
+TZ=UTC cvsps $CVSPS $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
+git-cvs2git $CVS2GIT --cvsroot="$CVSROOT" --module="$MODULE" < .git-cvsps-result > .git-create-script || exit 1
sh .git-create-script
\f
!-------------------------------------------------------------flip-
--
Tommy McGuire
^ permalink raw reply [flat|nested] 6+ messages in thread