<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" | |
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<meta name="generator" content="AsciiDoc 7.0.2" /> | |
<style type="text/css"> | |
/* Debug borders */ | |
p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 { | |
/* | |
border: 1px solid red; | |
*/ | |
} | |
body { | |
margin: 1em 5% 1em 5%; | |
} | |
a { color: blue; } | |
a:visited { color: fuchsia; } | |
em { | |
font-style: italic; | |
} | |
strong { | |
font-weight: bold; | |
} | |
tt { | |
color: navy; | |
} | |
h1, h2, h3, h4, h5, h6 { | |
color: #527bbd; | |
font-family: sans-serif; | |
margin-top: 1.2em; | |
margin-bottom: 0.5em; | |
line-height: 1.3; | |
} | |
h1 { | |
border-bottom: 2px solid silver; | |
} | |
h2 { | |
border-bottom: 2px solid silver; | |
padding-top: 0.5em; | |
} | |
div.sectionbody { | |
font-family: serif; | |
margin-left: 0; | |
} | |
hr { | |
border: 1px solid silver; | |
} | |
p { | |
margin-top: 0.5em; | |
margin-bottom: 0.5em; | |
} | |
pre { | |
padding: 0; | |
margin: 0; | |
} | |
span#author { | |
color: #527bbd; | |
font-family: sans-serif; | |
font-weight: bold; | |
font-size: 1.2em; | |
} | |
span#email { | |
} | |
span#revision { | |
font-family: sans-serif; | |
} | |
div#footer { | |
font-family: sans-serif; | |
font-size: small; | |
border-top: 2px solid silver; | |
padding-top: 0.5em; | |
margin-top: 4.0em; | |
} | |
div#footer-text { | |
float: left; | |
padding-bottom: 0.5em; | |
} | |
div#footer-badges { | |
float: right; | |
padding-bottom: 0.5em; | |
} | |
div#preamble, | |
div.tableblock, div.imageblock, div.exampleblock, div.verseblock, | |
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, | |
div.admonitionblock { | |
margin-right: 10%; | |
margin-top: 1.5em; | |
margin-bottom: 1.5em; | |
} | |
div.admonitionblock { | |
margin-top: 2.5em; | |
margin-bottom: 2.5em; | |
} | |
div.content { /* Block element content. */ | |
padding: 0; | |
} | |
/* Block element titles. */ | |
div.title, caption.title { | |
font-family: sans-serif; | |
font-weight: bold; | |
text-align: left; | |
margin-top: 1.0em; | |
margin-bottom: 0.5em; | |
} | |
div.title + * { | |
margin-top: 0; | |
} | |
td div.title:first-child { | |
margin-top: 0.0em; | |
} | |
div.content div.title:first-child { | |
margin-top: 0.0em; | |
} | |
div.content + div.title { | |
margin-top: 0.0em; | |
} | |
div.sidebarblock > div.content { | |
background: #ffffee; | |
border: 1px solid silver; | |
padding: 0.5em; | |
} | |
div.listingblock > div.content { | |
border: 1px solid silver; | |
background: #f4f4f4; | |
padding: 0.5em; | |
} | |
div.quoteblock > div.content { | |
padding-left: 2.0em; | |
} | |
div.quoteblock .attribution { | |
text-align: right; | |
} | |
div.admonitionblock .icon { | |
vertical-align: top; | |
font-size: 1.1em; | |
font-weight: bold; | |
text-decoration: underline; | |
color: #527bbd; | |
padding-right: 0.5em; | |
} | |
div.admonitionblock td.content { | |
padding-left: 0.5em; | |
border-left: 2px solid silver; | |
} | |
div.exampleblock > div.content { | |
border-left: 2px solid silver; | |
padding: 0.5em; | |
} | |
div.verseblock div.content { | |
white-space: pre; | |
} | |
div.imageblock div.content { padding-left: 0; } | |
div.imageblock img { border: 1px solid silver; } | |
span.image img { border-style: none; } | |
dl { | |
margin-top: 0.8em; | |
margin-bottom: 0.8em; | |
} | |
dt { | |
margin-top: 0.5em; | |
margin-bottom: 0; | |
font-style: italic; | |
} | |
dd > *:first-child { | |
margin-top: 0; | |
} | |
ul, ol { | |
list-style-position: outside; | |
} | |
ol.olist2 { | |
list-style-type: lower-alpha; | |
} | |
div.tableblock > table { | |
border-color: #527bbd; | |
border-width: 3px; | |
} | |
thead { | |
font-family: sans-serif; | |
font-weight: bold; | |
} | |
tfoot { | |
font-weight: bold; | |
} | |
div.hlist { | |
margin-top: 0.8em; | |
margin-bottom: 0.8em; | |
} | |
td.hlist1 { | |
vertical-align: top; | |
font-style: italic; | |
padding-right: 0.8em; | |
} | |
td.hlist2 { | |
vertical-align: top; | |
} | |
@media print { | |
div#footer-badges { display: none; } | |
} | |
include::./stylesheets/xhtml11-manpage.css[] | |
/* Workarounds for IE6's broken and incomplete CSS2. */ | |
div.sidebar-content { | |
background: #ffffee; | |
border: 1px solid silver; | |
padding: 0.5em; | |
} | |
div.sidebar-title, div.image-title { | |
font-family: sans-serif; | |
font-weight: bold; | |
margin-top: 0.0em; | |
margin-bottom: 0.5em; | |
} | |
div.listingblock div.content { | |
border: 1px solid silver; | |
background: #f4f4f4; | |
padding: 0.5em; | |
} | |
div.quoteblock-content { | |
padding-left: 2.0em; | |
} | |
div.exampleblock-content { | |
border-left: 2px solid silver; | |
padding-left: 0.5em; | |
} | |
</style> | |
<title>git-cvsserver(1)</title> | |
</head> | |
<body> | |
<div id="header"> | |
<h1> | |
git-cvsserver(1) Manual Page | |
</h1> | |
<h2>NAME</h2> | |
<div class="sectionbody"> | |
<p>git-cvsserver - | |
A CVS server emulator for git | |
</p> | |
</div> | |
</div> | |
<h2>SYNOPSIS</h2> | |
<div class="sectionbody"> | |
<p>SSH:</p> | |
<div class="verseblock"> | |
<div class="content">export CVS_SERVER=git-cvsserver | |
<em>cvs</em> -d :ext:user@server/path/repo.git co <HEAD_name></div></div> | |
<p>pserver (/etc/inetd.conf):</p> | |
<div class="verseblock"> | |
<div class="content">cvspserver stream tcp nowait nobody /usr/bin/git-cvsserver git-cvsserver pserver</div></div> | |
<p>Usage:</p> | |
<div class="verseblock"> | |
<div class="content"><em>git-cvsserver</em> [options] [pserver|server] [<directory> …]</div></div> | |
</div> | |
<h2>OPTIONS</h2> | |
<div class="sectionbody"> | |
<p>All these options obviously only make sense if enforced by the server side. | |
They have been implemented to resemble the <a href="git-daemon.html">git-daemon(1)</a> options as | |
closely as possible.</p> | |
<dl> | |
<dt> | |
--base-path <path> | |
</dt> | |
<dd> | |
<p> | |
Prepend <em>path</em> to requested CVSROOT | |
</p> | |
</dd> | |
<dt> | |
--strict-paths | |
</dt> | |
<dd> | |
<p> | |
Don't allow recursing into subdirectories | |
</p> | |
</dd> | |
<dt> | |
--export-all | |
</dt> | |
<dd> | |
<p> | |
Don't check for <tt>gitcvs.enabled</tt> in config. You also have to specify a list | |
of allowed directories (see below) if you want to use this option. | |
</p> | |
</dd> | |
<dt> | |
--version, -V | |
</dt> | |
<dd> | |
<p> | |
Print version information and exit | |
</p> | |
</dd> | |
<dt> | |
--help, -h, -H | |
</dt> | |
<dd> | |
<p> | |
Print usage information and exit | |
</p> | |
</dd> | |
<dt> | |
<directory> | |
</dt> | |
<dd> | |
<p> | |
You can specify a list of allowed directories. If no directories | |
are given, all are allowed. This is an additional restriction, gitcvs | |
access still needs to be enabled by the <tt>gitcvs.enabled</tt> config option | |
unless <em>--export-all</em> was given, too. | |
</p> | |
</dd> | |
</dl> | |
</div> | |
<h2>DESCRIPTION</h2> | |
<div class="sectionbody"> | |
<p>This application is a CVS emulation layer for git.</p> | |
<p>It is highly functional. However, not all methods are implemented, | |
and for those methods that are implemented, | |
not all switches are implemented.</p> | |
<p>Testing has been done using both the CLI CVS client, and the Eclipse CVS | |
plugin. Most functionality works fine with both of these clients.</p> | |
</div> | |
<h2>LIMITATIONS</h2> | |
<div class="sectionbody"> | |
<p>Currently cvsserver works over SSH connections for read/write clients, and | |
over pserver for anonymous CVS access.</p> | |
<p>CVS clients cannot tag, branch or perform GIT merges.</p> | |
<p>git-cvsserver maps GIT branches to CVS modules. This is very different | |
from what most CVS users would expect since in CVS modules usually represent | |
one or more directories.</p> | |
</div> | |
<h2>INSTALLATION</h2> | |
<div class="sectionbody"> | |
<ol> | |
<li> | |
<p> | |
If you are going to offer anonymous CVS access via pserver, add a line in | |
/etc/inetd.conf like | |
</p> | |
<div class="listingblock"> | |
<div class="content"> | |
<pre><tt> cvspserver stream tcp nowait nobody git-cvsserver pserver | |
</tt></pre> | |
</div></div> | |
<p>Note: Some inetd servers let you specify the name of the executable | |
independently of the value of argv[0] (i.e. the name the program assumes | |
it was executed with). In this case the correct line in /etc/inetd.conf | |
looks like</p> | |
<div class="listingblock"> | |
<div class="content"> | |
<pre><tt> cvspserver stream tcp nowait nobody /usr/bin/git-cvsserver git-cvsserver pserver | |
</tt></pre> | |
</div></div> | |
<p>No special setup is needed for SSH access, other than having GIT tools | |
in the PATH. If you have clients that do not accept the CVS_SERVER | |
environment variable, you can rename git-cvsserver to cvs.</p> | |
<p>Note: Newer CVS versions (>= 1.12.11) also support specifying | |
CVS_SERVER directly in CVSROOT like</p> | |
<div class="listingblock"> | |
<div class="content"> | |
<pre><tt>cvs -d ":ext;CVS_SERVER=git-cvsserver:user@server/path/repo.git" co <HEAD_name></tt></pre> | |
</div></div> | |
<p>This has the advantage that it will be saved in your <em>CVS/Root</em> files and | |
you don't need to worry about always setting the correct environment | |
variable.</p> | |
</li> | |
<li> | |
<p> | |
For each repo that you want accessible from CVS you need to edit config in | |
the repo and add the following section. | |
</p> | |
<div class="listingblock"> | |
<div class="content"> | |
<pre><tt> [gitcvs] | |
enabled=1 | |
# optional for debugging | |
logfile=/path/to/logfile | |
</tt></pre> | |
</div></div> | |
<p>Note: you need to ensure each user that is going to invoke git-cvsserver has | |
write access to the log file and to the database (see | |
<a href="#dbbackend">Database Backend</a>. If you want to offer write access over | |
SSH, the users of course also need write access to the git repository itself.</p> | |
<p><a id="configaccessmethod"></a>All configuration variables can also be overridden for a specific method of | |
access. Valid method names are "ext" (for SSH access) and "pserver". The | |
following example configuration would disable pserver access while still | |
allowing access over SSH.</p> | |
<div class="listingblock"> | |
<div class="content"> | |
<pre><tt> [gitcvs] | |
enabled=0 | |
[gitcvs "ext"] | |
enabled=1</tt></pre> | |
</div></div> | |
</li> | |
<li> | |
<p> | |
On the client machine you need to set the following variables. | |
CVSROOT should be set as per normal, but the directory should point at the | |
appropriate git repo. For example: | |
</p> | |
<p>For SSH access, CVS_SERVER should be set to git-cvsserver</p> | |
<p>Example:</p> | |
<div class="listingblock"> | |
<div class="content"> | |
<pre><tt> export CVSROOT=:ext:user@server:/var/git/project.git | |
export CVS_SERVER=git-cvsserver</tt></pre> | |
</div></div> | |
</li> | |
<li> | |
<p> | |
For SSH clients that will make commits, make sure their .bashrc file | |
sets the GIT_AUTHOR and GIT_COMMITTER variables. | |
</p> | |
</li> | |
<li> | |
<p> | |
Clients should now be able to check out the project. Use the CVS <em>module</em> | |
name to indicate what GIT <em>head</em> you want to check out. Example: | |
</p> | |
<div class="listingblock"> | |
<div class="content"> | |
<pre><tt> cvs co -d project-master master</tt></pre> | |
</div></div> | |
</li> | |
</ol> | |
</div> | |
<h2><a id="dbbackend"></a>Database Backend</h2> | |
<div class="sectionbody"> | |
<p>git-cvsserver uses one database per git head (i.e. CVS module) to | |
store information about the repository for faster access. The | |
database doesn't contain any persistent data and can be completely | |
regenerated from the git repository at any time. The database | |
needs to be updated (i.e. written to) after every commit.</p> | |
<p>If the commit is done directly by using git (as opposed to | |
using git-cvsserver) the update will need to happen on the | |
next repository access by git-cvsserver, independent of | |
access method and requested operation.</p> | |
<p>That means that even if you offer only read access (e.g. by using | |
the pserver method), git-cvsserver should have write access to | |
the database to work reliably (otherwise you need to make sure | |
that the database is up-to-date any time git-cvsserver is executed).</p> | |
<p>By default it uses SQLite databases in the git directory, named | |
<tt>gitcvs.<module_name>.sqlite</tt>. Note that the SQLite backend creates | |
temporary files in the same directory as the database file on | |
write so it might not be enough to grant the users using | |
git-cvsserver write access to the database file without granting | |
them write access to the directory, too.</p> | |
<p>You can configure the database backend with the following | |
configuration variables:</p> | |
<h3>Configuring database backend</h3> | |
<p>git-cvsserver uses the Perl DBI module. Please also read | |
its documentation if changing these variables, especially | |
about <tt>DBI->connect()</tt>.</p> | |
<dl> | |
<dt> | |
gitcvs.dbname | |
</dt> | |
<dd> | |
<p> | |
Database name. The exact meaning depends on the | |
selected database driver, for SQLite this is a filename. | |
Supports variable substitution (see below). May | |
not contain semicolons (<tt>;</tt>). | |
Default: <em>%Ggitcvs.%m.sqlite</em> | |
</p> | |
</dd> | |
<dt> | |
gitcvs.dbdriver | |
</dt> | |
<dd> | |
<p> | |
Used DBI driver. You can specify any available driver | |
for this here, but it might not work. cvsserver is tested | |
with <em>DBD::SQLite</em>, reported to work with | |
<em>DBD::Pg</em>, and reported <strong>not</strong> to work with <em>DBD::mysql</em>. | |
Please regard this as an experimental feature. May not | |
contain colons (<tt>:</tt>). | |
Default: <em>SQLite</em> | |
</p> | |
</dd> | |
<dt> | |
gitcvs.dbuser | |
</dt> | |
<dd> | |
<p> | |
Database user. Only useful if setting <tt>dbdriver</tt>, since | |
SQLite has no concept of database users. Supports variable | |
substitution (see below). | |
</p> | |
</dd> | |
<dt> | |
gitcvs.dbpass | |
</dt> | |
<dd> | |
<p> | |
Database password. Only useful if setting <tt>dbdriver</tt>, since | |
SQLite has no concept of database passwords. | |
</p> | |
</dd> | |
</dl> | |
<p>All variables can also be set per access method, see <a href="#configaccessmethod">above</a>.</p> | |
<h4>Variable substitution</h4> | |
<p>In <tt>dbdriver</tt> and <tt>dbuser</tt> you can use the following variables:</p> | |
<dl> | |
<dt> | |
%G | |
</dt> | |
<dd> | |
<p> | |
git directory name | |
</p> | |
</dd> | |
<dt> | |
%g | |
</dt> | |
<dd> | |
<p> | |
git directory name, where all characters except for | |
alpha-numeric ones, <tt>.</tt>, and <tt>-</tt> are replaced with | |
<tt>_</tt> (this should make it easier to use the directory | |
name in a filename if wanted) | |
</p> | |
</dd> | |
<dt> | |
%m | |
</dt> | |
<dd> | |
<p> | |
CVS module/git head name | |
</p> | |
</dd> | |
<dt> | |
%a | |
</dt> | |
<dd> | |
<p> | |
access method (one of "ext" or "pserver") | |
</p> | |
</dd> | |
<dt> | |
%u | |
</dt> | |
<dd> | |
<p> | |
Name of the user running git-cvsserver. | |
If no name can be determined, the | |
numeric uid is used. | |
</p> | |
</dd> | |
</dl> | |
</div> | |
<h2>Eclipse CVS Client Notes</h2> | |
<div class="sectionbody"> | |
<p>To get a checkout with the Eclipse CVS client:</p> | |
<ol> | |
<li> | |
<p> | |
Select "Create a new project -> From CVS checkout" | |
</p> | |
</li> | |
<li> | |
<p> | |
Create a new location. See the notes below for details on how to choose the | |
right protocol. | |
</p> | |
</li> | |
<li> | |
<p> | |
Browse the <em>modules</em> available. It will give you a list of the heads in | |
the repository. You will not be able to browse the tree from there. Only | |
the heads. | |
</p> | |
</li> | |
<li> | |
<p> | |
Pick <em>HEAD</em> when it asks what branch/tag to check out. Untick the | |
"launch commit wizard" to avoid committing the .project file. | |
</p> | |
</li> | |
</ol> | |
<p>Protocol notes: If you are using anonymous access via pserver, just select that. | |
Those using SSH access should choose the <em>ext</em> protocol, and configure <em>ext</em> | |
access on the Preferences->Team->CVS->ExtConnection pane. Set CVS_SERVER to | |
<em>git-cvsserver</em>. Note that password support is not good when using <em>ext</em>, | |
you will definitely want to have SSH keys setup.</p> | |
<p>Alternatively, you can just use the non-standard extssh protocol that Eclipse | |
offer. In that case CVS_SERVER is ignored, and you will have to replace | |
the cvs utility on the server with git-cvsserver or manipulate your <tt>.bashrc</tt> | |
so that calling <em>cvs</em> effectively calls git-cvsserver.</p> | |
</div> | |
<h2>Clients known to work</h2> | |
<div class="sectionbody"> | |
<ul> | |
<li> | |
<p> | |
CVS 1.12.9 on Debian | |
</p> | |
</li> | |
<li> | |
<p> | |
CVS 1.11.17 on MacOSX (from Fink package) | |
</p> | |
</li> | |
<li> | |
<p> | |
Eclipse 3.0, 3.1.2 on MacOSX (see Eclipse CVS Client Notes) | |
</p> | |
</li> | |
<li> | |
<p> | |
TortoiseCVS | |
</p> | |
</li> | |
</ul> | |
</div> | |
<h2>Operations supported</h2> | |
<div class="sectionbody"> | |
<p>All the operations required for normal use are supported, including | |
checkout, diff, status, update, log, add, remove, commit. | |
Legacy monitoring operations are not supported (edit, watch and related). | |
Exports and tagging (tags and branches) are not supported at this stage.</p> | |
<p>The server should set the <em>-k</em> mode to binary when relevant, however, | |
this is not really implemented yet. For now, you can force the server | |
to set <em>-kb</em> for all files by setting the <tt>gitcvs.allbinary</tt> config | |
variable. In proper GIT tradition, the contents of the files are | |
always respected. No keyword expansion or newline munging is supported.</p> | |
</div> | |
<h2>Dependencies</h2> | |
<div class="sectionbody"> | |
<p>git-cvsserver depends on DBD::SQLite.</p> | |
</div> | |
<h2>Copyright and Authors</h2> | |
<div class="sectionbody"> | |
<p>This program is copyright The Open University UK - 2006.</p> | |
<p>Authors:</p> | |
<ul> | |
<li> | |
<p> | |
Martyn Smith <martyn@catalyst.net.nz> | |
</p> | |
</li> | |
<li> | |
<p> | |
Martin Langhoff <martin@catalyst.net.nz> | |
</p> | |
</li> | |
</ul> | |
<p>with ideas and patches from participants of the git-list <git@vger.kernel.org>.</p> | |
</div> | |
<h2>Documentation</h2> | |
<div class="sectionbody"> | |
<p>Documentation by Martyn Smith <martyn@catalyst.net.nz>, Martin Langhoff <martin@catalyst.net.nz>, and Matthias Urlichs <smurf@smurf.noris.de>.</p> | |
</div> | |
<h2>GIT</h2> | |
<div class="sectionbody"> | |
<p>Part of the <a href="git.html">git(7)</a> suite</p> | |
</div> | |
<div id="footer"> | |
<div id="footer-text"> | |
Last updated 31-Jan-2008 03:19:58 UTC | |
</div> | |
</div> | |
</body> | |
</html> |