cvsserver: Document the GIT branches -> CVS modules mapping more prominently
[git/spearce.git] / Documentation / git-cvsserver.txt
blob1cd00aa07664cfe21b1b8aeafcd2729b4ecc4346
1 git-cvsserver(1)
2 ================
4 NAME
5 ----
6 git-cvsserver - A CVS server emulator for git
8 SYNOPSIS
9 --------
10 [verse]
11 export CVS_SERVER=git-cvsserver
12 'cvs' -d :ext:user@server/path/repo.git co <HEAD_name>
14 DESCRIPTION
15 -----------
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.
26 LIMITATIONS
27 -----------
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.
38 INSTALLATION
39 ------------
41 1. If you are going to offer anonymous CVS access via pserver, add a line in
42    /etc/inetd.conf like
45 ------
46    cvspserver stream tcp nowait nobody git-cvsserver pserver
48 ------
49 Note: In some cases, you need to pass the 'pserver' argument twice for
50 git-cvsserver to see it. So the line would look like
52 ------
53    cvspserver stream tcp nowait nobody git-cvsserver pserver pserver
55 ------
56 No special setup is needed for SSH access, other than having GIT tools
57 in the PATH. If you have clients that do not accept the CVS_SERVER
58 env variable, you can rename git-cvsserver to cvs.
60 2. For each repo that you want accessible from CVS you need to edit config in
61    the repo and add the following section.
64 ------
65    [gitcvs]
66         enabled=1
67         # optional for debugging
68         logfile=/path/to/logfile
70 ------
71 Note: you need to ensure each user that is going to invoke git-cvsserver has
72 write access to the log file and to the database (see
73 <<dbbackend,Database Backend>>. If you want to offer write access over
74 SSH, the users of course also need write access to the git repository itself.
76 [[configaccessmethod]]
77 All configuration variables can also be overriden for a specific method of
78 access. Valid method names are "ext" (for SSH access) and "pserver". The
79 following example configuration would disable pserver access while still
80 allowing access over SSH.
81 ------
82    [gitcvs]
83         enabled=0
85    [gitcvs "ext"]
86         enabled=1
87 ------
89 3. 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:
94 For SSH access, CVS_SERVER should be set to git-cvsserver
96 Example:
98 ------
99      export CVSROOT=:ext:user@server:/var/git/project.git
100      export CVS_SERVER=git-cvsserver
101 ------
103 4. For SSH clients that will make commits, make sure their .bashrc file
104    sets the GIT_AUTHOR and GIT_COMMITTER variables.
106 5. 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:
109 ------
110      cvs co -d project-master master
111 ------
113 [[dbbackend]]
114 Database Backend
115 ----------------
117 git-cvsserver uses one database per git head (i.e. CVS module) to
118 store information about the repository for faster access. The
119 database doesn't contain any persitent data and can be completly
120 regenerated from the git repository at any time. The database
121 needs to be updated (i.e. written to) after every commit.
123 If the commit is done directly by using git (as opposed to
124 using git-cvsserver) the update will need to happen on the
125 next repository access by git-cvsserver, independent of
126 access method and requested operation.
128 That means that even if you offer only read access (e.g. by using
129 the pserver method), git-cvsserver should have write access to
130 the database to work reliably (otherwise you need to make sure
131 that the database if up-to-date all the time git-cvsserver is run).
133 By default it uses SQLite databases in the git directory, named
134 `gitcvs.<module_name>.sqlite`. Note that the SQLite backend creates
135 temporary files in the same directory as the database file on
136 write so it might not be enough to grant the users using
137 git-cvsserver write access to the database file without granting
138 them write access to the directory, too.
140 You can configure the database backend with the following
141 configuration variables:
143 Configuring database backend
144 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
146 git-cvsserver uses the Perl DBI module. Please also read
147 its documentation if changing these variables, especially
148 about `DBI->connect()`.
150 gitcvs.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'
157 gitcvs.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'
166 gitcvs.dbuser::
167         Database user. Only useful if setting `dbdriver`, since
168         SQLite has no concept of database users. Supports variable
169         substitution (see below).
171 gitcvs.dbpass::
172         Database password.  Only useful if setting `dbdriver`, since
173         SQLite has no concept of database passwords.
175 All variables can also be set per access method, see <<configaccessmethod,above>>.
177 Variable substitution
178 ^^^^^^^^^^^^^^^^^^^^^
179 In `dbdriver` and `dbuser` you can use the following variables:
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.
197 Eclipse CVS Client Notes
198 ------------------------
200 To get a checkout with the Eclipse CVS client:
202 1. Select "Create a new project -> From CVS checkout"
203 2. Create a new location. See the notes below for details on how to choose the
204    right protocol.
205 3. 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.
208 4. Pick 'HEAD' when it asks what branch/tag to check out. Untick the
209    "launch commit wizard" to avoid committing the .project file.
211 Protocol notes: If you are using anonymous access via pserver, just select that.
212 Those using SSH access should choose the 'ext' protocol, and configure 'ext'
213 access on the Preferences->Team->CVS->ExtConnection pane. Set CVS_SERVER to
214 'git-cvsserver'. Not that password support is not good when using 'ext',
215 you will definitely want to have SSH keys setup.
217 Alternatively, you can just use the non-standard extssh protocol that Eclipse
218 offer. In that case CVS_SERVER is ignored, and you will have to replace
219 the cvs utility on the server with git-cvsserver or manipulate your .bashrc
220 so that calling 'cvs' effectively calls git-cvsserver.
222 Clients known to work
223 ---------------------
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
230 Operations supported
231 --------------------
233 All the operations required for normal use are supported, including
234 checkout, diff, status, update, log, add, remove, commit.
235 Legacy monitoring operations are not supported (edit, watch and related).
236 Exports and tagging (tags and branches) are not supported at this stage.
238 The server will set the -k mode to binary when relevant. In proper GIT
239 tradition, the contents of the files are always respected.
240 No keyword expansion or newline munging is supported.
242 Dependencies
243 ------------
245 git-cvsserver depends on DBD::SQLite.
247 Copyright and Authors
248 ---------------------
250 This program is copyright The Open University UK - 2006.
252 Authors:
254 - Martyn Smith    <martyn@catalyst.net.nz>
255 - Martin Langhoff <martin@catalyst.net.nz>
257 with ideas and patches from participants of the git-list <git@vger.kernel.org>.
259 Documentation
260 --------------
261 Documentation by Martyn Smith <martyn@catalyst.net.nz>, Martin Langhoff <martin@catalyst.net.nz>, and Matthias Urlichs <smurf@smurf.noris.de>.
265 Part of the gitlink:git[7] suite