blob: ddfcb3d143239174d600c8fde9dbb58b772fff4b [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 Hamano9e52d4e2007-06-13 08:29:3316 [-r <remote>] [<CVS_module>]
Junio C Hamano1a4e8412005-12-27 08:17:2317
18
19DESCRIPTION
20-----------
21Imports a CVS repository into git. It will either create a new
22repository, or incrementally import into an existing one.
23
24Splitting the CVS log into patch sets is done by 'cvsps'.
25At least version 2.1 is required.
26
Junio C Hamano625716a2009-03-25 18:49:3027*WARNING:* for certain situations the import leads to incorrect results.
28Please see the section <<issues,ISSUES>> for further reference.
29
Junio C Hamano04a32862006-03-08 01:42:4330You should *never* do any work of your own on the branches that are
Junio C Hamano1aa40d22010-01-21 17:46:4331created by 'git cvsimport'. By default initial import will create and populate a
Junio C Hamano04a32862006-03-08 01:42:4332"master" branch from the CVS repository's main branch which you're free
Junio C Hamano1aa40d22010-01-21 17:46:4333to work with; after that, you need to 'git merge' incremental imports, or
Junio C Hamano9e52d4e2007-06-13 08:29:3334any CVS branches, yourself. It is advisable to specify a named remote via
35-r to separate and protect the incoming branches.
36
Junio C Hamanoba4b9282008-07-06 05:20:3137If 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
Junio C Hamano04a32862006-03-08 01:42:4343
Junio C Hamano1a4e8412005-12-27 08:17:2344OPTIONS
45-------
Junio C Hamano12a3a232007-04-07 10:18:1046-v::
47Verbosity: let 'cvsimport' report what it is doing.
48
Junio C Hamano1a4e8412005-12-27 08:17:2349-d <CVSROOT>::
50The root of the CVS archive. May be local (a simple path) or remote;
Junio C Hamanoa77a5132007-06-08 16:13:4451currently, only the :local:, :ext: and :pserver: access methods
Junio C Hamano1aa40d22010-01-21 17:46:4352are supported. If not given, 'git cvsimport' will try to read it
Junio C Hamano12a3a232007-04-07 10:18:1053from `CVS/Root`. If no such file exists, it checks for the
54`CVSROOT` environment variable.
55
56<CVS_module>::
57The CVS module you want to import. Relative to <CVSROOT>.
Junio C Hamano1aa40d22010-01-21 17:46:4358If not given, 'git cvsimport' tries to read it from
Junio C Hamano12a3a232007-04-07 10:18:1059`CVS/Repository`.
Junio C Hamano1a4e8412005-12-27 08:17:2360
61-C <target-dir>::
62 The git repository to import to. If the directory doesn't
63 exist, it will be created. Default is the current directory.
64
Junio C Hamano9e52d4e2007-06-13 08:29:3365-r <remote>::
66The git remote to import this CVS repository into.
67Moves all CVS branches into remotes/<remote>/<branch>
Junio C Hamano1aa40d22010-01-21 17:46:4368akin to the way 'git clone' uses 'origin' by default.
Junio C Hamano9e52d4e2007-06-13 08:29:3369
Junio C Hamano1a4e8412005-12-27 08:17:2370-o <branch-for-HEAD>::
Junio C Hamano9e52d4e2007-06-13 08:29:3371When no remote is specified (via -r) the 'HEAD' branch
72from CVS is imported to the 'origin' branch within the git
73repository, as 'HEAD' already has a special meaning for git.
74When a remote is specified the 'HEAD' branch is named
Junio C Hamano1aa40d22010-01-21 17:46:4375remotes/<remote>/master mirroring 'git clone' behaviour.
Junio C Hamano9e52d4e2007-06-13 08:29:3376Use this option if you want to import into a different
77branch.
Junio C Hamano1a4e8412005-12-27 08:17:2378+
79Use '-o master' for continuing an import that was initially done by
80the old cvs2git tool.
81
Junio C Hamano12a3a232007-04-07 10:18:1082-i::
83Import-only: don't perform a checkout after importing. This option
84ensures the working directory and index remain untouched and will
85not create them if they do not exist.
86
87-k::
88Kill keywords: will extract files with '-kk' from the CVS archive
89to avoid noisy changesets. Highly recommended, but off by default
Junio C Hamanoa77a5132007-06-08 16:13:4490to preserve compatibility with early imported trees.
Junio C Hamano12a3a232007-04-07 10:18:1091
92-u::
93Convert underscores in tag and branch names to dots.
94
95-s <subst>::
96Substitute the character "/" in branch names with <subst>
97
Junio C Hamano1a4e8412005-12-27 08:17:2398-p <options-for-cvsps>::
99Additional options for cvsps.
100The options '-u' and '-A' are implicit and should not be used here.
101+
102If you need to pass multiple options, separate them with a comma.
103
Junio C Hamano12a3a232007-04-07 10:18:10104-z <fuzz>::
105Pass the timestamp fuzz factor to cvsps, in seconds. If unset,
106cvsps defaults to 300s.
107
Junio C Hamano1a4e8412005-12-27 08:17:23108-P <cvsps-output-file>::
109Instead of calling cvsps, read the provided cvsps output file. Useful
110for debugging or when cvsps is being handled outside cvsimport.
111
Junio C Hamanoa77a5132007-06-08 16:13:44112-m::
Junio C Hamano1a4e8412005-12-27 08:17:23113Attempt to detect merges based on the commit message. This option
Junio C Hamano4f1d8c42008-03-03 02:01:16114will enable default regexes that try to capture the source
Junio C Hamanoa77a5132007-06-08 16:13:44115branch name from the commit message.
Junio C Hamano1a4e8412005-12-27 08:17:23116
117-M <regex>::
118Attempt to detect merges based on the commit message with a custom
Junio C Hamanoefe3c632008-02-14 00:51:31119regex. It can be used with '-m' to enable the default regexes
120as well. You must escape forward slashes.
Junio C Hamano4f1d8c42008-03-03 02:01:16121+
122The regex must capture the source branch name in $1.
123+
124This option can be used several times to provide several detection regexes.
Junio C Hamano1a4e8412005-12-27 08:17:23125
Junio C Hamano12a3a232007-04-07 10:18:10126-S <regex>::
127Skip paths matching the regex.
Junio C Hamano1a4e8412005-12-27 08:17:23128
Junio C Hamanod1204f02007-01-08 11:18:48129-a::
130Import all commits, including recent ones. cvsimport by default
131skips commits that have a timestamp less than 10 minutes ago.
132
Junio C Hamanod1204f02007-01-08 11:18:48133-L <limit>::
134Limit the number of commits imported. Workaround for cases where
135cvsimport leaks memory.
136
Junio C Hamanodb911ee2007-02-28 08:13:52137-A <author-conv-file>::
138CVS by default uses the Unix username when writing its
139commit logs. Using this option and an author-conv-file
140in this format
Junio C Hamanoa725a532006-03-21 08:33:47141+
142---------
Junio C Hamano02d6fa52006-01-16 08:23:23143exon=Andreas Ericsson <ae@op5.se>
144spawn=Simon Pawn <spawn@frog-pond.org>
145
Junio C Hamanoa725a532006-03-21 08:33:47146---------
147+
Junio C Hamano1aa40d22010-01-21 17:46:43148'git cvsimport' will make it appear as those authors had
Junio C Hamanoa725a532006-03-21 08:33:47149their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly
150all along.
151+
Junio C Hamano12a3a232007-04-07 10:18:10152For convenience, this data is saved to `$GIT_DIR/cvs-authors`
153each time the '-A' option is provided and read from that same
Junio C Hamano1aa40d22010-01-21 17:46:43154file each time 'git cvsimport' is run.
Junio C Hamanoa725a532006-03-21 08:33:47155+
156It is not recommended to use this feature if you intend to
157export changes back to CVS again later with
Junio C Hamano1aa40d22010-01-21 17:46:43158'git cvsexportcommit'.
Junio C Hamano02d6fa52006-01-16 08:23:23159
Junio C Hamano12a3a232007-04-07 10:18:10160-h::
161Print a short usage message and exit.
162
Junio C Hamano1a4e8412005-12-27 08:17:23163OUTPUT
164------
165If '-v' is specified, the script reports what it is doing.
166
167Otherwise, success is indicated the Unix way, i.e. by simply exiting with
168a zero exit status.
169
Junio C Hamano625716a2009-03-25 18:49:30170[[issues]]
171ISSUES
172------
173Problems related to timestamps:
174
175 * If timestamps of commits in the cvs repository are not stable enough
Junio C Hamano9572e922009-04-02 06:52:03176 to be used for ordering commits changes may show up in the wrong
177 order.
Junio C Hamano625716a2009-03-25 18:49:30178 * If any files were ever "cvs import"ed more than once (e.g., import of
Junio C Hamano9572e922009-04-02 06:52:03179 more than one vendor release) the HEAD contains the wrong content.
Junio C Hamano625716a2009-03-25 18:49:30180 * If the timestamp order of different files cross the revision order
Junio C Hamano9572e922009-04-02 06:52:03181 within the commit matching time window the order of commits may be
182 wrong.
Junio C Hamano625716a2009-03-25 18:49:30183
184Problems related to branches:
185
Junio C Hamano9572e922009-04-02 06:52:03186 * Branches on which no commits have been made are not imported.
Junio C Hamano625716a2009-03-25 18:49:30187 * All files from the branching point are added to a branch even if
Junio C Hamano9572e922009-04-02 06:52:03188 never added in cvs.
189 * This applies to files added to the source branch *after* a daughter
190 branch was created: if previously no commit was made on the daughter
191 branch they will erroneously be added to the daughter branch in git.
Junio C Hamano625716a2009-03-25 18:49:30192
193Problems related to tags:
194
Junio C Hamano9572e922009-04-02 06:52:03195* Multiple tags on the same revision are not imported.
Junio C Hamano625716a2009-03-25 18:49:30196
197If you suspect that any of these issues may apply to the repository you
198want to import consider using these alternative tools which proved to be
Junio C Hamanoea868332009-04-21 08:11:06199more stable in practice:
Junio C Hamano625716a2009-03-25 18:49:30200
201* cvs2git (part of cvs2svn), `http://cvs2svn.tigris.org`
202* parsecvs, `http://cgit.freedesktop.org/~keithp/parsecvs`
Junio C Hamano1a4e8412005-12-27 08:17:23203
204Author
205------
206Written by Matthias Urlichs <smurf@smurf.noris.de>, with help from
207various participants of the git-list <git@vger.kernel.org>.
208
209Documentation
210--------------
211Documentation by Matthias Urlichs <smurf@smurf.noris.de>.
212
213GIT
214---
Junio C Hamanof7c042d2008-06-06 22:50:53215Part of the linkgit:git[1] suite