Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | git-cvsimport(1) |
| 2 | ================ |
| 3 | |
| 4 | NAME |
| 5 | ---- |
Junio C Hamano | 7c73c66 | 2007-01-19 00:37:50 | [diff] [blame] | 6 | git-cvsimport - Salvage your data out of another SCM people love to hate |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 7 | |
| 8 | |
| 9 | SYNOPSIS |
| 10 | -------- |
Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 11 | [verse] |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 12 | 'git cvsimport' [-o <branch-for-HEAD>] [-h] [-v] [-d <CVSROOT>] |
Junio C Hamano | 12a3a23 | 2007-04-07 10:18:10 | [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>] |
Junio C Hamano | 4aa0bcc | 2010-03-03 05:13:12 | [diff] [blame] | 16 | [-r <remote>] [-R] [<CVS_module>] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 17 | |
| 18 | |
| 19 | DESCRIPTION |
| 20 | ----------- |
Junio C Hamano | 0d1122e | 2013-02-01 21:37:02 | [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 |
| 24 | link:http://cvs2svn.tigris.org/cvs2git.html[cvs2git] or |
| 25 | link:https://github.com/BartMassey/parsecvs[parsecvs]. |
| 26 | |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 27 | Imports a CVS repository into Git. It will either create a new |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 28 | repository, or incrementally import into an existing one. |
| 29 | |
| 30 | Splitting the CVS log into patch sets is done by 'cvsps'. |
| 31 | At least version 2.1 is required. |
| 32 | |
Junio C Hamano | 625716a | 2009-03-25 18:49:30 | [diff] [blame] | 33 | *WARNING:* for certain situations the import leads to incorrect results. |
| 34 | Please see the section <<issues,ISSUES>> for further reference. |
| 35 | |
Junio C Hamano | 04a3286 | 2006-03-08 01:42:43 | [diff] [blame] | 36 | You should *never* do any work of your own on the branches that are |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 37 | created by 'git cvsimport'. By default initial import will create and populate a |
Junio C Hamano | 04a3286 | 2006-03-08 01:42:43 | [diff] [blame] | 38 | "master" branch from the CVS repository's main branch which you're free |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 39 | to work with; after that, you need to 'git merge' incremental imports, or |
Junio C Hamano | 9e52d4e | 2007-06-13 08:29:33 | [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 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [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 | |
Junio C Hamano | 04a3286 | 2006-03-08 01:42:43 | [diff] [blame] | 49 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 50 | OPTIONS |
| 51 | ------- |
Junio C Hamano | 12a3a23 | 2007-04-07 10:18:10 | [diff] [blame] | 52 | -v:: |
| 53 | Verbosity: let 'cvsimport' report what it is doing. |
| 54 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 55 | -d <CVSROOT>:: |
| 56 | The root of the CVS archive. May be local (a simple path) or remote; |
Junio C Hamano | a77a513 | 2007-06-08 16:13:44 | [diff] [blame] | 57 | currently, only the :local:, :ext: and :pserver: access methods |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 58 | are supported. If not given, 'git cvsimport' will try to read it |
Junio C Hamano | 12a3a23 | 2007-04-07 10:18:10 | [diff] [blame] | 59 | from `CVS/Root`. If no such file exists, it checks for the |
| 60 | `CVSROOT` environment variable. |
| 61 | |
| 62 | <CVS_module>:: |
| 63 | The CVS module you want to import. Relative to <CVSROOT>. |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 64 | If not given, 'git cvsimport' tries to read it from |
Junio C Hamano | 12a3a23 | 2007-04-07 10:18:10 | [diff] [blame] | 65 | `CVS/Repository`. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 66 | |
| 67 | -C <target-dir>:: |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 68 | The Git repository to import to. If the directory doesn't |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 69 | exist, it will be created. Default is the current directory. |
| 70 | |
Junio C Hamano | 9e52d4e | 2007-06-13 08:29:33 | [diff] [blame] | 71 | -r <remote>:: |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 72 | The Git remote to import this CVS repository into. |
Junio C Hamano | 9e52d4e | 2007-06-13 08:29:33 | [diff] [blame] | 73 | Moves all CVS branches into remotes/<remote>/<branch> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 74 | akin to the way 'git clone' uses 'origin' by default. |
Junio C Hamano | 9e52d4e | 2007-06-13 08:29:33 | [diff] [blame] | 75 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 76 | -o <branch-for-HEAD>:: |
Junio C Hamano | 9e52d4e | 2007-06-13 08:29:33 | [diff] [blame] | 77 | When no remote is specified (via -r) the 'HEAD' branch |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 78 | from CVS is imported to the 'origin' branch within the Git |
| 79 | repository, as 'HEAD' already has a special meaning for Git. |
Junio C Hamano | 9e52d4e | 2007-06-13 08:29:33 | [diff] [blame] | 80 | When a remote is specified the 'HEAD' branch is named |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 81 | remotes/<remote>/master mirroring 'git clone' behaviour. |
Junio C Hamano | 9e52d4e | 2007-06-13 08:29:33 | [diff] [blame] | 82 | Use this option if you want to import into a different |
| 83 | branch. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 84 | + |
| 85 | Use '-o master' for continuing an import that was initially done by |
| 86 | the old cvs2git tool. |
| 87 | |
Junio C Hamano | 12a3a23 | 2007-04-07 10:18:10 | [diff] [blame] | 88 | -i:: |
| 89 | Import-only: don't perform a checkout after importing. This option |
| 90 | ensures the working directory and index remain untouched and will |
| 91 | not create them if they do not exist. |
| 92 | |
| 93 | -k:: |
| 94 | Kill keywords: will extract files with '-kk' from the CVS archive |
| 95 | to avoid noisy changesets. Highly recommended, but off by default |
Junio C Hamano | a77a513 | 2007-06-08 16:13:44 | [diff] [blame] | 96 | to preserve compatibility with early imported trees. |
Junio C Hamano | 12a3a23 | 2007-04-07 10:18:10 | [diff] [blame] | 97 | |
| 98 | -u:: |
| 99 | Convert underscores in tag and branch names to dots. |
| 100 | |
| 101 | -s <subst>:: |
| 102 | Substitute the character "/" in branch names with <subst> |
| 103 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 104 | -p <options-for-cvsps>:: |
| 105 | Additional options for cvsps. |
| 106 | The options '-u' and '-A' are implicit and should not be used here. |
| 107 | + |
| 108 | If you need to pass multiple options, separate them with a comma. |
| 109 | |
Junio C Hamano | 12a3a23 | 2007-04-07 10:18:10 | [diff] [blame] | 110 | -z <fuzz>:: |
| 111 | Pass the timestamp fuzz factor to cvsps, in seconds. If unset, |
| 112 | cvsps defaults to 300s. |
| 113 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 114 | -P <cvsps-output-file>:: |
| 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 | a77a513 | 2007-06-08 16:13:44 | [diff] [blame] | 118 | -m:: |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 119 | Attempt to detect merges based on the commit message. This option |
Junio C Hamano | 4f1d8c4 | 2008-03-03 02:01:16 | [diff] [blame] | 120 | will enable default regexes that try to capture the source |
Junio C Hamano | a77a513 | 2007-06-08 16:13:44 | [diff] [blame] | 121 | branch name from the commit message. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 122 | |
| 123 | -M <regex>:: |
| 124 | Attempt to detect merges based on the commit message with a custom |
Junio C Hamano | efe3c63 | 2008-02-14 00:51:31 | [diff] [blame] | 125 | regex. It can be used with '-m' to enable the default regexes |
| 126 | as well. You must escape forward slashes. |
Junio C Hamano | 4f1d8c4 | 2008-03-03 02:01:16 | [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. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 131 | |
Junio C Hamano | 12a3a23 | 2007-04-07 10:18:10 | [diff] [blame] | 132 | -S <regex>:: |
| 133 | Skip paths matching the regex. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 134 | |
Junio C Hamano | d1204f0 | 2007-01-08 11:18:48 | [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. |
| 138 | |
Junio C Hamano | d1204f0 | 2007-01-08 11:18:48 | [diff] [blame] | 139 | -L <limit>:: |
| 140 | Limit the number of commits imported. Workaround for cases where |
| 141 | cvsimport leaks memory. |
| 142 | |
Junio C Hamano | db911ee | 2007-02-28 08:13:52 | [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 |
Junio C Hamano | 4eb2b9c | 2012-11-15 21:12:29 | [diff] [blame] | 146 | maps the name recorded in CVS to author name, e-mail and |
| 147 | optional timezone: |
Junio C Hamano | a725a53 | 2006-03-21 08:33:47 | [diff] [blame] | 148 | + |
| 149 | --------- |
Junio C Hamano | 02d6fa5 | 2006-01-16 08:23:23 | [diff] [blame] | 150 | exon=Andreas Ericsson <ae@op5.se> |
Junio C Hamano | 4eb2b9c | 2012-11-15 21:12:29 | [diff] [blame] | 151 | spawn=Simon Pawn <spawn@frog-pond.org> America/Chicago |
Junio C Hamano | 02d6fa5 | 2006-01-16 08:23:23 | [diff] [blame] | 152 | |
Junio C Hamano | a725a53 | 2006-03-21 08:33:47 | [diff] [blame] | 153 | --------- |
| 154 | + |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 155 | 'git cvsimport' will make it appear as those authors had |
Junio C Hamano | a725a53 | 2006-03-21 08:33:47 | [diff] [blame] | 156 | their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly |
Junio C Hamano | 4eb2b9c | 2012-11-15 21:12:29 | [diff] [blame] | 157 | all along. If a timezone is specified, GIT_AUTHOR_DATE will |
| 158 | have the corresponding offset applied. |
Junio C Hamano | a725a53 | 2006-03-21 08:33:47 | [diff] [blame] | 159 | + |
Junio C Hamano | 12a3a23 | 2007-04-07 10:18:10 | [diff] [blame] | 160 | For convenience, this data is saved to `$GIT_DIR/cvs-authors` |
| 161 | each time the '-A' option is provided and read from that same |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 162 | file each time 'git cvsimport' is run. |
Junio C Hamano | a725a53 | 2006-03-21 08:33:47 | [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 |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 166 | 'git cvsexportcommit'. |
Junio C Hamano | 02d6fa5 | 2006-01-16 08:23:23 | [diff] [blame] | 167 | |
Junio C Hamano | 4aa0bcc | 2010-03-03 05:13:12 | [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 | |
Junio C Hamano | 12a3a23 | 2007-04-07 10:18:10 | [diff] [blame] | 184 | -h:: |
| 185 | Print a short usage message and exit. |
| 186 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 187 | OUTPUT |
| 188 | ------ |
| 189 | If '-v' is specified, the script reports what it is doing. |
| 190 | |
| 191 | Otherwise, success is indicated the Unix way, i.e. by simply exiting with |
| 192 | a zero exit status. |
| 193 | |
Junio C Hamano | 625716a | 2009-03-25 18:49:30 | [diff] [blame] | 194 | [[issues]] |
| 195 | ISSUES |
| 196 | ------ |
| 197 | Problems related to timestamps: |
| 198 | |
Junio C Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 199 | * If timestamps of commits in the CVS repository are not stable enough |
Junio C Hamano | 9572e92 | 2009-04-02 06:52:03 | [diff] [blame] | 200 | to be used for ordering commits changes may show up in the wrong |
| 201 | order. |
Junio C Hamano | 625716a | 2009-03-25 18:49:30 | [diff] [blame] | 202 | * If any files were ever "cvs import"ed more than once (e.g., import of |
Junio C Hamano | 9572e92 | 2009-04-02 06:52:03 | [diff] [blame] | 203 | more than one vendor release) the HEAD contains the wrong content. |
Junio C Hamano | 625716a | 2009-03-25 18:49:30 | [diff] [blame] | 204 | * If the timestamp order of different files cross the revision order |
Junio C Hamano | 9572e92 | 2009-04-02 06:52:03 | [diff] [blame] | 205 | within the commit matching time window the order of commits may be |
| 206 | wrong. |
Junio C Hamano | 625716a | 2009-03-25 18:49:30 | [diff] [blame] | 207 | |
| 208 | Problems related to branches: |
| 209 | |
Junio C Hamano | 9572e92 | 2009-04-02 06:52:03 | [diff] [blame] | 210 | * Branches on which no commits have been made are not imported. |
Junio C Hamano | 625716a | 2009-03-25 18:49:30 | [diff] [blame] | 211 | * All files from the branching point are added to a branch even if |
Junio C Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 212 | never added in CVS. |
Junio C Hamano | 9572e92 | 2009-04-02 06:52:03 | [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. |
Junio C Hamano | 625716a | 2009-03-25 18:49:30 | [diff] [blame] | 216 | |
| 217 | Problems related to tags: |
| 218 | |
Junio C Hamano | 9572e92 | 2009-04-02 06:52:03 | [diff] [blame] | 219 | * Multiple tags on the same revision are not imported. |
Junio C Hamano | 625716a | 2009-03-25 18:49:30 | [diff] [blame] | 220 | |
| 221 | If you suspect that any of these issues may apply to the repository you |
Junio C Hamano | 4624718 | 2013-01-09 20:50:28 | [diff] [blame] | 222 | want to imort, consider using cvs2git: |
Junio C Hamano | 625716a | 2009-03-25 18:49:30 | [diff] [blame] | 223 | |
Junio C Hamano | 4624718 | 2013-01-09 20:50:28 | [diff] [blame] | 224 | * cvs2git (part of cvs2svn), `http://subversion.apache.org/` |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 225 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 226 | GIT |
| 227 | --- |
Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 228 | Part of the linkgit:git[1] suite |