1git-cvsserver(1) 2================ 3 4NAME 5---- 6git-cvsserver - A CVS server emulator for git 7 8SYNOPSIS 9-------- 10 11SSH: 12 13[verse] 14export CVS_SERVER=git-cvsserver 15'cvs' -d :ext:user@server/path/repo.git co <HEAD_name> 16 17pserver (/etc/inetd.conf): 18 19[verse] 20cvspserver stream tcp nowait nobody /usr/bin/git-cvsserver git-cvsserver pserver 21 22Usage: 23 24[verse] 25'git-cvsserver' [options] [pserver|server] [<directory> ...] 26 27OPTIONS 28------- 29 30All these options obviously only make sense if enforced by the server side. 31They have been implemented to resemble the gitlink:git-daemon[1] options as 32closely as possible. 33 34--base-path <path>:: 35Prepend 'path' to requested CVSROOT 36 37--strict-paths:: 38Don't allow recursing into subdirectories 39 40--export-all:: 41Don't check for `gitcvs.enabled` in config 42 43--version, -V:: 44Print version information and exit 45 46--help, -h, -H:: 47Print usage information and exit 48 49<directory>:: 50You can specify a list of allowed directories. If no directories 51are given, all are allowed. This is an additional restriction, gitcvs 52access still needs to be enabled by the `gitcvs.enabled` config option 53unless '--export-all' was given, too. 54 55 56DESCRIPTION 57----------- 58 59This application is a CVS emulation layer for git. 60 61It is highly functional. However, not all methods are implemented, 62and for those methods that are implemented, 63not all switches are implemented. 64 65Testing has been done using both the CLI CVS client, and the Eclipse CVS 66plugin. Most functionality works fine with both of these clients. 67 68LIMITATIONS 69----------- 70 71Currently cvsserver works over SSH connections for read/write clients, and 72over pserver for anonymous CVS access. 73 74CVS clients cannot tag, branch or perform GIT merges. 75 76git-cvsserver maps GIT branches to CVS modules. This is very different 77from what most CVS users would expect since in CVS modules usually represent 78one or more directories. 79 80INSTALLATION 81------------ 82 831. If you are going to offer anonymous CVS access via pserver, add a line in 84 /etc/inetd.conf like 85+ 86-- 87------ 88 cvspserver stream tcp nowait nobody git-cvsserver pserver 89 90------ 91Note: Some inetd servers let you specify the name of the executable 92independently of the value of argv[0] (i.e. the name the program assumes 93it was executed with). In this case the correct line in /etc/inetd.conf 94looks like 95 96------ 97 cvspserver stream tcp nowait nobody /usr/bin/git-cvsserver git-cvsserver pserver 98 99------ 100No special setup is needed for SSH access, other than having GIT tools 101in the PATH. If you have clients that do not accept the CVS_SERVER 102environment variable, you can rename git-cvsserver to cvs. 103 104Note: Newer cvs versions (>= 1.12.11) also support specifying 105CVS_SERVER directly in CVSROOT like 106 107------ 108cvs -d ":ext;CVS_SERVER=git-cvsserver:user@server/path/repo.git" co <HEAD_name> 109------ 110This has the advantage that it will be saved in your 'CVS/Root' files and 111you don't need to worry about always setting the correct environment 112variable. 113-- 1142. For each repo that you want accessible from CVS you need to edit config in 115 the repo and add the following section. 116+ 117-- 118------ 119 [gitcvs] 120 enabled=1 121 # optional for debugging 122 logfile=/path/to/logfile 123 124------ 125Note: you need to ensure each user that is going to invoke git-cvsserver has 126write access to the log file and to the database (see 127<<dbbackend,Database Backend>>. If you want to offer write access over 128SSH, the users of course also need write access to the git repository itself. 129 130[[configaccessmethod]] 131All configuration variables can also be overridden for a specific method of 132access. Valid method names are "ext" (for SSH access) and "pserver". The 133following example configuration would disable pserver access while still 134allowing access over SSH. 135------ 136 [gitcvs] 137 enabled=0 138 139 [gitcvs "ext"] 140 enabled=1 141------ 142-- 1433. On the client machine you need to set the following variables. 144 CVSROOT should be set as per normal, but the directory should point at the 145 appropriate git repo. For example: 146+ 147-- 148For SSH access, CVS_SERVER should be set to git-cvsserver 149 150Example: 151 152------ 153 export CVSROOT=:ext:user@server:/var/git/project.git 154 export CVS_SERVER=git-cvsserver 155------ 156-- 1574. For SSH clients that will make commits, make sure their .bashrc file 158 sets the GIT_AUTHOR and GIT_COMMITTER variables. 159 1605. Clients should now be able to check out the project. Use the CVS 'module' 161 name to indicate what GIT 'head' you want to check out. Example: 162+ 163------ 164 cvs co -d project-master master 165------ 166 167[[dbbackend]] 168Database Backend 169---------------- 170 171git-cvsserver uses one database per git head (i.e. CVS module) to 172store information about the repository for faster access. The 173database doesn't contain any persistent data and can be completely 174regenerated from the git repository at any time. The database 175needs to be updated (i.e. written to) after every commit. 176 177If the commit is done directly by using git (as opposed to 178using git-cvsserver) the update will need to happen on the 179next repository access by git-cvsserver, independent of 180access method and requested operation. 181 182That means that even if you offer only read access (e.g. by using 183the pserver method), git-cvsserver should have write access to 184the database to work reliably (otherwise you need to make sure 185that the database if up-to-date all the time git-cvsserver is run). 186 187By default it uses SQLite databases in the git directory, named 188`gitcvs.<module_name>.sqlite`. Note that the SQLite backend creates 189temporary files in the same directory as the database file on 190write so it might not be enough to grant the users using 191git-cvsserver write access to the database file without granting 192them write access to the directory, too. 193 194You can configure the database backend with the following 195configuration variables: 196 197Configuring database backend 198~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 199 200git-cvsserver uses the Perl DBI module. Please also read 201its documentation if changing these variables, especially 202about `DBI->connect()`. 203 204gitcvs.dbname:: 205 Database name. The exact meaning depends on the 206 used database driver, for SQLite this is a filename. 207 Supports variable substitution (see below). May 208 not contain semicolons (`;`). 209 Default: '%Ggitcvs.%m.sqlite' 210 211gitcvs.dbdriver:: 212 Used DBI driver. You can specify any available driver 213 for this here, but it might not work. cvsserver is tested 214 with 'DBD::SQLite', reported to work with 215 'DBD::Pg', and reported *not* to work with 'DBD::mysql'. 216 Please regard this as an experimental feature. May not 217 contain double colons (`:`). 218 Default: 'SQLite' 219 220gitcvs.dbuser:: 221 Database user. Only useful if setting `dbdriver`, since 222 SQLite has no concept of database users. Supports variable 223 substitution (see below). 224 225gitcvs.dbpass:: 226 Database password. Only useful if setting `dbdriver`, since 227 SQLite has no concept of database passwords. 228 229All variables can also be set per access method, see <<configaccessmethod,above>>. 230 231Variable substitution 232^^^^^^^^^^^^^^^^^^^^^ 233In `dbdriver` and `dbuser` you can use the following variables: 234 235%G:: 236 git directory name 237%g:: 238 git directory name, where all characters except for 239 alpha-numeric ones, `.`, and `-` are replaced with 240 `_` (this should make it easier to use the directory 241 name in a filename if wanted) 242%m:: 243 CVS module/git head name 244%a:: 245 access method (one of "ext" or "pserver") 246%u:: 247 Name of the user running git-cvsserver. 248 If no name can be determined, the 249 numeric uid is used. 250 251Eclipse CVS Client Notes 252------------------------ 253 254To get a checkout with the Eclipse CVS client: 255 2561. Select "Create a new project -> From CVS checkout" 2572. Create a new location. See the notes below for details on how to choose the 258 right protocol. 2593. Browse the 'modules' available. It will give you a list of the heads in 260 the repository. You will not be able to browse the tree from there. Only 261 the heads. 2624. Pick 'HEAD' when it asks what branch/tag to check out. Untick the 263 "launch commit wizard" to avoid committing the .project file. 264 265Protocol notes: If you are using anonymous access via pserver, just select that. 266Those using SSH access should choose the 'ext' protocol, and configure 'ext' 267access on the Preferences->Team->CVS->ExtConnection pane. Set CVS_SERVER to 268'git-cvsserver'. Note that password support is not good when using 'ext', 269you will definitely want to have SSH keys setup. 270 271Alternatively, you can just use the non-standard extssh protocol that Eclipse 272offer. In that case CVS_SERVER is ignored, and you will have to replace 273the cvs utility on the server with git-cvsserver or manipulate your `.bashrc` 274so that calling 'cvs' effectively calls git-cvsserver. 275 276Clients known to work 277--------------------- 278 279- CVS 1.12.9 on Debian 280- CVS 1.11.17 on MacOSX (from Fink package) 281- Eclipse 3.0, 3.1.2 on MacOSX (see Eclipse CVS Client Notes) 282- TortoiseCVS 283 284Operations supported 285-------------------- 286 287All the operations required for normal use are supported, including 288checkout, diff, status, update, log, add, remove, commit. 289Legacy monitoring operations are not supported (edit, watch and related). 290Exports and tagging (tags and branches) are not supported at this stage. 291 292The server should set the '-k' mode to binary when relevant, however, 293this is not really implemented yet. For now, you can force the server 294to set '-kb' for all files by setting the `gitcvs.allbinary` config 295variable. In proper GIT tradition, the contents of the files are 296always respected. No keyword expansion or newline munging is supported. 297 298Dependencies 299------------ 300 301git-cvsserver depends on DBD::SQLite. 302 303Copyright and Authors 304--------------------- 305 306This program is copyright The Open University UK - 2006. 307 308Authors: 309 310- Martyn Smith <martyn@catalyst.net.nz> 311- Martin Langhoff <martin@catalyst.net.nz> 312 313with ideas and patches from participants of the git-list <git@vger.kernel.org>. 314 315Documentation 316-------------- 317Documentation by Martyn Smith <martyn@catalyst.net.nz>, Martin Langhoff <martin@catalyst.net.nz>, and Matthias Urlichs <smurf@smurf.noris.de>. 318 319GIT 320--- 321Part of the gitlink:git[7] suite