6 git-cvsserver - A CVS server emulator for git
11 export CVS_SERVER=git-cvsserver
12 'cvs' -d :ext:user@server/path/repo.git co <HEAD_name>
17 This application is a CVS emulation layer for git.
19 It is highly functional. However, not all methods are implemented,
20 and for those methods that are implemented,
21 not all switches are implemented.
23 Testing has been done using both the CLI CVS client, and the Eclipse CVS
24 plugin. Most functionality works fine with both of these clients.
29 Currently cvsserver works over SSH connections for read/write clients, and
30 over pserver for anonymous CVS access.
32 CVS clients cannot tag, branch or perform GIT merges.
34 git-cvsserver maps GIT branches to CVS modules. This is very different
35 from what most CVS users would expect since in CVS modules usually represent
36 one or more directories.
41 1. If you are going to offer anonymous CVS access via pserver, add a line in
46 cvspserver stream tcp nowait nobody git-cvsserver pserver
49 Note: Some inetd servers let you specify the name of the executable
50 independently of the value of argv[0] (i.e. the name the program assumes
51 it was executed with). In this case the correct line in /etc/inetd.conf
55 cvspserver stream tcp nowait nobody /usr/bin/git-cvsserver git-cvsserver pserver
58 No special setup is needed for SSH access, other than having GIT tools
59 in the PATH. If you have clients that do not accept the CVS_SERVER
60 environment variable, you can rename git-cvsserver to cvs.
62 Note: Newer cvs versions (>= 1.12.11) also support specifying
63 CVS_SERVER directly in CVSROOT like
66 cvs -d ":ext;CVS_SERVER=git-cvsserver:user@server/path/repo.git" co <HEAD_name>
68 This has the advantage that it will be saved in your 'CVS/Root' files and
69 you don't need to worry about always setting the correct environment
72 2. For each repo that you want accessible from CVS you need to edit config in
73 the repo and add the following section.
79 # optional for debugging
80 logfile=/path/to/logfile
83 Note: you need to ensure each user that is going to invoke git-cvsserver has
84 write access to the log file and to the database (see
85 <<dbbackend,Database Backend>>. If you want to offer write access over
86 SSH, the users of course also need write access to the git repository itself.
88 [[configaccessmethod]]
89 All configuration variables can also be overridden for a specific method of
90 access. Valid method names are "ext" (for SSH access) and "pserver". The
91 following example configuration would disable pserver access while still
92 allowing access over SSH.
101 3. On the client machine you need to set the following variables.
102 CVSROOT should be set as per normal, but the directory should point at the
103 appropriate git repo. For example:
106 For SSH access, CVS_SERVER should be set to git-cvsserver
111 export CVSROOT=:ext:user@server:/var/git/project.git
112 export CVS_SERVER=git-cvsserver
115 4. For SSH clients that will make commits, make sure their .bashrc file
116 sets the GIT_AUTHOR and GIT_COMMITTER variables.
118 5. Clients should now be able to check out the project. Use the CVS 'module'
119 name to indicate what GIT 'head' you want to check out. Example:
122 cvs co -d project-master master
129 git-cvsserver uses one database per git head (i.e. CVS module) to
130 store information about the repository for faster access. The
131 database doesn't contain any persistent data and can be completely
132 regenerated from the git repository at any time. The database
133 needs to be updated (i.e. written to) after every commit.
135 If the commit is done directly by using git (as opposed to
136 using git-cvsserver) the update will need to happen on the
137 next repository access by git-cvsserver, independent of
138 access method and requested operation.
140 That means that even if you offer only read access (e.g. by using
141 the pserver method), git-cvsserver should have write access to
142 the database to work reliably (otherwise you need to make sure
143 that the database if up-to-date all the time git-cvsserver is run).
145 By default it uses SQLite databases in the git directory, named
146 `gitcvs.<module_name>.sqlite`. Note that the SQLite backend creates
147 temporary files in the same directory as the database file on
148 write so it might not be enough to grant the users using
149 git-cvsserver write access to the database file without granting
150 them write access to the directory, too.
152 You can configure the database backend with the following
153 configuration variables:
155 Configuring database backend
156 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
158 git-cvsserver uses the Perl DBI module. Please also read
159 its documentation if changing these variables, especially
160 about `DBI->connect()`.
163 Database name. The exact meaning depends on the
164 used database driver, for SQLite this is a filename.
165 Supports variable substitution (see below). May
166 not contain semicolons (`;`).
167 Default: '%Ggitcvs.%m.sqlite'
170 Used DBI driver. You can specify any available driver
171 for this here, but it might not work. cvsserver is tested
172 with 'DBD::SQLite', reported to work with
173 'DBD::Pg', and reported *not* to work with 'DBD::mysql'.
174 Please regard this as an experimental feature. May not
175 contain double colons (`:`).
179 Database user. Only useful if setting `dbdriver`, since
180 SQLite has no concept of database users. Supports variable
181 substitution (see below).
184 Database password. Only useful if setting `dbdriver`, since
185 SQLite has no concept of database passwords.
187 All variables can also be set per access method, see <<configaccessmethod,above>>.
189 Variable substitution
190 ^^^^^^^^^^^^^^^^^^^^^
191 In `dbdriver` and `dbuser` you can use the following variables:
196 git directory name, where all characters except for
197 alpha-numeric ones, `.`, and `-` are replaced with
198 `_` (this should make it easier to use the directory
199 name in a filename if wanted)
201 CVS module/git head name
203 access method (one of "ext" or "pserver")
205 Name of the user running git-cvsserver.
206 If no name can be determined, the
209 Eclipse CVS Client Notes
210 ------------------------
212 To get a checkout with the Eclipse CVS client:
214 1. Select "Create a new project -> From CVS checkout"
215 2. Create a new location. See the notes below for details on how to choose the
217 3. Browse the 'modules' available. It will give you a list of the heads in
218 the repository. You will not be able to browse the tree from there. Only
220 4. Pick 'HEAD' when it asks what branch/tag to check out. Untick the
221 "launch commit wizard" to avoid committing the .project file.
223 Protocol notes: If you are using anonymous access via pserver, just select that.
224 Those using SSH access should choose the 'ext' protocol, and configure 'ext'
225 access on the Preferences->Team->CVS->ExtConnection pane. Set CVS_SERVER to
226 'git-cvsserver'. Note that password support is not good when using 'ext',
227 you will definitely want to have SSH keys setup.
229 Alternatively, you can just use the non-standard extssh protocol that Eclipse
230 offer. In that case CVS_SERVER is ignored, and you will have to replace
231 the cvs utility on the server with git-cvsserver or manipulate your `.bashrc`
232 so that calling 'cvs' effectively calls git-cvsserver.
234 Clients known to work
235 ---------------------
237 - CVS 1.12.9 on Debian
238 - CVS 1.11.17 on MacOSX (from Fink package)
239 - Eclipse 3.0, 3.1.2 on MacOSX (see Eclipse CVS Client Notes)
245 All the operations required for normal use are supported, including
246 checkout, diff, status, update, log, add, remove, commit.
247 Legacy monitoring operations are not supported (edit, watch and related).
248 Exports and tagging (tags and branches) are not supported at this stage.
250 The server should set the '-k' mode to binary when relevant, however,
251 this is not really implemented yet. For now, you can force the server
252 to set '-kb' for all files by setting the `gitcvs.allbinary` config
253 variable. In proper GIT tradition, the contents of the files are
254 always respected. No keyword expansion or newline munging is supported.
259 git-cvsserver depends on DBD::SQLite.
261 Copyright and Authors
262 ---------------------
264 This program is copyright The Open University UK - 2006.
268 - Martyn Smith <martyn@catalyst.net.nz>
269 - Martin Langhoff <martin@catalyst.net.nz>
271 with ideas and patches from participants of the git-list <git@vger.kernel.org>.
275 Documentation by Martyn Smith <martyn@catalyst.net.nz>, Martin Langhoff <martin@catalyst.net.nz>, and Matthias Urlichs <smurf@smurf.noris.de>.
279 Part of the gitlink:git[7] suite