blob: 608cd63fc359d591e2aafbb8bd2fbae9b868b68b [file] [log] [blame]
Junio C Hamano215a7ad2005-09-07 17:26:23 -07001git-cvsimport(1)
2================
Matthias Urlichsf2114062005-06-30 22:54:33 +02003
4NAME
5----
Junio C Hamanoc3f0baa2007-01-18 15:53:37 -08006git-cvsimport - Salvage your data out of another SCM people love to hate
Matthias Urlichsf2114062005-06-30 22:54:33 +02007
8
9SYNOPSIS
10--------
Jonas Fonseca353ce812005-12-31 18:37:15 +010011[verse]
Jonathan Niederb1889c32008-06-30 01:09:04 -050012'git cvsimport' [-o <branch-for-HEAD>] [-h] [-v] [-d <CVSROOT>]
Frank Lichtenheldedbe4462007-04-06 23:52:39 +020013 [-A <author-conv-file>] [-p <options-for-cvsps>] [-P <file>]
14 [-C <git_repository>] [-z <fuzz>] [-i] [-k] [-u] [-s <subst>]
15 [-a] [-m] [-M <regex>] [-S <regex>] [-L <commitlimit>]
Aaron Crane0455ec02010-02-06 18:26:24 +000016 [-r <remote>] [-R] [<CVS_module>]
Matthias Urlichsf2114062005-06-30 22:54:33 +020017
18
19DESCRIPTION
20-----------
21Imports a CVS repository into git. It will either create a new
22repository, or incrementally import into an existing one.
23
Sven Verdoolaege1cd36742005-07-03 09:43:00 +020024Splitting the CVS log into patch sets is done by 'cvsps'.
Matthias Urlichsf2114062005-06-30 22:54:33 +020025At least version 2.1 is required.
26
Heiko Voigt7c982132009-03-23 20:53:05 +010027*WARNING:* for certain situations the import leads to incorrect results.
28Please see the section <<issues,ISSUES>> for further reference.
29
Matthias Urlichsa5412112006-03-07 10:08:34 +010030You should *never* do any work of your own on the branches that are
Thomas Rast0b444cd2010-01-10 00:33:00 +010031created by 'git cvsimport'. By default initial import will create and populate a
Matthias Urlichsa5412112006-03-07 10:08:34 +010032"master" branch from the CVS repository's main branch which you're free
Thomas Rast0b444cd2010-01-10 00:33:00 +010033to work with; after that, you need to 'git merge' incremental imports, or
Andy Whitcroftcbc9be52007-06-04 10:01:34 +010034any CVS branches, yourself. It is advisable to specify a named remote via
35-r to separate and protect the incoming branches.
36
Matthew Ogilviea41a32b2008-07-04 22:43:41 -060037If you intend to set up a shared public repository that all developers can
38read/write, or if you want to use linkgit:git-cvsserver[1], then you
39probably want to make a bare clone of the imported repository,
40and use the clone as the shared repository.
41See linkgit:gitcvs-migration[7].
42
Matthias Urlichsa5412112006-03-07 10:08:34 +010043
Matthias Urlichsf2114062005-06-30 22:54:33 +020044OPTIONS
45-------
Frank Lichtenheld7b14b3c2007-04-06 23:52:42 +020046-v::
47 Verbosity: let 'cvsimport' report what it is doing.
48
Matthias Urlichsf2114062005-06-30 22:54:33 +020049-d <CVSROOT>::
50 The root of the CVS archive. May be local (a simple path) or remote;
Junio C Hamanoa6080a02007-06-07 00:04:01 -070051 currently, only the :local:, :ext: and :pserver: access methods
Thomas Rast0b444cd2010-01-10 00:33:00 +010052 are supported. If not given, 'git cvsimport' will try to read it
Frank Lichtenheld407049c2007-04-06 23:52:40 +020053 from `CVS/Root`. If no such file exists, it checks for the
54 `CVSROOT` environment variable.
Matthias Urlichsf2114062005-06-30 22:54:33 +020055
Frank Lichtenheld7b14b3c2007-04-06 23:52:42 +020056<CVS_module>::
57 The CVS module you want to import. Relative to <CVSROOT>.
Thomas Rast0b444cd2010-01-10 00:33:00 +010058 If not given, 'git cvsimport' tries to read it from
Frank Lichtenheld7b14b3c2007-04-06 23:52:42 +020059 `CVS/Repository`.
60
iso-8859-1?Q?David_K=E5gedalb0921332005-08-15 20:18:25 +020061-C <target-dir>::
Christian Meder72e93402005-10-10 16:01:31 -070062 The git repository to import to. If the directory doesn't
iso-8859-1?Q?David_K=E5gedalb0921332005-08-15 20:18:25 +020063 exist, it will be created. Default is the current directory.
64
Andy Whitcroftcbc9be52007-06-04 10:01:34 +010065-r <remote>::
66 The git remote to import this CVS repository into.
67 Moves all CVS branches into remotes/<remote>/<branch>
Thomas Rast0b444cd2010-01-10 00:33:00 +010068 akin to the way 'git clone' uses 'origin' by default.
Andy Whitcroftcbc9be52007-06-04 10:01:34 +010069
Frank Lichtenheld7b14b3c2007-04-06 23:52:42 +020070-o <branch-for-HEAD>::
Andy Whitcroftcbc9be52007-06-04 10:01:34 +010071 When no remote is specified (via -r) the 'HEAD' branch
72 from CVS is imported to the 'origin' branch within the git
73 repository, as 'HEAD' already has a special meaning for git.
74 When a remote is specified the 'HEAD' branch is named
Thomas Rast0b444cd2010-01-10 00:33:00 +010075 remotes/<remote>/master mirroring 'git clone' behaviour.
Andy Whitcroftcbc9be52007-06-04 10:01:34 +010076 Use this option if you want to import into a different
77 branch.
Frank Lichtenheld7b14b3c2007-04-06 23:52:42 +020078+
79Use '-o master' for continuing an import that was initially done by
80the old cvs2git tool.
81
Sven Verdoolaegec1c774e2005-07-11 16:57:49 +020082-i::
83 Import-only: don't perform a checkout after importing. This option
Lukas_Sandström5f3aa192005-11-11 02:12:27 +010084 ensures the working directory and index remain untouched and will
Sven Verdoolaegec1c774e2005-07-11 16:57:49 +020085 not create them if they do not exist.
86
Martin Langhoffabe05822005-08-16 17:39:29 +120087-k::
Frank Lichtenheld0e070f92007-04-06 23:52:43 +020088 Kill keywords: will extract files with '-kk' from the CVS archive
Martin Langhoffabe05822005-08-16 17:39:29 +120089 to avoid noisy changesets. Highly recommended, but off by default
Junio C Hamanoa6080a02007-06-07 00:04:01 -070090 to preserve compatibility with early imported trees.
Martin Langhoffabe05822005-08-16 17:39:29 +120091
H. Peter Anvin0d821d42005-09-06 10:36:01 -070092-u::
93 Convert underscores in tag and branch names to dots.
94
Frank Lichtenheld7b14b3c2007-04-06 23:52:42 +020095-s <subst>::
96 Substitute the character "/" in branch names with <subst>
Matthias Urlichsf2114062005-06-30 22:54:33 +020097
98-p <options-for-cvsps>::
99 Additional options for cvsps.
iso-8859-1?Q?David_K=E5gedalb0921332005-08-15 20:18:25 +0200100 The options '-u' and '-A' are implicit and should not be used here.
Jonas Fonsecadf8baa42005-10-03 19:16:30 +0200101+
102If you need to pass multiple options, separate them with a comma.
Matthias Urlichsf2114062005-06-30 22:54:33 +0200103
Frank Lichtenheld7b14b3c2007-04-06 23:52:42 +0200104-z <fuzz>::
105 Pass the timestamp fuzz factor to cvsps, in seconds. If unset,
106 cvsps defaults to 300s.
107
Nikolai Weibull56e5e912005-12-09 00:28:05 +0100108-P <cvsps-output-file>::
Martin Langhoff211dcac2005-11-02 13:48:47 +1300109 Instead of calling cvsps, read the provided cvsps output file. Useful
110 for debugging or when cvsps is being handled outside cvsimport.
111
Junio C Hamanoa6080a02007-06-07 00:04:01 -0700112-m::
Martin Langhoffdb4b6582005-08-16 22:35:27 +1200113 Attempt to detect merges based on the commit message. This option
Philippe Bruhat (BooK3c832a72008-02-28 11:18:23 +0100114 will enable default regexes that try to capture the source
Junio C Hamanoa6080a02007-06-07 00:04:01 -0700115 branch name from the commit message.
Martin Langhoffdb4b6582005-08-16 22:35:27 +1200116
117-M <regex>::
118 Attempt to detect merges based on the commit message with a custom
Sergei Organov8608b332008-02-13 17:31:17 +0300119 regex. It can be used with '-m' to enable the default regexes
120 as well. You must escape forward slashes.
Philippe Bruhat (BooK3c832a72008-02-28 11:18:23 +0100121+
122The regex must capture the source branch name in $1.
123+
124This option can be used several times to provide several detection regexes.
Martin Langhoffdb4b6582005-08-16 22:35:27 +1200125
Frank Lichtenheld7b14b3c2007-04-06 23:52:42 +0200126-S <regex>::
127 Skip paths matching the regex.
Johannes Schindelinfbfd60d2005-08-17 11:19:20 +0200128
Martin Langhoffded9f402007-01-08 19:43:39 +1300129-a::
130 Import all commits, including recent ones. cvsimport by default
131 skips commits that have a timestamp less than 10 minutes ago.
Martin Langhoffeec84962007-01-08 19:53:03 +1300132
Martin Langhoffeec84962007-01-08 19:53:03 +1300133-L <limit>::
134 Limit the number of commits imported. Workaround for cases where
135 cvsimport leaks memory.
136
Michael Poole0a43acb2007-02-27 22:27:44 -0500137-A <author-conv-file>::
138 CVS by default uses the Unix username when writing its
139 commit logs. Using this option and an author-conv-file
140 in this format
Francis Daly3070b602006-03-20 10:41:18 +0000141+
142---------
Andreas Ericssonffd97f32006-01-13 00:38:59 +0100143 exon=Andreas Ericsson <ae@op5.se>
144 spawn=Simon Pawn <spawn@frog-pond.org>
145
Francis Daly3070b602006-03-20 10:41:18 +0000146---------
147+
Thomas Rast0b444cd2010-01-10 00:33:00 +0100148'git cvsimport' will make it appear as those authors had
Francis Daly3070b602006-03-20 10:41:18 +0000149their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly
150all along.
151+
Frank Lichtenheld407049c2007-04-06 23:52:40 +0200152For convenience, this data is saved to `$GIT_DIR/cvs-authors`
Frank Lichtenheld0e070f92007-04-06 23:52:43 +0200153each time the '-A' option is provided and read from that same
Thomas Rast0b444cd2010-01-10 00:33:00 +0100154file each time 'git cvsimport' is run.
Francis Daly3070b602006-03-20 10:41:18 +0000155+
156It is not recommended to use this feature if you intend to
157export changes back to CVS again later with
Thomas Rast0b444cd2010-01-10 00:33:00 +0100158'git cvsexportcommit'.
Andreas Ericssonffd97f32006-01-13 00:38:59 +0100159
Aaron Crane0455ec02010-02-06 18:26:24 +0000160-R::
161 Generate a `$GIT_DIR/cvs-revisions` file containing a mapping from CVS
162 revision numbers to newly-created Git commit IDs. The generated file
163 will contain one line for each (filename, revision) pair imported;
164 each line will look like
165+
166---------
167src/widget.c 1.1 1d862f173cdc7325b6fa6d2ae1cfd61fd1b512b7
168---------
169+
170The revision data is appended to the file if it already exists, for use when
171doing incremental imports.
172+
173This option may be useful if you have CVS revision numbers stored in commit
174messages, bug-tracking systems, email archives, and the like.
175
Frank Lichtenheld7b14b3c2007-04-06 23:52:42 +0200176-h::
177 Print a short usage message and exit.
178
Matthias Urlichsf2114062005-06-30 22:54:33 +0200179OUTPUT
180------
181If '-v' is specified, the script reports what it is doing.
182
183Otherwise, success is indicated the Unix way, i.e. by simply exiting with
184a zero exit status.
185
Heiko Voigt7c982132009-03-23 20:53:05 +0100186[[issues]]
187ISSUES
188------
189Problems related to timestamps:
190
Ville Skyttä6b677a22010-07-20 00:17:17 +0300191 * If timestamps of commits in the CVS repository are not stable enough
Heiko Voigt75fd8772009-04-01 22:24:28 +0200192 to be used for ordering commits changes may show up in the wrong
193 order.
Heiko Voigt7c982132009-03-23 20:53:05 +0100194 * If any files were ever "cvs import"ed more than once (e.g., import of
Heiko Voigt75fd8772009-04-01 22:24:28 +0200195 more than one vendor release) the HEAD contains the wrong content.
Heiko Voigt7c982132009-03-23 20:53:05 +0100196 * If the timestamp order of different files cross the revision order
Heiko Voigt75fd8772009-04-01 22:24:28 +0200197 within the commit matching time window the order of commits may be
198 wrong.
Heiko Voigt7c982132009-03-23 20:53:05 +0100199
200Problems related to branches:
201
Heiko Voigt75fd8772009-04-01 22:24:28 +0200202 * Branches on which no commits have been made are not imported.
Heiko Voigt7c982132009-03-23 20:53:05 +0100203 * All files from the branching point are added to a branch even if
Ville Skyttä6b677a22010-07-20 00:17:17 +0300204 never added in CVS.
Heiko Voigt75fd8772009-04-01 22:24:28 +0200205 * This applies to files added to the source branch *after* a daughter
206 branch was created: if previously no commit was made on the daughter
207 branch they will erroneously be added to the daughter branch in git.
Heiko Voigt7c982132009-03-23 20:53:05 +0100208
209Problems related to tags:
210
Heiko Voigt75fd8772009-04-01 22:24:28 +0200211* Multiple tags on the same revision are not imported.
Heiko Voigt7c982132009-03-23 20:53:05 +0100212
213If you suspect that any of these issues may apply to the repository you
214want to import consider using these alternative tools which proved to be
Mike Ralphson680ebc02009-04-17 19:13:28 +0100215more stable in practice:
Heiko Voigt7c982132009-03-23 20:53:05 +0100216
217* cvs2git (part of cvs2svn), `http://cvs2svn.tigris.org`
218* parsecvs, `http://cgit.freedesktop.org/~keithp/parsecvs`
Matthias Urlichsf2114062005-06-30 22:54:33 +0200219
220Author
221------
222Written by Matthias Urlichs <smurf@smurf.noris.de>, with help from
223various participants of the git-list <git@vger.kernel.org>.
224
225Documentation
226--------------
227Documentation by Matthias Urlichs <smurf@smurf.noris.de>.
228
229GIT
230---
Christian Couder9e1f0a82008-06-06 09:07:32 +0200231Part of the linkgit:git[1] suite