- Project tools
-
-
-
-
-
- How do I...
-
| Category |
Featured projects |
| scm |
Subversion,
Subclipse,
TortoiseSVN,
RapidSVN
|
| issuetrack |
Scarab |
| requirements |
xmlbasedsrs |
| design |
ArgoUML |
| techcomm |
SubEtha,
eyebrowse,
midgard,
cowiki |
| construction |
antelope,
scons,
frameworx,
build-interceptor,
propel,
phing
|
| testing |
maxq,
aut
|
| deployment |
current |
| process |
ReadySET |
| libraries |
GEF,
Axion,
Style,
SSTree
|
| Over 500 more tools... |
|
cvs2git
Index
cvs2svn is a tool that was originally developed to migrate CVS
repositories to Subversion. The current
development version of cvs2svn can also output the converted
repository directly to git, a
distributed version control system most famous for being used for
Linux kernel development. When talking about converting from CVS to
git, I will refer to the program as cvs2git, even though the project
and the main executable are still called "cvs2svn".
Please note that conversion to git was added in release 2.1
of cvs2svn. Please make sure you are using cvs2svn release 2.1 or
newer.
Most of the work of converting a repository from CVS to a more
modern version control system is inferring the most likely history
given the incomplete information that CVS records. cvs2svn has a long
history of making sense of even the most convoluted CVS repositories,
and cvs2git uses this same machinery. Therefore, cvs2git inherits the
robustness and many of the features of cvs2svn. cvs2svn can convert
just about every CVS repository we have ever seen, and includes a
plethora of options for customizing your conversion. See the cvs2svn documentation for a summary
of cvs2svn's features.
However, the git output of cvs2git is still rather new and rough
around the edges. The main cvs2svn developer is not a git user, so
help would be much appreciated! Some of these missing
features would be pretty easy to program, and I'd be happy to help you
get started.
But thanks to the excellent git-fast-import
tool, the code needed to output to git is relatively straightforward,
and it is believed that cvs2git can (cautiously) be used for
production conversions.
cvs2git still has the following limitations:
- The cvs2git documentation is still rather thin. See below for more references.
- CVS allows a branch to be created from arbitrary combinations of
source revisions and/or source branches. cvs2git tries to create
a branch from a single source, but if it can't figure out how to,
it creates the branch using "merge" from multiple sources. In
pathological situations, the number of merge sources for a branch
can be arbitrarily large.
-
It is not very intelligent about creating tags. When asked to
create a tag, it unconditionally creates a tag
fixup branch named TAG.FIXUP, then tags this
branch. The TAG.FIXUP branch is cleared at the end of
the conversion, but not deleted.
Some CVS tags can be created from a single parent, in which
case the tag fixup branch would be superfluous. It would be
possible to teach cvs2git to determine when single-source tags
can be created, at a considerable cost in runtime and temporary
workspace. Alternatively, it is possible to delete
uninteresting branches after the conversion.
- There are no checks that CVS branch and tag names are legal git
names. There are probably other git constraints that should also
be checked.
- The data that should be fed to git-fast-input is written to two
files, which have to be loaded into git-fast-import manually.
These files might grow to very large size. It would be nice to
add an option to invoke git-fast-import automatically and pipe the
output directly into git-fast-import; this should also speed up
the conversion.
- Only single projects can be converted at a time. Given the way
git is typically used, I don't think that this is a significant
limitation.
- cvs2git is not especially fast. Among other things, it still
uses RCS or CVS to extract the contents of the CVS revisions.
Reconstructing the revision contents within cvs2git (using code
that already exists in cvs2svn) might improve the conversion
speed.
- The cvs2svn test suite does not include meaningful tests of git
output.
- cvs2git makes no attempt to convert .cvsignore files
into .gitignore files.
There is not a lot of documentation specific to cvs2git, but much
of the cvs2svn documentation applies fairly straightforwardly to
cvs2git. See the following sources:
- This document.
- The cvs2svn documentation and
the cvs2svn FAQ contain much general
discussion and describe many features that can also be used for
cvs2git.
- test-data/main-cvsrepos/cvs2svn-git.options in the
cvs2svn source tree is an example of an options file that can be
used to configure a cvs2git conversion. It includes from
cvs2svn-example.options many settings that apply to both
cvs2svn and cvs2git. Both files are extensively documented.
- The cvs2svn mailing lists, IRC channel, etc., as described in the cvs2svn FAQ.
This section outlines the steps needed to convert a CVS repository
to git using cvs2git.
- Be sure that you have the cvs2svn requirements, including either RCS or
CVS (used to read revision contents from the CVS repository).
- Obtain a copy of cvs2svn version 2.1 or newer.
- To install cvs2svn from a tarball,
simply unpack the tarball into a directory on your conversion
computer (cvs2svn can be run directly from this
directory).
-
To Check out the current trunk version of cvs2svn, make
sure that you have Subversion installed and then run:
svn co --username=guest http://cvs2svn.tigris.org/svn/cvs2svn/trunk cvs2svn-trunk
# The password is empty; i.e., just press return.
cd cvs2svn-trunk
make check # ...optional
Please note that the test suite includes tests that are
marked "XFAIL" (expected failure); these are known and are
not considered serious problems. In fact, the test for git
output is marked XFAIL because the cvs2svn test suite
doesn't know how to verify the contents of the git
repository.
- Configure cvs2svn for your conversion. This has to be done via
the options-file method.
See test-data/main-cvsrepos/cvs2svn-git.options and
cvs2svn-example.options in the cvs2svn source tree as
examples; both files contain lots of documentation.
- Run cvs2svn. This creates two output files in git-fast-import
format. The names of these files are specified by your options
file. In the example, these files are named
cvs2svn-tmp/git-blob.dat and
cvs2svn-tmp/git-dump.dat.
-
Initialize a git repository, and load the dump files using
git-fast-import:
git-init
cat cvs2svn-tmp/git-blob.dat | git-fast-import --export-marks=cvs2svn-tmp/git-marks.dat
cat cvs2svn-tmp/git-dump.dat | git-fast-import --import-marks=cvs2svn-tmp/git-marks.dat
This can, of course, be shortened to:
git-init
cat cvs2svn-tmp/git-blob.dat cvs2svn-tmp/git-dump.dat | git-fast-import
Feedback would be much appreciated, as I am a git newbie. Please
send comments, bug reports, and patches to the cvs2svn
mailing lists.
|