git-cvsimport — Salvage your data out of another SCM people love to hate
git cvsimport [-A <author-conv-file>] [-b] [-C <git_repository>]
[-d <CVSROOT>] [-h] [-i] [-k] [-m] [-M <regex>]
[-p <options-for-engine>] [-P <cvsps-output-file>]
[-r <remote>] [-R] [-s <subst>] [-S <regex>] [-u]
[-v] [-z <fuzz>] [<CVS_module>]
Imports a CVS repository into git. This tool will either create a new repository, or incrementally import into an existing one.
WARNING: The CVS model of version control lends itself to all manner of perversities; not all sequences of CVS operations can be translated into an import stream, and importing is not guaranteed to produce a perfectly accurate representation of CVS history. Please see the section on engine-specific issues for further reference.
git cvsimport will do well at translating CVS repositories with a linear or close-to-linear revision history, no merges, and well-disciplined tagging practices. More complex cases will require human judgment amplified by a repository-editing tool such as reposurgeon.
CVS by default uses the Unix username when writing its commit logs. Using this option and an author-conv-file maps the name recorded in CVS to author name, e-mail and optional timezone:
exon=Andreas Ericsson <ae@op5.se> +0200 spawn=Simon Pawn <spawn@frog-pond.org> -0500
git cvsimport will make it appear as those authors had their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly all along.
For convenience, this data is saved to $GIT_DIR/cvs-authors
each time the -A option is provided and read from that same
file each time git cvsimport is run.
It is not recommended to use this feature if you intend to export changes back to CVS again later with git cvsexportcommit.
Generate a $GIT_DIR/cvs-revisions
file containing a mapping from CVS
revision numbers to newly-created Git commit IDs. The generated file
will contain one line for each (filename, revision) pair imported;
each line will look like
src/widget.c 1.1 1d862f173cdc7325b6fa6d2ae1cfd61fd1b512b7
The revision data is appended to the file if it already exists, for use when doing incremental imports.
This option may be useful if you have CVS revision numbers stored in commit messages, bug-tracking systems, email archives, and the like.
If -v is specified, the program reports what it is doing.
Otherwise, success is indicated the Unix way, i.e. by simply exiting with a zero exit status.
In 2012 two serious bugs dating back to 2006 in cvsps were exposed. The ancestry-branch tracking formerly enabled by -A did not work, and branch detection was generally buggy; translations of branchy repos could be mangled. While the --fast-export mode in 3.x releases of cvsps solved the problem, it required an emergency rewrite of git-cvsimport. Some compatibility with older versions was unavoidably lost
The -a, -o, and -L options in older versions of this tool have been removed (in effect, -a is always on; you can negate it with a suitably crafted -d argument). Certain older versions could take a named timezone (like "America/Chicago") in an author-map file rather than just a [+-]hhmm offset; this version doesn’t do that, but the capability may be restored in a future release.
The -m and -M options are also not presently implemented. In future versions of this program -m and -M may be either restored or retired in favor of more flexible editing tools such as git-filter-branch and reposurgeon.
The conversion engines try to warn you about repository histories they can’t handle; see their individual manual pages to learn how to interpret the warnings you may receive.
The default conversion engine is cvsps. If warnings you receive suggest that the repository translation is invalid, consider switching engines to cvs2git.
The default conversion engine is cvsps; at least version 3.3 is
required. The cvsps project page is at http://www.catb.org/~esr/cvsps
.
Things to know about this engine:
The cvs2git project page is at http://cvs2svn.tigris.org
. It is
much slower than cvsps, and does not implement some git-cvsimport
options (such as -d and -A), but it handles a wider range of
pathological CVS cases.