git/list[1] front-page[2] threads[3] people[4] search[5] about
 

cvs2svn conversion directly to git ready for experimentation

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Aug 1, 2007, 00:09 UTC
Message-ID
<46AFCF3E.5010805@alum.mit.edu>

I am the maintainer of cvs2svn[1], which is a program for one-time conversions from CVS to Subversion. cvs2svn is very robust against the many peculiarities of CVS and can convert just about every CVS repository we have ever seen.

I've been working on a cvs2svn output pass that writes the converted CVS repository directly into git rather than Subversion. The code runs now with at least one repository from our test suite of nasty CVS repositories.

Unfortunately, I am a complete git newbie, so I would very much appreciate help from the git community with feedback and checking whether the conversion output is reasonable and gitlike.

The git output is very preliminary and virtually untested, and has the following limitations (hopefully to be removed in the near future):

- It is rather slow.  Among other things, it still uses RCS or CVS to
extract the contents of the CVS revisions, which will soon be changed to
win a factor of 2 or so.
- CVS allows a branch to be created from arbitrary combinations of
source revisions and/or source branches.  cvs2svn 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"[2] with the same
name and contents as the tag, then tags this branch.  The tag fixup
branch is never deleted.
- There are no checks that CVS branch and tag names are legal git names,
or indeed that any other similar limitations of git are honored.
- 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.  Eventually I
will add an option to invoke git-fast-import automatically and pipe the
output directly into git-fast-import.
- Only single projects can be converted at a time.  I don't think that
this will be a significant limitation when outputting to git.
To try it out:
1. Install svn (to be able to check out cvs2svn) and either cvs or rcs.
2. Check out the current trunk version of cvs2svn:
    svn co http://cvs2svn.tigris.org/svn/cvs2svn/trunk cvs2svn-trunk
    cd cvs2svn-trunk
    make check # ...optional
3. Configure cvs2svn for your conversion.  This has to be done via the
"options-file method"[3].  See cvs2svn-example.options and
test-data/main-cvsrepos/cvs2svn-git.options as examples; the former file
includes voluminous documentation.
4. Run cvs2svn.  This outputs two git-fast-import files, with the names
specified by your options file.  In the example, these files are named
'cvs2svn-tmp/git-blob.dat' and 'cvs2svn-tmp/git-dump.dat'.
5. 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

I am looking forward to your feedback. Even better would be if somebody wants to join forces on this project. I would be happy to supply the cvs2svn knowledge if you can bring the git experience.

Michael

[1] http://cvs2svn.tigris.org/ [2] http://www.kernel.org/pub/software/scm/git/docs/git-fast-import.html [3] http://cvs2svn.tigris.org/cvs2svn.html#cmd-vs-options

Next: Johannes Schindelin
Message 1 of 40 in “cvs2svn conversion directly to git ready for experimentation”
  1. Michael HaggertyAug 1, 2007
  2. Johannes SchindelinAug 1, 2007
  3. Jakub NarebskiAug 1, 2007
  4. Michael HaggertyAug 2, 2007
  5. Jon SmirlAug 2, 2007
  6. Steffen ProhaskaAug 2, 2007
  7. Michael HaggertyAug 2, 2007
  8. Marko MacekAug 2, 2007
  9. Jon SmirlAug 2, 2007
  10. Oswald BuddenhagenAug 5, 2007
  11. Simon 'corecode' SchubertAug 2, 2007
  12. Steffen ProhaskaAug 2, 2007
  13. Simon 'corecode' SchubertAug 2, 2007
  14. Robin RosenbergAug 2, 2007
  15. Lübbe OnkenAug 2, 2007
  16. Lübbe OnkenAug 2, 2007
  17. Steffen ProhaskaAug 2, 2007
  18. Simon 'corecode' SchubertAug 2, 2007
  19. Michael HaggertyAug 2, 2007
  20. Simon 'corecode' SchubertAug 3, 2007
  21. Steffen ProhaskaAug 4, 2007
  22. Shawn O. PearceAug 3, 2007
  23. Michael HaggertyAug 2, 2007
  24. Linus TorvaldsAug 2, 2007
  25. Michael HaggertyAug 2, 2007
  26. Shawn O. PearceAug 3, 2007
  27. Jon SmirlAug 2, 2007
  28. Michael HaggertyAug 2, 2007
  29. Martin LanghoffAug 2, 2007
  30. Johannes SchindelinAug 3, 2007
  31. Steffen ProhaskaAug 3, 2007
  32. Steffen ProhaskaAug 3, 2007
  33. Michael HaggertyAug 3, 2007
  34. Patwardhan, RajeshAug 3, 2007
  35. Jon SmirlAug 3, 2007
  36. Patwardhan, RajeshAug 3, 2007
  37. Michael HaggertyAug 3, 2007
  38. Jon SmirlAug 3, 2007
  39. Jon SmirlAug 3, 2007
  40. Lübbe OnkenAug 2, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.