blob: d1bcda28f423566dff17a7bff85f40ae07d4ca9a [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-cvsimport(1)
2================
3
4NAME
5----
Junio C Hamano7c73c662007-01-19 00:37:506git-cvsimport - Salvage your data out of another SCM people love to hate
Junio C Hamano1a4e8412005-12-27 08:17:237
8
9SYNOPSIS
10--------
Junio C Hamano235a91e2006-01-07 01:13:5811[verse]
Junio C Hamanofce7c7e2008-07-02 03:06:3812'git cvsimport' [-o <branch-for-HEAD>] [-h] [-v] [-d <CVSROOT>]
Junio C Hamano12a3a232007-04-07 10:18:1013 [-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>]
Junio C Hamano4aa0bcc2010-03-03 05:13:1216 [-r <remote>] [-R] [<CVS_module>]
Junio C Hamano1a4e8412005-12-27 08:17:2317
18
19DESCRIPTION
20-----------
Junio C Hamano0d1122e2013-02-01 21:37:0221*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
24link:http://cvs2svn.tigris.org/cvs2git.html[cvs2git] or
25link:https://github.com/BartMassey/parsecvs[parsecvs].
26
Junio C Hamano076ffcc2013-02-06 05:13:2127Imports a CVS repository into Git. It will either create a new
Junio C Hamano1a4e8412005-12-27 08:17:2328repository, or incrementally import into an existing one.
29
30Splitting the CVS log into patch sets is done by 'cvsps'.
31At least version 2.1 is required.
32
Junio C Hamano625716a2009-03-25 18:49:3033*WARNING:* for certain situations the import leads to incorrect results.
34Please see the section <<issues,ISSUES>> for further reference.
35
Junio C Hamano04a32862006-03-08 01:42:4336You should *never* do any work of your own on the branches that are
Junio C Hamano1aa40d22010-01-21 17:46:4337created by 'git cvsimport'. By default initial import will create and populate a
Junio C Hamano04a32862006-03-08 01:42:4338"master" branch from the CVS repository's main branch which you're free
Junio C Hamano1aa40d22010-01-21 17:46:4339to work with; after that, you need to 'git merge' incremental imports, or
Junio C Hamano9e52d4e2007-06-13 08:29:3340any CVS branches, yourself. It is advisable to specify a named remote via
41-r to separate and protect the incoming branches.
42
Junio C Hamanoba4b9282008-07-06 05:20:3143If 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
Junio C Hamano04a32862006-03-08 01:42:4349
Junio C Hamano1a4e8412005-12-27 08:17:2350OPTIONS
51-------
Junio C Hamano12a3a232007-04-07 10:18:1052-v::
53Verbosity: let 'cvsimport' report what it is doing.
54
Junio C Hamano1a4e8412005-12-27 08:17:2355-d <CVSROOT>::
56The root of the CVS archive. May be local (a simple path) or remote;
Junio C Hamanoa77a5132007-06-08 16:13:4457currently, only the :local:, :ext: and :pserver: access methods
Junio C Hamano1aa40d22010-01-21 17:46:4358are supported. If not given, 'git cvsimport' will try to read it
Junio C Hamano12a3a232007-04-07 10:18:1059from `CVS/Root`. If no such file exists, it checks for the
60`CVSROOT` environment variable.
61
62<CVS_module>::
63The CVS module you want to import. Relative to <CVSROOT>.
Junio C Hamano1aa40d22010-01-21 17:46:4364If not given, 'git cvsimport' tries to read it from
Junio C Hamano12a3a232007-04-07 10:18:1065`CVS/Repository`.
Junio C Hamano1a4e8412005-12-27 08:17:2366
67-C <target-dir>::
Junio C Hamano076ffcc2013-02-06 05:13:2168The Git repository to import to. If the directory doesn't
Junio C Hamano1a4e8412005-12-27 08:17:2369 exist, it will be created. Default is the current directory.
70
Junio C Hamano9e52d4e2007-06-13 08:29:3371-r <remote>::
Junio C Hamano076ffcc2013-02-06 05:13:2172The Git remote to import this CVS repository into.
Junio C Hamano9e52d4e2007-06-13 08:29:3373Moves all CVS branches into remotes/<remote>/<branch>
Junio C Hamano1aa40d22010-01-21 17:46:4374akin to the way 'git clone' uses 'origin' by default.
Junio C Hamano9e52d4e2007-06-13 08:29:3375
Junio C Hamano1a4e8412005-12-27 08:17:2376-o <branch-for-HEAD>::
Junio C Hamano9e52d4e2007-06-13 08:29:3377When no remote is specified (via -r) the 'HEAD' branch
Junio C Hamano076ffcc2013-02-06 05:13:2178from CVS is imported to the 'origin' branch within the Git
79repository, as 'HEAD' already has a special meaning for Git.
Junio C Hamano9e52d4e2007-06-13 08:29:3380When a remote is specified the 'HEAD' branch is named
Junio C Hamano1aa40d22010-01-21 17:46:4381remotes/<remote>/master mirroring 'git clone' behaviour.
Junio C Hamano9e52d4e2007-06-13 08:29:3382Use this option if you want to import into a different
83branch.
Junio C Hamano1a4e8412005-12-27 08:17:2384+
85Use '-o master' for continuing an import that was initially done by
86the old cvs2git tool.
87
Junio C Hamano12a3a232007-04-07 10:18:1088-i::
89Import-only: don't perform a checkout after importing. This option
90ensures the working directory and index remain untouched and will
91not create them if they do not exist.
92
93-k::
94Kill keywords: will extract files with '-kk' from the CVS archive
95to avoid noisy changesets. Highly recommended, but off by default
Junio C Hamanoa77a5132007-06-08 16:13:4496to preserve compatibility with early imported trees.
Junio C Hamano12a3a232007-04-07 10:18:1097
98-u::
99Convert underscores in tag and branch names to dots.
100
101-s <subst>::
102Substitute the character "/" in branch names with <subst>
103
Junio C Hamano1a4e8412005-12-27 08:17:23104-p <options-for-cvsps>::
105Additional options for cvsps.
106The options '-u' and '-A' are implicit and should not be used here.
107+
108If you need to pass multiple options, separate them with a comma.
109
Junio C Hamano12a3a232007-04-07 10:18:10110-z <fuzz>::
111Pass the timestamp fuzz factor to cvsps, in seconds. If unset,
112cvsps defaults to 300s.
113
Junio C Hamano1a4e8412005-12-27 08:17:23114-P <cvsps-output-file>::
115Instead of calling cvsps, read the provided cvsps output file. Useful
116for debugging or when cvsps is being handled outside cvsimport.
117
Junio C Hamanoa77a5132007-06-08 16:13:44118-m::
Junio C Hamano1a4e8412005-12-27 08:17:23119Attempt to detect merges based on the commit message. This option
Junio C Hamano4f1d8c42008-03-03 02:01:16120will enable default regexes that try to capture the source
Junio C Hamanoa77a5132007-06-08 16:13:44121branch name from the commit message.
Junio C Hamano1a4e8412005-12-27 08:17:23122
123-M <regex>::
124Attempt to detect merges based on the commit message with a custom
Junio C Hamanoefe3c632008-02-14 00:51:31125regex. It can be used with '-m' to enable the default regexes
126as well. You must escape forward slashes.
Junio C Hamano4f1d8c42008-03-03 02:01:16127+
128The regex must capture the source branch name in $1.
129+
130This option can be used several times to provide several detection regexes.
Junio C Hamano1a4e8412005-12-27 08:17:23131
Junio C Hamano12a3a232007-04-07 10:18:10132-S <regex>::
133Skip paths matching the regex.
Junio C Hamano1a4e8412005-12-27 08:17:23134
Junio C Hamanod1204f02007-01-08 11:18:48135-a::
136Import all commits, including recent ones. cvsimport by default
137skips commits that have a timestamp less than 10 minutes ago.
138
Junio C Hamanod1204f02007-01-08 11:18:48139-L <limit>::
140Limit the number of commits imported. Workaround for cases where
141cvsimport leaks memory.
142
Junio C Hamanodb911ee2007-02-28 08:13:52143-A <author-conv-file>::
144CVS by default uses the Unix username when writing its
145commit logs. Using this option and an author-conv-file
Junio C Hamano4eb2b9c2012-11-15 21:12:29146maps the name recorded in CVS to author name, e-mail and
147optional timezone:
Junio C Hamanoa725a532006-03-21 08:33:47148+
149---------
Junio C Hamano02d6fa52006-01-16 08:23:23150exon=Andreas Ericsson <ae@op5.se>
Junio C Hamano4eb2b9c2012-11-15 21:12:29151spawn=Simon Pawn <spawn@frog-pond.org> America/Chicago
Junio C Hamano02d6fa52006-01-16 08:23:23152
Junio C Hamanoa725a532006-03-21 08:33:47153---------
154+
Junio C Hamano1aa40d22010-01-21 17:46:43155'git cvsimport' will make it appear as those authors had
Junio C Hamanoa725a532006-03-21 08:33:47156their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly
Junio C Hamano4eb2b9c2012-11-15 21:12:29157all along. If a timezone is specified, GIT_AUTHOR_DATE will
158have the corresponding offset applied.
Junio C Hamanoa725a532006-03-21 08:33:47159+
Junio C Hamano12a3a232007-04-07 10:18:10160For convenience, this data is saved to `$GIT_DIR/cvs-authors`
161each time the '-A' option is provided and read from that same
Junio C Hamano1aa40d22010-01-21 17:46:43162file each time 'git cvsimport' is run.
Junio C Hamanoa725a532006-03-21 08:33:47163+
164It is not recommended to use this feature if you intend to
165export changes back to CVS again later with
Junio C Hamano1aa40d22010-01-21 17:46:43166'git cvsexportcommit'.
Junio C Hamano02d6fa52006-01-16 08:23:23167
Junio C Hamano4aa0bcc2010-03-03 05:13:12168-R::
169Generate a `$GIT_DIR/cvs-revisions` file containing a mapping from CVS
170revision numbers to newly-created Git commit IDs. The generated file
171will contain one line for each (filename, revision) pair imported;
172each 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
Junio C Hamano12a3a232007-04-07 10:18:10184-h::
185Print a short usage message and exit.
186
Junio C Hamano1a4e8412005-12-27 08:17:23187OUTPUT
188------
189If '-v' is specified, the script reports what it is doing.
190
191Otherwise, success is indicated the Unix way, i.e. by simply exiting with
192a zero exit status.
193
Junio C Hamano625716a2009-03-25 18:49:30194[[issues]]
195ISSUES
196------
197Problems related to timestamps:
198
Junio C Hamano619596a2010-08-18 22:15:35199 * If timestamps of commits in the CVS repository are not stable enough
Junio C Hamano9572e922009-04-02 06:52:03200 to be used for ordering commits changes may show up in the wrong
201 order.
Junio C Hamano625716a2009-03-25 18:49:30202 * If any files were ever "cvs import"ed more than once (e.g., import of
Junio C Hamano9572e922009-04-02 06:52:03203 more than one vendor release) the HEAD contains the wrong content.
Junio C Hamano625716a2009-03-25 18:49:30204 * If the timestamp order of different files cross the revision order
Junio C Hamano9572e922009-04-02 06:52:03205 within the commit matching time window the order of commits may be
206 wrong.
Junio C Hamano625716a2009-03-25 18:49:30207
208Problems related to branches:
209
Junio C Hamano9572e922009-04-02 06:52:03210 * Branches on which no commits have been made are not imported.
Junio C Hamano625716a2009-03-25 18:49:30211 * All files from the branching point are added to a branch even if
Junio C Hamano619596a2010-08-18 22:15:35212 never added in CVS.
Junio C Hamano9572e922009-04-02 06:52:03213 * 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.
Junio C Hamano625716a2009-03-25 18:49:30216
217Problems related to tags:
218
Junio C Hamano9572e922009-04-02 06:52:03219* Multiple tags on the same revision are not imported.
Junio C Hamano625716a2009-03-25 18:49:30220
221If you suspect that any of these issues may apply to the repository you
Junio C Hamano46247182013-01-09 20:50:28222want to imort, consider using cvs2git:
Junio C Hamano625716a2009-03-25 18:49:30223
Junio C Hamano46247182013-01-09 20:50:28224* cvs2git (part of cvs2svn), `http://subversion.apache.org/`
Junio C Hamano1a4e8412005-12-27 08:17:23225
Junio C Hamano1a4e8412005-12-27 08:17:23226GIT
227---
Junio C Hamanof7c042d2008-06-06 22:50:53228Part of the linkgit:git[1] suite