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