Autogenerated HTML docs for v1.7.7-325-g05f6ed
[git/jnareb-git.git] / git-cvsserver.html
blobcfdb45b98fa905bf88630d1e7c310f151db71295
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6 <meta name="generator" content="AsciiDoc 8.5.2" />
7 <title>git-cvsserver(1)</title>
8 <style type="text/css">
9 /* Debug borders */
10 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
12 border: 1px solid red;
16 body {
17 margin: 1em 5% 1em 5%;
20 a {
21 color: blue;
22 text-decoration: underline;
24 a:visited {
25 color: fuchsia;
28 em {
29 font-style: italic;
30 color: navy;
33 strong {
34 font-weight: bold;
35 color: #083194;
38 tt {
39 color: navy;
42 h1, h2, h3, h4, h5, h6 {
43 color: #527bbd;
44 font-family: sans-serif;
45 margin-top: 1.2em;
46 margin-bottom: 0.5em;
47 line-height: 1.3;
50 h1, h2, h3 {
51 border-bottom: 2px solid silver;
53 h2 {
54 padding-top: 0.5em;
56 h3 {
57 float: left;
59 h3 + * {
60 clear: left;
63 div.sectionbody {
64 font-family: serif;
65 margin-left: 0;
68 hr {
69 border: 1px solid silver;
72 p {
73 margin-top: 0.5em;
74 margin-bottom: 0.5em;
77 ul, ol, li > p {
78 margin-top: 0;
81 pre {
82 padding: 0;
83 margin: 0;
86 span#author {
87 color: #527bbd;
88 font-family: sans-serif;
89 font-weight: bold;
90 font-size: 1.1em;
92 span#email {
94 span#revnumber, span#revdate, span#revremark {
95 font-family: sans-serif;
98 div#footer {
99 font-family: sans-serif;
100 font-size: small;
101 border-top: 2px solid silver;
102 padding-top: 0.5em;
103 margin-top: 4.0em;
105 div#footer-text {
106 float: left;
107 padding-bottom: 0.5em;
109 div#footer-badges {
110 float: right;
111 padding-bottom: 0.5em;
114 div#preamble {
115 margin-top: 1.5em;
116 margin-bottom: 1.5em;
118 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
119 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
120 div.admonitionblock {
121 margin-top: 1.0em;
122 margin-bottom: 1.5em;
124 div.admonitionblock {
125 margin-top: 2.0em;
126 margin-bottom: 2.0em;
127 margin-right: 10%;
128 color: #606060;
131 div.content { /* Block element content. */
132 padding: 0;
135 /* Block element titles. */
136 div.title, caption.title {
137 color: #527bbd;
138 font-family: sans-serif;
139 font-weight: bold;
140 text-align: left;
141 margin-top: 1.0em;
142 margin-bottom: 0.5em;
144 div.title + * {
145 margin-top: 0;
148 td div.title:first-child {
149 margin-top: 0.0em;
151 div.content div.title:first-child {
152 margin-top: 0.0em;
154 div.content + div.title {
155 margin-top: 0.0em;
158 div.sidebarblock > div.content {
159 background: #ffffee;
160 border: 1px solid silver;
161 padding: 0.5em;
164 div.listingblock > div.content {
165 border: 1px solid silver;
166 background: #f4f4f4;
167 padding: 0.5em;
170 div.quoteblock, div.verseblock {
171 padding-left: 1.0em;
172 margin-left: 1.0em;
173 margin-right: 10%;
174 border-left: 5px solid #dddddd;
175 color: #777777;
178 div.quoteblock > div.attribution {
179 padding-top: 0.5em;
180 text-align: right;
183 div.verseblock > div.content {
184 white-space: pre;
186 div.verseblock > div.attribution {
187 padding-top: 0.75em;
188 text-align: left;
190 /* DEPRECATED: Pre version 8.2.7 verse style literal block. */
191 div.verseblock + div.attribution {
192 text-align: left;
195 div.admonitionblock .icon {
196 vertical-align: top;
197 font-size: 1.1em;
198 font-weight: bold;
199 text-decoration: underline;
200 color: #527bbd;
201 padding-right: 0.5em;
203 div.admonitionblock td.content {
204 padding-left: 0.5em;
205 border-left: 3px solid #dddddd;
208 div.exampleblock > div.content {
209 border-left: 3px solid #dddddd;
210 padding-left: 0.5em;
213 div.imageblock div.content { padding-left: 0; }
214 span.image img { border-style: none; }
215 a.image:visited { color: white; }
217 dl {
218 margin-top: 0.8em;
219 margin-bottom: 0.8em;
221 dt {
222 margin-top: 0.5em;
223 margin-bottom: 0;
224 font-style: normal;
225 color: navy;
227 dd > *:first-child {
228 margin-top: 0.1em;
231 ul, ol {
232 list-style-position: outside;
234 ol.arabic {
235 list-style-type: decimal;
237 ol.loweralpha {
238 list-style-type: lower-alpha;
240 ol.upperalpha {
241 list-style-type: upper-alpha;
243 ol.lowerroman {
244 list-style-type: lower-roman;
246 ol.upperroman {
247 list-style-type: upper-roman;
250 div.compact ul, div.compact ol,
251 div.compact p, div.compact p,
252 div.compact div, div.compact div {
253 margin-top: 0.1em;
254 margin-bottom: 0.1em;
257 div.tableblock > table {
258 border: 3px solid #527bbd;
260 thead, p.table.header {
261 font-family: sans-serif;
262 font-weight: bold;
264 tfoot {
265 font-weight: bold;
267 td > div.verse {
268 white-space: pre;
270 p.table {
271 margin-top: 0;
273 /* Because the table frame attribute is overriden by CSS in most browsers. */
274 div.tableblock > table[frame="void"] {
275 border-style: none;
277 div.tableblock > table[frame="hsides"] {
278 border-left-style: none;
279 border-right-style: none;
281 div.tableblock > table[frame="vsides"] {
282 border-top-style: none;
283 border-bottom-style: none;
287 div.hdlist {
288 margin-top: 0.8em;
289 margin-bottom: 0.8em;
291 div.hdlist tr {
292 padding-bottom: 15px;
294 dt.hdlist1.strong, td.hdlist1.strong {
295 font-weight: bold;
297 td.hdlist1 {
298 vertical-align: top;
299 font-style: normal;
300 padding-right: 0.8em;
301 color: navy;
303 td.hdlist2 {
304 vertical-align: top;
306 div.hdlist.compact tr {
307 margin: 0;
308 padding-bottom: 0;
311 .comment {
312 background: yellow;
315 .footnote, .footnoteref {
316 font-size: 0.8em;
319 span.footnote, span.footnoteref {
320 vertical-align: super;
323 #footnotes {
324 margin: 20px 0 20px 0;
325 padding: 7px 0 0 0;
328 #footnotes div.footnote {
329 margin: 0 0 5px 0;
332 #footnotes hr {
333 border: none;
334 border-top: 1px solid silver;
335 height: 1px;
336 text-align: left;
337 margin-left: 0;
338 width: 20%;
339 min-width: 100px;
343 @media print {
344 div#footer-badges { display: none; }
347 div#toc {
348 margin-bottom: 2.5em;
351 div#toctitle {
352 color: #527bbd;
353 font-family: sans-serif;
354 font-size: 1.1em;
355 font-weight: bold;
356 margin-top: 1.0em;
357 margin-bottom: 0.1em;
360 div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
361 margin-top: 0;
362 margin-bottom: 0;
364 div.toclevel2 {
365 margin-left: 2em;
366 font-size: 0.9em;
368 div.toclevel3 {
369 margin-left: 4em;
370 font-size: 0.9em;
372 div.toclevel4 {
373 margin-left: 6em;
374 font-size: 0.9em;
376 /* Overrides for manpage documents */
377 h1 {
378 padding-top: 0.5em;
379 padding-bottom: 0.5em;
380 border-top: 2px solid silver;
381 border-bottom: 2px solid silver;
383 h2 {
384 border-style: none;
386 div.sectionbody {
387 margin-left: 5%;
390 @media print {
391 div#toc { display: none; }
394 /* Workarounds for IE6's broken and incomplete CSS2. */
396 div.sidebar-content {
397 background: #ffffee;
398 border: 1px solid silver;
399 padding: 0.5em;
401 div.sidebar-title, div.image-title {
402 color: #527bbd;
403 font-family: sans-serif;
404 font-weight: bold;
405 margin-top: 0.0em;
406 margin-bottom: 0.5em;
409 div.listingblock div.content {
410 border: 1px solid silver;
411 background: #f4f4f4;
412 padding: 0.5em;
415 div.quoteblock-attribution {
416 padding-top: 0.5em;
417 text-align: right;
420 div.verseblock-content {
421 white-space: pre;
423 div.verseblock-attribution {
424 padding-top: 0.75em;
425 text-align: left;
428 div.exampleblock-content {
429 border-left: 3px solid #dddddd;
430 padding-left: 0.5em;
433 /* IE6 sets dynamically generated links as visited. */
434 div#toc a:visited { color: blue; }
435 </style>
436 <script type="text/javascript">
437 /*<![CDATA[*/
438 window.onload = function(){asciidoc.footnotes();}
439 var asciidoc = { // Namespace.
441 /////////////////////////////////////////////////////////////////////
442 // Table Of Contents generator
443 /////////////////////////////////////////////////////////////////////
445 /* Author: Mihai Bazon, September 2002
446 * http://students.infoiasi.ro/~mishoo
448 * Table Of Content generator
449 * Version: 0.4
451 * Feel free to use this script under the terms of the GNU General Public
452 * License, as long as you do not remove or alter this notice.
455 /* modified by Troy D. Hanson, September 2006. License: GPL */
456 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
458 // toclevels = 1..4.
459 toc: function (toclevels) {
461 function getText(el) {
462 var text = "";
463 for (var i = el.firstChild; i != null; i = i.nextSibling) {
464 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
465 text += i.data;
466 else if (i.firstChild != null)
467 text += getText(i);
469 return text;
472 function TocEntry(el, text, toclevel) {
473 this.element = el;
474 this.text = text;
475 this.toclevel = toclevel;
478 function tocEntries(el, toclevels) {
479 var result = new Array;
480 var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
481 // Function that scans the DOM tree for header elements (the DOM2
482 // nodeIterator API would be a better technique but not supported by all
483 // browsers).
484 var iterate = function (el) {
485 for (var i = el.firstChild; i != null; i = i.nextSibling) {
486 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
487 var mo = re.exec(i.tagName);
488 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
489 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
491 iterate(i);
495 iterate(el);
496 return result;
499 var toc = document.getElementById("toc");
500 var entries = tocEntries(document.getElementById("content"), toclevels);
501 for (var i = 0; i < entries.length; ++i) {
502 var entry = entries[i];
503 if (entry.element.id == "")
504 entry.element.id = "_toc_" + i;
505 var a = document.createElement("a");
506 a.href = "#" + entry.element.id;
507 a.appendChild(document.createTextNode(entry.text));
508 var div = document.createElement("div");
509 div.appendChild(a);
510 div.className = "toclevel" + entry.toclevel;
511 toc.appendChild(div);
513 if (entries.length == 0)
514 toc.parentNode.removeChild(toc);
518 /////////////////////////////////////////////////////////////////////
519 // Footnotes generator
520 /////////////////////////////////////////////////////////////////////
522 /* Based on footnote generation code from:
523 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
526 footnotes: function () {
527 var cont = document.getElementById("content");
528 var noteholder = document.getElementById("footnotes");
529 var spans = cont.getElementsByTagName("span");
530 var refs = {};
531 var n = 0;
532 for (i=0; i<spans.length; i++) {
533 if (spans[i].className == "footnote") {
534 n++;
535 // Use [\s\S] in place of . so multi-line matches work.
536 // Because JavaScript has no s (dotall) regex flag.
537 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
538 noteholder.innerHTML +=
539 "<div class='footnote' id='_footnote_" + n + "'>" +
540 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
541 n + "</a>. " + note + "</div>";
542 spans[i].innerHTML =
543 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
544 "' title='View footnote' class='footnote'>" + n + "</a>]";
545 var id =spans[i].getAttribute("id");
546 if (id != null) refs["#"+id] = n;
549 if (n == 0)
550 noteholder.parentNode.removeChild(noteholder);
551 else {
552 // Process footnoterefs.
553 for (i=0; i<spans.length; i++) {
554 if (spans[i].className == "footnoteref") {
555 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
556 href = href.match(/#.*/)[0]; // Because IE return full URL.
557 n = refs[href];
558 spans[i].innerHTML =
559 "[<a href='#_footnote_" + n +
560 "' title='View footnote' class='footnote'>" + n + "</a>]";
567 /*]]>*/
568 </script>
569 </head>
570 <body>
571 <div id="header">
572 <h1>
573 git-cvsserver(1) Manual Page
574 </h1>
575 <h2>NAME</h2>
576 <div class="sectionbody">
577 <p>git-cvsserver -
578 A CVS server emulator for git
579 </p>
580 </div>
581 </div>
582 <div id="content">
583 <h2 id="_synopsis">SYNOPSIS</h2>
584 <div class="sectionbody">
585 <div class="paragraph"><p>SSH:</p></div>
586 <div class="verseblock">
587 <div class="verseblock-content">export CVS_SERVER="git cvsserver"
588 <em>cvs</em> -d :ext:user@server/path/repo.git co &lt;HEAD_name&gt;</div>
589 <div class="verseblock-attribution">
590 </div></div>
591 <div class="paragraph"><p>pserver (/etc/inetd.conf):</p></div>
592 <div class="verseblock">
593 <div class="verseblock-content">cvspserver stream tcp nowait nobody /usr/bin/git-cvsserver git-cvsserver pserver</div>
594 <div class="verseblock-attribution">
595 </div></div>
596 <div class="paragraph"><p>Usage:</p></div>
597 <div class="verseblock">
598 <div class="verseblock-content"><em>git-cvsserver</em> [options] [pserver|server] [&lt;directory&gt; &#8230;]</div>
599 <div class="verseblock-attribution">
600 </div></div>
601 </div>
602 <h2 id="_options">OPTIONS</h2>
603 <div class="sectionbody">
604 <div class="paragraph"><p>All these options obviously only make sense if enforced by the server side.
605 They have been implemented to resemble the <a href="git-daemon.html">git-daemon(1)</a> options as
606 closely as possible.</p></div>
607 <div class="dlist"><dl>
608 <dt class="hdlist1">
609 --base-path &lt;path&gt;
610 </dt>
611 <dd>
613 Prepend <em>path</em> to requested CVSROOT
614 </p>
615 </dd>
616 <dt class="hdlist1">
617 --strict-paths
618 </dt>
619 <dd>
621 Don&#8217;t allow recursing into subdirectories
622 </p>
623 </dd>
624 <dt class="hdlist1">
625 --export-all
626 </dt>
627 <dd>
629 Don&#8217;t check for <tt>gitcvs.enabled</tt> in config. You also have to specify a list
630 of allowed directories (see below) if you want to use this option.
631 </p>
632 </dd>
633 <dt class="hdlist1">
635 </dt>
636 <dt class="hdlist1">
637 --version
638 </dt>
639 <dd>
641 Print version information and exit
642 </p>
643 </dd>
644 <dt class="hdlist1">
646 </dt>
647 <dt class="hdlist1">
649 </dt>
650 <dt class="hdlist1">
651 --help
652 </dt>
653 <dd>
655 Print usage information and exit
656 </p>
657 </dd>
658 <dt class="hdlist1">
659 &lt;directory&gt;
660 </dt>
661 <dd>
663 You can specify a list of allowed directories. If no directories
664 are given, all are allowed. This is an additional restriction, gitcvs
665 access still needs to be enabled by the <tt>gitcvs.enabled</tt> config option
666 unless <em>--export-all</em> was given, too.
667 </p>
668 </dd>
669 </dl></div>
670 </div>
671 <h2 id="_description">DESCRIPTION</h2>
672 <div class="sectionbody">
673 <div class="paragraph"><p>This application is a CVS emulation layer for git.</p></div>
674 <div class="paragraph"><p>It is highly functional. However, not all methods are implemented,
675 and for those methods that are implemented,
676 not all switches are implemented.</p></div>
677 <div class="paragraph"><p>Testing has been done using both the CLI CVS client, and the Eclipse CVS
678 plugin. Most functionality works fine with both of these clients.</p></div>
679 </div>
680 <h2 id="_limitations">LIMITATIONS</h2>
681 <div class="sectionbody">
682 <div class="paragraph"><p>CVS clients cannot tag, branch or perform GIT merges.</p></div>
683 <div class="paragraph"><p><em>git-cvsserver</em> maps GIT branches to CVS modules. This is very different
684 from what most CVS users would expect since in CVS modules usually represent
685 one or more directories.</p></div>
686 </div>
687 <h2 id="_installation">INSTALLATION</h2>
688 <div class="sectionbody">
689 <div class="olist arabic"><ol class="arabic">
690 <li>
692 If you are going to offer CVS access via pserver, add a line in
693 /etc/inetd.conf like
694 </p>
695 <div class="listingblock">
696 <div class="content">
697 <pre><tt> cvspserver stream tcp nowait nobody git-cvsserver pserver</tt></pre>
698 </div></div>
699 <div class="paragraph"><p>Note: Some inetd servers let you specify the name of the executable
700 independently of the value of argv[0] (i.e. the name the program assumes
701 it was executed with). In this case the correct line in /etc/inetd.conf
702 looks like</p></div>
703 <div class="listingblock">
704 <div class="content">
705 <pre><tt> cvspserver stream tcp nowait nobody /usr/bin/git-cvsserver git-cvsserver pserver</tt></pre>
706 </div></div>
707 <div class="paragraph"><p>Only anonymous access is provided by pserve by default. To commit you
708 will have to create pserver accounts, simply add a gitcvs.authdb
709 setting in the config file of the repositories you want the cvsserver
710 to allow writes to, for example:</p></div>
711 <div class="listingblock">
712 <div class="content">
713 <pre><tt> [gitcvs]
714 authdb = /etc/cvsserver/passwd</tt></pre>
715 </div></div>
716 <div class="paragraph"><p>The format of these files is username followed by the crypted password,
717 for example:</p></div>
718 <div class="listingblock">
719 <div class="content">
720 <pre><tt> myuser:$1Oyx5r9mdGZ2
721 myuser:$1$BA)@$vbnMJMDym7tA32AamXrm./</tt></pre>
722 </div></div>
723 <div class="paragraph"><p>You can use the <em>htpasswd</em> facility that comes with Apache to make these
724 files, but Apache&#8217;s MD5 crypt method differs from the one used by most C
725 library&#8217;s crypt() function, so don&#8217;t use the -m option.</p></div>
726 <div class="paragraph"><p>Alternatively you can produce the password with perl&#8217;s crypt() operator:</p></div>
727 <div class="listingblock">
728 <div class="content">
729 <pre><tt> perl -e 'my ($user, $pass) = @ARGV; printf "%s:%s\n", $user, crypt($user, $pass)' $USER password</tt></pre>
730 </div></div>
731 <div class="paragraph"><p>Then provide your password via the pserver method, for example:</p></div>
732 <div class="listingblock">
733 <div class="content">
734 <pre><tt> cvs -d:pserver:someuser:somepassword &lt;at&gt; server/path/repo.git co &lt;HEAD_name&gt;</tt></pre>
735 </div></div>
736 <div class="paragraph"><p>No special setup is needed for SSH access, other than having GIT tools
737 in the PATH. If you have clients that do not accept the CVS_SERVER
738 environment variable, you can rename <em>git-cvsserver</em> to <tt>cvs</tt>.</p></div>
739 <div class="paragraph"><p>Note: Newer CVS versions (&gt;= 1.12.11) also support specifying
740 CVS_SERVER directly in CVSROOT like</p></div>
741 <div class="listingblock">
742 <div class="content">
743 <pre><tt>cvs -d ":ext;CVS_SERVER=git cvsserver:user@server/path/repo.git" co &lt;HEAD_name&gt;</tt></pre>
744 </div></div>
745 <div class="paragraph"><p>This has the advantage that it will be saved in your <em>CVS/Root</em> files and
746 you don&#8217;t need to worry about always setting the correct environment
747 variable. SSH users restricted to <em>git-shell</em> don&#8217;t need to override the default
748 with CVS_SERVER (and shouldn&#8217;t) as <em>git-shell</em> understands <tt>cvs</tt> to mean
749 <em>git-cvsserver</em> and pretends that the other end runs the real <em>cvs</em> better.</p></div>
750 </li>
751 <li>
753 For each repo that you want accessible from CVS you need to edit config in
754 the repo and add the following section.
755 </p>
756 <div class="listingblock">
757 <div class="content">
758 <pre><tt> [gitcvs]
759 enabled=1
760 # optional for debugging
761 logfile=/path/to/logfile</tt></pre>
762 </div></div>
763 <div class="paragraph"><p>Note: you need to ensure each user that is going to invoke <em>git-cvsserver</em> has
764 write access to the log file and to the database (see
765 <a href="#dbbackend">Database Backend</a>. If you want to offer write access over
766 SSH, the users of course also need write access to the git repository itself.</p></div>
767 <div class="paragraph"><p>You also need to ensure that each repository is "bare" (without a git index
768 file) for <tt>cvs commit</tt> to work. See <a href="gitcvs-migration.html">gitcvs-migration(7)</a>.</p></div>
769 <div class="paragraph" id="configaccessmethod"><p>All configuration variables can also be overridden for a specific method of
770 access. Valid method names are "ext" (for SSH access) and "pserver". The
771 following example configuration would disable pserver access while still
772 allowing access over SSH.</p></div>
773 <div class="listingblock">
774 <div class="content">
775 <pre><tt> [gitcvs]
776 enabled=0
778 [gitcvs "ext"]
779 enabled=1</tt></pre>
780 </div></div>
781 </li>
782 <li>
784 If you didn&#8217;t specify the CVSROOT/CVS_SERVER directly in the checkout command,
785 automatically saving it in your <em>CVS/Root</em> files, then you need to set them
786 explicitly in your environment. CVSROOT should be set as per normal, but the
787 directory should point at the appropriate git repo. As above, for SSH clients
788 <em>not</em> restricted to <em>git-shell</em>, CVS_SERVER should be set to <em>git-cvsserver</em>.
789 </p>
790 <div class="listingblock">
791 <div class="content">
792 <pre><tt> export CVSROOT=:ext:user@server:/var/git/project.git
793 export CVS_SERVER="git cvsserver"</tt></pre>
794 </div></div>
795 </li>
796 <li>
798 For SSH clients that will make commits, make sure their server-side
799 .ssh/environment files (or .bashrc, etc., according to their specific shell)
800 export appropriate values for GIT_AUTHOR_NAME, GIT_AUTHOR_EMAIL,
801 GIT_COMMITTER_NAME, and GIT_COMMITTER_EMAIL. For SSH clients whose login
802 shell is bash, .bashrc may be a reasonable alternative.
803 </p>
804 </li>
805 <li>
807 Clients should now be able to check out the project. Use the CVS <em>module</em>
808 name to indicate what GIT <em>head</em> you want to check out. This also sets the
809 name of your newly checked-out directory, unless you tell it otherwise with
810 <tt>-d &lt;dir_name&gt;</tt>. For example, this checks out <em>master</em> branch to the
811 <tt>project-master</tt> directory:
812 </p>
813 <div class="listingblock">
814 <div class="content">
815 <pre><tt> cvs co -d project-master master</tt></pre>
816 </div></div>
817 </li>
818 </ol></div>
819 </div>
820 <h2 id="dbbackend">Database Backend</h2>
821 <div class="sectionbody">
822 <div class="paragraph"><p><em>git-cvsserver</em> uses one database per git head (i.e. CVS module) to
823 store information about the repository to maintain consistent
824 CVS revision numbers. The database needs to be
825 updated (i.e. written to) after every commit.</p></div>
826 <div class="paragraph"><p>If the commit is done directly by using <tt>git</tt> (as opposed to
827 using <em>git-cvsserver</em>) the update will need to happen on the
828 next repository access by <em>git-cvsserver</em>, independent of
829 access method and requested operation.</p></div>
830 <div class="paragraph"><p>That means that even if you offer only read access (e.g. by using
831 the pserver method), <em>git-cvsserver</em> should have write access to
832 the database to work reliably (otherwise you need to make sure
833 that the database is up-to-date any time <em>git-cvsserver</em> is executed).</p></div>
834 <div class="paragraph"><p>By default it uses SQLite databases in the git directory, named
835 <tt>gitcvs.&lt;module_name&gt;.sqlite</tt>. Note that the SQLite backend creates
836 temporary files in the same directory as the database file on
837 write so it might not be enough to grant the users using
838 <em>git-cvsserver</em> write access to the database file without granting
839 them write access to the directory, too.</p></div>
840 <div class="paragraph"><p>The database can not be reliably regenerated in a
841 consistent form after the branch it is tracking has changed.
842 Example: For merged branches, <em>git-cvsserver</em> only tracks
843 one branch of development, and after a <em>git merge</em> an
844 incrementally updated database may track a different branch
845 than a database regenerated from scratch, causing inconsistent
846 CVS revision numbers. <tt>git-cvsserver</tt> has no way of knowing which
847 branch it would have picked if it had been run incrementally
848 pre-merge. So if you have to fully or partially (from old
849 backup) regenerate the database, you should be suspicious
850 of pre-existing CVS sandboxes.</p></div>
851 <div class="paragraph"><p>You can configure the database backend with the following
852 configuration variables:</p></div>
853 <h3 id="_configuring_database_backend">Configuring database backend</h3><div style="clear:left"></div>
854 <div class="paragraph"><p><em>git-cvsserver</em> uses the Perl DBI module. Please also read
855 its documentation if changing these variables, especially
856 about <tt>DBI-&gt;connect()</tt>.</p></div>
857 <div class="dlist"><dl>
858 <dt class="hdlist1">
859 gitcvs.dbname
860 </dt>
861 <dd>
863 Database name. The exact meaning depends on the
864 selected database driver, for SQLite this is a filename.
865 Supports variable substitution (see below). May
866 not contain semicolons (<tt>;</tt>).
867 Default: <em>%Ggitcvs.%m.sqlite</em>
868 </p>
869 </dd>
870 <dt class="hdlist1">
871 gitcvs.dbdriver
872 </dt>
873 <dd>
875 Used DBI driver. You can specify any available driver
876 for this here, but it might not work. cvsserver is tested
877 with <em>DBD::SQLite</em>, reported to work with
878 <em>DBD::Pg</em>, and reported <strong>not</strong> to work with <em>DBD::mysql</em>.
879 Please regard this as an experimental feature. May not
880 contain colons (<tt>:</tt>).
881 Default: <em>SQLite</em>
882 </p>
883 </dd>
884 <dt class="hdlist1">
885 gitcvs.dbuser
886 </dt>
887 <dd>
889 Database user. Only useful if setting <tt>dbdriver</tt>, since
890 SQLite has no concept of database users. Supports variable
891 substitution (see below).
892 </p>
893 </dd>
894 <dt class="hdlist1">
895 gitcvs.dbpass
896 </dt>
897 <dd>
899 Database password. Only useful if setting <tt>dbdriver</tt>, since
900 SQLite has no concept of database passwords.
901 </p>
902 </dd>
903 <dt class="hdlist1">
904 gitcvs.dbTableNamePrefix
905 </dt>
906 <dd>
908 Database table name prefix. Supports variable substitution
909 (see below). Any non-alphabetic characters will be replaced
910 with underscores.
911 </p>
912 </dd>
913 </dl></div>
914 <div class="paragraph"><p>All variables can also be set per access method, see <a href="#configaccessmethod">above</a>.</p></div>
915 <h4 id="_variable_substitution">Variable substitution</h4>
916 <div class="paragraph"><p>In <tt>dbdriver</tt> and <tt>dbuser</tt> you can use the following variables:</p></div>
917 <div class="dlist"><dl>
918 <dt class="hdlist1">
920 </dt>
921 <dd>
923 git directory name
924 </p>
925 </dd>
926 <dt class="hdlist1">
928 </dt>
929 <dd>
931 git directory name, where all characters except for
932 alpha-numeric ones, <tt>.</tt>, and <tt>-</tt> are replaced with
933 <tt>_</tt> (this should make it easier to use the directory
934 name in a filename if wanted)
935 </p>
936 </dd>
937 <dt class="hdlist1">
939 </dt>
940 <dd>
942 CVS module/git head name
943 </p>
944 </dd>
945 <dt class="hdlist1">
947 </dt>
948 <dd>
950 access method (one of "ext" or "pserver")
951 </p>
952 </dd>
953 <dt class="hdlist1">
955 </dt>
956 <dd>
958 Name of the user running <em>git-cvsserver</em>.
959 If no name can be determined, the
960 numeric uid is used.
961 </p>
962 </dd>
963 </dl></div>
964 </div>
965 <h2 id="_environment">ENVIRONMENT</h2>
966 <div class="sectionbody">
967 <div class="paragraph"><p>These variables obviate the need for command-line options in some
968 circumstances, allowing easier restricted usage through git-shell.</p></div>
969 <div class="paragraph"><p>GIT_CVSSERVER_BASE_PATH takes the place of the argument to --base-path.</p></div>
970 <div class="paragraph"><p>GIT_CVSSERVER_ROOT specifies a single-directory whitelist. The
971 repository must still be configured to allow access through
972 git-cvsserver, as described above.</p></div>
973 <div class="paragraph"><p>When these environment variables are set, the corresponding
974 command-line arguments may not be used.</p></div>
975 </div>
976 <h2 id="_eclipse_cvs_client_notes">Eclipse CVS Client Notes</h2>
977 <div class="sectionbody">
978 <div class="paragraph"><p>To get a checkout with the Eclipse CVS client:</p></div>
979 <div class="olist arabic"><ol class="arabic">
980 <li>
982 Select "Create a new project &#8594; From CVS checkout"
983 </p>
984 </li>
985 <li>
987 Create a new location. See the notes below for details on how to choose the
988 right protocol.
989 </p>
990 </li>
991 <li>
993 Browse the <em>modules</em> available. It will give you a list of the heads in
994 the repository. You will not be able to browse the tree from there. Only
995 the heads.
996 </p>
997 </li>
998 <li>
1000 Pick <em>HEAD</em> when it asks what branch/tag to check out. Untick the
1001 "launch commit wizard" to avoid committing the .project file.
1002 </p>
1003 </li>
1004 </ol></div>
1005 <div class="paragraph"><p>Protocol notes: If you are using anonymous access via pserver, just select that.
1006 Those using SSH access should choose the <em>ext</em> protocol, and configure <em>ext</em>
1007 access on the Preferences&#8594;Team&#8594;CVS&#8594;ExtConnection pane. Set CVS_SERVER to
1008 "<tt>git cvsserver</tt>". Note that password support is not good when using <em>ext</em>,
1009 you will definitely want to have SSH keys setup.</p></div>
1010 <div class="paragraph"><p>Alternatively, you can just use the non-standard extssh protocol that Eclipse
1011 offer. In that case CVS_SERVER is ignored, and you will have to replace
1012 the cvs utility on the server with <em>git-cvsserver</em> or manipulate your <tt>.bashrc</tt>
1013 so that calling <em>cvs</em> effectively calls <em>git-cvsserver</em>.</p></div>
1014 </div>
1015 <h2 id="_clients_known_to_work">Clients known to work</h2>
1016 <div class="sectionbody">
1017 <div class="ulist"><ul>
1018 <li>
1020 CVS 1.12.9 on Debian
1021 </p>
1022 </li>
1023 <li>
1025 CVS 1.11.17 on MacOSX (from Fink package)
1026 </p>
1027 </li>
1028 <li>
1030 Eclipse 3.0, 3.1.2 on MacOSX (see Eclipse CVS Client Notes)
1031 </p>
1032 </li>
1033 <li>
1035 TortoiseCVS
1036 </p>
1037 </li>
1038 </ul></div>
1039 </div>
1040 <h2 id="_operations_supported">Operations supported</h2>
1041 <div class="sectionbody">
1042 <div class="paragraph"><p>All the operations required for normal use are supported, including
1043 checkout, diff, status, update, log, add, remove, commit.
1044 Legacy monitoring operations are not supported (edit, watch and related).
1045 Exports and tagging (tags and branches) are not supported at this stage.</p></div>
1046 <h3 id="_crlf_line_ending_conversions">CRLF Line Ending Conversions</h3><div style="clear:left"></div>
1047 <div class="paragraph"><p>By default the server leaves the <em>-k</em> mode blank for all files,
1048 which causes the CVS client to treat them as a text files, subject
1049 to end-of-line conversion on some platforms.</p></div>
1050 <div class="paragraph"><p>You can make the server use the end-of-line conversion attributes to
1051 set the <em>-k</em> modes for files by setting the <tt>gitcvs.usecrlfattr</tt>
1052 config variable. See <a href="gitattributes.html">gitattributes(5)</a> for more information
1053 about end-of-line conversion.</p></div>
1054 <div class="paragraph"><p>Alternatively, if <tt>gitcvs.usecrlfattr</tt> config is not enabled
1055 or the attributes do not allow automatic detection for a filename, then
1056 the server uses the <tt>gitcvs.allbinary</tt> config for the default setting.
1057 If <tt>gitcvs.allbinary</tt> is set, then file not otherwise
1058 specified will default to <em>-kb</em> mode. Otherwise the <em>-k</em> mode
1059 is left blank. But if <tt>gitcvs.allbinary</tt> is set to "guess", then
1060 the correct <em>-k</em> mode will be guessed based on the contents of
1061 the file.</p></div>
1062 <div class="paragraph"><p>For best consistency with <em>cvs</em>, it is probably best to override the
1063 defaults by setting <tt>gitcvs.usecrlfattr</tt> to true,
1064 and <tt>gitcvs.allbinary</tt> to "guess".</p></div>
1065 </div>
1066 <h2 id="_dependencies">Dependencies</h2>
1067 <div class="sectionbody">
1068 <div class="paragraph"><p><em>git-cvsserver</em> depends on DBD::SQLite.</p></div>
1069 </div>
1070 <h2 id="_git">GIT</h2>
1071 <div class="sectionbody">
1072 <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
1073 </div>
1074 </div>
1075 <div id="footnotes"><hr /></div>
1076 <div id="footer">
1077 <div id="footer-text">
1078 Last updated 2011-09-21 23:01:14 PDT
1079 </div>
1080 </div>
1081 </body>
1082 </html>