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