blob: 90fdc2551a349939a0cbf9ab12d792ab20f0b765 [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>]
Jean-Noël Avila133db542021-11-06 19:48:52 +010014 [-C <git-repository>] [-z <fuzz>] [-i] [-k] [-u] [-s <subst>]
15 [-a] [-m] [-M <regex>] [-S <regex>] [-L <commit-limit>]
16 [-r <remote>] [-R] [<CVS-module>]
Matthias Urlichsf2114062005-06-30 22:54:33 +020017
18
19DESCRIPTION
20-----------
John Keeping1187ec92013-01-24 19:18:45 +000021*WARNING:* `git cvsimport` uses cvsps version 2, which is considered
22deprecated; it does not work with cvsps version 3 and later. If you are
23performing a one-shot import of a CVS repository consider using
Roberto Tyley2df85662014-02-18 21:42:22 +000024http://cvs2svn.tigris.org/cvs2git.html[cvs2git] or
Josh Soref65175d92023-11-24 03:35:12 +000025https://gitlab.com/esr/cvs-fast-export[cvs-fast-export].
John Keeping1187ec92013-01-24 19:18:45 +000026
Thomas Ackermann2de9b712013-01-21 20:17:53 +010027Imports a CVS repository into Git. It will either create a new
Matthias Urlichsf2114062005-06-30 22:54:33 +020028repository, or incrementally import into an existing one.
29
Sven Verdoolaege1cd36742005-07-03 09:43:00 +020030Splitting the CVS log into patch sets is done by 'cvsps'.
Matthias Urlichsf2114062005-06-30 22:54:33 +020031At least version 2.1 is required.
32
Heiko Voigt7c982132009-03-23 20:53:05 +010033*WARNING:* for certain situations the import leads to incorrect results.
34Please see the section <<issues,ISSUES>> for further reference.
35
Matthias Urlichsa5412112006-03-07 10:08:34 +010036You should *never* do any work of your own on the branches that are
Thomas Rast0b444cd2010-01-10 00:33:00 +010037created by 'git cvsimport'. By default initial import will create and populate a
Matthias Urlichsa5412112006-03-07 10:08:34 +010038"master" branch from the CVS repository's main branch which you're free
Thomas Rast0b444cd2010-01-10 00:33:00 +010039to work with; after that, you need to 'git merge' incremental imports, or
Andy Whitcroftcbc9be52007-06-04 10:01:34 +010040any CVS branches, yourself. It is advisable to specify a named remote via
41-r to separate and protect the incoming branches.
42
Matthew Ogilviea41a32b2008-07-04 22:43:41 -060043If you intend to set up a shared public repository that all developers can
44read/write, or if you want to use linkgit:git-cvsserver[1], then you
45probably want to make a bare clone of the imported repository,
46and use the clone as the shared repository.
47See linkgit:gitcvs-migration[7].
48
Matthias Urlichsa5412112006-03-07 10:08:34 +010049
Matthias Urlichsf2114062005-06-30 22:54:33 +020050OPTIONS
51-------
Frank Lichtenheld7b14b3c2007-04-06 23:52:42 +020052-v::
53 Verbosity: let 'cvsimport' report what it is doing.
54
Matthias Urlichsf2114062005-06-30 22:54:33 +020055-d <CVSROOT>::
56 The root of the CVS archive. May be local (a simple path) or remote;
Junio C Hamanoa6080a02007-06-07 00:04:01 -070057 currently, only the :local:, :ext: and :pserver: access methods
Thomas Rast0b444cd2010-01-10 00:33:00 +010058 are supported. If not given, 'git cvsimport' will try to read it
Frank Lichtenheld407049c2007-04-06 23:52:40 +020059 from `CVS/Root`. If no such file exists, it checks for the
60 `CVSROOT` environment variable.
Matthias Urlichsf2114062005-06-30 22:54:33 +020061
Jean-Noël Avila133db542021-11-06 19:48:52 +010062<CVS-module>::
Frank Lichtenheld7b14b3c2007-04-06 23:52:42 +020063 The CVS module you want to import. Relative to <CVSROOT>.
Thomas Rast0b444cd2010-01-10 00:33:00 +010064 If not given, 'git cvsimport' tries to read it from
Frank Lichtenheld7b14b3c2007-04-06 23:52:42 +020065 `CVS/Repository`.
66
iso-8859-1?Q?David_K=E5gedalb0921332005-08-15 20:18:25 +020067-C <target-dir>::
Thomas Ackermann2de9b712013-01-21 20:17:53 +010068 The Git repository to import to. If the directory doesn't
iso-8859-1?Q?David_K=E5gedalb0921332005-08-15 20:18:25 +020069 exist, it will be created. Default is the current directory.
70
Andy Whitcroftcbc9be52007-06-04 10:01:34 +010071-r <remote>::
Thomas Ackermann2de9b712013-01-21 20:17:53 +010072 The Git remote to import this CVS repository into.
Andy Whitcroftcbc9be52007-06-04 10:01:34 +010073 Moves all CVS branches into remotes/<remote>/<branch>
Thomas Rast0b444cd2010-01-10 00:33:00 +010074 akin to the way 'git clone' uses 'origin' by default.
Andy Whitcroftcbc9be52007-06-04 10:01:34 +010075
Frank Lichtenheld7b14b3c2007-04-06 23:52:42 +020076-o <branch-for-HEAD>::
Matthieu Moy661c3e92016-06-28 13:40:15 +020077 When no remote is specified (via -r) the `HEAD` branch
Thomas Ackermann2de9b712013-01-21 20:17:53 +010078 from CVS is imported to the 'origin' branch within the Git
Matthieu Moy661c3e92016-06-28 13:40:15 +020079 repository, as `HEAD` already has a special meaning for Git.
80 When a remote is specified the `HEAD` branch is named
Thomas Rast0b444cd2010-01-10 00:33:00 +010081 remotes/<remote>/master mirroring 'git clone' behaviour.
Andy Whitcroftcbc9be52007-06-04 10:01:34 +010082 Use this option if you want to import into a different
83 branch.
Frank Lichtenheld7b14b3c2007-04-06 23:52:42 +020084+
85Use '-o master' for continuing an import that was initially done by
86the old cvs2git tool.
87
Sven Verdoolaegec1c774e2005-07-11 16:57:49 +020088-i::
89 Import-only: don't perform a checkout after importing. This option
Lukas_Sandström5f3aa192005-11-11 02:12:27 +010090 ensures the working directory and index remain untouched and will
Sven Verdoolaegec1c774e2005-07-11 16:57:49 +020091 not create them if they do not exist.
92
Martin Langhoffabe05822005-08-16 17:39:29 +120093-k::
Frank Lichtenheld0e070f92007-04-06 23:52:43 +020094 Kill keywords: will extract files with '-kk' from the CVS archive
Martin Langhoffabe05822005-08-16 17:39:29 +120095 to avoid noisy changesets. Highly recommended, but off by default
Junio C Hamanoa6080a02007-06-07 00:04:01 -070096 to preserve compatibility with early imported trees.
Martin Langhoffabe05822005-08-16 17:39:29 +120097
H. Peter Anvin0d821d42005-09-06 10:36:01 -070098-u::
99 Convert underscores in tag and branch names to dots.
100
Frank Lichtenheld7b14b3c2007-04-06 23:52:42 +0200101-s <subst>::
102 Substitute the character "/" in branch names with <subst>
Matthias Urlichsf2114062005-06-30 22:54:33 +0200103
104-p <options-for-cvsps>::
105 Additional options for cvsps.
Matthieu Moy23f82392016-06-28 13:40:10 +0200106 The options `-u` and '-A' are implicit and should not be used here.
Jonas Fonsecadf8baa42005-10-03 19:16:30 +0200107+
108If you need to pass multiple options, separate them with a comma.
Matthias Urlichsf2114062005-06-30 22:54:33 +0200109
Frank Lichtenheld7b14b3c2007-04-06 23:52:42 +0200110-z <fuzz>::
111 Pass the timestamp fuzz factor to cvsps, in seconds. If unset,
112 cvsps defaults to 300s.
113
Nikolai Weibull56e5e912005-12-09 00:28:05 +0100114-P <cvsps-output-file>::
Martin Langhoff211dcac2005-11-02 13:48:47 +1300115 Instead of calling cvsps, read the provided cvsps output file. Useful
116 for debugging or when cvsps is being handled outside cvsimport.
117
Junio C Hamanoa6080a02007-06-07 00:04:01 -0700118-m::
Martin Langhoffdb4b6582005-08-16 22:35:27 +1200119 Attempt to detect merges based on the commit message. This option
Philippe Bruhat (BooK3c832a72008-02-28 11:18:23 +0100120 will enable default regexes that try to capture the source
Junio C Hamanoa6080a02007-06-07 00:04:01 -0700121 branch name from the commit message.
Martin Langhoffdb4b6582005-08-16 22:35:27 +1200122
123-M <regex>::
124 Attempt to detect merges based on the commit message with a custom
Matthieu Moy23f82392016-06-28 13:40:10 +0200125 regex. It can be used with `-m` to enable the default regexes
Sergei Organov8608b332008-02-13 17:31:17 +0300126 as well. You must escape forward slashes.
Philippe Bruhat (BooK3c832a72008-02-28 11:18:23 +0100127+
128The regex must capture the source branch name in $1.
129+
130This option can be used several times to provide several detection regexes.
Martin Langhoffdb4b6582005-08-16 22:35:27 +1200131
Frank Lichtenheld7b14b3c2007-04-06 23:52:42 +0200132-S <regex>::
133 Skip paths matching the regex.
Johannes Schindelinfbfd60d2005-08-17 11:19:20 +0200134
Martin Langhoffded9f402007-01-08 19:43:39 +1300135-a::
136 Import all commits, including recent ones. cvsimport by default
137 skips commits that have a timestamp less than 10 minutes ago.
Martin Langhoffeec84962007-01-08 19:53:03 +1300138
Martin Langhoffeec84962007-01-08 19:53:03 +1300139-L <limit>::
140 Limit the number of commits imported. Workaround for cases where
141 cvsimport leaks memory.
142
Michael Poole0a43acb2007-02-27 22:27:44 -0500143-A <author-conv-file>::
144 CVS by default uses the Unix username when writing its
145 commit logs. Using this option and an author-conv-file
Chris Rorvickfb2c9842012-10-16 22:53:29 -0500146 maps the name recorded in CVS to author name, e-mail and
Jason St. John0ffa1542013-11-08 19:48:52 -0500147 optional time zone:
Francis Daly3070b602006-03-20 10:41:18 +0000148+
149---------
Andreas Ericssonffd97f32006-01-13 00:38:59 +0100150 exon=Andreas Ericsson <ae@op5.se>
Chris Rorvickfb2c9842012-10-16 22:53:29 -0500151 spawn=Simon Pawn <spawn@frog-pond.org> America/Chicago
Andreas Ericssonffd97f32006-01-13 00:38:59 +0100152
Francis Daly3070b602006-03-20 10:41:18 +0000153---------
154+
Thomas Rast0b444cd2010-01-10 00:33:00 +0100155'git cvsimport' will make it appear as those authors had
Francis Daly3070b602006-03-20 10:41:18 +0000156their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly
Jason St. John0ffa1542013-11-08 19:48:52 -0500157all along. If a time zone is specified, GIT_AUTHOR_DATE will
Chris Rorvickfb2c9842012-10-16 22:53:29 -0500158have the corresponding offset applied.
Francis Daly3070b602006-03-20 10:41:18 +0000159+
Frank Lichtenheld407049c2007-04-06 23:52:40 +0200160For convenience, this data is saved to `$GIT_DIR/cvs-authors`
Frank Lichtenheld0e070f92007-04-06 23:52:43 +0200161each time the '-A' option is provided and read from that same
Thomas Rast0b444cd2010-01-10 00:33:00 +0100162file each time 'git cvsimport' is run.
Francis Daly3070b602006-03-20 10:41:18 +0000163+
164It is not recommended to use this feature if you intend to
165export changes back to CVS again later with
Thomas Rast0b444cd2010-01-10 00:33:00 +0100166'git cvsexportcommit'.
Andreas Ericssonffd97f32006-01-13 00:38:59 +0100167
Aaron Crane0455ec02010-02-06 18:26:24 +0000168-R::
169 Generate a `$GIT_DIR/cvs-revisions` file containing a mapping from CVS
170 revision numbers to newly-created Git commit IDs. The generated file
171 will contain one line for each (filename, revision) pair imported;
172 each line will look like
173+
174---------
175src/widget.c 1.1 1d862f173cdc7325b6fa6d2ae1cfd61fd1b512b7
176---------
177+
178The revision data is appended to the file if it already exists, for use when
179doing incremental imports.
180+
181This option may be useful if you have CVS revision numbers stored in commit
182messages, bug-tracking systems, email archives, and the like.
183
Frank Lichtenheld7b14b3c2007-04-06 23:52:42 +0200184-h::
185 Print a short usage message and exit.
186
Matthias Urlichsf2114062005-06-30 22:54:33 +0200187OUTPUT
188------
Matthieu Moy23f82392016-06-28 13:40:10 +0200189If `-v` is specified, the script reports what it is doing.
Matthias Urlichsf2114062005-06-30 22:54:33 +0200190
191Otherwise, success is indicated the Unix way, i.e. by simply exiting with
192a zero exit status.
193
Heiko Voigt7c982132009-03-23 20:53:05 +0100194[[issues]]
195ISSUES
196------
197Problems related to timestamps:
198
Ville Skyttä6b677a22010-07-20 00:17:17 +0300199 * If timestamps of commits in the CVS repository are not stable enough
Heiko Voigt75fd8772009-04-01 22:24:28 +0200200 to be used for ordering commits changes may show up in the wrong
201 order.
Heiko Voigt7c982132009-03-23 20:53:05 +0100202 * If any files were ever "cvs import"ed more than once (e.g., import of
Heiko Voigt75fd8772009-04-01 22:24:28 +0200203 more than one vendor release) the HEAD contains the wrong content.
Heiko Voigt7c982132009-03-23 20:53:05 +0100204 * If the timestamp order of different files cross the revision order
Heiko Voigt75fd8772009-04-01 22:24:28 +0200205 within the commit matching time window the order of commits may be
206 wrong.
Heiko Voigt7c982132009-03-23 20:53:05 +0100207
208Problems related to branches:
209
Heiko Voigt75fd8772009-04-01 22:24:28 +0200210 * Branches on which no commits have been made are not imported.
Heiko Voigt7c982132009-03-23 20:53:05 +0100211 * All files from the branching point are added to a branch even if
Ville Skyttä6b677a22010-07-20 00:17:17 +0300212 never added in CVS.
Heiko Voigt75fd8772009-04-01 22:24:28 +0200213 * This applies to files added to the source branch *after* a daughter
214 branch was created: if previously no commit was made on the daughter
215 branch they will erroneously be added to the daughter branch in git.
Heiko Voigt7c982132009-03-23 20:53:05 +0100216
217Problems related to tags:
218
Heiko Voigt75fd8772009-04-01 22:24:28 +0200219* Multiple tags on the same revision are not imported.
Heiko Voigt7c982132009-03-23 20:53:05 +0100220
221If you suspect that any of these issues may apply to the repository you
Thomas Ackermannf745acb2014-11-03 21:37:07 +0100222want to import, consider using cvs2git:
Heiko Voigt7c982132009-03-23 20:53:05 +0100223
Josh Sorefd05b08c2023-11-24 03:35:13 +0000224* cvs2git (part of cvs2svn), `https://subversion.apache.org/`
Matthias Urlichsf2114062005-06-30 22:54:33 +0200225
Matthias Urlichsf2114062005-06-30 22:54:33 +0200226GIT
227---
Christian Couder9e1f0a82008-06-06 09:07:32 +0200228Part of the linkgit:git[1] suite