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 | 9e52d4e | 2007-06-13 08:29:33 | [diff] [blame] | 16 | [-r <remote>] [<CVS_module>] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [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 | |
| 24 | Splitting the CVS log into patch sets is done by 'cvsps'. |
| 25 | At least version 2.1 is required. |
| 26 | |
Junio C Hamano | 04a3286 | 2006-03-08 01:42:43 | [diff] [blame] | 27 | You should *never* do any work of your own on the branches that are |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame^] | 28 | 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] | 29 | "master" branch from the CVS repository's main branch which you're free |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame^] | 30 | 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] | 31 | any CVS branches, yourself. It is advisable to specify a named remote via |
| 32 | -r to separate and protect the incoming branches. |
| 33 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame^] | 34 | If you intend to set up a shared public repository that all developers can |
| 35 | read/write, or if you want to use linkgit:git-cvsserver[1], then you |
| 36 | probably want to make a bare clone of the imported repository, |
| 37 | and use the clone as the shared repository. |
| 38 | See linkgit:gitcvs-migration[7]. |
| 39 | |
Junio C Hamano | 04a3286 | 2006-03-08 01:42:43 | [diff] [blame] | 40 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 41 | OPTIONS |
| 42 | ------- |
Junio C Hamano | 12a3a23 | 2007-04-07 10:18:10 | [diff] [blame] | 43 | -v:: |
| 44 | Verbosity: let 'cvsimport' report what it is doing. |
| 45 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 46 | -d <CVSROOT>:: |
| 47 | 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] | 48 | currently, only the :local:, :ext: and :pserver: access methods |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame^] | 49 | are supported. If not given, 'git-cvsimport' will try to read it |
Junio C Hamano | 12a3a23 | 2007-04-07 10:18:10 | [diff] [blame] | 50 | from `CVS/Root`. If no such file exists, it checks for the |
| 51 | `CVSROOT` environment variable. |
| 52 | |
| 53 | <CVS_module>:: |
| 54 | The CVS module you want to import. Relative to <CVSROOT>. |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame^] | 55 | If not given, 'git-cvsimport' tries to read it from |
Junio C Hamano | 12a3a23 | 2007-04-07 10:18:10 | [diff] [blame] | 56 | `CVS/Repository`. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 57 | |
| 58 | -C <target-dir>:: |
| 59 | The git repository to import to. If the directory doesn't |
| 60 | exist, it will be created. Default is the current directory. |
| 61 | |
Junio C Hamano | 9e52d4e | 2007-06-13 08:29:33 | [diff] [blame] | 62 | -r <remote>:: |
| 63 | The git remote to import this CVS repository into. |
| 64 | Moves all CVS branches into remotes/<remote>/<branch> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame^] | 65 | akin to the 'git-clone' "--use-separate-remote" option. |
Junio C Hamano | 9e52d4e | 2007-06-13 08:29:33 | [diff] [blame] | 66 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 67 | -o <branch-for-HEAD>:: |
Junio C Hamano | 9e52d4e | 2007-06-13 08:29:33 | [diff] [blame] | 68 | When no remote is specified (via -r) the 'HEAD' branch |
| 69 | from CVS is imported to the 'origin' branch within the git |
| 70 | repository, as 'HEAD' already has a special meaning for git. |
| 71 | When a remote is specified the 'HEAD' branch is named |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame^] | 72 | remotes/<remote>/master mirroring 'git-clone' behaviour. |
Junio C Hamano | 9e52d4e | 2007-06-13 08:29:33 | [diff] [blame] | 73 | Use this option if you want to import into a different |
| 74 | branch. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 75 | + |
| 76 | Use '-o master' for continuing an import that was initially done by |
| 77 | the old cvs2git tool. |
| 78 | |
Junio C Hamano | 12a3a23 | 2007-04-07 10:18:10 | [diff] [blame] | 79 | -i:: |
| 80 | Import-only: don't perform a checkout after importing. This option |
| 81 | ensures the working directory and index remain untouched and will |
| 82 | not create them if they do not exist. |
| 83 | |
| 84 | -k:: |
| 85 | Kill keywords: will extract files with '-kk' from the CVS archive |
| 86 | to avoid noisy changesets. Highly recommended, but off by default |
Junio C Hamano | a77a513 | 2007-06-08 16:13:44 | [diff] [blame] | 87 | to preserve compatibility with early imported trees. |
Junio C Hamano | 12a3a23 | 2007-04-07 10:18:10 | [diff] [blame] | 88 | |
| 89 | -u:: |
| 90 | Convert underscores in tag and branch names to dots. |
| 91 | |
| 92 | -s <subst>:: |
| 93 | Substitute the character "/" in branch names with <subst> |
| 94 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 95 | -p <options-for-cvsps>:: |
| 96 | Additional options for cvsps. |
| 97 | The options '-u' and '-A' are implicit and should not be used here. |
| 98 | + |
| 99 | If you need to pass multiple options, separate them with a comma. |
| 100 | |
Junio C Hamano | 12a3a23 | 2007-04-07 10:18:10 | [diff] [blame] | 101 | -z <fuzz>:: |
| 102 | Pass the timestamp fuzz factor to cvsps, in seconds. If unset, |
| 103 | cvsps defaults to 300s. |
| 104 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 105 | -P <cvsps-output-file>:: |
| 106 | Instead of calling cvsps, read the provided cvsps output file. Useful |
| 107 | for debugging or when cvsps is being handled outside cvsimport. |
| 108 | |
Junio C Hamano | a77a513 | 2007-06-08 16:13:44 | [diff] [blame] | 109 | -m:: |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 110 | Attempt to detect merges based on the commit message. This option |
Junio C Hamano | 4f1d8c4 | 2008-03-03 02:01:16 | [diff] [blame] | 111 | will enable default regexes that try to capture the source |
Junio C Hamano | a77a513 | 2007-06-08 16:13:44 | [diff] [blame] | 112 | branch name from the commit message. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 113 | |
| 114 | -M <regex>:: |
| 115 | Attempt to detect merges based on the commit message with a custom |
Junio C Hamano | efe3c63 | 2008-02-14 00:51:31 | [diff] [blame] | 116 | regex. It can be used with '-m' to enable the default regexes |
| 117 | as well. You must escape forward slashes. |
Junio C Hamano | 4f1d8c4 | 2008-03-03 02:01:16 | [diff] [blame] | 118 | + |
| 119 | The regex must capture the source branch name in $1. |
| 120 | + |
| 121 | This option can be used several times to provide several detection regexes. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 122 | |
Junio C Hamano | 12a3a23 | 2007-04-07 10:18:10 | [diff] [blame] | 123 | -S <regex>:: |
| 124 | Skip paths matching the regex. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 125 | |
Junio C Hamano | d1204f0 | 2007-01-08 11:18:48 | [diff] [blame] | 126 | -a:: |
| 127 | Import all commits, including recent ones. cvsimport by default |
| 128 | skips commits that have a timestamp less than 10 minutes ago. |
| 129 | |
Junio C Hamano | d1204f0 | 2007-01-08 11:18:48 | [diff] [blame] | 130 | -L <limit>:: |
| 131 | Limit the number of commits imported. Workaround for cases where |
| 132 | cvsimport leaks memory. |
| 133 | |
Junio C Hamano | db911ee | 2007-02-28 08:13:52 | [diff] [blame] | 134 | -A <author-conv-file>:: |
| 135 | CVS by default uses the Unix username when writing its |
| 136 | commit logs. Using this option and an author-conv-file |
| 137 | in this format |
Junio C Hamano | a725a53 | 2006-03-21 08:33:47 | [diff] [blame] | 138 | + |
| 139 | --------- |
Junio C Hamano | 02d6fa5 | 2006-01-16 08:23:23 | [diff] [blame] | 140 | exon=Andreas Ericsson <ae@op5.se> |
| 141 | spawn=Simon Pawn <spawn@frog-pond.org> |
| 142 | |
Junio C Hamano | a725a53 | 2006-03-21 08:33:47 | [diff] [blame] | 143 | --------- |
| 144 | + |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame^] | 145 | 'git-cvsimport' will make it appear as those authors had |
Junio C Hamano | a725a53 | 2006-03-21 08:33:47 | [diff] [blame] | 146 | their GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL set properly |
| 147 | all along. |
| 148 | + |
Junio C Hamano | 12a3a23 | 2007-04-07 10:18:10 | [diff] [blame] | 149 | For convenience, this data is saved to `$GIT_DIR/cvs-authors` |
| 150 | each time the '-A' option is provided and read from that same |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame^] | 151 | file each time 'git-cvsimport' is run. |
Junio C Hamano | a725a53 | 2006-03-21 08:33:47 | [diff] [blame] | 152 | + |
| 153 | It is not recommended to use this feature if you intend to |
| 154 | export changes back to CVS again later with |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame^] | 155 | 'git-cvsexportcommit'. |
Junio C Hamano | 02d6fa5 | 2006-01-16 08:23:23 | [diff] [blame] | 156 | |
Junio C Hamano | 12a3a23 | 2007-04-07 10:18:10 | [diff] [blame] | 157 | -h:: |
| 158 | Print a short usage message and exit. |
| 159 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 160 | OUTPUT |
| 161 | ------ |
| 162 | If '-v' is specified, the script reports what it is doing. |
| 163 | |
| 164 | Otherwise, success is indicated the Unix way, i.e. by simply exiting with |
| 165 | a zero exit status. |
| 166 | |
| 167 | |
| 168 | Author |
| 169 | ------ |
| 170 | Written by Matthias Urlichs <smurf@smurf.noris.de>, with help from |
| 171 | various participants of the git-list <git@vger.kernel.org>. |
| 172 | |
| 173 | Documentation |
| 174 | -------------- |
| 175 | Documentation by Matthias Urlichs <smurf@smurf.noris.de>. |
| 176 | |
| 177 | GIT |
| 178 | --- |
Junio C Hamano | f7c042d | 2008-06-06 22:50:53 | [diff] [blame] | 179 | Part of the linkgit:git[1] suite |