Junio C Hamano | 215a7ad | 2005-09-07 17:26:23 -0700 | [diff] [blame] | 1 | git-cvsimport(1) |
| 2 | ================ |
Matthias Urlichs | f211406 | 2005-06-30 22:54:33 +0200 | [diff] [blame] | 3 | |
| 4 | NAME |
| 5 | ---- |
Junio C Hamano | c3f0baa | 2007-01-18 15:53:37 -0800 | [diff] [blame] | 6 | git-cvsimport - Salvage your data out of another SCM people love to hate |
Matthias Urlichs | f211406 | 2005-06-30 22:54:33 +0200 | [diff] [blame] | 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Jonas Fonseca | 353ce81 | 2005-12-31 18:37:15 +0100 | [diff] [blame] | 11 | [verse] |
Jonathan Nieder | b1889c3 | 2008-06-30 01:09:04 -0500 | [diff] [blame] | 12 | 'git cvsimport' [-o <branch-for-HEAD>] [-h] [-v] [-d <CVSROOT>] |
Frank Lichtenheld | edbe446 | 2007-04-06 23:52:39 +0200 | [diff] [blame] | 13 | [-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 Crane | 0455ec0 | 2010-02-06 18:26:24 +0000 | [diff] [blame] | 16 | [-r <remote>] [-R] [<CVS_module>] |
Matthias Urlichs | f211406 | 2005-06-30 22:54:33 +0200 | [diff] [blame] | 17 | |
| 18 | |
| 19 | DESCRIPTION |
| 20 | ----------- |
| 21 | Imports a CVS repository into git. It will either create a new |
| 22 | repository, or incrementally import into an existing one. |
| 23 | |
Sven Verdoolaege | 1cd3674 | 2005-07-03 09:43:00 +0200 | [diff] [blame] | 24 | Splitting the CVS log into patch sets is done by 'cvsps'. |
Matthias Urlichs | f211406 | 2005-06-30 22:54:33 +0200 | [diff] [blame] | 25 | At least version 2.1 is required. |
| 26 | |
Heiko Voigt | 7c98213 | 2009-03-23 20:53:05 +0100 | [diff] [blame] | 27 | *WARNING:* for certain situations the import leads to incorrect results. |
| 28 | Please see the section <<issues,ISSUES>> for further reference. |
| 29 | |
Matthias Urlichs | a541211 | 2006-03-07 10:08:34 +0100 | [diff] [blame] | 30 | You should *never* do any work of your own on the branches that are |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 31 | created by 'git cvsimport'. By default initial import will create and populate a |
Matthias Urlichs | a541211 | 2006-03-07 10:08:34 +0100 | [diff] [blame] | 32 | "master" branch from the CVS repository's main branch which you're free |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 33 | to work with; after that, you need to 'git merge' incremental imports, or |
Andy Whitcroft | cbc9be5 | 2007-06-04 10:01:34 +0100 | [diff] [blame] | 34 | any CVS branches, yourself. It is advisable to specify a named remote via |
| 35 | -r to separate and protect the incoming branches. |
| 36 | |
Matthew Ogilvie | a41a32b | 2008-07-04 22:43:41 -0600 | [diff] [blame] | 37 | If you intend to set up a shared public repository that all developers can |
| 38 | read/write, or if you want to use linkgit:git-cvsserver[1], then you |
| 39 | probably want to make a bare clone of the imported repository, |
| 40 | and use the clone as the shared repository. |
| 41 | See linkgit:gitcvs-migration[7]. |
| 42 | |
Matthias Urlichs | a541211 | 2006-03-07 10:08:34 +0100 | [diff] [blame] | 43 | |
Matthias Urlichs | f211406 | 2005-06-30 22:54:33 +0200 | [diff] [blame] | 44 | OPTIONS |
| 45 | ------- |
Frank Lichtenheld | 7b14b3c | 2007-04-06 23:52:42 +0200 | [diff] [blame] | 46 | -v:: |
| 47 | Verbosity: let 'cvsimport' report what it is doing. |
| 48 | |
Matthias Urlichs | f211406 | 2005-06-30 22:54:33 +0200 | [diff] [blame] | 49 | -d <CVSROOT>:: |
| 50 | The root of the CVS archive. May be local (a simple path) or remote; |
Junio C Hamano | a6080a0 | 2007-06-07 00:04:01 -0700 | [diff] [blame] | 51 | currently, only the :local:, :ext: and :pserver: access methods |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 52 | are supported. If not given, 'git cvsimport' will try to read it |
Frank Lichtenheld | 407049c | 2007-04-06 23:52:40 +0200 | [diff] [blame] | 53 | from `CVS/Root`. If no such file exists, it checks for the |
| 54 | `CVSROOT` environment variable. |
Matthias Urlichs | f211406 | 2005-06-30 22:54:33 +0200 | [diff] [blame] | 55 | |
Frank Lichtenheld | 7b14b3c | 2007-04-06 23:52:42 +0200 | [diff] [blame] | 56 | <CVS_module>:: |
| 57 | The CVS module you want to import. Relative to <CVSROOT>. |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 58 | If not given, 'git cvsimport' tries to read it from |
Frank Lichtenheld | 7b14b3c | 2007-04-06 23:52:42 +0200 | [diff] [blame] | 59 | `CVS/Repository`. |
| 60 | |
iso-8859-1?Q?David_K=E5gedal | b092133 | 2005-08-15 20:18:25 +0200 | [diff] [blame] | 61 | -C <target-dir>:: |
Christian Meder | 72e9340 | 2005-10-10 16:01:31 -0700 | [diff] [blame] | 62 | The git repository to import to. If the directory doesn't |
iso-8859-1?Q?David_K=E5gedal | b092133 | 2005-08-15 20:18:25 +0200 | [diff] [blame] | 63 | exist, it will be created. Default is the current directory. |
| 64 | |
Andy Whitcroft | cbc9be5 | 2007-06-04 10:01:34 +0100 | [diff] [blame] | 65 | -r <remote>:: |
| 66 | The git remote to import this CVS repository into. |
| 67 | Moves all CVS branches into remotes/<remote>/<branch> |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 68 | akin to the way 'git clone' uses 'origin' by default. |
Andy Whitcroft | cbc9be5 | 2007-06-04 10:01:34 +0100 | [diff] [blame] | 69 | |
Frank Lichtenheld | 7b14b3c | 2007-04-06 23:52:42 +0200 | [diff] [blame] | 70 | -o <branch-for-HEAD>:: |
Andy Whitcroft | cbc9be5 | 2007-06-04 10:01:34 +0100 | [diff] [blame] | 71 | 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 Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 75 | remotes/<remote>/master mirroring 'git clone' behaviour. |
Andy Whitcroft | cbc9be5 | 2007-06-04 10:01:34 +0100 | [diff] [blame] | 76 | Use this option if you want to import into a different |
| 77 | branch. |
Frank Lichtenheld | 7b14b3c | 2007-04-06 23:52:42 +0200 | [diff] [blame] | 78 | + |
| 79 | Use '-o master' for continuing an import that was initially done by |
| 80 | the old cvs2git tool. |
| 81 | |
Sven Verdoolaege | c1c774e | 2005-07-11 16:57:49 +0200 | [diff] [blame] | 82 | -i:: |
| 83 | Import-only: don't perform a checkout after importing. This option |
Lukas_Sandström | 5f3aa19 | 2005-11-11 02:12:27 +0100 | [diff] [blame] | 84 | ensures the working directory and index remain untouched and will |
Sven Verdoolaege | c1c774e | 2005-07-11 16:57:49 +0200 | [diff] [blame] | 85 | not create them if they do not exist. |
| 86 | |
Martin Langhoff | abe0582 | 2005-08-16 17:39:29 +1200 | [diff] [blame] | 87 | -k:: |
Frank Lichtenheld | 0e070f9 | 2007-04-06 23:52:43 +0200 | [diff] [blame] | 88 | Kill keywords: will extract files with '-kk' from the CVS archive |
Martin Langhoff | abe0582 | 2005-08-16 17:39:29 +1200 | [diff] [blame] | 89 | to avoid noisy changesets. Highly recommended, but off by default |
Junio C Hamano | a6080a0 | 2007-06-07 00:04:01 -0700 | [diff] [blame] | 90 | to preserve compatibility with early imported trees. |
Martin Langhoff | abe0582 | 2005-08-16 17:39:29 +1200 | [diff] [blame] | 91 | |
H. Peter Anvin | 0d821d4 | 2005-09-06 10:36:01 -0700 | [diff] [blame] | 92 | -u:: |
| 93 | Convert underscores in tag and branch names to dots. |
| 94 | |
Frank Lichtenheld | 7b14b3c | 2007-04-06 23:52:42 +0200 | [diff] [blame] | 95 | -s <subst>:: |
| 96 | Substitute the character "/" in branch names with <subst> |
Matthias Urlichs | f211406 | 2005-06-30 22:54:33 +0200 | [diff] [blame] | 97 | |
| 98 | -p <options-for-cvsps>:: |
| 99 | Additional options for cvsps. |
iso-8859-1?Q?David_K=E5gedal | b092133 | 2005-08-15 20:18:25 +0200 | [diff] [blame] | 100 | The options '-u' and '-A' are implicit and should not be used here. |
Jonas Fonseca | df8baa4 | 2005-10-03 19:16:30 +0200 | [diff] [blame] | 101 | + |
| 102 | If you need to pass multiple options, separate them with a comma. |
Matthias Urlichs | f211406 | 2005-06-30 22:54:33 +0200 | [diff] [blame] | 103 | |
Frank Lichtenheld | 7b14b3c | 2007-04-06 23:52:42 +0200 | [diff] [blame] | 104 | -z <fuzz>:: |
| 105 | Pass the timestamp fuzz factor to cvsps, in seconds. If unset, |
| 106 | cvsps defaults to 300s. |
| 107 | |
Nikolai Weibull | 56e5e91 | 2005-12-09 00:28:05 +0100 | [diff] [blame] | 108 | -P <cvsps-output-file>:: |
Martin Langhoff | 211dcac | 2005-11-02 13:48:47 +1300 | [diff] [blame] | 109 | 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 Hamano | a6080a0 | 2007-06-07 00:04:01 -0700 | [diff] [blame] | 112 | -m:: |
Martin Langhoff | db4b658 | 2005-08-16 22:35:27 +1200 | [diff] [blame] | 113 | Attempt to detect merges based on the commit message. This option |
Philippe Bruhat (BooK | 3c832a7 | 2008-02-28 11:18:23 +0100 | [diff] [blame] | 114 | will enable default regexes that try to capture the source |
Junio C Hamano | a6080a0 | 2007-06-07 00:04:01 -0700 | [diff] [blame] | 115 | branch name from the commit message. |
Martin Langhoff | db4b658 | 2005-08-16 22:35:27 +1200 | [diff] [blame] | 116 | |
| 117 | -M <regex>:: |
| 118 | Attempt to detect merges based on the commit message with a custom |
Sergei Organov | 8608b33 | 2008-02-13 17:31:17 +0300 | [diff] [blame] | 119 | regex. It can be used with '-m' to enable the default regexes |
| 120 | as well. You must escape forward slashes. |
Philippe Bruhat (BooK | 3c832a7 | 2008-02-28 11:18:23 +0100 | [diff] [blame] | 121 | + |
| 122 | The regex must capture the source branch name in $1. |
| 123 | + |
| 124 | This option can be used several times to provide several detection regexes. |
Martin Langhoff | db4b658 | 2005-08-16 22:35:27 +1200 | [diff] [blame] | 125 | |
Frank Lichtenheld | 7b14b3c | 2007-04-06 23:52:42 +0200 | [diff] [blame] | 126 | -S <regex>:: |
| 127 | Skip paths matching the regex. |
Johannes Schindelin | fbfd60d | 2005-08-17 11:19:20 +0200 | [diff] [blame] | 128 | |
Martin Langhoff | ded9f40 | 2007-01-08 19:43:39 +1300 | [diff] [blame] | 129 | -a:: |
| 130 | Import all commits, including recent ones. cvsimport by default |
| 131 | skips commits that have a timestamp less than 10 minutes ago. |
Martin Langhoff | eec8496 | 2007-01-08 19:53:03 +1300 | [diff] [blame] | 132 | |
Martin Langhoff | eec8496 | 2007-01-08 19:53:03 +1300 | [diff] [blame] | 133 | -L <limit>:: |
| 134 | Limit the number of commits imported. Workaround for cases where |
| 135 | cvsimport leaks memory. |
| 136 | |
Michael Poole | 0a43acb | 2007-02-27 22:27:44 -0500 | [diff] [blame] | 137 | -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 Daly | 3070b60 | 2006-03-20 10:41:18 +0000 | [diff] [blame] | 141 | + |
| 142 | --------- |
Andreas Ericsson | ffd97f3 | 2006-01-13 00:38:59 +0100 | [diff] [blame] | 143 | exon=Andreas Ericsson <ae@op5.se> |
| 144 | spawn=Simon Pawn <spawn@frog-pond.org> |
| 145 | |
Francis Daly | 3070b60 | 2006-03-20 10:41:18 +0000 | [diff] [blame] | 146 | --------- |
| 147 | + |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 148 | 'git cvsimport' will make it appear as those authors had |
Francis Daly | 3070b60 | 2006-03-20 10:41:18 +0000 | [diff] [blame] | 149 | their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly |
| 150 | all along. |
| 151 | + |
Frank Lichtenheld | 407049c | 2007-04-06 23:52:40 +0200 | [diff] [blame] | 152 | For convenience, this data is saved to `$GIT_DIR/cvs-authors` |
Frank Lichtenheld | 0e070f9 | 2007-04-06 23:52:43 +0200 | [diff] [blame] | 153 | each time the '-A' option is provided and read from that same |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 154 | file each time 'git cvsimport' is run. |
Francis Daly | 3070b60 | 2006-03-20 10:41:18 +0000 | [diff] [blame] | 155 | + |
| 156 | It is not recommended to use this feature if you intend to |
| 157 | export changes back to CVS again later with |
Thomas Rast | 0b444cd | 2010-01-10 00:33:00 +0100 | [diff] [blame] | 158 | 'git cvsexportcommit'. |
Andreas Ericsson | ffd97f3 | 2006-01-13 00:38:59 +0100 | [diff] [blame] | 159 | |
Aaron Crane | 0455ec0 | 2010-02-06 18:26:24 +0000 | [diff] [blame] | 160 | -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 | --------- |
| 167 | src/widget.c 1.1 1d862f173cdc7325b6fa6d2ae1cfd61fd1b512b7 |
| 168 | --------- |
| 169 | + |
| 170 | The revision data is appended to the file if it already exists, for use when |
| 171 | doing incremental imports. |
| 172 | + |
| 173 | This option may be useful if you have CVS revision numbers stored in commit |
| 174 | messages, bug-tracking systems, email archives, and the like. |
| 175 | |
Frank Lichtenheld | 7b14b3c | 2007-04-06 23:52:42 +0200 | [diff] [blame] | 176 | -h:: |
| 177 | Print a short usage message and exit. |
| 178 | |
Matthias Urlichs | f211406 | 2005-06-30 22:54:33 +0200 | [diff] [blame] | 179 | OUTPUT |
| 180 | ------ |
| 181 | If '-v' is specified, the script reports what it is doing. |
| 182 | |
| 183 | Otherwise, success is indicated the Unix way, i.e. by simply exiting with |
| 184 | a zero exit status. |
| 185 | |
Heiko Voigt | 7c98213 | 2009-03-23 20:53:05 +0100 | [diff] [blame] | 186 | [[issues]] |
| 187 | ISSUES |
| 188 | ------ |
| 189 | Problems related to timestamps: |
| 190 | |
Ville Skyttä | 6b677a2 | 2010-07-20 00:17:17 +0300 | [diff] [blame] | 191 | * If timestamps of commits in the CVS repository are not stable enough |
Heiko Voigt | 75fd877 | 2009-04-01 22:24:28 +0200 | [diff] [blame] | 192 | to be used for ordering commits changes may show up in the wrong |
| 193 | order. |
Heiko Voigt | 7c98213 | 2009-03-23 20:53:05 +0100 | [diff] [blame] | 194 | * If any files were ever "cvs import"ed more than once (e.g., import of |
Heiko Voigt | 75fd877 | 2009-04-01 22:24:28 +0200 | [diff] [blame] | 195 | more than one vendor release) the HEAD contains the wrong content. |
Heiko Voigt | 7c98213 | 2009-03-23 20:53:05 +0100 | [diff] [blame] | 196 | * If the timestamp order of different files cross the revision order |
Heiko Voigt | 75fd877 | 2009-04-01 22:24:28 +0200 | [diff] [blame] | 197 | within the commit matching time window the order of commits may be |
| 198 | wrong. |
Heiko Voigt | 7c98213 | 2009-03-23 20:53:05 +0100 | [diff] [blame] | 199 | |
| 200 | Problems related to branches: |
| 201 | |
Heiko Voigt | 75fd877 | 2009-04-01 22:24:28 +0200 | [diff] [blame] | 202 | * Branches on which no commits have been made are not imported. |
Heiko Voigt | 7c98213 | 2009-03-23 20:53:05 +0100 | [diff] [blame] | 203 | * All files from the branching point are added to a branch even if |
Ville Skyttä | 6b677a2 | 2010-07-20 00:17:17 +0300 | [diff] [blame] | 204 | never added in CVS. |
Heiko Voigt | 75fd877 | 2009-04-01 22:24:28 +0200 | [diff] [blame] | 205 | * 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 Voigt | 7c98213 | 2009-03-23 20:53:05 +0100 | [diff] [blame] | 208 | |
| 209 | Problems related to tags: |
| 210 | |
Heiko Voigt | 75fd877 | 2009-04-01 22:24:28 +0200 | [diff] [blame] | 211 | * Multiple tags on the same revision are not imported. |
Heiko Voigt | 7c98213 | 2009-03-23 20:53:05 +0100 | [diff] [blame] | 212 | |
| 213 | If you suspect that any of these issues may apply to the repository you |
| 214 | want to import consider using these alternative tools which proved to be |
Mike Ralphson | 680ebc0 | 2009-04-17 19:13:28 +0100 | [diff] [blame] | 215 | more stable in practice: |
Heiko Voigt | 7c98213 | 2009-03-23 20:53:05 +0100 | [diff] [blame] | 216 | |
| 217 | * cvs2git (part of cvs2svn), `http://cvs2svn.tigris.org` |
| 218 | * parsecvs, `http://cgit.freedesktop.org/~keithp/parsecvs` |
Matthias Urlichs | f211406 | 2005-06-30 22:54:33 +0200 | [diff] [blame] | 219 | |
| 220 | Author |
| 221 | ------ |
| 222 | Written by Matthias Urlichs <smurf@smurf.noris.de>, with help from |
| 223 | various participants of the git-list <git@vger.kernel.org>. |
| 224 | |
| 225 | Documentation |
| 226 | -------------- |
| 227 | Documentation by Matthias Urlichs <smurf@smurf.noris.de>. |
| 228 | |
| 229 | GIT |
| 230 | --- |
Christian Couder | 9e1f0a8 | 2008-06-06 09:07:32 +0200 | [diff] [blame] | 231 | Part of the linkgit:git[1] suite |