1\input texinfo @c -*-texinfo-*- 2@comment cvs.texinfo,v 1.6 1995/10/12 23:39:26 kfogel Exp 3@comment Documentation for CVS. 4@comment Copyright (C) 1992, 1993 Signum Support AB 5@comment Copyright (C) 1993 Free Software Foundation, Inc. 6 7@comment This file is part of the CVS distribution. 8 9@comment CVS is free software; you can redistribute it and/or modify 10@comment it under the terms of the GNU General Public License as published by 11@comment the Free Software Foundation; either version 1, or (at your option) 12@comment any later version. 13 14@comment CVS is distributed in the hope that it will be useful, 15@comment but WITHOUT ANY WARRANTY; without even the implied warranty of 16@comment MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17@comment GNU General Public License for more details. 18 19@c See ../README for A4 vs. US letter size. 20@c When we provided A4 postscript, and people tried to 21@c print it on US letter, the usual complaint was that the 22@c page numbers would get cut off. 23@c If one prints US letter on A4, reportedly there is 24@c some extra space at the top and/or bottom, and the side 25@c margins are a bit narrow, but no text is lost. 26@c 27@c See 28@c http://www.ft.uni-erlangen.de/~mskuhn/iso-paper.html 29@c for more on paper sizes. Insuring that margins are 30@c big enough to print on either A4 or US letter does 31@c indeed seem to be the usual approach (according to 32@c an internet draft by Jacob Palme). 33 34@setfilename cvs.info 35@include CVSvn.texi 36@settitle CVS---Concurrent Versions System 37@setchapternewpage odd 38 39@c -- TODO list: 40@c -- Fix all lines that match "^@c -- " 41@c -- Document how CVS finds the binaries it executes. 42@c Things to include in the index: 43@c Finding RCS binaries 44@c Path to RCS binaries 45@c RCS, how CVS finds them 46@c s/RCS/diff/ 47@c -- More on binary files 48 49@ifinfo 50Copyright @copyright{} 1992, 1993 Signum Support AB 51Copyright @copyright{} 1993, 1994 Free Software Foundation, Inc. 52 53Permission is granted to make and distribute verbatim copies of 54this manual provided the copyright notice and this permission notice 55are preserved on all copies. 56 57@ignore 58Permission is granted to process this file through Tex and print the 59results, provided the printed document carries copying permission 60notice identical to this one except for the removal of this paragraph 61(this paragraph not being relevant to the printed manual). 62 63@end ignore 64Permission is granted to copy and distribute modified versions of this 65manual under the conditions for verbatim copying, provided also that the 66section entitled ``GNU General Public License'' is included exactly as 67in the original, and provided that the entire resulting derived work is 68distributed under the terms of a permission notice identical to this one. 69 70Permission is granted to copy and distribute translations of this manual 71into another language, under the above conditions for modified versions, 72except that the section entitled ``GNU General Public License'' and 73this permission notice may be included in translations approved by the 74Free Software Foundation instead of in the original English. 75@end ifinfo 76 77@comment The titlepage section does not appear in the Info file. 78@titlepage 79@sp 4 80@comment The title is printed in a large font. 81@center @titlefont{Version Management} 82@sp 83@center @titlefont{with} 84@sp 85@center @titlefont{CVS} 86@sp 2 87@center for @sc{cvs} @value{CVSVN} 88@comment -release- 89@sp 3 90@center Per Cederqvist et al 91 92@comment The following two commands start the copyright page 93@comment for the printed manual. This will not appear in the Info file. 94@page 95@vskip 0pt plus 1filll 96Copyright @copyright{} 1992, 1993 Signum Support AB 97 98Permission is granted to make and distribute verbatim copies of 99this manual provided the copyright notice and this permission notice 100are preserved on all copies. 101 102Permission is granted to copy and distribute modified versions of this 103manual under the conditions for verbatim copying, provided also that the 104section entitled ``GNU General Public License'' is included exactly as 105in the original, and provided that the entire resulting derived work is 106distributed under the terms of a permission notice identical to this one. 107 108Permission is granted to copy and distribute translations of this manual 109into another language, under the above conditions for modified versions, 110except that the section entitled ``GNU General Public License'' and 111this permission notice may be included in translations approved by the 112Free Software Foundation instead of in the original English. 113@end titlepage 114 115@comment ================================================================ 116@comment The real text starts here 117@comment ================================================================ 118 119@ifinfo 120@c --------------------------------------------------------------------- 121@node Top 122@top 123@c Note: there is a space after that @top command. 124@c The texinfo-format-buffer Emacs function and 125@c the makeinfo shell command disagree on what arguments 126@c @top takes; @top followed by a single space is 127@c something they can both cope with. 128 129This info manual describes how to use and administer 130@sc{cvs} version @value{CVSVN}. 131@end ifinfo 132 133@c This menu is pretty long. Not sure how easily that 134@c can be fixed; seems like "Adding files", "Removing 135@c files", "Removing directories", "Moving files", 136@c and "Moving directories" all go together (into 137@c "Adding, removing, and renaming"?). Other than that 138@c no brilliant ideas for a fix... 139@menu 140* Preface:: About this manual 141* What is CVS?:: What is CVS? 142* A sample session:: A tour of basic CVS usage 143* Repository:: Where all your sources are stored 144* Starting a new project:: Starting a project with CVS 145* Multiple developers:: How CVS helps a group of developers 146* Revisions and branches:: Numeric, symbolic, and branch revisions 147* Merging:: How to move changes between branches 148* Recursive behavior:: CVS descends directories 149* Adding files:: Adding files 150* Removing files:: Removing files 151* Removing directories:: Removing directories 152* Tracking sources:: Tracking third-party sources 153* Moving files:: Moving and renaming files 154* Moving directories:: Moving and renaming directories 155* History browsing:: Viewing the history of files in various ways 156* Keyword substitution:: CVS can include the revision inside the file 157* Binary files:: CVS can handle binary files 158* Builds:: Issues related to CVS and builds 159* Compatibility:: Upgrading CVS versions 160* Revision management:: Policy questions for revision management 161* CVS commands:: CVS commands share some things 162* Invoking CVS:: Quick reference to CVS commands 163* Administrative files:: Reference manual for the Administrative files 164* Environment variables:: All environment variables which affect CVS 165* Troubleshooting:: Some tips when nothing works 166* Copying:: GNU GENERAL PUBLIC LICENSE 167* Index:: Index 168@end menu 169 170@c --------------------------------------------------------------------- 171@node Preface 172@unnumbered About this manual 173@cindex Preface 174@cindex About this manual 175 176Up to this point, one of the weakest parts of @sc{cvs} 177has been the documentation. @sc{cvs} is a complex 178program. Previous versions of the manual were written 179in the manual page format, which is not really well 180suited for such a complex program. 181 182When writing this manual, I had several goals in mind: 183 184@itemize @bullet 185@item 186No knowledge of @sc{rcs} should be necessary. 187 188@item 189No previous knowledge of revision control software 190should be necessary. All terms, such as @dfn{revision 191numbers}, @dfn{revision trees} and @dfn{merging} are 192explained as they are introduced. 193 194@item 195The manual should concentrate on the things @sc{cvs} users 196want to do, instead of what the @sc{cvs} commands can do. 197The first part of this manual leads you through things 198you might want to do while doing development, and 199introduces the relevant @sc{cvs} commands as they are 200needed. 201 202@item 203Information should be easy to find. In the reference 204manual in the appendices almost all information about 205every @sc{cvs} command is gathered together. There is also 206an extensive index, and a lot of cross references. 207@end itemize 208 209@cindex Signum Support 210@cindex Support, getting CVS support 211This manual was contributed by Signum Support AB in 212Sweden. Signum is yet another in the growing list of 213companies that support free software. You are free to 214copy both this manual and the @sc{cvs} program. 215@xref{Copying}, for the details. Signum Support offers 216@c -- Check this reference! It has been bogus in the past. 217support contracts and binary distribution for many 218programs, such as @sc{cvs}, @sc{gnu} Emacs, the 219@sc{gnu} C compiler and others. Write to us for 220more information. 221 222@example 223Signum Support AB 224Box 2044 225S-580 02 Linkoping 226Sweden 227 228Email: info@@signum.se 229Phone: +46 (0)13 - 21 46 00 230Fax: +46 (0)13 - 21 47 00 231@end example 232 233Another company selling support for @sc{cvs} is Cyclic 234Software, web: @code{http://www.cyclic.com/}, email: 235@code{info@@cyclic.com}. 236 237@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 238@menu 239* Checklist:: 240* Credits:: 241* BUGS:: 242@end menu 243 244@node Checklist 245@unnumberedsec Checklist for the impatient reader 246 247@sc{cvs} is a complex system. You will need to read 248the manual to be able to use all of its capabilities. 249There are dangers that can easily be avoided if you 250know about them, and this manual tries to warn you 251about them. This checklist is intended to help you 252avoid the dangers without reading the entire manual. 253If you intend to read the entire manual you can skip 254this table. 255 256@table @asis 257@item Binary files 258@sc{cvs} can handle binary files, but 259you must have @sc{rcs} release 5.5 or later and 260a release of @sc{gnu} diff that supports the @samp{-a} 261flag (release 1.15 and later are OK). You must also 262configure both @sc{rcs} and @sc{cvs} to handle binary 263files when you install them. 264 265Keyword substitution can be a source of trouble with 266binary files. @xref{Keyword substitution}, for 267solutions. 268 269@item The @code{admin} command 270Careless use of the @code{admin} command can cause 271@sc{cvs} to cease working. @xref{admin}, before trying 272to use it. 273@end table 274 275@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 276@node Credits 277@unnumberedsec Credits 278 279@cindex Contributors (manual) 280@cindex Credits (manual) 281Roland Pesch, then of Cygnus Support <@t{roland@@wrs.com}> 282wrote the manual pages which were distributed with 283@sc{cvs} 1.3. Appendix A and B contain much text that 284was extracted from them. He also read an early draft 285of this manual and contributed many ideas and 286corrections. 287 288The mailing-list @code{info-cvs} is sometimes 289informative. I have included information from postings 290made by the following persons: 291David G. Grubbs <@t{dgg@@think.com}>. 292 293Some text has been extracted from the man pages for 294@sc{rcs}. 295 296The @sc{cvs} @sc{faq} by David G. Grubbs has provided 297useful material. The @sc{faq} is no longer maintained, 298however, and this manual is about the closest thing there 299is to a successor (with respect to documenting how to 300use @sc{cvs}, at least). 301 302In addition, the following persons have helped by 303telling me about mistakes I've made: 304Roxanne Brunskill <@t{rbrunski@@datap.ca}>, 305Kathy Dyer <@t{dyer@@phoenix.ocf.llnl.gov}>, 306Karl Pingle <@t{pingle@@acuson.com}>, 307Thomas A Peterson <@t{tap@@src.honeywell.com}>, 308Inge Wallin <@t{ingwa@@signum.se}>, 309Dirk Koschuetzki <@t{koschuet@@fmi.uni-passau.de}> 310and Michael Brown <@t{brown@@wi.extrel.com}>. 311 312@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 313@node BUGS 314@unnumberedsec BUGS 315 316@cindex Bugs, known in this manual 317@cindex Known bugs in this manual 318This manual is known to have room for improvement. 319Here is a list of known deficiencies: 320 321@itemize @bullet 322@item 323In the examples, the output from @sc{cvs} is sometimes 324displayed, sometimes not. 325 326@item 327The input that you are supposed to type in the examples 328should have a different font than the output from the 329computer. 330 331@item 332This manual should be clearer about what file 333permissions you should set up in the repository, and 334about setuid/setgid. 335 336@item 337Some of the chapters are not yet complete. They are 338noted by comments in the @file{cvs.texinfo} file. 339 340@item 341@cindex Reporting bugs (manual) 342@cindex Bugs, reporting (manual) 343@cindex Errors, reporting (manual) 344This list is not complete. If you notice any error, 345omission, or something that is unclear, please send 346mail to @t{bug-cvs@@prep.ai.mit.edu}. 347@end itemize 348 349I hope that you will find this manual useful, despite 350the above-mentioned shortcomings. 351 352@flushright 353 354Linkoping, October 1993 355Per Cederqvist 356@end flushright 357 358@c --------------------------------------------------------------------- 359@node What is CVS? 360@chapter What is CVS? 361@cindex What is CVS? 362@cindex Introduction to CVS 363@cindex CVS, introduction to 364 365@sc{cvs} is a version control system. Using it, you can 366record the history of your source files. 367 368@c -- /// 369@c -- ///Those who cannot remember the past are condemned to repeat it. 370@c -- /// -- George Santayana 371@c -- ////// 372 373@c -- Insert history quote here! 374For example, bugs sometimes creep in when 375software is modified, and you might not detect the bug 376until a long time after you make the modification. 377With @sc{cvs}, you can easily retrieve old versions to see 378exactly which change caused the bug. This can 379sometimes be a big help. 380 381You could of course save every version of every file 382you have ever created. This would 383however waste an enormous amount of disk space. @sc{cvs} 384stores all the versions of a file in a single file in a 385clever way that only stores the differences between 386versions. 387 388@sc{cvs} also helps you if you are part of a group of people working 389on the same project. It is all too easy to overwrite 390each others' changes unless you are extremely careful. 391Some editors, like @sc{gnu} Emacs, try to make sure that 392the same file is never modified by two people at the 393same time. Unfortunately, if someone is using another 394editor, that safeguard will not work. @sc{cvs} solves this problem 395by insulating the different developers from each other. Every 396developer works in his own directory, and @sc{cvs} merges 397the work when each developer is done. 398 399@cindex History of CVS 400@cindex CVS, history of 401@cindex Credits (CVS program) 402@cindex Contributors (CVS program) 403@sc{cvs} started out as a bunch of shell scripts written by 404Dick Grune, posted to @code{comp.sources.unix} in the volume 6 405release of December, 1986. While no actual code from 406these shell scripts is present in the current version 407of @sc{cvs} much of the @sc{cvs} conflict resolution algorithms 408come from them. 409 410In April, 1989, Brian Berliner designed and coded @sc{cvs}. 411Jeff Polk later helped Brian with the design of the @sc{cvs} 412module and vendor branch support. 413 414@cindex Source, getting CVS source 415You can get @sc{cvs} via anonymous @sc{ftp} from a 416number of sites; for example see 417@example 418http://www.gnu.ai.mit.edu/order/ftp.html 419@end example 420for a list of the @sc{gnu} @sc{ftp} sites. 421@c We could also be pointing to other resources like 422@c the cyclic getting.html, Pascal Molli's page, etc., 423@c and probably should, when someone gets around to 424@c figuring out which pages are stable enough that we 425@c should cite them, which ones are best to point 426@c people to (supported? binary? source? zero-cost? 427@c buying CD-ROMs? etc.), etc. 428 429@cindex Mailing list 430@cindex List, mailing list 431@cindex Newsgroups 432@c Be careful in editing this--it is worded so that 433@c the long -request address is in the middle of a 434@c line, thus avoiding overfull hboxes. 435There is a mailing list, known as @w{@code{info-cvs}}, 436devoted to @sc{cvs}. To subscribe or 437unsubscribe 438@c could add "to the mailing list," 439send a message to 440@c or "write to" 441@w{@code{info-cvs-request@@prep.ai.mit.edu}}. Please 442be specific about your email address. As of May 1996, 443subscription requests are handled by a busy human 444being, so you cannot expect to be added or removed 445immediately. If you prefer a usenet group, the right 446group is @code{comp.software.config-mgmt} which is for 447@sc{cvs} discussions (along with other configuration 448management systems). In the future, it might be 449possible to create a 450@code{comp.software.config-mgmt.cvs}, but probably only 451if there is sufficient @sc{cvs} traffic on 452@code{comp.software.config-mgmt}. 453@c Other random data is that past attempts to create a 454@c gnu.* group have failed (the relevant authorities 455@c say they'll do it, but don't), and that tale was very 456@c skeptical of comp.software.config-mgmt.cvs when the 457@c subject came up around 1995 or so (for one 458@c thing, because creating it would be a "reorg" which 459@c would need to take a more comprehensive look at the 460@c whole comp.software.config-mgmt.* hierarchy). 461 462@cindex Reporting bugs (CVS) 463@cindex Bugs, reporting (CVS) 464@cindex Errors, reporting (CVS) 465To report bugs in @sc{cvs} send mail to 466@code{bug-cvs@@prep.ai.mit.edu}. Do note that someone 467may or may not feel like taking care of your bug 468report---if you need a response consider a support 469contract from Cyclic Software 470(@code{http://www.cyclic.com} or 471@code{info@@cyclic.com}). This is also the procedure 472for submitting suggested changes to @sc{cvs} (see the file 473@sc{hacking} in the source distribution for more details). 474Note that all submitted changes may be distributed 475under the terms of the @sc{gnu} Public License, so if you 476don't like this, don't submit them. 477 478@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 479@unnumberedsec CVS is not@dots{} 480 481@sc{cvs} can do a lot of things for you, but it does 482not try to be everything for everyone. 483 484@table @asis 485@item @sc{cvs} is not a build system. 486 487Though the structure of your repository and modules 488file interact with your build system 489(e.g. @file{Makefile}s), they are essentially 490independent. 491 492@sc{cvs} does not dictate how you build anything. It 493merely stores files for retrieval in a tree structure 494you devise. 495 496@sc{cvs} does not dictate how to use disk space in the 497checked out working directories. If you write your 498@file{Makefile}s or scripts in every directory so they 499have to know the relative positions of everything else, 500you wind up requiring the entire repository to be 501checked out. 502 503If you modularize your work, and construct a build 504system that will share files (via links, mounts, 505@code{VPATH} in @file{Makefile}s, etc.), you can 506arrange your disk usage however you like. 507 508But you have to remember that @emph{any} such system is 509a lot of work to construct and maintain. @sc{cvs} does 510not address the issues involved. 511 512Of course, you should place the tools created to 513support such a build system (scripts, @file{Makefile}s, 514etc) under @sc{cvs}. 515 516Figuring out what files need to be rebuilt when 517something changes is, again, something to be handled 518outside the scope of @sc{cvs}. One traditional 519approach is to use @code{make} for building, and use 520some automated tool for generating the dependencies which 521@code{make} uses. 522 523See @ref{Builds}, for more information on doing builds 524in conjunction with @sc{cvs}. 525 526@item @sc{cvs} is not a substitute for management. 527 528Your managers and project leaders are expected to talk 529to you frequently enough to make certain you are aware 530of schedules, merge points, branch names and release 531dates. If they don't, @sc{cvs} can't help. 532 533@sc{cvs} is an instrument for making sources dance to 534your tune. But you are the piper and the composer. No 535instrument plays itself or writes its own music. 536 537@item @sc{cvs} is not a substitute for developer communication. 538 539When faced with conflicts within a single file, most 540developers manage to resolve them without too much 541effort. But a more general definition of ``conflict'' 542includes problems too difficult to solve without 543communication between developers. 544 545@sc{cvs} cannot determine when simultaneous changes 546within a single file, or across a whole collection of 547files, will logically conflict with one another. Its 548concept of a @dfn{conflict} is purely textual, arising 549when two changes to the same base file are near enough 550to spook the merge (i.e. @code{diff3}) command. 551 552@sc{cvs} does not claim to help at all in figuring out 553non-textual or distributed conflicts in program logic. 554 555For example: Say you change the arguments to function 556@code{X} defined in file @file{A}. At the same time, 557someone edits file @file{B}, adding new calls to 558function @code{X} using the old arguments. You are 559outside the realm of @sc{cvs}'s competence. 560 561Acquire the habit of reading specs and talking to your 562peers. 563 564 565@item @sc{cvs} does not have change control 566 567Change control refers to a number of things. First of 568all it can mean @dfn{bug-tracking}, that is being able 569to keep a database of reported bugs and the status of 570each one (is it fixed? in what release? has the bug 571submitter agreed that it is fixed?). For interfacing 572@sc{cvs} to an external bug-tracking system, see the 573@file{rcsinfo} and @file{verifymsg} files 574(@pxref{Administrative files}). 575 576Another aspect of change control is keeping track of 577the fact that changes to several files were in fact 578changed together as one logical change. If you check 579in several files in a single @code{cvs commit} 580operation, @sc{cvs} then forgets that those files were 581checked in together, and the fact that they have the 582same log message is the only thing tying them 583together. Keeping a @sc{gnu} style @file{ChangeLog} 584can help somewhat. 585@c FIXME: should have an xref to a section which talks 586@c more about keeping ChangeLog's with CVS, but that 587@c section hasn't been written yet. 588 589Another aspect of change control, in some systems, is 590the ability to keep track of the status of each 591change. Some changes have been written by a developer, 592others have been reviewed by a second developer, and so 593on. Generally, the way to do this with @sc{cvs} is to 594generate a diff (using @code{cvs diff} or @code{diff}) 595and email it to someone who can then apply it using the 596@code{patch} utility. This is very flexible, but 597depends on mechanisms outside @sc{cvs} to make sure 598nothing falls through the cracks. 599 600@item @sc{cvs} is not an automated testing program 601 602It should be possible to enforce mandatory use of a 603testsuite using the @code{commitinfo} file. I haven't 604heard a lot about projects trying to do that or whether 605there are subtle gotchas, however. 606 607@item @sc{cvs} does not have a builtin process model 608 609Some systems provide ways to ensure that changes or 610releases go through various steps, with various 611approvals as needed. Generally, one can accomplish 612this with @sc{cvs} but it might be a little more work. 613In some cases you'll want to use the @file{commitinfo}, 614@file{loginfo}, @file{rcsinfo}, or @file{verifymsg} 615files, to require that certain steps be performed 616before cvs will allow a checkin. Also consider whether 617features such as branches and tags can be used to 618perform tasks such as doing work in a development tree 619and then merging certain changes over to a stable tree 620only once they have been proven. 621@end table 622 623@c --------------------------------------------------------------------- 624@node A sample session 625@chapter A sample session 626@cindex A sample session 627@cindex Example of a work-session 628@cindex Getting started 629@cindex Work-session, example of 630@cindex tc, Trivial Compiler (example) 631@cindex Trivial Compiler (example) 632 633@c I think an example is a pretty good way to start. But 634@c somewhere in here, maybe after the sample session, 635@c we need something which is kind of 636@c a "roadmap" which is more directed at sketching out 637@c the functionality of CVS and pointing people to 638@c various other parts of the manual. As it stands now 639@c people who read in order get dumped right into all 640@c manner of hair regarding remote repositories, 641@c creating a repository, etc. 642@c 643@c The following was in the old Basic concepts node. I don't 644@c know how good a job it does at introducing modules, 645@c or whether they need to be introduced so soon, but 646@c something of this sort might go into some 647@c introductory material somewhere. 648@ignore 649@cindex Modules (intro) 650The repository contains directories and files, in an 651arbitrary tree. The @dfn{modules} feature can be used 652to group together a set of directories or files into a 653single entity (@pxref{modules}). A typical usage is to 654define one module per project. 655@end ignore 656 657As a way of introducing @sc{cvs}, we'll go through a 658typical work-session using @sc{cvs}. The first thing 659to understand is that @sc{cvs} stores all files in a 660centralized @dfn{repository} (@pxref{Repository}); this 661section assumes that a repository is set up. 662@c I'm not sure that the sentence concerning the 663@c repository quite tells the user what they need to 664@c know at this point. Might need to expand on "centralized" 665@c slightly (maybe not here, maybe further down in the example?) 666 667Suppose you are working on a simple compiler. The source 668consists of a handful of C files and a @file{Makefile}. 669The compiler is called @samp{tc} (Trivial Compiler), 670and the repository is set up so that there is a module 671called @samp{tc}. 672 673@menu 674* Getting the source:: Creating a workspace 675* Committing your changes:: Making your work available to others 676* Cleaning up:: Cleaning up 677* Viewing differences:: Viewing differences 678@end menu 679 680@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 681@node Getting the source 682@section Getting the source 683@cindex Getting the source 684@cindex Checking out source 685@cindex Fetching source 686@cindex Source, getting from CVS 687@cindex Checkout, example 688 689The first thing you must do is to get your own working copy of the 690source for @samp{tc}. For this, you use the @code{checkout} command: 691 692@example 693$ cvs checkout tc 694@end example 695 696@noindent 697This will create a new directory called @file{tc} and populate it with 698the source files. 699 700@example 701$ cd tc 702$ ls 703CVS Makefile backend.c driver.c frontend.c parser.c 704@end example 705 706The @file{CVS} directory is used internally by 707@sc{cvs}. Normally, you should not modify or remove 708any of the files in it. 709 710You start your favorite editor, hack away at @file{backend.c}, and a couple 711of hours later you have added an optimization pass to the compiler. 712A note to @sc{rcs} and @sc{sccs} users: There is no need to lock the files that 713you want to edit. @xref{Multiple developers}, for an explanation. 714 715@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 716@node Committing your changes 717@section Committing your changes 718@cindex Committing changes 719@cindex Log message entry 720@cindex CVSEDITOR, environment variable 721@cindex EDITOR, environment variable 722 723When you have checked that the compiler is still compilable you decide 724to make a new version of @file{backend.c}. 725 726@example 727$ cvs commit backend.c 728@end example 729 730@noindent 731@sc{cvs} starts an editor, to allow you to enter a log 732message. You type in ``Added an optimization pass.'', 733save the temporary file, and exit the editor. 734 735The environment variable @code{$CVSEDITOR} determines 736which editor is started. If @code{$CVSEDITOR} is not 737set, then if the environment variable @code{$EDITOR} is 738set, it will be used. If both @code{$CVSEDITOR} and 739@code{$EDITOR} are not set then the editor defaults to 740@code{vi}. If you want to avoid the overhead of 741starting an editor you can specify the log message on 742the command line using the @samp{-m} flag instead, like 743this: 744 745@example 746$ cvs commit -m "Added an optimization pass" backend.c 747@end example 748 749@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 750@node Cleaning up 751@section Cleaning up 752@cindex Cleaning up 753@cindex Working copy, removing 754@cindex Removing your working copy 755@cindex Releasing your working copy 756 757Before you turn to other tasks you decide to remove your working copy of 758tc. One acceptable way to do that is of course 759 760@example 761$ cd .. 762$ rm -r tc 763@end example 764 765@noindent 766but a better way is to use the @code{release} command (@pxref{release}): 767 768@example 769$ cd .. 770$ cvs release -d tc 771M driver.c 772? tc 773You have [1] altered files in this repository. 774Are you sure you want to release (and delete) module `tc': n 775** `release' aborted by user choice. 776@end example 777 778The @code{release} command checks that all your modifications have been 779committed. If history logging is enabled it also makes a note in the 780history file. @xref{history file}. 781 782When you use the @samp{-d} flag with @code{release}, it 783also removes your working copy. 784 785In the example above, the @code{release} command wrote a couple of lines 786of output. @samp{? tc} means that the file @file{tc} is unknown to @sc{cvs}. 787That is nothing to worry about: @file{tc} is the executable compiler, 788and it should not be stored in the repository. @xref{cvsignore}, 789for information about how to make that warning go away. 790@xref{release output}, for a complete explanation of 791all possible output from @code{release}. 792 793@samp{M driver.c} is more serious. It means that the 794file @file{driver.c} has been modified since it was 795checked out. 796 797The @code{release} command always finishes by telling 798you how many modified files you have in your working 799copy of the sources, and then asks you for confirmation 800before deleting any files or making any note in the 801history file. 802 803You decide to play it safe and answer @kbd{n @key{RET}} 804when @code{release} asks for confirmation. 805 806@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 807@node Viewing differences 808@section Viewing differences 809@cindex Viewing differences 810@cindex Diff 811 812You do not remember modifying @file{driver.c}, so you want to see what 813has happened to that file. 814 815@example 816$ cd tc 817$ cvs diff driver.c 818@end example 819 820This command runs @code{diff} to compare the version of @file{driver.c} 821that you checked out with your working copy. When you see the output 822you remember that you added a command line option that enabled the 823optimization pass. You check it in, and release the module. 824@c FIXME: we haven't yet defined the term "check in". 825 826@example 827$ cvs commit -m "Added an optimization pass" driver.c 828Checking in driver.c; 829/usr/local/cvsroot/tc/driver.c,v <-- driver.c 830new revision: 1.2; previous revision: 1.1 831done 832$ cd .. 833$ cvs release -d tc 834? tc 835You have [0] altered files in this repository. 836Are you sure you want to release (and delete) module `tc': y 837@end example 838 839@c --------------------------------------------------------------------- 840@node Repository 841@chapter The Repository 842@cindex Repository (intro) 843@cindex Repository, example 844@cindex Layout of repository 845@cindex Typical repository 846@cindex /usr/local/cvsroot, as example repository 847@cindex cvsroot 848 849The @sc{cvs} @dfn{repository} stores a complete copy of 850all the files and directories which are under version 851control. 852 853Normally, you never access any of the files in the 854repository directly. Instead, you use @sc{cvs} 855commands to get your own copy of the files, and then 856work on that copy. When you've finished a set of 857changes, you check (or @dfn{commit}) them back into the 858repository. The repository then contains the changes 859which you have made, as well as recording exactly what 860you changed, when you changed it, and other such 861information. 862 863@cindex :local: 864@sc{Cvs} can access a repository by a variety of 865means. It might be on the local computer, or it might 866be on a computer across the room or across the world. 867To distinguish various ways to access a repository, the 868repository name can start with an @dfn{access method}. 869For example, the access method @code{:local:} means to 870access a repository directory, so the repository 871@code{:local:/usr/local/cvsroot} means that the 872repository is in @file{/usr/local/cvsroot} on the 873computer running @sc{cvs}. For information on other 874access methods, see @ref{Remote repositories}. 875 876@c Can se say this more concisely? Like by passing 877@c more of the buck to the Remote repositories node? 878If the access method is omitted, then if the repository 879does not contain @samp{:}, then @code{:local:} is 880assumed. If it does contain @samp{:} than either 881@code{:ext:} or @code{:server:} is assumed. For 882example, if you have a local repository in 883@file{/usr/local/cvsroot}, you can use 884@code{/usr/local/cvsroot} instead of 885@code{:local:/usr/local/cvsroot}. But if (under 886Windows NT, for example) your local repository is 887@file{c:\src\cvsroot}, then you must specify the access 888method, as in @code{:local:c:\src\cvsroot}. 889 890@c This might appear to go in Repository storage, but 891@c actually it is describing something which is quite 892@c user-visible, when you do a "cvs co CVSROOT". This 893@c isn't necessary the perfect place for that, though. 894The repository is split in two parts. @file{$CVSROOT/CVSROOT} contains 895administrative files for @sc{cvs}. The other directories contain the actual 896user-defined modules. 897 898@menu 899* Specifying a repository:: Telling CVS where your repository is 900* Repository storage:: The structure of the repository 901* Intro administrative files:: Defining modules 902* Multiple repositories:: Multiple repositories 903* Creating a repository:: Creating a repository 904* Remote repositories:: Accessing repositories on remote machines 905* Read-only access:: Granting read-only access to the repository 906@end menu 907 908@node Specifying a repository 909@section Telling CVS where your repository is 910 911There are a couple of different ways to tell @sc{cvs} 912where to find the repository. You can name the 913repository on the command line explicitly, with the 914@code{-d} (for "directory") option: 915 916@example 917cvs -d /usr/local/cvsroot checkout yoyodyne/tc 918@end example 919 920@cindex .profile, setting CVSROOT in 921@cindex .cshrc, setting CVSROOT in 922@cindex .tcshrc, setting CVSROOT in 923@cindex .bashrc, setting CVSROOT in 924@cindex CVSROOT, environment variable 925 Or you can set the @code{$CVSROOT} environment 926variable to an absolute path to the root of the 927repository, @file{/usr/local/cvsroot} in this example. 928To set @code{$CVSROOT}, all @code{csh} and @code{tcsh} 929users should have this line in their @file{.cshrc} or 930@file{.tcshrc} files: 931 932@example 933setenv CVSROOT /usr/local/cvsroot 934@end example 935 936@noindent 937@code{sh} and @code{bash} users should instead have these lines in their 938@file{.profile} or @file{.bashrc}: 939 940@example 941CVSROOT=/usr/local/cvsroot 942export CVSROOT 943@end example 944 945 A repository specified with @code{-d} will 946override the @code{$CVSROOT} environment variable. 947Once you've checked a working copy out from the 948repository, it will remember where its repository is 949(the information is recorded in the 950@file{CVS/Root} file in the working copy). 951 952The @code{-d} option and the @file{CVS/Root} file both 953override the @code{$CVSROOT} environment variable. If 954@code{-d} option differs from @file{CVS/Root}, the 955former is used (and specifying @code{-d} will cause 956@file{CVS/Root} to be updated). Of course, for proper 957operation they should be two ways of referring to the 958same repository. 959 960@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 961@node Repository storage 962@section How data is stored in the repository 963@cindex Repository, how data is stored 964 965For most purposes it isn't important @emph{how} 966@sc{cvs} stores information in the repository. In 967fact, the format has changed in the past, and is likely 968to change in the future. Since in almost all cases one 969accesses the repository via @sc{cvs} commands; such 970changes need not be disruptive. 971 972However, in some cases it may be necessary to 973understand how @sc{cvs} stores data in the repository, 974for example you might need to track down @sc{cvs} locks 975(@pxref{Concurrency}) or you might need to deal with 976the file permissions appropriate for the repository. 977 978@menu 979* Repository files:: What files are stored in the repository 980* File permissions:: File permissions 981@end menu 982 983@node Repository files 984@subsection Where files are stored within the repository 985 986The overall structure of the repository is a directory 987tree corresponding to the directories in the working 988directory. For example, supposing the repository is in 989@file{/usr/local/cvsroot}, here is a possible directory 990tree (showing only the directories): 991 992@example 993@t{/usr} 994 | 995 +--@t{local} 996 | | 997 | +--@t{cvsroot} 998 | | | 999 | | +--@t{CVSROOT} 1000 | (administrative files) 1001 | 1002 +--@t{gnu} 1003 | | 1004 | +--@t{diff} 1005 | | (source code to @sc{gnu} diff) 1006 | | 1007 | +--@t{rcs} 1008 | | (source code to @sc{rcs}) 1009 | | 1010 | +--@t{cvs} 1011 | (source code to @sc{cvs}) 1012 | 1013 +--@t{yoyodyne} 1014 | 1015 +--@t{tc} 1016 | | 1017 | +--@t{man} 1018 | | 1019 | +--@t{testing} 1020 | 1021 +--(other Yoyodyne software) 1022@end example 1023 1024With the directories are @dfn{history files} for each file 1025under version control. The name of the history file is 1026the name of the corresponding file with @samp{,v} 1027appended to the end. Here is what the repository for 1028the @file{yoyodyne/tc} directory might look like: 1029@c FIXME: Should also mention CVS (CVSREP) and Attic 1030 1031@example 1032 @code{$CVSROOT} 1033 | 1034 +--@t{yoyodyne} 1035 | | 1036 | +--@t{tc} 1037 | | | 1038 +--@t{Makefile,v} 1039 +--@t{backend.c,v} 1040 +--@t{driver.c,v} 1041 +--@t{frontend.c,v} 1042 +--@t{parser.c,v} 1043 +--@t{man} 1044 | | 1045 | +--@t{tc.1,v} 1046 | 1047 +--@t{testing} 1048 | 1049 +--@t{testpgm.t,v} 1050 +--@t{test2.t,v} 1051@end example 1052 1053@cindex History files 1054@cindex RCS history files 1055@c The first sentence, about what history files 1056@c contain, is kind of redundant with our intro to what the 1057@c repository does in node Repository.... 1058The history files contain, among other things, enough 1059information to recreate any revision of the file, a log 1060of all commit messages and the user-name of the person 1061who committed the revision. The history files are 1062known as @dfn{RCS files}, because the first program to 1063store files in that format was a version control system 1064known as @sc{rcs}. For a full 1065description of the file format, see the @code{man} page 1066@cite{rcsfile(5)}, distributed with @sc{rcs}. This 1067file format has become very common---many systems other 1068than @sc{cvs} or @sc{rcs} can at least import history 1069files in this format. 1070@c FIXME: Think about including documentation for this 1071@c rather than citing it? In the long run, getting 1072@c this to be a standard (not sure if we can cope with 1073@c a standards process as formal as IEEE/ANSI/ISO/etc, 1074@c though...) is the way to go, so maybe citing is 1075@c better. 1076 1077The @sc{rcs} files used in @sc{cvs} differ in a few 1078ways from the standard format. The biggest difference 1079is magic branches; for more information see @ref{Magic 1080branch numbers}. Also in @sc{cvs} the valid tag names 1081are a subset of what @sc{rcs} accepts; for @sc{cvs}'s 1082rules see @ref{Tags}. 1083 1084@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1085@node File permissions 1086@subsection File permissions 1087@c -- Move this to @node Creating a repository or similar 1088@cindex Security 1089@cindex File permissions 1090@cindex Group 1091@cindex read-only files, in repository 1092All @samp{,v} files are created read-only, and you 1093should not change the permission of those files. The 1094directories inside the repository should be writable by 1095the persons that have permission to modify the files in 1096each directory. This normally means that you must 1097create a UNIX group (see group(5)) consisting of the 1098persons that are to edit the files in a project, and 1099set up the repository so that it is that group that 1100owns the directory. 1101@c See also comment in commitinfo node regarding cases 1102@c which are really awkward with unix groups. 1103 1104This means that you can only control access to files on 1105a per-directory basis. 1106 1107Note that users must also have write access to check 1108out files, because @sc{cvs} needs to create lock files 1109(@pxref{Concurrency}). 1110 1111@c CVS seems to use CVSUMASK in picking permissions for 1112@c val-tags, but maybe we should say more about this. 1113@c Like val-tags gets created by someone who doesn't 1114@c have CVSUMASK set right? 1115Also note that users must have write access to the 1116@file{CVSROOT/val-tags} file. @sc{Cvs} uses it to keep 1117track of what tags are valid tag names (it is sometimes 1118updated when tags are used, as well as when they are 1119created, though). 1120 1121@cindex CVSUMASK 1122@cindex umask, for repository files 1123@sc{cvs} tries to set up reasonable file permissions 1124for new directories that are added inside the tree, but 1125you must fix the permissions manually when a new 1126directory should have different permissions than its 1127parent directory. If you set the @code{CVSUMASK} 1128environment variable that will control the file 1129permissions which @sc{cvs} uses in creating directories 1130and/or files in the repository. @code{CVSUMASK} does 1131not affect the file permissions in the working 1132directory; such files have the permissions which are 1133typical for newly created files, except that sometimes 1134@sc{cvs} creates them read-only (see the sections on 1135watches, @ref{Setting a watch}; -r, @ref{Global 1136options}; or CVSREAD, @ref{Environment variables}). 1137 1138Note that using the client/server @sc{cvs} 1139(@pxref{Remote repositories}), there is no good way to 1140set @code{CVSUMASK}; the setting on the client machine 1141has no effect. If you are connecting with @code{rsh}, you 1142can set @code{CVSUMASK} in @file{.bashrc} or @file{.cshrc}, as 1143described in the documentation for your operating 1144system. This behavior might change in future versions 1145of @sc{cvs}; do not rely on the setting of 1146@code{CVSUMASK} on the client having no effect. 1147@c FIXME: need to explain what a umask is or cite 1148@c someplace which does. 1149@c FIXME: Need one place which discusses this 1150@c read-only files thing. Why would one use -r or 1151@c CVSREAD? Why would one use watches? How do they interact? 1152@c FIXME: We need to state 1153@c whether using CVSUMASK removes the need for manually 1154@c fixing permissions (in fact, if we are going to mention 1155@c manually fixing permission, we better document a lot 1156@c better just what we mean by "fix"). 1157 1158@cindex setuid 1159@cindex setgid 1160Since @sc{cvs} was not written to be run setuid, it is 1161unsafe to try to run it setuid. You cannot use the 1162setuid features of @sc{rcs} together with @sc{cvs}. 1163 1164@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1165@node Intro administrative files 1166@section The administrative files 1167@cindex Administrative files (intro) 1168@cindex Modules file 1169@cindex CVSROOT, module name 1170@cindex Defining modules (intro) 1171 1172@c FIXME: this node should be reorganized into "general 1173@c information about admin files" and put the "editing 1174@c admin files" stuff up front rather than jumping into 1175@c the details of modules right away. Then the 1176@c Administrative files node can go away, the information 1177@c on each admin file distributed to a place appropriate 1178@c to its function, and this node can contain a table 1179@c listing each file and a @ref to its detailed description. 1180 1181The directory @file{$CVSROOT/CVSROOT} contains some @dfn{administrative 1182files}. @xref{Administrative files}, for a complete description. 1183You can use @sc{cvs} without any of these files, but 1184some commands work better when at least the 1185@file{modules} file is properly set up. 1186 1187The most important of these files is the @file{modules} 1188file. It defines all modules in the repository. This 1189is a sample @file{modules} file. 1190 1191@c FIXME: The CVSROOT line is a goofy example now that 1192@c mkmodules doesn't exist. 1193@example 1194CVSROOT CVSROOT 1195modules CVSROOT modules 1196cvs gnu/cvs 1197rcs gnu/rcs 1198diff gnu/diff 1199tc yoyodyne/tc 1200@end example 1201 1202The @file{modules} file is line oriented. In its 1203simplest form each line contains the name of the 1204module, whitespace, and the directory where the module 1205resides. The directory is a path relative to 1206@code{$CVSROOT}. The last four lines in the example 1207above are examples of such lines. 1208 1209@c FIXME: might want to introduce the concept of options in modules file 1210@c (the old example which was here, -i mkmodules, is obsolete). 1211 1212The line that defines the module called @samp{modules} 1213uses features that are not explained here. 1214@xref{modules}, for a full explanation of all the 1215available features. 1216 1217@c FIXME: subsection without node is bogus 1218@subsection Editing administrative files 1219@cindex Editing administrative files 1220@cindex Administrative files, editing them 1221 1222You edit the administrative files in the same way that you would edit 1223any other module. Use @samp{cvs checkout CVSROOT} to get a working 1224copy, edit it, and commit your changes in the normal way. 1225 1226It is possible to commit an erroneous administrative 1227file. You can often fix the error and check in a new 1228revision, but sometimes a particularly bad error in the 1229administrative file makes it impossible to commit new 1230revisions. 1231@c @xref{Bad administrative files} for a hint 1232@c about how to solve such situations. 1233@c -- administrative file checking-- 1234 1235@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1236@node Multiple repositories 1237@section Multiple repositories 1238@cindex Multiple repositories 1239@cindex Repositories, multiple 1240@cindex Many repositories 1241@cindex Parallel repositories 1242@cindex Disjoint repositories 1243@cindex CVSROOT, multiple repositories 1244 1245In some situations it is a good idea to have more than 1246one repository, for instance if you have two 1247development groups that work on separate projects 1248without sharing any code. All you have to do to have 1249several repositories is to specify the appropriate 1250repository, using the @code{CVSROOT} environment 1251variable, the @samp{-d} option to @sc{cvs}, or (once 1252you have checked out a working directory) by simply 1253allowing @sc{cvs} to use the repository that was used 1254to check out the working directory 1255(@pxref{Specifying a repository}). 1256 1257The big advantage of having multiple repositories is 1258that they can reside on different servers. The big 1259disadvantage is that you cannot have a single @sc{cvs} 1260command recurse into directories which comes from 1261different repositories. Generally speaking, if you are 1262thinking of setting up several repositories on the same 1263machine, you might want to consider using several 1264directories within the same repository. 1265@c FIXCVS: the thing about recursing into diverse roots 1266@c would be nice to fix. 1267@c FIXME: Does the FAQ have more about this? I have a 1268@c dim recollection, but I'm too lazy to check right now. 1269 1270None of the examples in this manual show multiple 1271repositories. 1272 1273@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1274@node Creating a repository 1275@section Creating a repository 1276 1277@cindex Repository, setting up 1278@cindex Creating a repository 1279@cindex Setting up a repository 1280 1281To set up a @sc{cvs} repository, first choose the 1282machine and disk on which you want to store the 1283revision history of the source files. CPU and memory 1284requirements are modest---a server with 32M of memory 1285or even less can handle a fairly large source tree with 1286a fair amount of activity. To estimate disk space 1287requirements, if you are importing RCS files from 1288another system, the size of those files is the 1289approximate initial size of your repository, or if you 1290are starting without any version history, a rule of 1291thumb is to allow for the server approximately three 1292times the size of the code to be under CVS for the 1293repository (you will eventually outgrow this, but not 1294for a while). On the machines on which the developers 1295will be working, you'll want disk space for 1296approximately one working directory for each developer 1297(either the entire tree or a portion of it, depending 1298on what each developer uses). Don't worry about CPU 1299and memory requirements for the clients---any machine 1300with enough capacity to run the operating system in 1301question should have little trouble. 1302@c Stuff about memory duplicates Server requirements 1303@c to some extent. I'm not sure this is a bad thing, 1304@c though (one is aimed at people who are looking into 1305@c this carefully, the other is aimed at people who 1306@c want a rule of thumb). 1307 1308The repository should be accessable 1309(directly or via a networked file system) from all 1310machines which want to use @sc{cvs} in server or local 1311mode; the client machines need not have any access to 1312it other than via the @sc{cvs} protocol. It is not 1313possible to use @sc{cvs} to read from a repository 1314which one only has read access to; @sc{cvs} needs to be 1315able to create lock files (@pxref{Concurrency}). 1316 1317@cindex init (subcommand) 1318To create a repository, run the @code{cvs init} 1319command. It will set up an empty repository in the 1320@sc{cvs} root specified in the usual way 1321(@pxref{Repository}). For example, 1322 1323@example 1324cvs -d /usr/local/cvsroot init 1325@end example 1326 1327@code{cvs init} is careful to never overwrite any 1328existing files in the repository, so no harm is done if 1329you run @code{cvs init} on an already set-up 1330repository. 1331 1332@code{cvs init} will enable history logging; if you 1333don't want that, remove the history file after running 1334@code{cvs init}. @xref{history file}. 1335 1336@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1337@node Remote repositories 1338@section Remote repositories 1339@cindex Repositories, remote 1340@cindex Remote repositories 1341@cindex Client/Server Operation 1342@cindex server, CVS 1343 1344 Your working copy of the sources can be on a 1345different machine than the repository. Using @sc{cvs} 1346in this manner is known as @dfn{client/server} 1347operation. You run @sc{cvs} on a machine which can 1348mount your working directory, known as the 1349@dfn{client}, and tell it to communicate to a machine 1350which can mount the repository, known as the 1351@dfn{server}. Generally, using a remote 1352repository is just like using a local one, except that 1353the format of the repository name is: 1354 1355@example 1356:@var{method}:@var{user}@@@var{hostname}:/path/to/repository 1357@end example 1358 1359The details of exactly what needs to be set up depend 1360on how you are connecting to the server. 1361 1362If @var{method} is not specified, and the repository 1363name contains @samp{:}, then the default is @code{ext} 1364or @code{server}, depending on your platform; both are 1365described in @ref{Connecting via rsh}. 1366@c Should we try to explain which platforms are which? 1367@c Platforms like unix and VMS, which only allow 1368@c privileged programs to bind to sockets <1024 lose on 1369@c :server: 1370@c Platforms like Mac and VMS, whose rsh program is 1371@c unusable or nonexistent, lose on :ext: 1372@c Platforms like OS/2 and NT probably could plausibly 1373@c default either way (modulo -b troubles). 1374 1375@c FIXME: We need to have a better way of explaining 1376@c what method to use. This presentation totally 1377@c obscures the fact that :ext: and CVS_RSH is the way to 1378@c use SSH, for example. Plus it incorrectly implies 1379@c that you need an @code{rsh} binary on the client to use 1380@c :server:. 1381@menu 1382* Server requirements:: Memory and other resources for servers 1383* Connecting via rsh:: Using the @code{rsh} program to connect 1384* Password authenticated:: Direct connections using passwords 1385* Kerberos authenticated:: Direct connections with kerberos 1386@end menu 1387 1388@node Server requirements 1389@subsection Server requirements 1390 1391The quick answer to what sort of machine is suitable as 1392a server is that requirements are modest---a server 1393with 32M of memory or even less can handle a fairly 1394large source tree with a fair amount of activity. 1395@c Say something about CPU speed too? I'm even less sure 1396@c what to say on that subject... 1397 1398The real answer, of course, is more complicated. The 1399@sc{cvs} server consists of two processes for each 1400client that it is serving. Memory consumption on the 1401child process should remain fairly small. Memory 1402consumption on the parent process, particularly if the 1403network connection to the client is slow, can be 1404expected to grow to slightly more than the size of the 1405sources in a single directory, or two megabytes, 1406whichever is larger. 1407@c "two megabytes" of course is SERVER_HI_WATER. But 1408@c we don't mention that here because we are 1409@c documenting the default configuration of CVS. If it 1410@c is a "standard" thing to change that value, it 1411@c should be some kind of run-time configuration. 1412@c 1413@c See cvsclient.texi for more on the design decision 1414@c to not have locks in place while waiting for the 1415@c client, which is what results in memory consumption 1416@c as high as this. 1417 1418Multiplying the size of each @sc{cvs} server by the 1419number of servers which you expect to have active at 1420one time should give an idea of memory requirements for 1421the server. For the most part, the memory consumed by 1422the parent process probably can be swap space rather 1423than physical memory. 1424@c Has anyone verified that notion about swap space? 1425@c I say it based pretty much on guessing that the 1426@c ->text of the struct buffer_data only gets accessed 1427@c in a first in, first out fashion, but I haven't 1428@c looked very closely. 1429 1430Resource consumption for the client or the 1431non-client/server @sc{cvs} is even more modest---any 1432machine with enough capacity to run the operating system 1433in question should have little trouble. 1434@c Probably we could be saying more about this. 1435@c I would guess for non-client/server CVS in an NFS 1436@c environment the biggest issues is the network and 1437@c the NFS server. 1438 1439@node Connecting via rsh 1440@subsection Connecting with rsh 1441 1442@cindex rsh 1443CVS uses the @file{rsh} protocol to perform these 1444operations, so the remote user host needs to have a 1445@file{.rhosts} file which grants access to the local 1446user. 1447 1448For example, suppose you are the user @file{mozart} on 1449the local machine @file{anklet.grunge.com}, and the 1450server machine is @file{chainsaw.brickyard.com}. On 1451chainsaw, put the following line into the file 1452@file{.rhosts} in @file{bach}'s home directory: 1453 1454@example 1455anklet.grunge.com mozart 1456@end example 1457 1458Then test that @code{rsh} is working with 1459 1460@example 1461rsh -l bach chainsaw.brickyard.com 'echo $PATH' 1462@end example 1463 1464@cindex CVS_SERVER 1465Next you have to make sure that @code{rsh} will be able 1466to find the server. Make sure that the path which 1467@code{rsh} printed in the above example includes the 1468directory containing a program named @code{cvs} which 1469is the server. You need to set the path in 1470@file{.bashrc}, @file{.cshrc}, etc., not @file{.login} 1471or @file{.profile}. Alternately, you can set the 1472environment variable @code{CVS_SERVER} on the client 1473machine to the filename of the server you want to use, 1474for example @file{/usr/local/bin/cvs-1.6}. 1475@c FIXME: there should be a way to specify the 1476@c program in CVSROOT, not CVS_SERVER, so that one can use 1477@c different ones for different roots. e.g. ":server;cvs=cvs-1.6:" 1478@c instead of ":server:". 1479 1480There is no need to edit @code{inetd.conf} or start a 1481@sc{cvs} server daemon. 1482 1483@cindex :server: 1484@cindex :ext: 1485There are two access methods that you use in CVSROOT 1486for rsh. @code{:server:} specifies an internal rsh 1487client, which is supported only by some CVS ports. 1488@code{:ext:} specifies an external rsh program. By 1489default this is @code{rsh} but you may set the 1490@code{CVS_RSH} environment variable to invoke another 1491program which can access the remote server (for 1492example, @code{remsh} on HP-UX 9 because @code{rsh} is 1493something different). It must be a program which can 1494transmit data to and from the server without modifying 1495it; for example the Windows NT @code{rsh} is not 1496suitable since it by default translates between CRLF 1497and LF. The OS/2 CVS port has a hack to pass @samp{-b} 1498to @code{rsh} to get around this, but since this could 1499potentially cause problems for programs other than the 1500standard @code{rsh}, it may change in the future. If 1501you set @code{CVS_RSH} to @code{SSH} or some other rsh 1502replacement, the instructions in the rest of this 1503section concerning @file{.rhosts} and so on are likely 1504to be inapplicable; consult the documentation for your rsh 1505replacement. 1506@c FIXME: there should be a way to specify the 1507@c program in CVSROOT, not CVS_RSH, so that one can use 1508@c different ones for different roots. e.g. ":ext;rsh=remsh:" 1509@c instead of ":ext:". 1510@c See also the comment in src/client.c for rationale 1511@c concerning "rsh" being the default and never 1512@c "remsh". 1513 1514Continuing our example, supposing you want to access 1515the module @file{foo} in the repository 1516@file{/usr/local/cvsroot/}, on machine 1517@file{chainsaw.brickyard.com}, you are ready to go: 1518 1519@example 1520cvs -d :ext:bach@@chainsaw.brickyard.com:/usr/local/cvsroot checkout foo 1521@end example 1522 1523(The @file{bach@@} can be omitted if the username is 1524the same on both the local and remote hosts.) 1525 1526@c Should we mention "rsh host echo hi" and "rsh host 1527@c cat" (the latter followed by typing text and ^D) 1528@c as troubleshooting techniques? Probably yes 1529@c (people tend to have trouble setting this up), 1530@c but this kind of thing can be hard to spell out. 1531 1532@node Password authenticated 1533@subsection Direct connection with password authentication 1534 1535The @sc{cvs} client can also connect to the server 1536using a password protocol. This is particularly useful 1537if using @code{rsh} is not feasible (for example, 1538the server is behind a firewall), and Kerberos also is 1539not available. 1540 1541 To use this method, it is necessary to make 1542some adjustments on both the server and client sides. 1543 1544@menu 1545* Password authentication server:: Setting up the server 1546* Password authentication client:: Using the client 1547* Password authentication security:: What this method does and does not do 1548@end menu 1549 1550@node Password authentication server 1551@subsubsection Setting up the server for password authentication 1552 1553@cindex Pserver (subcommand) 1554@cindex password server, setting up 1555@cindex authenticating server, setting up 1556@c FIXME: this isn't quite right regarding port 1557@c numbers; CVS looks up "cvspserver" in 1558@c /etc/services (on unix, but what about non-unix?). 1559On the server side, the file @file{/etc/inetd.conf} 1560needs to be edited so @code{inetd} knows to run the 1561command @code{cvs pserver} when it receives a 1562connection on the right port. By default, the port 1563number is 2401; it would be different if your client 1564were compiled with @code{CVS_AUTH_PORT} defined to 1565something else, though. 1566 1567 If your @code{inetd} allows raw port numbers in 1568@file{/etc/inetd.conf}, then the following (all on a 1569single line in @file{inetd.conf}) should be sufficient: 1570 1571@example 15722401 stream tcp nowait root /usr/local/bin/cvs 1573cvs -b /usr/local/bin pserver 1574@end example 1575 1576The @samp{-b} option specifies the directory which contains 1577the @sc{rcs} binaries on the server. You could also use the 1578@samp{-T} option to specify a temporary directory. 1579 1580 If your @code{inetd} wants a symbolic service 1581name instead of a raw port number, then put this in 1582@file{/etc/services}: 1583 1584@example 1585cvspserver 2401/tcp 1586@end example 1587 1588 and put @code{cvspserver} instead of 1589@code{2401} in @file{inetd.conf}. 1590 1591 Once the above is taken care of, restart your 1592@code{inetd}, or do whatever is necessary to force it 1593to reread its initialization files. 1594 1595@c FIXME: should be documenting how to troubleshoot 1596@c this. One strange situation I ran into recently 1597@c was that if inetd.conf specifies a non-existent 1598@c cvs (e.g. /usr/local/bin/cvs doesn't exist in 1599@c the above example), the client says 1600@c cvs-1.8 [login aborted]: unrecognized auth response from harvey: 1601@c which is a very unhelpful response (can it be 1602@c improved? does inetd log somewhere?) 1603 1604@cindex CVS passwd file 1605@cindex passwd (admin file) 1606Because the client stores and transmits passwords in 1607cleartext (almost---see @ref{Password authentication 1608security}, for details), a separate @sc{cvs} password 1609file may be used, so people don't compromise their 1610regular passwords when they access the repository. 1611This file is @file{$CVSROOT/CVSROOT/passwd} 1612(@pxref{Intro administrative files}). Its format is 1613similar to @file{/etc/passwd}, except that it only has 1614two fields, username and password. For example: 1615 1616@example 1617bach:ULtgRLXo7NRxs 1618cwang:1sOp854gDF3DY 1619@end example 1620 1621The password is encrypted according to the standard 1622Unix @code{crypt()} function, so it is possible to 1623paste in passwords directly from regular Unix 1624@file{passwd} files. 1625 1626When authenticating a password, the server first checks 1627for the user in the @sc{cvs} @file{passwd} file. If it 1628finds the user, it compares against that password. If 1629it does not find the user, or if the @sc{cvs} 1630@file{passwd} file does not exist, then the server 1631tries to match the password using the system's 1632user-lookup routine. When using the @sc{cvs} 1633@file{passwd} file, the server runs under as the 1634username specified in the the third argument in the 1635entry, or as the first argument if there is no third 1636argument (in this way @sc{cvs} allows imaginary 1637usernames provided the @sc{cvs} @file{passwd} file 1638indicates corresponding valid system usernames). In 1639any case, @sc{cvs} will have no privileges which the 1640(valid) user would not have. 1641 1642@cindex user aliases 1643 It is possible to ``map'' cvs-specific 1644usernames onto system usernames (i.e., onto system 1645login names) in the @file{$CVSROOT/CVSROOT/passwd} file 1646by appending a colon and the system username after the 1647password. For example: 1648 1649@example 1650cvs:ULtgRLXo7NRxs:kfogel 1651generic:1sOp854gDF3DY:spwang 1652anyone:1sOp854gDF3DY:spwang 1653@end example 1654 1655 Thus, someone remotely accessing the repository 1656on @file{chainsaw.brickyard.com} with the following 1657command: 1658 1659@example 1660cvs -d :pserver:cvs@@chainsaw.brickyard.com:/usr/local/cvsroot checkout foo 1661@end example 1662 1663 would end up running the server under the 1664system identity kfogel, assuming successful 1665authentication. However, the remote user would not 1666necessarily need to know kfogel's system password, as 1667the @file{$CVSROOT/CVSROOT/passwd} file might contain a 1668different password, used only for @sc{cvs}. And as the 1669example above indicates, it is permissible to map 1670multiple cvs usernames onto a single system username. 1671 1672 This feature is designed to allow people 1673repository access without full system access (in 1674particular, see @xref{Read-only access}); however, also 1675@xref{Password authentication security}. Any sort of 1676repository access very likely implies a degree of 1677general system access as well. 1678 1679Right now, the only way to put a password in the 1680@sc{cvs} @file{passwd} file is to paste it there from 1681somewhere else. Someday, there may be a @code{cvs 1682passwd} command. 1683@c We might also suggest using the @code{htpasswd} command 1684@c from freely available web servers as well, but that 1685@c would open up a can of worms in that the users next 1686@c questions are likely to be "where do I get it?" and 1687@c "how do I use it?" 1688 1689@node Password authentication client 1690@subsubsection Using the client with password authentication 1691@cindex Login (subcommand) 1692@cindex password client, using 1693@cindex authenticated client, using 1694@cindex :pserver: 1695Before connecting to the server, the client must @dfn{log 1696in} with the command @code{cvs login}. Logging in 1697verifies a password with the server, and also records 1698the password for later transactions with the server. 1699The @code{cvs login} command needs to know the 1700username, server hostname, and full repository path, 1701and it gets this information from the repository 1702argument or the @code{CVSROOT} environment variable. 1703 1704@code{cvs login} is interactive --- it prompts for a 1705password: 1706 1707@example 1708cvs -d :pserver:bach@@chainsaw.brickyard.com:/usr/local/cvsroot login 1709CVS password: 1710@end example 1711 1712The password is checked with the server; if it is 1713correct, the @code{login} succeeds, else it fails, 1714complaining that the password was incorrect. 1715 1716Once you have logged in, you can force @sc{cvs} to 1717connect directly to the server and authenticate with 1718the stored password: 1719 1720@example 1721cvs -d :pserver:bach@@chainsaw.brickyard.com:/usr/local/cvsroot checkout foo 1722@end example 1723 1724The @samp{:pserver:} is necessary because without it, 1725@sc{cvs} will assume it should use @code{rsh} to 1726connect with the server (@pxref{Connecting via rsh}). 1727(Once you have a working copy checked out and are 1728running @sc{cvs} commands from within it, there is no 1729longer any need to specify the repository explicitly, 1730because @sc{cvs} records it in the working copy's 1731@file{CVS} subdirectory.) 1732 1733@cindex CVS_PASSFILE, environment variable 1734Passwords are stored by default in the file 1735@file{$HOME/.cvspass}. Its format is human-readable, 1736but don't edit it unless you know what you are doing. 1737The passwords are not stored in cleartext, but are 1738trivially encoded to protect them from "innocent" 1739compromise (i.e., inadvertently being seen by a system 1740administrator who happens to look at that file). 1741 1742@c FIXME: seems to me this needs somewhat more 1743@c explanation. 1744@cindex Logout (subcommand) 1745The password for the currently choosen remote repository 1746can be removed from the CVS_PASSFILE by using the 1747@code{cvs logout} command. 1748 1749The @code{CVS_PASSFILE} environment variable overrides 1750this default. If you use this variable, make sure you 1751set it @emph{before} @code{cvs login} is run. If you 1752were to set it after running @code{cvs login}, then 1753later @sc{cvs} commands would be unable to look up the 1754password for transmission to the server. 1755 1756@node Password authentication security 1757@subsubsection Security considerations with password authentication 1758 1759The passwords are stored on the client side in a 1760trivial encoding of the cleartext, and transmitted in 1761the same encoding. The encoding is done only to 1762prevent inadvertent password compromises (i.e., a 1763system administrator accidentally looking at the file), 1764and will not prevent even a naive attacker from gaining 1765the password. 1766 1767@c FIXME: The bit about "access to the repository 1768@c implies general access to the system is *not* specific 1769@c to pserver; it applies to kerberos and SSH and 1770@c everything else too. Should reorganize the 1771@c documentation to make this clear. 1772The separate @sc{cvs} password file (@pxref{Password 1773authentication server}) allows people 1774to use a different password for repository access than 1775for login access. On the other hand, once a user has 1776access to the repository, she can execute programs on 1777the server system through a variety of means. Thus, repository 1778access implies fairly broad system access as well. It 1779might be possible to modify @sc{cvs} to prevent that, 1780but no one has done so as of this writing. 1781@c OpenBSD uses chroot() and copies the repository to 1782@c provide anonymous read-only access (for details see 1783@c http://www.openbsd.org/anoncvs.shar). While this 1784@c closes the most obvious holes, I'm not sure it 1785@c closes enough holes to recommend it (plus it is 1786@c *very* easy to accidentally screw up a setup of this 1787@c type). 1788Furthermore, there may be other ways in which having 1789access to @sc{cvs} allows people to gain more general 1790access to the system; noone has done a careful audit. 1791 1792In summary, anyone who gets the password gets 1793repository access, and some measure of general system 1794access as well. The password is available to anyone 1795who can sniff network packets or read a protected 1796(i.e., user read-only) file. If you want real 1797security, get Kerberos. 1798 1799@node Kerberos authenticated 1800@subsection Direct connection with kerberos 1801 1802@cindex kerberos 1803@cindex :kserver: 1804The main disadvantage of using rsh is that all the data 1805needs to pass through additional programs, so it may be 1806slower. So if you have kerberos installed you can 1807connect via a direct @sc{tcp} connection, 1808authenticating with kerberos. 1809 1810To do this, @sc{cvs} needs to be compiled with kerberos 1811support; when configuring @sc{cvs} it tries to detect 1812whether kerberos is present or you can use the 1813@file{--with-krb4} flag to configure. 1814 1815The data transmitted is @emph{not} encrypted by 1816default. Encryption support must be compiled into both 1817the client and server; use the 1818@file{--enable-encryption} configure option to turn it 1819on. You must then use the @code{-x} global option to 1820request encryption. 1821 1822@cindex CVS_CLIENT_PORT 1823You need to edit @code{inetd.conf} on the server 1824machine to run @code{cvs kserver}. The client uses 1825port 1999 by default; if you want to use another port 1826specify it in the @code{CVS_CLIENT_PORT} environment 1827variable on the client. 1828 1829@cindex kinit 1830When you want to use @sc{cvs}, get a ticket in the 1831usual way (generally @code{kinit}); it must be a ticket 1832which allows you to log into the server machine. Then 1833you are ready to go: 1834 1835@example 1836cvs -d :kserver:chainsaw.brickyard.com:/user/local/cvsroot checkout foo 1837@end example 1838 1839Previous versions of @sc{cvs} would fall back to a 1840connection via rsh; this version will not do so. 1841 1842@c --------------------------------------------------------------------- 1843@node Read-only access 1844@section Read-only repository access 1845@cindex read-only repository access 1846@cindex readers (admin file) 1847@cindex writers (admin file) 1848 1849 It is possible to grant read-only repository 1850access to people using the password-authenticated 1851server (@pxref{Password authenticated}). (The 1852other access methods do not have explicit support for 1853read-only users because those methods all assume login 1854access to the repository machine anyway, and therefore 1855the user can do whatever local file permissions allow 1856her to do.) 1857 1858 A user who has read-only access can do only 1859those @sc{cvs} operations which do not modify the 1860repository, except for certain ``administrative'' files 1861(such as lock files and the history file). It may be 1862desirable to use this feature in conjunction with 1863user-aliasing (@pxref{Password authentication server}). 1864However, note that read-only access does not repeal the 1865existing security considerations in @xref{Password 1866authentication security}. 1867 1868 There are two ways to specify read-only access 1869for a user: by inclusion, and by exclusion. 1870 1871 "Inclusion" means listing that user 1872specifically in the @file{$CVSROOT/CVSROOT/readers} 1873file, which is simply a newline-separated list of 1874users. Here is a sample @file{readers} file: 1875 1876@example 1877melissa 1878splotnik 1879jrandom 1880@end example 1881 1882 (Don't forget the newline after the last user.) 1883 1884 "Exclusion" means explicitly listing everyone 1885who has @emph{write} access---if the 1886@file{$CVSROOT/CVSROOT/writers} file exists, then only 1887those users listed in it have write access, and 1888everyone else has read-only access (of course, even the 1889read-only users still need to be listed in the 1890@file{$CVSROOT/CVSROOT/passwd} file). The 1891@file{writers} file has the same format as the 1892@file{readers} file. 1893 1894 Note: if your @file{$CVSROOT/CVSROOT/passwd} 1895file maps cvs users onto system users (@pxref{Password 1896authentication server}), make sure you deny or grant 1897read-only access using the @emph{cvs} usernames, not 1898the system usernames. That is, the @file{readers} and 1899@file{writers} files contain cvs usernames, which may 1900or may not be the same as system usernames. 1901 1902 Here is a complete description of the server's 1903behavior in deciding whether to grant read-only or 1904read-write access: 1905 1906 If @file{readers} exists, and this user is 1907listed in it, then she gets read-only access. Or if 1908@file{writers} exists, and this user is NOT listed in 1909it, then she also gets read-only access (this is true 1910even if @file{readers} exists but she is not listed 1911there). Otherwise, she gets full read-write access. 1912 1913 Of course there is a conflict if the user is 1914listed in both files. This is resolved in the more 1915conservative way, it being better to protect the 1916repository too much than too little: such a user gets 1917read-only access. 1918 1919@c --------------------------------------------------------------------- 1920@node Starting a new project 1921@chapter Starting a project with CVS 1922@cindex Starting a project with CVS 1923@cindex Creating a project 1924 1925@comment --moduledb-- 1926Because renaming files and moving them between 1927directories is somewhat inconvenient, the first thing 1928you do when you start a new project should be to think 1929through your file organization. It is not impossible 1930to rename or move files, but it does increase the 1931potential for confusion and @sc{cvs} does have some 1932quirks particularly in the area of renaming 1933directories. @xref{Moving files}. 1934 1935What to do next depends on the situation at hand. 1936 1937@menu 1938* Setting up the files:: Getting the files into the repository 1939* Defining the module:: How to make a module of the files 1940@end menu 1941@c -- File permissions! 1942 1943@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1944@node Setting up the files 1945@section Setting up the files 1946 1947The first step is to create the files inside the repository. This can 1948be done in a couple of different ways. 1949 1950@c -- The contributed scripts 1951@menu 1952* From files:: This method is useful with old projects 1953 where files already exists. 1954* From other version control systems:: Old projects where you want to 1955 preserve history from another system. 1956* From scratch:: Creating a directory tree from scratch. 1957@end menu 1958 1959@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1960@node From files 1961@subsection Creating a directory tree from a number of files 1962@cindex Importing files 1963 1964When you begin using @sc{cvs}, you will probably already have several 1965projects that can be 1966put under @sc{cvs} control. In these cases the easiest way is to use the 1967@code{import} command. An example is probably the easiest way to 1968explain how to use it. If the files you want to install in 1969@sc{cvs} reside in @file{@var{wdir}}, and you want them to appear in the 1970repository as @file{$CVSROOT/yoyodyne/@var{rdir}}, you can do this: 1971 1972@example 1973$ cd @var{wdir} 1974$ cvs import -m "Imported sources" yoyodyne/@var{rdir} yoyo start 1975@end example 1976 1977Unless you supply a log message with the @samp{-m} 1978flag, @sc{cvs} starts an editor and prompts for a 1979message. The string @samp{yoyo} is a @dfn{vendor tag}, 1980and @samp{start} is a @dfn{release tag}. They may fill 1981no purpose in this context, but since @sc{cvs} requires 1982them they must be present. @xref{Tracking sources}, for 1983more information about them. 1984 1985You can now verify that it worked, and remove your 1986original source directory. 1987@c FIXME: Need to say more about "verify that it 1988@c worked". What should the user look for in the output 1989@c from "diff -r"? 1990 1991@example 1992$ cd .. 1993$ mv @var{dir} @var{dir}.orig 1994$ cvs checkout yoyodyne/@var{dir} # @r{Explanation below} 1995$ diff -r @var{dir}.orig yoyodyne/@var{dir} 1996$ rm -r @var{dir}.orig 1997@end example 1998 1999@noindent 2000Erasing the original sources is a good idea, to make sure that you do 2001not accidentally edit them in @var{dir}, bypassing @sc{cvs}. 2002Of course, it would be wise to make sure that you have 2003a backup of the sources before you remove them. 2004 2005The @code{checkout} command can either take a module 2006name as argument (as it has done in all previous 2007examples) or a path name relative to @code{$CVSROOT}, 2008as it did in the example above. 2009 2010It is a good idea to check that the permissions 2011@sc{cvs} sets on the directories inside @samp{$CVSROOT} 2012are reasonable, and that they belong to the proper 2013groups. @xref{File permissions}. 2014 2015If some of the files you want to import are binary, you 2016may want to use the wrappers features to specify which 2017files are binary and which are not. @xref{Wrappers}. 2018 2019@c The node name is too long, but I am having trouble 2020@c thinking of something more concise. 2021@node From other version control systems 2022@subsection Creating Files From Other Version Control Systems 2023@cindex Importing files, from other version control systesm 2024 2025If you have a project which you are maintaining with 2026another version control system, such as @sc{rcs}, you 2027may wish to put the files from that project into 2028@sc{cvs}, and preserve the revision history of the 2029files. 2030 2031@table @asis 2032@cindex RCS, importing files from 2033@item From RCS 2034If you have been using @sc{rcs}, find the @sc{rcs} 2035files---usually a file named @file{foo.c} will have its 2036@sc{rcs} file in @file{RCS/foo.c,v} (but it could be 2037other places; consult the @sc{rcs} documentation for 2038details). Then create the appropriate directories in 2039@sc{cvs} if they do not already exist. Then copy the 2040files into the appropriate directories in the @sc{cvs} 2041repository (the name in the repository must be the name 2042of the source file with @samp{,v} added; the files go 2043directly in the appopriate directory of the repository, 2044not in an @file{RCS} subdirectory). This is one of the 2045few times when it is a good idea to access the @sc{cvs} 2046repository directly, rather than using @sc{cvs} 2047commands. Then you are ready to check out a new 2048working directory. 2049@c Someday there probably should be a "cvs import -t 2050@c rcs" or some such. It could even create magic 2051@c branches. It could also do something about the case 2052@c where the RCS file had a (non-magic) "0" branch. 2053 2054The @sc{rcs} file should not be locked when you move it 2055into @sc{cvs}; if it is, @sc{cvs} will have trouble 2056letting you operate on it. 2057@c What is the easiest way to unlock your files if you 2058@c have them locked? Especially if you have a lot of them? 2059@c This is a CVS bug/misfeature; importing RCS files 2060@c should ignore whether they are locked and leave them in 2061@c an unlocked state. Yet another reason for a separate 2062@c "import RCS file" command. 2063 2064@c How many is "many"? Or do they just import RCS files? 2065@item From another version control system 2066Many version control systems have the ability to export 2067@sc{rcs} files in the standard format. If yours does, 2068export the @sc{rcs} files and then follow the above 2069instructions. 2070 2071@cindex SCCS, importing files from 2072@item From SCCS 2073There is a script in the @file{contrib} directory of 2074the @sc{cvs} source distribution called @file{sccs2rcs} 2075which converts @sc{sccs} files to @sc{rcs} files. 2076Note: you must run it on a machine which has both 2077@sc{sccs} and @sc{rcs} installed, and like everything 2078else in contrib it is unsupported (your mileage may 2079vary). 2080@end table 2081 2082@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2083@node From scratch 2084@subsection Creating a directory tree from scratch 2085 2086@c Also/instead should be documenting 2087@c $ cvs co -l . 2088@c $ mkdir tc 2089@c $ cvs add tc 2090@c $ cd tc 2091@c $ mkdir man 2092@c $ cvs add man 2093@c etc. 2094@c Using import to create the directories only is 2095@c probably a somewhat confusing concept. 2096For a new project, the easiest thing to do is probably 2097to create an empty directory structure, like this: 2098 2099@example 2100$ mkdir tc 2101$ mkdir tc/man 2102$ mkdir tc/testing 2103@end example 2104 2105After that, you use the @code{import} command to create 2106the corresponding (empty) directory structure inside 2107the repository: 2108 2109@example 2110$ cd tc 2111$ cvs import -m "Created directory structure" yoyodyne/@var{dir} yoyo start 2112@end example 2113 2114Then, use @code{add} to add files (and new directories) 2115as they appear. 2116 2117Check that the permissions @sc{cvs} sets on the 2118directories inside @samp{$CVSROOT} are reasonable. 2119 2120@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2121@node Defining the module 2122@section Defining the module 2123@cindex Defining a module 2124@cindex Editing the modules file 2125@cindex Module, defining 2126@cindex Modules file, changing 2127 2128The next step is to define the module in the 2129@file{modules} file. This is not strictly necessary, 2130but modules can be convenient in grouping together 2131related files and directories. 2132 2133In simple cases these steps are sufficient to define a module. 2134 2135@enumerate 2136@item 2137Get a working copy of the modules file. 2138 2139@example 2140$ cvs checkout CVSROOT/modules 2141$ cd CVSROOT 2142@end example 2143 2144@item 2145Edit the file and insert a line that defines the module. @xref{Intro 2146administrative files}, for an introduction. @xref{modules}, for a full 2147description of the modules file. You can use the 2148following line to define the module @samp{tc}: 2149 2150@example 2151tc yoyodyne/tc 2152@end example 2153 2154@item 2155Commit your changes to the modules file. 2156 2157@example 2158$ cvs commit -m "Added the tc module." modules 2159@end example 2160 2161@item 2162Release the modules module. 2163 2164@example 2165$ cd .. 2166$ cvs release -d CVSROOT 2167@end example 2168@end enumerate 2169 2170@c --------------------------------------------------------------------- 2171@node Multiple developers 2172@chapter Multiple developers 2173@cindex Multiple developers 2174@cindex Team of developers 2175@cindex File locking 2176@cindex Locking files 2177@cindex Working copy 2178@cindex reserved checkouts 2179@cindex unreserved checkouts 2180@cindex RCS-style locking 2181 2182When more than one person works on a software project 2183things often get complicated. Often, two people try to 2184edit the same file simultaneously. One solution, known 2185as @dfn{file locking} or @dfn{reserved checkouts}, is 2186to allow only one person to edit each file at a time. 2187This is the only solution with some version control 2188systems, including @sc{rcs} and @sc{sccs}. Currently 2189the usual way to get reserved checkouts with @sc{cvs} 2190is the @code{cvs admin -l} command (@pxref{admin 2191options}). This is not as nicely integrated into 2192@sc{cvs} as the watch features, described below, but it 2193seems that most people with a need for reserved 2194checkouts find it adequate. 2195@c Or "find it better than worrying about implementing 2196@c nicely integrated reserved checkouts" or ...? 2197It also may be possible to use the watches 2198features described below, together with suitable 2199procedures (not enforced by software), to avoid having 2200two people edit at the same time. 2201 2202@c Our unreserved checkout model might not 2203@c be quite the same as others. For example, I 2204@c think that some systems will tend to create a branch 2205@c in the case where CVS prints "up-to-date check failed". 2206@c It isn't clear to me whether we should try to 2207@c explore these subtleties; it could easily just 2208@c confuse people. 2209The default model with @sc{cvs} is known as 2210@dfn{unreserved checkouts}. In this model, developers 2211can edit their own @dfn{working copy} of a file 2212simultaneously. The first person that commits his 2213changes has no automatic way of knowing that another 2214has started to edit it. Others will get an error 2215message when they try to commit the file. They must 2216then use @sc{cvs} commands to bring their working copy 2217up to date with the repository revision. This process 2218is almost automatic. 2219 2220@c FIXME? should probably use the word "watch" here, to 2221@c tie this into the text below and above. 2222@sc{Cvs} also supports mechanisms which facilitate 2223various kinds of communcation, without actually 2224enforcing rules like reserved checkouts do. 2225 2226The rest of this chapter describes how these various 2227models work, and some of the issues involved in 2228choosing between them. 2229 2230@ignore 2231Here is a draft reserved checkout design or discussion 2232of the issues. This seems like as good a place as any 2233for this. 2234 2235Might want a cvs lock/cvs unlock--in which the names 2236differ from edit/unedit because the network must be up 2237for these to work. unedit gives an error if there is a 2238reserved checkout in place (so that people don't 2239accidentally leave locks around); unlock gives an error 2240if one is not in place (this is more arguable; perhaps 2241it should act like unedit in that case). 2242 2243On the other hand, might want it so that emacs, 2244scripts, etc., can get ready to edit a file without 2245having to know which model is in use. In that case we 2246would have a "cvs watch lock" (or .cvsrc?) (that is, 2247three settings, "on", "off", and "lock"). Having cvs 2248watch lock set would cause a get to record in the CVS 2249directory which model is in use, and cause "cvs edit" 2250to change behaviors. We'd want a way to query which 2251setting is in effect (this would be handy even if it is 2252only "on" or "off" as presently). If lock is in 2253effect, then commit would require a lock before 2254allowing a checkin; chmod wouldn't suffice (might be 2255debatable--see chmod comment below, in watches--but it 2256is the way people expect RCS to work and I can't think 2257of any significant downside. On the other hand, maybe 2258it isn't worth bothering, because people who are used 2259to RCS wouldn't think to use chmod anyway). 2260 2261Implementation: use file attributes or use RCS 2262locking. The former avoids more dependence on RCS 2263behaviors we will need to reimplement as we librarify 2264RCS, and makes it easier to import/export RCS files (in 2265that context, want to ignore the locker field). But 2266note that RCS locks are per-branch, which is the 2267correct behavior (this is also an issue for the "watch 2268on" features; they should be per-branch too). 2269 2270Here are a few more random notes about implementation 2271details, assuming "cvs watch lock" and 2272 2273CVS/Watched file? Or try to fit this into CVS/Entries somehow? 2274Cases: (1) file is checked out (unreserved or with watch on) by old 2275version of CVS, now we do something with new one, (2) file is checked 2276out by new version, now we do something with old one. 2277 2278Remote protocol would have a "Watched" analogous to "Mode". Of course 2279it would apply to all Updated-like requests. How do we keep this 2280setting up to date? I guess that there wants to be a Watched request, 2281and the server would send a new one if it isn't up to date? (Ugh--hard 2282to implement and slows down "cvs -q update"--is there an easier way?) 2283 2284"cvs edit"--checks CVS/Watched, and if watch lock, then sends 2285"edit-lock" request. Which comes back with a Checked-in with 2286appropriate Watched (off, on, lock, locked, or some such?), or error 2287message if already locked. 2288 2289"cvs commit"--only will commit if off/on/locked. lock is not OK. 2290 2291Doc: 2292note that "cvs edit" must be connected to network if watch lock is in 2293effect. 2294 2295Talk about what to do if someone has locked a file and you want to 2296edit that file. (breaking locks, or lack thereof). 2297 2298 2299@end ignore 2300 2301@menu 2302* File status:: A file can be in several states 2303* Updating a file:: Bringing a file up-to-date 2304* Conflicts example:: An informative example 2305* Informing others:: To cooperate you must inform 2306* Concurrency:: Simultaneous repository access 2307* Watches:: Mechanisms to track who is editing files 2308* Choosing a model:: Reserved or unreserved checkouts? 2309@end menu 2310 2311@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2312@node File status 2313@section File status 2314@cindex File status 2315@cindex Status of a file 2316 2317Based on what operations you have performed on a 2318checked out file, and what operations others have 2319performed to that file in the repository, one can 2320classify a file in a number of states. The states, as 2321reported by the @code{status} command, are: 2322 2323@c The order of items is chosen to group logically 2324@c similar outputs together. 2325@c People who want alphabetical can use the index... 2326@table @asis 2327@cindex Up-to-date 2328@item Up-to-date 2329The file is identical with the latest revision in the 2330repository for the branch in use. 2331@c FIXME: should we clarify "in use"? The answer is 2332@c sticky tags, and trying to distinguish branch sticky 2333@c tags from non-branch sticky tags seems rather awkward 2334@c here. 2335@c FIXME: What happens with non-branch sticky tags? Is 2336@c a stuck file "Up-to-date" or "Needs checkout" or what? 2337 2338@item Locally Modified 2339@cindex Locally Modified 2340You have edited the file, and not yet committed your changes. 2341 2342@item Locally Added 2343@cindex Locally Added 2344You have added the file with @code{add}, and not yet 2345committed your changes. 2346@c There are many cases involving the file being 2347@c added/removed/modified in the working directory, and 2348@c added/removed/modified in the repository, which we 2349@c don't try to describe here. I'm not sure that "cvs 2350@c status" produces a non-confusing output in most of 2351@c those cases. 2352 2353@item Locally Removed 2354@cindex Locally Removed 2355You have removed the file with @code{remove}, and not yet 2356committed your changes. 2357 2358@item Needs Checkout 2359@cindex Needs Checkout 2360Someone else has committed a newer revision to the 2361repository. The name is slightly misleading; you will 2362ordinarily use @code{update} rather than 2363@code{checkout} to get that newer revision. 2364 2365@item Needs Patch 2366@cindex Needs Patch 2367@c See also newb-123j0 in sanity.sh (although that case 2368@c should probably be changed rather than documented). 2369Like Needs Checkout, but the @sc{cvs} server will send 2370a patch rather than the entire file. Sending a patch or 2371sending an entire file accomplishes the same thing. 2372 2373@item Needs Merge 2374@cindex Needs Merge 2375Someone else has committed a newer revision to the repository, and you 2376have also made modifications to the file. 2377 2378@item File had conflicts on merge 2379@cindex File had conflicts on merge 2380@c is it worth saying that this message was "Unresolved 2381@c Conflict" in CVS 1.9 and earlier? I'm inclined to 2382@c think that is unnecessarily confusing to new users. 2383This is like Locally Modified, except that a previous 2384@code{update} command gave a conflict. If you have not 2385already done so, you need to 2386resolve the conflict as described in @ref{Conflicts example}. 2387 2388@item Unknown 2389@cindex Unknown 2390@sc{Cvs} doesn't know anything about this file. For 2391example, you have created a new file and have not run 2392@code{add}. 2393@c 2394@c "Entry Invalid" and "Classify Error" are also in the 2395@c status.c. The latter definitely indicates a CVS bug 2396@c (should it be worded more like "internal error" so 2397@c people submit bug reports if they see it?). The former 2398@c I'm not as sure; I haven't tracked down whether/when it 2399@c appears in "cvs status" output. 2400 2401@end table 2402 2403To help clarify the file status, @code{status} also 2404reports the @code{Working revision} which is the 2405revision that the file in the working directory derives 2406from, and the @code{Repository revision} which is the 2407latest revision in the repository for the branch in 2408use. 2409@c FIXME: should we clarify "in use"? The answer is 2410@c sticky tags, and trying to distinguish branch sticky 2411@c tags from non-branch sticky tags seems rather awkward 2412@c here. 2413@c FIXME: What happens with non-branch sticky tags? 2414@c What is the Repository Revision there? See the 2415@c comment at vn_rcs in cvs.h, which is kind of 2416@c confused--we really need to document better what this 2417@c field contains. 2418@c Q: Should we document "New file!" and other such 2419@c outputs or are they self-explanatory? 2420@c FIXME: what about the date to the right of "Working 2421@c revision"? It doesn't appear with client/server and 2422@c seems unnecessary (redundant with "ls -l") so 2423@c perhaps it should be removed for non-client/server too? 2424@c FIXME: Need some examples. 2425 2426For information on the options to @code{status}, see 2427@ref{status}. For information on its @code{Sticky tag} 2428and @code{Sticky date} output, see @ref{Sticky tags}. 2429For information on its @code{Sticky options} output, 2430see the @samp{-k} option in @ref{update options}. 2431 2432@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2433@node Updating a file 2434@section Bringing a file up to date 2435@cindex Bringing a file up to date 2436@cindex Updating a file 2437@cindex Merging a file 2438@cindex update, introduction 2439 2440When you want to update or merge a file, use the @code{update} 2441command. For files that are not up to date this is roughly equivalent 2442to a @code{checkout} command: the newest revision of the file is 2443extracted from the repository and put in your working copy of the 2444module. 2445 2446Your modifications to a file are never lost when you 2447use @code{update}. If no newer revision exists, 2448running @code{update} has no effect. If you have 2449edited the file, and a newer revision is available, 2450@sc{cvs} will merge all changes into your working copy. 2451 2452For instance, imagine that you checked out revision 1.4 and started 2453editing it. In the meantime someone else committed revision 1.5, and 2454shortly after that revision 1.6. If you run @code{update} on the file 2455now, @sc{cvs} will incorporate all changes between revision 1.4 and 1.6 into 2456your file. 2457 2458@cindex Overlap 2459If any of the changes between 1.4 and 1.6 were made too 2460close to any of the changes you have made, an 2461@dfn{overlap} occurs. In such cases a warning is 2462printed, and the resulting file includes both 2463versions of the lines that overlap, delimited by 2464special markers. 2465@xref{update}, for a complete description of the 2466@code{update} command. 2467 2468@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2469@node Conflicts example 2470@section Conflicts example 2471@cindex Merge, an example 2472@cindex Example of merge 2473@cindex driver.c (merge example) 2474 2475Suppose revision 1.4 of @file{driver.c} contains this: 2476 2477@example 2478#include <stdio.h> 2479 2480void main() 2481@{ 2482 parse(); 2483 if (nerr == 0) 2484 gencode(); 2485 else 2486 fprintf(stderr, "No code generated.\n"); 2487 exit(nerr == 0 ? 0 : 1); 2488@} 2489@end example 2490 2491@noindent 2492Revision 1.6 of @file{driver.c} contains this: 2493 2494@example 2495#include <stdio.h> 2496 2497int main(int argc, 2498 char **argv) 2499@{ 2500 parse(); 2501 if (argc != 1) 2502 @{ 2503 fprintf(stderr, "tc: No args expected.\n"); 2504 exit(1); 2505 @} 2506 if (nerr == 0) 2507 gencode(); 2508 else 2509 fprintf(stderr, "No code generated.\n"); 2510 exit(!!nerr); 2511@} 2512@end example 2513 2514@noindent 2515Your working copy of @file{driver.c}, based on revision 25161.4, contains this before you run @samp{cvs update}: 2517@c -- Really include "cvs"? 2518 2519@example 2520#include <stdlib.h> 2521#include <stdio.h> 2522 2523void main() 2524@{ 2525 init_scanner(); 2526 parse(); 2527 if (nerr == 0) 2528 gencode(); 2529 else 2530 fprintf(stderr, "No code generated.\n"); 2531 exit(nerr == 0 ? EXIT_SUCCESS : EXIT_FAILURE); 2532@} 2533@end example 2534 2535@noindent 2536You run @samp{cvs update}: 2537@c -- Really include "cvs"? 2538 2539@example 2540$ cvs update driver.c 2541RCS file: /usr/local/cvsroot/yoyodyne/tc/driver.c,v 2542retrieving revision 1.4 2543retrieving revision 1.6 2544Merging differences between 1.4 and 1.6 into driver.c 2545rcsmerge warning: overlaps during merge 2546cvs update: conflicts found in driver.c 2547C driver.c 2548@end example 2549 2550@noindent 2551@cindex Conflicts (merge example) 2552@sc{cvs} tells you that there were some conflicts. 2553Your original working file is saved unmodified in 2554@file{.#driver.c.1.4}. The new version of 2555@file{driver.c} contains this: 2556 2557@example 2558#include <stdlib.h> 2559#include <stdio.h> 2560 2561int main(int argc, 2562 char **argv) 2563@{ 2564 init_scanner(); 2565 parse(); 2566 if (argc != 1) 2567 @{ 2568 fprintf(stderr, "tc: No args expected.\n"); 2569 exit(1); 2570 @} 2571 if (nerr == 0) 2572 gencode(); 2573 else 2574 fprintf(stderr, "No code generated.\n"); 2575@asis{}<<<<<<< driver.c 2576 exit(nerr == 0 ? EXIT_SUCCESS : EXIT_FAILURE); 2577@asis{}======= 2578 exit(!!nerr); 2579@asis{}>>>>>>> 1.6 2580@} 2581@end example 2582 2583@noindent 2584@cindex Markers, conflict 2585@cindex Conflict markers 2586@cindex <<<<<<< 2587@cindex >>>>>>> 2588@cindex ======= 2589 2590Note how all non-overlapping modifications are incorporated in your working 2591copy, and that the overlapping section is clearly marked with 2592@samp{<<<<<<<}, @samp{=======} and @samp{>>>>>>>}. 2593 2594@cindex Resolving a conflict 2595@cindex Conflict resolution 2596You resolve the conflict by editing the file, removing the markers and 2597the erroneous line. Suppose you end up with this file: 2598@c -- Add xref to the pcl-cvs manual when it talks 2599@c -- about this. 2600@example 2601#include <stdlib.h> 2602#include <stdio.h> 2603 2604int main(int argc, 2605 char **argv) 2606@{ 2607 init_scanner(); 2608 parse(); 2609 if (argc != 1) 2610 @{ 2611 fprintf(stderr, "tc: No args expected.\n"); 2612 exit(1); 2613 @} 2614 if (nerr == 0) 2615 gencode(); 2616 else 2617 fprintf(stderr, "No code generated.\n"); 2618 exit(nerr == 0 ? EXIT_SUCCESS : EXIT_FAILURE); 2619@} 2620@end example 2621 2622@noindent 2623You can now go ahead and commit this as revision 1.7. 2624 2625@example 2626$ cvs commit -m "Initialize scanner. Use symbolic exit values." driver.c 2627Checking in driver.c; 2628/usr/local/cvsroot/yoyodyne/tc/driver.c,v <-- driver.c 2629new revision: 1.7; previous revision: 1.6 2630done 2631@end example 2632 2633For your protection, @sc{cvs} will refuse to check in a 2634file if a conflict occurred and you have not resolved 2635the conflict. Currently to resolve a conflict, you 2636must change the timestamp on the file, and must also 2637insure that the file contains no conflict markers. If 2638your file legitimately contains conflict markers (that 2639is, occurrences of @samp{>>>>>>> } at the start of a 2640line that don't mark a conflict), then @sc{cvs} has 2641trouble handling this and you need to start hacking on 2642the @code{CVS/Entries} file or other such workarounds. 2643@c FIXME: There should be a "cvs resolved" command 2644@c which clears the conflict indication. For a nice user 2645@c interface, this should be invoked by an interactive 2646@c merge tool like emerge rather than by the user 2647@c directly--such a tool can verify that the user has 2648@c really dealt with each conflict. 2649 2650@cindex emerge 2651If you use release 1.04 or later of pcl-cvs (a @sc{gnu} 2652Emacs front-end for @sc{cvs}) you can use an Emacs 2653package called emerge to help you resolve conflicts. 2654See the documentation for pcl-cvs. 2655 2656@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 2657@node Informing others 2658@section Informing others about commits 2659@cindex Informing others 2660@cindex Spreading information 2661@cindex Mail, automatic mail on commit 2662 2663It is often useful to inform others when you commit a 2664new revision of a file. The @samp{-i} option of the 2665@file{modules} file, or the @file{loginfo} file, can be 2666used to automate this process. @xref{modules}. 2667@xref{loginfo}. You can use these features of @sc{cvs} 2668to, for instance, instruct @sc{cvs} to mail a 2669message to all developers, or post a message to a local 2670newsgroup. 2671@c -- More text would be nice here. 2672 2673@node Concurrency 2674@section Several developers simultaneously attempting to run CVS 2675 2676@cindex locks, cvs 2677@c For a discussion of *why* CVS creates locks, see 2678@c the comment at the start of src/lock.c 2679If several developers try to run @sc{cvs} at the same 2680time, one may get the following message: 2681 2682@example 2683[11:43:23] waiting for bach's lock in /usr/local/cvsroot/foo 2684@end example 2685 2686@sc{cvs} will try again every 30 seconds, and either 2687continue with the operation or print the message again, 2688if it still needs to wait. If a lock seems to stick 2689around for an undue amount of time, find the person 2690holding the lock and ask them about the cvs command 2691they are running. If they aren't running a cvs 2692command, look in the repository directory mentioned in 2693the message and remove files which they own whose names 2694start with @file{#cvs.tfl}, @file{#cvs.rfl}, or 2695@file{#cvs.wfl}. 2696 2697Note that these locks are to protect @sc{cvs}'s 2698internal data structures and have no relationship to 2699the word @dfn{lock} in the sense used by 2700@sc{rcs}---which refers to reserved checkouts 2701(@pxref{Multiple developers}). 2702 2703Any number of people can be reading from a given 2704repository at a time; only when someone is writing do 2705the locks prevent other people from reading or writing. 2706 2707@cindex Atomic transactions, lack of 2708@cindex Transactions, atomic, lack of 2709@c the following talks about what one might call commit/update 2710@c atomicity. 2711@c Probably also should say something about 2712@c commit/commit atomicity, that is, "An update will 2713@c not get partial versions of more than one commit". 2714@c CVS currently has this property and I guess we can 2715@c make it a documented feature. 2716@c For example one person commits 2717@c a/one.c and b/four.c and another commits a/two.c and 2718@c b/three.c. Then an update cannot get the new a/one.c 2719@c and a/two.c and the old b/four.c and b/three.c. 2720One might hope for the following property 2721 2722@example 2723If someone commits some changes in one cvs command, 2724then an update by someone else will either get all the 2725changes, or none of them. 2726@end example 2727 2728but @sc{cvs} does @emph{not} have this property. For 2729example, given the files 2730 2731@example 2732a/one.c 2733a/two.c 2734b/three.c 2735b/four.c 2736@end example 2737 2738if someone runs 2739 2740@example 2741cvs ci a/two.c b/three.c 2742@end example 2743 2744and someone else runs @code{cvs update} at the same 2745time, the person running @code{update} might get only 2746the change to @file{b/three.c} and not the change to 2747@file{a/two.c}. 2748 2749@node Watches 2750@section Mechanisms to track who is editing files 2751@cindex Watches 2752 2753For many groups, use of @sc{cvs} in its default mode is 2754perfectly satisfactory. Users may sometimes go to 2755check in a modification only to find that another 2756modification has intervened, but they deal with it and 2757proceed with their check in. Other groups prefer to be 2758able to know who is editing what files, so that if two 2759people try to edit the same file they can choose to 2760talk about who is doing what when rather than be 2761surprised at check in time. The features in this 2762section allow such coordination, while retaining the 2763ability of two developers to edit the same file at the 2764same time. 2765 2766@c Some people might ask why CVS does not enforce the 2767@c rule on chmod, by requiring a cvs edit before a cvs 2768@c commit. The main reason is that it could always be 2769@c circumvented--one could edit the file, and 2770@c then when ready to check it in, do the cvs edit and put 2771@c in the new contents and do the cvs commit. One 2772@c implementation note: if we _do_ want to have cvs commit 2773@c require a cvs edit, we should store the state on 2774@c whether the cvs edit has occurred in the working 2775@c directory, rather than having the server try to keep 2776@c track of what working directories exist. 2777@c FIXME: should the above discussion be part of the 2778@c manual proper, somewhere, not just in a comment? 2779For maximum benefit developers should use @code{cvs 2780edit} (not @code{chmod}) to make files read-write to 2781edit them, and @code{cvs release} (not @code{rm}) to 2782discard a working directory which is no longer in use, 2783but @sc{cvs} is not able to enforce this behavior. 2784 2785@c I'm a little dissatisfied with this presentation, 2786@c because "watch on"/"edit"/"editors" are one set of 2787@c functionality, and "watch add"/"watchers" is another 2788@c which is somewhat orthogonal even though they interact in 2789@c various ways. But I think it might be 2790@c confusing to describe them separately (e.g. "watch 2791@c add" with loginfo). I don't know. 2792 2793@menu 2794* Setting a watch:: Telling CVS to watch certain files 2795* Getting Notified:: Telling CVS to notify you 2796* Editing files:: How to edit a file which is being watched 2797* Watch information:: Information about who is watching and editing 2798* Watches Compatibility:: Watches interact poorly with CVS 1.6 or earlier 2799@end menu 2800 2801@node Setting a watch 2802@subsection Telling CVS to watch certain files 2803 2804To enable the watch features, you first specify that 2805certain files are to be watched. 2806 2807@cindex watch on (subcommand) 2808@deffn Command {cvs watch on} [@code{-l}] files @dots{} 2809 2810@cindex read-only files, and watches 2811Specify that developers should run @code{cvs edit} 2812before editing @var{files}. CVS will create working 2813copies of @var{files} read-only, to remind developers 2814to run the @code{cvs edit} command before working on 2815them. 2816 2817If @var{files} includes the name of a directory, CVS 2818arranges to watch all files added to the corresponding 2819repository directory, and sets a default for files 2820added in the future; this allows the user to set 2821notification policies on a per-directory basis. The 2822contents of the directory are processed recursively, 2823unless the @code{-l} option is given. 2824 2825If @var{files} is omitted, it defaults to the current directory. 2826 2827@cindex watch off (subcommand) 2828@end deffn 2829 2830@deffn Command {cvs watch off} [@code{-l}] files @dots{} 2831 2832Do not provide notification about work on @var{files}. CVS will create 2833working copies of @var{files} read-write. 2834 2835The @var{files} and @code{-l} arguments are processed as for @code{cvs 2836watch on}. 2837 2838@end deffn 2839 2840@node Getting Notified 2841@subsection Telling CVS to notify you 2842 2843You can tell @sc{cvs} that you want to receive 2844notifications about various actions taken on a file. 2845You can do this without using @code{cvs watch on} for 2846the file, but generally you will want to use @code{cvs 2847watch on}, so that developers use the @code{cvs edit} 2848command. 2849 2850@cindex watch add (subcommand) 2851@deffn Command {cvs watch add} [@code{-a} action] [@code{-l}] files @dots{} 2852 2853Add the current user to the list of people to receive notification of 2854work done on @var{files}. 2855 2856The @code{-a} option specifies what kinds of events CVS should notify 2857the user about. @var{action} is one of the following: 2858 2859@table @code 2860 2861@item edit 2862Another user has applied the @code{cvs edit} command (described 2863below) to a file. 2864 2865@item unedit 2866Another user has applied the @code{cvs unedit} command (described 2867below) or the @code{cvs release} command to a file, or has deleted 2868the file and allowed @code{cvs update} to recreate it. 2869 2870@item commit 2871Another user has committed changes to a file. 2872 2873@item all 2874All of the above. 2875 2876@item none 2877None of the above. (This is useful with @code{cvs edit}, 2878described below.) 2879 2880@end table 2881 2882The @code{-a} option may appear more than once, or not at all. If 2883omitted, the action defaults to @code{all}. 2884 2885The @var{files} and @code{-l} option are processed as for the 2886@code{cvs watch} commands. 2887 2888@end deffn 2889 2890 2891@cindex watch remove (subcommand) 2892@deffn Command {cvs watch remove} [@code{-a} action] [@code{-l}] files @dots{} 2893 2894Remove a notification request established using @code{cvs watch add}; 2895the arguments are the same. If the @code{-a} option is present, only 2896watches for the specified actions are removed. 2897 2898@end deffn 2899 2900@cindex notify (admin file) 2901When the conditions exist for notification, @sc{cvs} 2902calls the @file{notify} administrative file. Edit 2903@file{notify} as one edits the other administrative 2904files (@pxref{Intro administrative files}). This 2905file follows the usual conventions for administrative 2906files (@pxref{syntax}), where each line is a regular 2907expression followed by a command to execute. The 2908command should contain a single ocurrence of @samp{%s} 2909which will be replaced by the user to notify; the rest 2910of the information regarding the notification will be 2911supplied to the command on standard input. The 2912standard thing to put in the @code{notify} file is the 2913single line: 2914 2915@example 2916ALL mail %s -s \"CVS notification\" 2917@end example 2918 2919This causes users to be notified by electronic mail. 2920@c FIXME: should it be this hard to set up this 2921@c behavior (and the result when one fails to do so, 2922@c silent failure to notify, so non-obvious)? Should 2923@c CVS give a warning if no line in notify matches (and 2924@c document the use of "DEFAULT :" for the case where 2925@c skipping the notification is indeed desired)? 2926 2927@cindex users (admin file) 2928Note that if you set this up in the straightforward 2929way, users receive notifications on the server machine. 2930One could of course write a @file{notify} script which 2931directed notifications elsewhere, but to make this 2932easy, @sc{cvs} allows you to associate a notification 2933address for each user. To do so create a file 2934@file{users} in @file{CVSROOT} with a line for each 2935user in the format @var{user}:@var{value}. Then 2936instead of passing the name of the user to be notified 2937to @file{notify}, @sc{cvs} will pass the @var{value} 2938(normally an email address on some other machine). 2939 2940@sc{Cvs} does not notify you for your own changes. 2941Currently this check is done based on whether the user 2942name of the person taking the action which triggers 2943notification matches the user name of the person 2944getting notification. In fact, in general, the watches 2945features only track one edit by each user. It probably 2946would be more useful if watches tracked each working 2947directory separately, so this behavior might be worth 2948changing. 2949@c "behavior might be worth changing" is an effort to 2950@c point to future directions while also not promising 2951@c that "they" (as in "why don't they fix CVS to....") 2952@c will do this. 2953@c one implementation issue is identifying whether a 2954@c working directory is same or different. Comparing 2955@c pathnames/hostnames is hopeless, but having the server 2956@c supply a serial number which the client stores in the 2957@c CVS directory as a magic cookie should work. 2958 2959@node Editing files 2960@subsection How to edit a file which is being watched 2961 2962@cindex checkout, as term for getting ready to edit 2963Since a file which is being watched is checked out 2964read-only, you cannot simply edit it. To make it 2965read-write, and inform others that you are planning to 2966edit it, use the @code{cvs edit} command. Some systems 2967call this a @dfn{checkout}, but @sc{cvs} uses that term 2968for obtaining a copy of the sources (@pxref{Getting the 2969source}), an operation which those systems call a 2970@dfn{get} or a @dfn{fetch}. 2971@c Issue to think about: should we transition CVS 2972@c towards the "get" terminology? "cvs get" is already a 2973@c synonym for "cvs checkout" and that section of the 2974@c manual refers to "Getting the source". If this is 2975@c done, needs to be done gingerly (for example, we should 2976@c still accept "checkout" in .cvsrc files indefinitely 2977@c even if the CVS's messages are changed from "cvs checkout: " 2978@c to "cvs get: "). 2979 2980@cindex edit (subcommand) 2981@deffn Command {cvs edit} [options] files @dots{} 2982 2983Prepare to edit the working files @var{files}. CVS makes the 2984@var{files} read-write, and notifies users who have requested 2985@code{edit} notification for any of @var{files}. 2986 2987The @code{cvs edit} command accepts the same @var{options} as the 2988@code{cvs watch add} command, and establishes a temporary watch for the 2989user on @var{files}; CVS will remove the watch when @var{files} are 2990@code{unedit}ed or @code{commit}ted. If the user does not wish to 2991receive notifications, she should specify @code{-a none}. 2992 2993The @var{files} and @code{-l} option are processed as for the @code{cvs 2994watch} commands. 2995 2996@end deffn 2997 2998Normally when you are done with a set of changes, you 2999use the @code{cvs commit} command, which checks in your 3000changes and returns the watched files to their usual 3001read-only state. But if you instead decide to abandon 3002your changes, or not to make any changes, you can use 3003the @code{cvs unedit} command. 3004 3005@cindex unedit (subcommand) 3006@cindex abandoning work 3007@cindex reverting to repository version 3008@deffn Command {cvs unedit} [@code{-l}] files @dots{} 3009 3010Abandon work on the working files @var{files}, and revert them to the 3011repository versions on which they are based. CVS makes those 3012@var{files} read-only for which users have requested notification using 3013@code{cvs watch on}. CVS notifies users who have requested @code{unedit} 3014notification for any of @var{files}. 3015 3016The @var{files} and @code{-l} option are processed as for the 3017@code{cvs watch} commands. 3018 3019If watches are not in use, the @code{unedit} command 3020probably does not work, and the way to revert to the 3021repository version is to remove the file and then use 3022@code{cvs update} to get a new copy. The meaning is 3023not precisely the same; removing and updating may also 3024bring in some changes which have been made in the 3025repository since the last time you updated. 3026@c It would be a useful enhancement to CVS to make 3027@c unedit work in the non-watch case as well. 3028@end deffn 3029 3030When using client/server @sc{cvs}, you can use the 3031@code{cvs edit} and @code{cvs unedit} commands even if 3032@sc{cvs} is unable to succesfully communicate with the 3033server; the notifications will be sent upon the next 3034successful @sc{cvs} command. 3035 3036@node Watch information 3037@subsection Information about who is watching and editing 3038 3039@cindex watchers (subcommand) 3040@deffn Command {cvs watchers} [@code{-l}] files @dots{} 3041 3042List the users currently watching changes to @var{files}. The report 3043includes the files being watched, and the mail address of each watcher. 3044 3045The @var{files} and @code{-l} arguments are processed as for the 3046@code{cvs watch} commands. 3047 3048@end deffn 3049 3050 3051@cindex editors (subcommand) 3052@deffn Command {cvs editors} [@code{-l}] files @dots{} 3053 3054List the users currently working on @var{files}. The report 3055includes the mail address of each user, the time when the user began 3056working with the file, and the host and path of the working directory 3057containing the file. 3058 3059The @var{files} and @code{-l} arguments are processed as for the 3060@code{cvs watch} commands. 3061 3062@end deffn 3063 3064@node Watches Compatibility 3065@subsection Using watches with old versions of CVS 3066 3067@cindex CVS 1.6, and watches 3068If you use the watch features on a repository, it 3069creates @file{CVS} directories in the repository and 3070stores the information about watches in that directory. 3071If you attempt to use @sc{cvs} 1.6 or earlier with the 3072repository, you get an error message such as 3073 3074@example 3075cvs update: cannot open CVS/Entries for reading: No such file or directory 3076@end example 3077 3078and your operation will likely be aborted. To use the 3079watch features, you must upgrade all copies of @sc{cvs} 3080which use that repository in local or server mode. If 3081you cannot upgrade, use the @code{watch off} and 3082@code{watch remove} commands to remove all watches, and 3083that will restore the repository to a state which 3084@sc{cvs} 1.6 can cope with. 3085 3086@node Choosing a model 3087@section Choosing between reserved or unreserved checkouts 3088@cindex choosing, reserved or unreserved checkouts 3089 3090Reserved and unreserved checkouts each have pros and 3091cons. Let it be said that a lot of this is a matter of 3092opinion or what works given different groups' working 3093styles, but here is a brief description of some of the 3094issues. There are many ways to organize a team of 3095developers. @sc{cvs} does not try to enforce a certain 3096organization. It is a tool that can be used in several 3097ways. 3098 3099Reserved checkouts can be very counter-productive. If 3100two persons want to edit different parts of a file, 3101there may be no reason to prevent either of them from 3102doing so. Also, it is common for someone to take out a 3103lock on a file, because they are planning to edit it, 3104but then forget to release the lock. 3105 3106@c "many groups"? specifics? cites to papers on this? 3107@c some way to weasel-word it a bit more so we don't 3108@c need facts :-)? 3109People, especially people who are familiar with 3110reserved checkouts, often wonder how often conflicts 3111occur if unreserved checkouts are used, and how 3112difficult they are to resolve. The experience with 3113many groups is that they occur rarely and usually are 3114relatively straightforward to resolve. 3115 3116The rarity of serious conflicts may be surprising, until one realizes 3117that they occur only when two developers disagree on the proper design 3118for a given section of code; such a disagreement suggests that the 3119team has not been communicating properly in the first place. In order 3120to collaborate under @emph{any} source management regimen, developers 3121must agree on the general design of the system; given this agreement, 3122overlapping changes are usually straightforward to merge. 3123 3124In some cases unreserved checkouts are clearly 3125inappropriate. If no merge tool exists for the kind of 3126file you are managing (for example word processor files 3127or files edited by Computer Aided Design programs), and 3128it is not desirable to change to a program which uses a 3129mergeable data format, then resolving conflicts is 3130going to be unpleasant enough that you generally will 3131be better off to simply avoid the conflicts instead, by 3132using reserved checkouts. 3133 3134The watches features described above in @ref{Watches} 3135can be considered to be an intermediate model between 3136reserved checkouts and unreserved checkouts. When you 3137go to edit a file, it is possible to find out who else 3138is editing it. And rather than having the system 3139simply forbid both people editing the file, it can tell 3140you what the situation is and let you figure out 3141whether it is a problem in that particular case or not. 3142Therefore, for some groups it can be considered the 3143best of both the reserved checkout and unreserved 3144checkout worlds. 3145 3146@c --------------------------------------------------------------------- 3147@node Revisions and branches 3148@chapter Revisions and branches 3149@cindex Branches 3150@cindex Main trunk and branches 3151@cindex Revision tree, making branches 3152 3153For many uses of @sc{cvs}, one doesn't need to worry 3154too much about revision numbers; @sc{cvs} assigns 3155numbers such as @code{1.1}, @code{1.2}, and so on, and 3156that is all one needs to know. However, some people 3157prefer to have more knowledge and control concerning 3158how @sc{cvs} assigns revision numbers. 3159 3160If one wants to keep track of a set of revisions 3161involving more than one file, such as which revisions 3162went into a particular release, one uses a @dfn{tag}, 3163which is a symbolic revision which can be assigned to a 3164numeric revision in each file. 3165 3166Another useful feature, especially when maintaining 3167several releases of a software product at once, is the 3168ability to make branches on the revision tree. 3169@c FIXME: probably want another sentence or two, very 3170@c briefly motivating branches. 3171 3172@menu 3173* Revision numbers:: The meaning of a revision number 3174* Versions revisions releases:: Terminology used in this manual 3175* Assigning revisions:: Assigning revisions 3176* Tags:: Tags--Symbolic revisions 3177* Branches motivation:: What branches are good for 3178* Creating a branch:: Creating a branch 3179* Sticky tags:: Sticky tags 3180@end menu 3181 3182@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3183@node Revision numbers 3184@section Revision numbers 3185@cindex Revision numbers 3186@cindex Revision tree 3187@cindex Linear development 3188@cindex Number, revision- 3189@cindex Decimal revision number 3190@cindex Main trunk (intro) 3191@cindex Branch number 3192@cindex Number, branch 3193 3194Each version of a file has a unique @dfn{revision 3195number}. Revision numbers look like @samp{1.1}, 3196@samp{1.2}, @samp{1.3.2.2} or even @samp{1.3.2.2.4.5}. 3197A revision number always has an even number of 3198period-separated decimal integers. By default revision 31991.1 is the first revision of a file. Each successive 3200revision is given a new number by increasing the 3201rightmost number by one. The following figure displays 3202a few revisions, with newer revisions to the right. 3203 3204@example 3205 +-----+ +-----+ +-----+ +-----+ +-----+ 3206 ! 1.1 !----! 1.2 !----! 1.3 !----! 1.4 !----! 1.5 ! 3207 +-----+ +-----+ +-----+ +-----+ +-----+ 3208@end example 3209 3210@c Probably should move the following down a few 3211@c sections, until after "branch motivation". 3212@sc{cvs} is not limited to linear development. The 3213@dfn{revision tree} can be split into @dfn{branches}, 3214where each branch is a self-maintained line of 3215development. Changes made on one branch can easily be 3216moved back to the main trunk. 3217 3218Each branch has a @dfn{branch number}, consisting of an 3219odd number of period-separated decimal integers. The 3220branch number is created by appending an integer to the 3221revision number where the corresponding branch forked 3222off. Having branch numbers allows more than one branch 3223to be forked off from a certain revision. 3224 3225@need 3500 3226All revisions on a branch have revision numbers formed 3227by appending an ordinal number to the branch number. 3228The following figure illustrates branching with an 3229example. 3230 3231@example 3232@group 3233 +-------------+ 3234 Branch 1.2.2.3.2 -> ! 1.2.2.3.2.1 ! 3235 / +-------------+ 3236 / 3237 / 3238 +---------+ +---------+ +---------+ +---------+ 3239Branch 1.2.2 -> _! 1.2.2.1 !----! 1.2.2.2 !----! 1.2.2.3 !----! 1.2.2.4 ! 3240 / +---------+ +---------+ +---------+ +---------+ 3241 / 3242 / 3243+-----+ +-----+ +-----+ +-----+ +-----+ 3244! 1.1 !----! 1.2 !----! 1.3 !----! 1.4 !----! 1.5 ! <- The main trunk 3245+-----+ +-----+ +-----+ +-----+ +-----+ 3246 ! 3247 ! 3248 ! +---------+ +---------+ +---------+ 3249Branch 1.2.4 -> +---! 1.2.4.1 !----! 1.2.4.2 !----! 1.2.4.3 ! 3250 +---------+ +---------+ +---------+ 3251 3252@end group 3253@end example 3254 3255@c -- However, at least for me the figure is not enough. I suggest more 3256@c -- text to accompany it. "A picture is worth a thousand words", so you 3257@c -- have to make sure the reader notices the couple of hundred words 3258@c -- *you* had in mind more than the others! 3259 3260@c -- Why an even number of segments? This section implies that this is 3261@c -- how the main trunk is distinguished from branch roots, but you never 3262@c -- explicitly say that this is the purpose of the [by itself rather 3263@c -- surprising] restriction to an even number of segments. 3264 3265The exact details of how the branch number is 3266constructed is not something you normally need to be 3267concerned about, but here is how it works: When 3268@sc{cvs} creates a branch number it picks the first 3269unused even integer, starting with 2. So when you want 3270to create a branch from revision 6.4 it will be 3271numbered 6.4.2. All branch numbers ending in a zero 3272(such as 6.4.0) are used internally by @sc{cvs} 3273(@pxref{Magic branch numbers}). The branch 1.1.1 has a 3274special meaning. @xref{Tracking sources}. 3275 3276@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3277@node Versions revisions releases 3278@section Versions, revisions and releases 3279@cindex Revisions, versions and releases 3280@cindex Versions, revisions and releases 3281@cindex Releases, revisions and versions 3282 3283A file can have several versions, as described above. 3284Likewise, a software product can have several versions. 3285A software product is often given a version number such 3286as @samp{4.1.1}. 3287 3288Versions in the first sense are called @dfn{revisions} 3289in this document, and versions in the second sense are 3290called @dfn{releases}. To avoid confusion, the word 3291@dfn{version} is almost never used in this document. 3292 3293@node Assigning revisions 3294@section Assigning revisions 3295 3296@c We avoid the "major revision" terminology. It seems 3297@c like jargon. Hopefully "first number" is clear enough. 3298By default, @sc{cvs} will assign numeric revisions by 3299leaving the first number the same and incrementing the 3300second number. For example, @code{1.1}, @code{1.2}, 3301@code{1.3}, etc. 3302 3303When adding a new file, the second number will always 3304be one and the first number will equal the highest 3305first number of any file in that directory. For 3306example, the current directory contains files whose 3307highest numbered revisions are @code{1.7}, @code{3.1}, 3308and @code{4.12}, then an added file will be given the 3309numeric revision @code{4.1}. 3310 3311@c This is sort of redundant with something we said a 3312@c while ago. Somewhere we need a better way of 3313@c introducing how the first number can be anything 3314@c except "1", perhaps. Also I don't think this 3315@c presentation is clear on why we are discussing releases 3316@c and first numbers of numeric revisions in the same 3317@c breath. 3318Normally there is no reason to care 3319about the revision numbers---it is easier to treat them 3320as internal numbers that @sc{cvs} maintains, and tags 3321provide a better way to distinguish between things like 3322release 1 versus release 2 of your product 3323(@pxref{Tags}). However, if you want to set the 3324numeric revisions, the @samp{-r} option to @code{cvs 3325commit} can do that. 3326 3327For example, to bring all your files up to the @sc{rcs} 3328revision 3.0 (including those that haven't changed), 3329you might invoke: 3330 3331@c Why does this not require -f to get the "those that 3332@c haven't changed" part? That isn't clear to me. 3333@example 3334$ cvs commit -r 3.0 3335@end example 3336 3337Note that the number you specify with @samp{-r} must be 3338larger than any existing revision number. That is, if 3339revision 3.0 exists, you cannot @samp{cvs commit 3340-r 1.3}. If you want to maintain several releases in 3341parallel, you need to use a branch (@pxref{Revisions and branches}). 3342 3343@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3344@node Tags 3345@section Tags--Symbolic revisions 3346@cindex Tags 3347 3348The revision numbers live a life of their own. They 3349need not have anything at all to do with the release 3350numbers of your software product. Depending 3351on how you use @sc{cvs} the revision numbers might change several times 3352between two releases. As an example, some of the 3353source files that make up @sc{rcs} 5.6 have the following 3354revision numbers: 3355@cindex RCS revision numbers 3356 3357@example 3358ci.c 5.21 3359co.c 5.9 3360ident.c 5.3 3361rcs.c 5.12 3362rcsbase.h 5.11 3363rcsdiff.c 5.10 3364rcsedit.c 5.11 3365rcsfcmp.c 5.9 3366rcsgen.c 5.10 3367rcslex.c 5.11 3368rcsmap.c 5.2 3369rcsutil.c 5.10 3370@end example 3371 3372@cindex tag, command, introduction 3373@cindex Tag, symbolic name 3374@cindex Symbolic name (tag) 3375@cindex Name, symbolic (tag) 3376You can use the @code{tag} command to give a symbolic name to a 3377certain revision of a file. You can use the @samp{-v} flag to the 3378@code{status} command to see all tags that a file has, and 3379which revision numbers they represent. Tag names must 3380start with an uppercase or lowercase letter and can 3381contain uppercase and lowercase letters, digits, 3382@samp{-}, and @samp{_}. The two tag names @code{BASE} 3383and @code{HEAD} are reserved for use by @sc{cvs}. It 3384is expected that future names which are special to 3385@sc{cvs} will be specially named, for example by 3386starting with @samp{.}, rather than being named analogously to 3387@code{BASE} and @code{HEAD}, to avoid conflicts with 3388actual tag names. 3389@c Including a character such as % or = has also been 3390@c suggested as the naming convention for future 3391@c special tag names. Starting with . is nice because 3392@c that is not a legal tag name as far as RCS is concerned. 3393@c FIXME: CVS actually accepts quite a few characters 3394@c in tag names, not just the ones documented above 3395@c (see RCS_check_tag). RCS 3396@c defines legitimate tag names by listing illegal 3397@c characters rather than legal ones. CVS is said to lose its 3398@c mind if you try to use "/" (try making such a tag sticky 3399@c and using "cvs status" client/server--see remote 3400@c protocol format for entries line for probable cause). 3401@c TODO: The testsuite 3402@c should test for whatever are documented above as 3403@c officially-OK tag names, and CVS should at least reject 3404@c characters that won't work, like "/". 3405 3406You'll want to choose some convention for naming tags, 3407based on information such as the name of the program 3408and the version number of the release. For example, 3409one might take the name of the program, immediately 3410followed by the version number with @samp{.} changed to 3411@samp{-}, so that CVS 1.9 would be tagged with the name 3412@code{cvs1-9}. If you choose a consistent convention, 3413then you won't constantly be guessing whether a tag is 3414@code{cvs-1-9} or @code{cvs1_9} or what. You might 3415even want to consider enforcing your convention in the 3416taginfo file (@pxref{user-defined logging}). 3417@c Might be nice to say more about using taginfo this 3418@c way, like giving an example, or pointing out any particular 3419@c issues which arise. 3420 3421@cindex Adding a tag 3422@cindex tag, example 3423The following example shows how you can add a tag to a 3424file. The commands must be issued inside your working 3425copy of the module. That is, you should issue the 3426command in the directory where @file{backend.c} 3427resides. 3428 3429@example 3430$ cvs tag release-0-4 backend.c 3431T backend.c 3432$ cvs status -v backend.c 3433=================================================================== 3434File: backend.c Status: Up-to-date 3435 3436 Version: 1.4 Tue Dec 1 14:39:01 1992 3437 RCS Version: 1.4 /usr/local/cvsroot/yoyodyne/tc/backend.c,v 3438 Sticky Tag: (none) 3439 Sticky Date: (none) 3440 Sticky Options: (none) 3441 3442 Existing Tags: 3443 release-0-4 (revision: 1.4) 3444 3445@end example 3446 3447There is seldom reason to tag a file in isolation. A more common use is 3448to tag all the files that constitute a module with the same tag at 3449strategic points in the development life-cycle, such as when a release 3450is made. 3451 3452@example 3453$ cvs tag release-1-0 . 3454cvs tag: Tagging . 3455T Makefile 3456T backend.c 3457T driver.c 3458T frontend.c 3459T parser.c 3460@end example 3461 3462(When you give @sc{cvs} a directory as argument, it generally applies the 3463operation to all the files in that directory, and (recursively), to any 3464subdirectories that it may contain. @xref{Recursive behavior}.) 3465 3466@cindex Retrieving an old revision using tags 3467@cindex Tag, retrieving old revisions 3468The @code{checkout} command has a flag, @samp{-r}, that lets you check out 3469a certain revision of a module. This flag makes it easy to 3470retrieve the sources that make up release 1.0 of the module @samp{tc} at 3471any time in the future: 3472 3473@example 3474$ cvs checkout -r release-1-0 tc 3475@end example 3476 3477@noindent 3478This is useful, for instance, if someone claims that there is a bug in 3479that release, but you cannot find the bug in the current working copy. 3480 3481You can also check out a module as it was at any given date. 3482@xref{checkout options}. 3483 3484When you tag more than one file with the same tag you 3485can think about the tag as "a curve drawn through a 3486matrix of filename vs. revision number." Say we have 5 3487files with the following revisions: 3488 3489@example 3490@group 3491 file1 file2 file3 file4 file5 3492 3493 1.1 1.1 1.1 1.1 /--1.1* <-*- TAG 3494 1.2*- 1.2 1.2 -1.2*- 3495 1.3 \- 1.3*- 1.3 / 1.3 3496 1.4 \ 1.4 / 1.4 3497 \-1.5*- 1.5 3498 1.6 3499@end group 3500@end example 3501 3502At some time in the past, the @code{*} versions were tagged. 3503You can think of the tag as a handle attached to the curve 3504drawn through the tagged revisions. When you pull on 3505the handle, you get all the tagged revisions. Another 3506way to look at it is that you "sight" through a set of 3507revisions that is "flat" along the tagged revisions, 3508like this: 3509 3510@example 3511@group 3512 file1 file2 file3 file4 file5 3513 3514 1.1 3515 1.2 3516 1.1 1.3 _ 3517 1.1 1.2 1.4 1.1 / 3518 1.2*----1.3*----1.5*----1.2*----1.1 (--- <--- Look here 3519 1.3 1.6 1.3 \_ 3520 1.4 1.4 3521 1.5 3522@end group 3523@end example 3524 3525@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3526@node Branches motivation 3527@section What branches are good for 3528@cindex Branches motivation 3529@cindex What branches are good for 3530@cindex Motivation for branches 3531 3532Suppose that release 1.0 of tc has been made. You are continuing to 3533develop tc, planning to create release 1.1 in a couple of months. After a 3534while your customers start to complain about a fatal bug. You check 3535out release 1.0 (@pxref{Tags}) and find the bug 3536(which turns out to have a trivial fix). However, the current revision 3537of the sources are in a state of flux and are not expected to be stable 3538for at least another month. There is no way to make a 3539bugfix release based on the newest sources. 3540 3541The thing to do in a situation like this is to create a @dfn{branch} on 3542the revision trees for all the files that make up 3543release 1.0 of tc. You can then make 3544modifications to the branch without disturbing the main trunk. When the 3545modifications are finished you can select to either incorporate them on 3546the main trunk, or leave them on the branch. 3547 3548@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3549@node Creating a branch 3550@section Creating a branch 3551@cindex Creating a branch 3552@cindex Branch, creating a 3553@cindex rtag, creating a branch using 3554 3555@c FIXME: should be more explicit about the value of 3556@c having a tag on the branchpoint. Also should talk 3557@c about creating a branch with tag not rtag. 3558The @code{rtag} command can be used to create a branch. 3559The @code{rtag} command is much like @code{tag}, but it 3560does not require that you have a working copy of the 3561module. @xref{rtag}. (You can also use the @code{tag} 3562command; @pxref{tag}). 3563 3564@c Why does this example use -r? That seems like a 3565@c confusing thing to do in an example where we are 3566@c introducing branches. One user thought it was 3567@c a mandatory part of creating a branch for example. 3568@c And we are not sufficiently 3569@c "step by step" in terms of explaining 3570@c what argument one should give to -r. 3571@example 3572$ cvs rtag -b -r release-1-0 release-1-0-patches tc 3573@end example 3574 3575The @samp{-b} flag makes @code{rtag} create a branch 3576(rather than just a symbolic revision name). @samp{-r 3577release-1-0} says that this branch should be rooted at the node (in 3578the revision tree) that corresponds to the tag 3579@samp{release-1-0}. Note that the numeric revision number that matches 3580@samp{release-1-0} will probably be different from file to file. The 3581name of the new branch is @samp{release-1-0-patches}, and the 3582module affected is @samp{tc}. 3583 3584To fix the problem in release 1.0, you need a working 3585copy of the branch you just created. 3586 3587@example 3588$ cvs checkout -r release-1-0-patches tc 3589$ cvs status -v driver.c backend.c 3590=================================================================== 3591File: driver.c Status: Up-to-date 3592 3593 Version: 1.7 Sat Dec 5 18:25:54 1992 3594 RCS Version: 1.7 /usr/local/cvsroot/yoyodyne/tc/driver.c,v 3595 Sticky Tag: release-1-0-patches (branch: 1.7.2) 3596 Sticky Date: (none) 3597 Sticky Options: (none) 3598 3599 Existing Tags: 3600 release-1-0-patches (branch: 1.7.2) 3601 release-1-0 (revision: 1.7) 3602 3603=================================================================== 3604File: backend.c Status: Up-to-date 3605 3606 Version: 1.4 Tue Dec 1 14:39:01 1992 3607 RCS Version: 1.4 /usr/local/cvsroot/yoyodyne/tc/backend.c,v 3608 Sticky Tag: release-1-0-patches (branch: 1.4.2) 3609 Sticky Date: (none) 3610 Sticky Options: (none) 3611 3612 Existing Tags: 3613 release-1-0-patches (branch: 1.4.2) 3614 release-1-0 (revision: 1.4) 3615 release-0-4 (revision: 1.4) 3616 3617@end example 3618 3619@cindex Branch numbers 3620As the output from the @code{status} command shows the branch 3621number is created by adding a digit at the tail of the revision number 3622it is based on. (If @samp{release-1-0} corresponds to revision 1.4, the 3623branch's revision number will be 1.4.2. For obscure reasons @sc{cvs} always 3624gives branches even numbers, starting at 2. 3625@xref{Revision numbers}.). 3626 3627@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3628@node Sticky tags 3629@section Sticky tags 3630@cindex Sticky tags 3631@cindex Tags, sticky 3632@cindex Branches, sticky 3633 3634@c FIXME: make this stand alone better; many places 3635@c @xref to this node. 3636The @samp{-r release-1-0-patches} flag that was given 3637to @code{checkout} in the previous example 3638is @dfn{sticky}, that is, it will apply to subsequent commands 3639in this directory. If you commit any modifications, they are 3640committed on the branch. You can later merge the modifications into 3641the main trunk. @xref{Merging}. 3642 3643You can use the @code{status} command to see what 3644sticky tags or dates are set: 3645 3646@c FIXME: This example needs to stand alone better and it 3647@c would also better if it didn't use -v which only 3648@c clutters the output in this context. 3649@example 3650$ vi driver.c # @r{Fix the bugs} 3651$ cvs commit -m "Fixed initialization bug" driver.c 3652Checking in driver.c; 3653/usr/local/cvsroot/yoyodyne/tc/driver.c,v <-- driver.c 3654new revision: 1.7.2.1; previous revision: 1.7 3655done 3656$ cvs status -v driver.c 3657=================================================================== 3658File: driver.c Status: Up-to-date 3659 3660 Version: 1.7.2.1 Sat Dec 5 19:35:03 1992 3661 RCS Version: 1.7.2.1 /usr/local/cvsroot/yoyodyne/tc/driver.c,v 3662 Sticky Tag: release-1-0-patches (branch: 1.7.2) 3663 Sticky Date: (none) 3664 Sticky Options: (none) 3665 3666 Existing Tags: 3667 release-1-0-patches (branch: 1.7.2) 3668 release-1-0 (revision: 1.7) 3669 3670@end example 3671 3672@cindex Resetting sticky tags 3673@cindex Sticky tags, resetting 3674@cindex Deleting sticky tags 3675The sticky tags will remain on your working files until 3676you delete them with @samp{cvs update -A}. The 3677@samp{-A} option retrieves the version of the file from 3678the head of the trunk, and forgets any sticky tags, 3679dates, or options. 3680 3681@cindex sticky date 3682Sticky tags are not just for branches. For example, 3683suppose that you want to avoid updating your working 3684directory, to isolate yourself from possibly 3685destabilizing changes other people are making. You 3686can, of course, just refrain from running @code{cvs 3687update}. But if you want to avoid updating only a 3688portion of a larger tree, then sticky tags can help. 3689If you check out a certain revision (such as 1.4) it 3690will become sticky. Subsequent @code{cvs update} will 3691not retrieve the latest revision until you reset the 3692tag with @code{cvs update -A}. Likewise, use of the 3693@samp{-D} option to @code{update} or @code{checkout} 3694sets a @dfn{sticky date}, which, similarly, causes that 3695date to be used for future retrievals. 3696 3697@cindex Restoring old version of removed file 3698@cindex Resurrecting old version of dead file 3699Many times you will want to retrieve an old version of 3700a file without setting a sticky tag. The way to do 3701that is with the @samp{-p} option to @code{checkout} or 3702@code{update}, which sends the contents of the file to 3703standard output. For example, suppose you have a file 3704named @file{file1} which existed as revision 1.1, and 3705you then removed it (thus adding a dead revision 1.2). 3706Now suppose you want to add it again, with the same 3707contents it had previously. Here is how to do it: 3708 3709@example 3710$ cvs update -p -r 1.1 file1 >file1 3711=================================================================== 3712Checking out file1 3713RCS: /tmp/cvs-sanity/cvsroot/first-dir/Attic/file1,v 3714VERS: 1.1 3715*************** 3716$ cvs add file1 3717cvs add: re-adding file file1 (in place of dead revision 1.2) 3718cvs add: use 'cvs commit' to add this file permanently 3719$ cvs commit -m test 3720Checking in file1; 3721/tmp/cvs-sanity/cvsroot/first-dir/file1,v <-- file1 3722new revision: 1.3; previous revision: 1.2 3723done 3724$ 3725@end example 3726 3727@c --------------------------------------------------------------------- 3728@node Merging 3729@chapter Merging 3730@cindex Merging 3731@cindex Copying changes 3732@cindex Branches, copying changes between 3733@cindex Changes, copying between branches 3734@cindex Modifications, copying between branches 3735 3736You can include the changes made between any two 3737revisions into your working copy, by @dfn{merging}. 3738You can then commit that revision, and thus effectively 3739copy the changes onto another branch. 3740 3741@menu 3742* Merging a branch:: Merging an entire branch 3743* Merging more than once:: Merging from a branch several times 3744* Merging two revisions:: Merging differences between two revisions 3745* Merging adds and removals:: What if files are added or removed? 3746@end menu 3747 3748@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3749@node Merging a branch 3750@section Merging an entire branch 3751@cindex Merging a branch 3752@cindex -j (merging branches) 3753 3754You can merge changes made on a branch into your working copy by giving 3755the @samp{-j @var{branch}} flag to the @code{update} command. With one 3756@samp{-j @var{branch}} option it merges the changes made between the 3757point where the branch forked and newest revision on that branch (into 3758your working copy). 3759 3760@cindex Join 3761The @samp{-j} stands for ``join''. 3762 3763@cindex Branch merge example 3764@cindex Example, branch merge 3765@cindex Merge, branch example 3766Consider this revision tree: 3767 3768@example 3769+-----+ +-----+ +-----+ +-----+ 3770! 1.1 !----! 1.2 !----! 1.3 !----! 1.4 ! <- The main trunk 3771+-----+ +-----+ +-----+ +-----+ 3772 ! 3773 ! 3774 ! +---------+ +---------+ 3775Branch R1fix -> +---! 1.2.2.1 !----! 1.2.2.2 ! 3776 +---------+ +---------+ 3777@end example 3778 3779@noindent 3780The branch 1.2.2 has been given the tag (symbolic name) @samp{R1fix}. The 3781following example assumes that the module @samp{mod} contains only one 3782file, @file{m.c}. 3783 3784@example 3785$ cvs checkout mod # @r{Retrieve the latest revision, 1.4} 3786 3787$ cvs update -j R1fix m.c # @r{Merge all changes made on the branch,} 3788 # @r{i.e. the changes between revision 1.2} 3789 # @r{and 1.2.2.2, into your working copy} 3790 # @r{of the file.} 3791 3792$ cvs commit -m "Included R1fix" # @r{Create revision 1.5.} 3793@end example 3794 3795A conflict can result from a merge operation. If that 3796happens, you should resolve it before committing the 3797new revision. @xref{Conflicts example}. 3798 3799The @code{checkout} command also supports the @samp{-j @var{branch}} flag. The 3800same effect as above could be achieved with this: 3801 3802@example 3803$ cvs checkout -j R1fix mod 3804$ cvs commit -m "Included R1fix" 3805@end example 3806 3807@node Merging more than once 3808@section Merging from a branch several times 3809 3810Continuing our example, the revision tree now looks 3811like this: 3812 3813@example 3814+-----+ +-----+ +-----+ +-----+ +-----+ 3815! 1.1 !----! 1.2 !----! 1.3 !----! 1.4 !----! 1.5 ! <- The main trunk 3816+-----+ +-----+ +-----+ +-----+ +-----+ 3817 ! * 3818 ! * 3819 ! +---------+ +---------+ 3820Branch R1fix -> +---! 1.2.2.1 !----! 1.2.2.2 ! 3821 +---------+ +---------+ 3822@end example 3823 3824where the starred line represents the merge from the 3825@samp{R1fix} branch to the main trunk, as just 3826discussed. 3827 3828Now suppose that development continues on the 3829@samp{R1fix} branch: 3830 3831@example 3832+-----+ +-----+ +-----+ +-----+ +-----+ 3833! 1.1 !----! 1.2 !----! 1.3 !----! 1.4 !----! 1.5 ! <- The main trunk 3834+-----+ +-----+ +-----+ +-----+ +-----+ 3835 ! * 3836 ! * 3837 ! +---------+ +---------+ +---------+ 3838Branch R1fix -> +---! 1.2.2.1 !----! 1.2.2.2 !----! 1.2.2.3 ! 3839 +---------+ +---------+ +---------+ 3840@end example 3841 3842and then you want to merge those new changes onto the 3843main trunk. If you just use the @code{cvs update -j 3844R1fix m.c} command again, @sc{cvs} will attempt to 3845merge again the changes which you have already merged, 3846which can have undesirable side effects. 3847 3848So instead you need to specify that you only want to 3849merge the changes on the branch which have not yet been 3850merged into the trunk. To do that you specify two 3851@samp{-j} options, and @sc{cvs} merges the changes from 3852the first revision to the second revision. For 3853example, in this case the simplest way would be 3854 3855@example 3856cvs update -j 1.2.2.2 -j R1fix m.c # @r{Merge changes from 1.2.2.2 to the} 3857 # @r{head of the R1fix branch} 3858@end example 3859 3860The problem with this is that you need to specify the 38611.2.2.2 revision manually. A slightly better approach 3862might be to use the date the last merge was done: 3863 3864@example 3865cvs update -j R1fix:yesterday -j R1fix m.c 3866@end example 3867 3868Better yet, tag the R1fix branch after every merge into 3869the trunk, and then use that tag for subsequent merges: 3870 3871@example 3872cvs update -j merged_from_R1fix_to_trunk -j R1fix m.c 3873@end example 3874 3875@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3876@node Merging two revisions 3877@section Merging differences between any two revisions 3878@cindex Merging two revisions 3879@cindex Revisions, merging differences between 3880@cindex Differences, merging 3881 3882With two @samp{-j @var{revision}} flags, the @code{update} 3883(and @code{checkout}) command can merge the differences 3884between any two revisions into your working file. 3885 3886@cindex Undoing a change 3887@cindex Removing a change 3888@example 3889$ cvs update -j 1.5 -j 1.3 backend.c 3890@end example 3891 3892@noindent 3893will @emph{remove} all changes made between revision 38941.3 and 1.5. Note the order of the revisions! 3895 3896If you try to use this option when operating on 3897multiple files, remember that the numeric revisions will 3898probably be very different between the various files 3899that make up a module. You almost always use symbolic 3900tags rather than revision numbers when operating on 3901multiple files. 3902 3903@node Merging adds and removals 3904@section Merging can add or remove files 3905 3906If the changes which you are merging involve removing 3907or adding some files, @code{update -j} will reflect 3908such additions or removals. 3909 3910@c FIXME: This example needs a lot more explanation. 3911@c We also need other examples for some of the other 3912@c cases (not all--there are too many--as long as we present a 3913@c coherent general principle). 3914For example: 3915@example 3916cvs update -A 3917touch a b c 3918cvs add a b c ; cvs ci -m "added" a b c 3919cvs tag -b branchtag 3920cvs update -r branchtag 3921touch d ; cvs add d 3922rm a ; cvs rm a 3923cvs ci -m "added d, removed a" 3924cvs update -A 3925cvs update -jbranchtag 3926@end example 3927 3928@c --------------------------------------------------------------------- 3929@node Recursive behavior 3930@chapter Recursive behavior 3931@cindex Recursive (directory descending) 3932@cindex Directory, descending 3933@cindex Descending directories 3934@cindex Subdirectories 3935 3936Almost all of the subcommands of @sc{cvs} work 3937recursively when you specify a directory as an 3938argument. For instance, consider this directory 3939structure: 3940 3941@example 3942 @code{$HOME} 3943 | 3944 +--@t{tc} 3945 | | 3946 +--@t{CVS} 3947 | (internal @sc{cvs} files) 3948 +--@t{Makefile} 3949 +--@t{backend.c} 3950 +--@t{driver.c} 3951 +--@t{frontend.c} 3952 +--@t{parser.c} 3953 +--@t{man} 3954 | | 3955 | +--@t{CVS} 3956 | | (internal @sc{cvs} files) 3957 | +--@t{tc.1} 3958 | 3959 +--@t{testing} 3960 | 3961 +--@t{CVS} 3962 | (internal @sc{cvs} files) 3963 +--@t{testpgm.t} 3964 +--@t{test2.t} 3965@end example 3966 3967@noindent 3968If @file{tc} is the current working directory, the 3969following is true: 3970 3971@itemize @bullet 3972@item 3973@samp{cvs update testing} is equivalent to @samp{cvs 3974update testing/testpgm.t testing/test2.t} 3975 3976@item 3977@samp{cvs update testing man} updates all files in the 3978subdirectories 3979 3980@item 3981@samp{cvs update .} or just @samp{cvs update} updates 3982all files in the @code{tc} module 3983@end itemize 3984 3985If no arguments are given to @code{update} it will 3986update all files in the current working directory and 3987all its subdirectories. In other words, @file{.} is a 3988default argument to @code{update}. This is also true 3989for most of the @sc{cvs} subcommands, not only the 3990@code{update} command. 3991 3992The recursive behavior of the @sc{cvs} subcommands can be 3993turned off with the @samp{-l} option. 3994 3995@example 3996$ cvs update -l # @r{Don't update files in subdirectories} 3997@end example 3998 3999@c --------------------------------------------------------------------- 4000@node Adding files 4001@chapter Adding files to a directory 4002@cindex Adding files 4003 4004To add a new file to a directory, follow these steps. 4005 4006@itemize @bullet 4007@item 4008You must have a working copy of the directory. 4009@xref{Getting the source}. 4010 4011@item 4012Create the new file inside your working copy of the directory. 4013 4014@item 4015Use @samp{cvs add @var{filename}} to tell @sc{cvs} that you 4016want to version control the file. If the file contains 4017binary data, specify @samp{-kb} (@pxref{Binary files}). 4018 4019@item 4020Use @samp{cvs commit @var{filename}} to actually check 4021in the file into the repository. Other developers 4022cannot see the file until you perform this step. 4023@end itemize 4024 4025You can also use the @code{add} command to add a new 4026directory. 4027@c FIXCVS and/or FIXME: Adding a directory doesn't 4028@c require the commit step. This probably can be 4029@c considered a CVS bug, but it is possible we should 4030@c warn people since this behavior probably won't be 4031@c changing right away. 4032 4033Unlike most other commands, the @code{add} command is 4034not recursive. You cannot even type @samp{cvs add 4035foo/bar}! Instead, you have to 4036@c FIXCVS: This is, of course, not a feature. It is 4037@c just that noone has gotten around to fixing "cvs add 4038@c foo/bar". 4039 4040@example 4041$ cd foo 4042$ cvs add bar 4043@end example 4044 4045@cindex add (subcommand) 4046@deffn Command {cvs add} [@code{-k} kflag] [@code{-m} message] files @dots{} 4047 4048Schedule @var{files} to be added to the repository. 4049The files or directories specified with @code{add} must 4050already exist in the current directory. To add a whole 4051new directory hierarchy to the source repository (for 4052example, files received from a third-party vendor), use 4053the @code{import} command instead. @xref{import}. 4054 4055The added files are not placed in the source repository 4056until you use @code{commit} to make the change 4057permanent. Doing an @code{add} on a file that was 4058removed with the @code{remove} command will undo the 4059effect of the @code{remove}, unless a @code{commit} 4060command intervened. @xref{Removing files}, for an 4061example. 4062 4063The @samp{-k} option specifies the default way that 4064this file will be checked out; for more information see 4065@ref{Substitution modes}. 4066 4067@c As noted in BUGS, -m is broken client/server (Nov 4068@c 96). Also see testsuite log2-* tests. 4069The @samp{-m} option specifies a description for the 4070file. This description appears in the history log (if 4071it is enabled, @pxref{history file}). It will also be 4072saved in the version history inside the repository when 4073the file is committed. The @code{log} command displays 4074this description. The description can be changed using 4075@samp{admin -t}. @xref{admin}. If you omit the 4076@samp{-m @var{description}} flag, an empty string will 4077be used. You will not be prompted for a description. 4078@end deffn 4079 4080For example, the following commands add the file 4081@file{backend.c} to the repository: 4082 4083@c This example used to specify 4084@c -m "Optimizer and code generation passes." 4085@c to the cvs add command, but that doesn't work 4086@c client/server (see log2 in sanity.sh). Should fix CVS, 4087@c but also seems strange to document things which 4088@c don't work... 4089@example 4090$ cvs add backend.c 4091$ cvs commit -m "Early version. Not yet compilable." backend.c 4092@end example 4093 4094When you add a file it is added only on the branch 4095which you are working on (@pxref{Revisions and branches}). You can 4096later merge the additions to another branch if you want 4097(@pxref{Merging adds and removals}). 4098@c Should we mention that earlier versions of CVS 4099@c lacked this feature (1.3) or implemented it in a buggy 4100@c way (well, 1.8 had many bugs in cvs update -j)? 4101@c Should we mention the bug/limitation regarding a 4102@c file being a regular file on one branch and a directory 4103@c on another? 4104@c FIXME: This needs an example, or several, here or 4105@c elsewhere, for it to make much sense. 4106@c Somewhere we need to discuss the aspects of death 4107@c support which don't involve branching, I guess. 4108@c Like the ability to re-create a release from a tag. 4109 4110@c --------------------------------------------------------------------- 4111@node Removing files 4112@chapter Removing files 4113@cindex Removing files 4114@cindex Deleting files 4115 4116Modules change. New files are added, and old files 4117disappear. Still, you want to be able to retrieve an 4118exact copy of old releases. 4119 4120Here is what you can do to remove a file, 4121but remain able to retrieve old revisions: 4122 4123@itemize @bullet 4124@c FIXME: should probably be saying something about 4125@c having a working directory in the first place. 4126@item 4127Make sure that you have not made any uncommitted 4128modifications to the file. @xref{Viewing differences}, 4129for one way to do that. You can also use the 4130@code{status} or @code{update} command. If you remove 4131the file without committing your changes, you will of 4132course not be able to retrieve the file as it was 4133immediately before you deleted it. 4134 4135@item 4136Remove the file from your working copy of the directory. 4137You can for instance use @code{rm}. 4138 4139@item 4140Use @samp{cvs remove @var{filename}} to tell @sc{cvs} that 4141you really want to delete the file. 4142 4143@item 4144Use @samp{cvs commit @var{filename}} to actually 4145perform the removal of the file from the repository. 4146@end itemize 4147 4148When you commit the removal of the file, @sc{cvs} 4149records the fact that the file no longer exists. It is 4150possible for a file to exist on only some branches and 4151not on others, or to re-add another file with the same 4152name later. CVS will correctly create or not create 4153the file, based on the @samp{-r} and @samp{-D} options 4154specified to @code{checkout} or @code{update}. 4155 4156@cindex Remove (subcommand) 4157@deffn Command {cvs remove} [@code{-lR}] files @dots{} 4158 4159Schedule file(s) to be removed from the repository 4160(files which have not already been removed from the 4161working directory are not processed). This command 4162does not actually remove the file from the repository 4163until you commit the removal. The @samp{-R} option 4164(the default) specifies that it will recurse into 4165subdirectories; @samp{-l} specifies that it will not. 4166@end deffn 4167 4168Here is an example of removing several files: 4169 4170@example 4171$ cd test 4172$ rm ?.c 4173$ cvs remove 4174cvs remove: Removing . 4175cvs remove: scheduling a.c for removal 4176cvs remove: scheduling b.c for removal 4177cvs remove: use 'cvs commit' to remove these files permanently 4178$ cvs ci -m "Removed unneeded files" 4179cvs commit: Examining . 4180cvs commit: Committing . 4181@end example 4182 4183If you change your mind you can easily resurrect the 4184file before you commit it, using the @code{add} 4185command. 4186 4187@example 4188$ ls 4189CVS ja.h oj.c 4190$ rm oj.c 4191$ cvs remove oj.c 4192cvs remove: scheduling oj.c for removal 4193cvs remove: use 'cvs commit' to remove this file permanently 4194$ cvs add oj.c 4195U oj.c 4196cvs add: oj.c, version 1.1.1.1, resurrected 4197@end example 4198 4199If you realize your mistake before you run the 4200@code{remove} command you can use @code{update} to 4201resurrect the file: 4202 4203@example 4204$ rm oj.c 4205$ cvs update oj.c 4206cvs update: warning: oj.c was lost 4207U oj.c 4208@end example 4209 4210When you remove a file it is removed only on the branch 4211which you are working on (@pxref{Revisions and branches}). You can 4212later merge the removals to another branch if you want 4213(@pxref{Merging adds and removals}). 4214 4215@node Removing directories 4216@chapter Removing directories 4217@cindex removing directories 4218@cindex directories, removing 4219 4220In concept removing directories is somewhat similar to 4221removing files---you want the directory to not exist in 4222your current working directories, but you also want to 4223be able to retrieve old releases in which the directory 4224existed. 4225 4226The way that you remove a directory is to remove all 4227the files in it. Then specify the @samp{-P} option to 4228@code{cvs update}, @code{cvs checkout}, or @code{cvs 4229export}, which will cause @sc{cvs} to remove empty 4230directories from working directories. Probably the 4231best way to do this is to always specify @samp{-P}; if 4232you want an empty directory then put a dummy file (for 4233example @file{.keepme}) in it to prevent @samp{-P} from 4234removing it. 4235 4236@c I'd try to give a rationale for this, but I'm not 4237@c sure there is a particularly convincing one. What 4238@c we would _like_ is for CVS to do a better job of version 4239@c controlling whether directories exist, to eliminate the 4240@c need for -P and so that a file can be a directory in 4241@c one revision and a regular file in another. 4242Note that @samp{-P} is implied by the @samp{-r} or @samp{-D} 4243options of @code{checkout} and @code{export}. This way 4244@sc{cvs} will be able to correctly create the directory 4245or not depending on whether the particular version you 4246are checking out contains any files in that directory. 4247 4248@c --------------------------------------------------------------------- 4249@node Tracking sources 4250@chapter Tracking third-party sources 4251@cindex Third-party sources 4252@cindex Tracking sources 4253 4254@c FIXME: Need discussion of added and removed files. 4255If you modify a program to better fit your site, you 4256probably want to include your modifications when the next 4257release of the program arrives. @sc{cvs} can help you with 4258this task. 4259 4260@cindex Vendor 4261@cindex Vendor branch 4262@cindex Branch, vendor- 4263In the terminology used in @sc{cvs}, the supplier of the 4264program is called a @dfn{vendor}. The unmodified 4265distribution from the vendor is checked in on its own 4266branch, the @dfn{vendor branch}. @sc{cvs} reserves branch 42671.1.1 for this use. 4268 4269When you modify the source and commit it, your revision 4270will end up on the main trunk. When a new release is 4271made by the vendor, you commit it on the vendor branch 4272and copy the modifications onto the main trunk. 4273 4274Use the @code{import} command to create and update 4275the vendor branch. After a successful @code{import} 4276the vendor branch is made the `head' revision, so 4277anyone that checks out a copy of the file gets that 4278revision. When a local modification is committed it is 4279placed on the main trunk, and made the `head' 4280revision. 4281 4282@menu 4283* First import:: Importing a module for the first time 4284* Update imports:: Updating a module with the import command 4285* Reverting local changes:: Reverting a module to the latest vendor release 4286* Binary files in imports:: Binary files require special handling 4287@end menu 4288 4289@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4290@node First import 4291@section Importing a module for the first time 4292@cindex Importing modules 4293 4294@c Should mention naming conventions for vendor tags, 4295@c release tags, and perhaps directory names. 4296Use the @code{import} command to check in the sources 4297for the first time. When you use the @code{import} 4298command to track third-party sources, the @dfn{vendor 4299tag} and @dfn{release tags} are useful. The 4300@dfn{vendor tag} is a symbolic name for the branch 4301(which is always 1.1.1, unless you use the @samp{-b 4302@var{branch}} flag---@xref{import options}.). The 4303@dfn{release tags} are symbolic names for a particular 4304release, such as @samp{FSF_0_04}. 4305 4306@c I'm not completely sure this belongs here. But 4307@c we need to say it _somewhere_ reasonably obvious; it 4308@c is a common misconception among people first learning CVS 4309Note that @code{import} does @emph{not} change the 4310directory in which you invoke it. In particular, it 4311does not set up that directory as a @sc{cvs} working 4312directory; if you want to work with the sources import 4313them first and then check them out into a different 4314directory (@pxref{Getting the source}). 4315 4316@cindex Wdiff (import example) 4317Suppose you have the sources to a program called 4318@code{wdiff} in a directory called @file{wdiff-0.04}, 4319and are going to make private modifications that you 4320want to be able to use even when new releases are made 4321in the future. You start by importing the source to 4322your repository: 4323 4324@example 4325$ cd wdiff-0.04 4326$ cvs import -m "Import of FSF v. 0.04" fsf/wdiff FSF_DIST WDIFF_0_04 4327@end example 4328 4329The vendor tag is named @samp{FSF_DIST} in the above 4330example, and the only release tag assigned is 4331@samp{WDIFF_0_04}. 4332@c FIXME: Need to say where fsf/wdiff comes from. 4333 4334@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4335@node Update imports 4336@section Updating a module with the import command 4337 4338When a new release of the source arrives, you import it into the 4339repository with the same @code{import} command that you used to set up 4340the repository in the first place. The only difference is that you 4341specify a different release tag this time. 4342 4343@example 4344$ tar xfz wdiff-0.05.tar.gz 4345$ cd wdiff-0.05 4346$ cvs import -m "Import of FSF v. 0.05" fsf/wdiff FSF_DIST WDIFF_0_05 4347@end example 4348 4349For files that have not been modified locally, the newly created 4350revision becomes the head revision. If you have made local 4351changes, @code{import} will warn you that you must merge the changes 4352into the main trunk, and tell you to use @samp{checkout -j} to do so. 4353 4354@example 4355$ cvs checkout -jFSF_DIST:yesterday -jFSF_DIST wdiff 4356@end example 4357 4358@noindent 4359The above command will check out the latest revision of 4360@samp{wdiff}, merging the changes made on the vendor branch @samp{FSF_DIST} 4361since yesterday into the working copy. If any conflicts arise during 4362the merge they should be resolved in the normal way (@pxref{Conflicts 4363example}). Then, the modified files may be committed. 4364 4365Using a date, as suggested above, assumes that you do 4366not import more than one release of a product per 4367day. If you do, you can always use something like this 4368instead: 4369 4370@example 4371$ cvs checkout -jWDIFF_0_04 -jWDIFF_0_05 wdiff 4372@end example 4373 4374@noindent 4375In this case, the two above commands are equivalent. 4376 4377@node Reverting local changes 4378@section Reverting to the latest vendor release 4379 4380You can also revert local changes completely and return 4381to the latest vendor release by changing the `head' 4382revision back to the vendor branch on all files. For 4383example, if you have a checked-out copy of the sources 4384in @file{~/work.d/wdiff}, and you want to revert to the 4385vendor's version for all the files in that directory, 4386you would type: 4387 4388@example 4389$ cd ~/work.d/wdiff 4390$ cvs admin -bWDIFF . 4391@end example 4392 4393@noindent 4394You must specify the @samp{-bWDIFF} without any space 4395after the @samp{-b}. @xref{admin options}. 4396 4397@node Binary files in imports 4398@section How to handle binary files with cvs import 4399 4400Use the @samp{-k} wrapper option to tell import which 4401files are binary. @xref{Wrappers}. 4402 4403@c --------------------------------------------------------------------- 4404@node Moving files 4405@chapter Moving and renaming files 4406@cindex Moving files 4407@cindex Renaming files 4408@cindex Files, moving 4409 4410Moving files to a different directory or renaming them 4411is not difficult, but some of the ways in which this 4412works may be non-obvious. (Moving or renaming a 4413directory is even harder. @xref{Moving directories}.). 4414 4415The examples below assume that the file @var{old} is renamed to 4416@var{new}. 4417 4418@menu 4419* Outside:: The normal way to Rename 4420* Inside:: A tricky, alternative way 4421* Rename by copying:: Another tricky, alternative way 4422@end menu 4423 4424@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4425@node Outside 4426@section The Normal way to Rename 4427 4428@c More rename issues. Not sure whether these are 4429@c worth documenting; I'm putting them here because 4430@c it seems to be as good a place as any to try to 4431@c set down the issues. 4432@c * "cvs annotate" will annotate either the new 4433@c file or the old file; it cannot annotate _each 4434@c line_ based on whether it was last changed in the 4435@c new or old file. Unlike "cvs log", where the 4436@c consequences of having to select either the new 4437@c or old name seem fairly benign, this may be a 4438@c real advantage to having CVS know about renames 4439@c other than as a deletion and an addition. 4440 4441The normal way to move a file is to copy @var{old} to 4442@var{new}, and then issue the normal @sc{cvs} commands 4443to remove @var{old} from the repository, and add 4444@var{new} to it. (Both @var{old} and @var{new} could 4445contain relative paths, for example @file{foo/bar.c}). 4446 4447@example 4448$ mv @var{old} @var{new} 4449$ cvs remove @var{old} 4450$ cvs add @var{new} 4451$ cvs commit -m "Renamed @var{old} to @var{new}" @var{old} @var{new} 4452@end example 4453 4454This is the simplest way to move a file, it is not 4455error-prone, and it preserves the history of what was 4456done. Note that to access the history of the file you 4457must specify the old or the new name, depending on what 4458portion of the history you are accessing. For example, 4459@code{cvs log @var{old}} will give the log up until the 4460time of the rename. 4461 4462When @var{new} is committed its revision numbers will 4463start at 1.0 again, so if that bothers you, use the 4464@samp{-r rev} option to commit (@pxref{commit options}) 4465 4466@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4467@node Inside 4468@section Moving the history file 4469 4470This method is more dangerous, since it involves moving 4471files inside the repository. Read this entire section 4472before trying it out! 4473 4474@example 4475$ cd $CVSROOT/@var{module} 4476$ mv @var{old},v @var{new},v 4477@end example 4478 4479@noindent 4480Advantages: 4481 4482@itemize @bullet 4483@item 4484The log of changes is maintained intact. 4485 4486@item 4487The revision numbers are not affected. 4488@end itemize 4489 4490@noindent 4491Disadvantages: 4492 4493@itemize @bullet 4494@item 4495Old releases of the module cannot easily be fetched from the 4496repository. (The file will show up as @var{new} even 4497in revisions from the time before it was renamed). 4498 4499@item 4500There is no log information of when the file was renamed. 4501 4502@item 4503Nasty things might happen if someone accesses the history file 4504while you are moving it. Make sure no one else runs any of the @sc{cvs} 4505commands while you move it. 4506@end itemize 4507 4508@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4509@node Rename by copying 4510@section Copying the history file 4511 4512This way also involves direct modifications to the 4513repository. It is safe, but not without drawbacks. 4514 4515@example 4516# @r{Copy the @sc{rcs} file inside the repository} 4517$ cd $CVSROOT/@var{module} 4518$ cp @var{old},v @var{new},v 4519# @r{Remove the old file} 4520$ cd ~/@var{module} 4521$ rm @var{old} 4522$ cvs remove @var{old} 4523$ cvs commit @var{old} 4524# @r{Remove all tags from @var{new}} 4525$ cvs update @var{new} 4526$ cvs log @var{new} # @r{Remember the non-branch tag names} 4527$ cvs tag -d @var{tag1} @var{new} 4528$ cvs tag -d @var{tag2} @var{new} 4529@dots{} 4530@end example 4531 4532By removing the tags you will be able to check out old 4533revisions of the module. 4534 4535@noindent 4536Advantages: 4537 4538@itemize @bullet 4539@item 4540@c FIXME: Is this true about -D now that we have death 4541@c support? See 5B.3 in the FAQ. 4542Checking out old revisions works correctly, as long as 4543you use @samp{-r@var{tag}} and not @samp{-D@var{date}} 4544to retrieve the revisions. 4545 4546@item 4547The log of changes is maintained intact. 4548 4549@item 4550The revision numbers are not affected. 4551@end itemize 4552 4553@noindent 4554Disadvantages: 4555 4556@itemize @bullet 4557@item 4558You cannot easily see the history of the file across the rename. 4559 4560@item 4561Unless you use the @samp{-r rev} (@pxref{commit 4562options}) flag when @var{new} is committed its revision 4563numbers will start at 1.0 again. 4564@end itemize 4565 4566@c --------------------------------------------------------------------- 4567@node Moving directories 4568@chapter Moving and renaming directories 4569@cindex Moving directories 4570@cindex Renaming directories 4571@cindex Directories, moving 4572 4573The normal way to rename or move a directory is to 4574rename or move each file within it as described in 4575@ref{Outside}. Then check out with the @samp{-P} 4576option, as described in @ref{Removing directories}. 4577 4578If you really want to hack the repository to rename or 4579delete a directory in the repository, you can do it 4580like this: 4581 4582@enumerate 4583@item 4584Inform everyone who has a copy of the module that the 4585directory will be renamed. They should commit all 4586their changes, and remove their working copies of the 4587module, before you take the steps below. 4588 4589@item 4590Rename the directory inside the repository. 4591 4592@example 4593$ cd $CVSROOT/@var{module} 4594$ mv @var{old-dir} @var{new-dir} 4595@end example 4596 4597@item 4598Fix the @sc{cvs} administrative files, if necessary (for 4599instance if you renamed an entire module). 4600 4601@item 4602Tell everyone that they can check out the module and continue 4603working. 4604 4605@end enumerate 4606 4607If someone had a working copy of the module the @sc{cvs} commands will 4608cease to work for him, until he removes the directory 4609that disappeared inside the repository. 4610 4611It is almost always better to move the files in the 4612directory instead of moving the directory. If you move the 4613directory you are unlikely to be able to retrieve old 4614releases correctly, since they probably depend on the 4615name of the directories. 4616 4617@c --------------------------------------------------------------------- 4618@node History browsing 4619@chapter History browsing 4620@cindex History browsing 4621@cindex Traceability 4622@cindex Isolation 4623 4624@ignore 4625@c This is too long for an introduction (goal is 4626@c one 20x80 character screen), and also mixes up a 4627@c variety of issues (parallel development, history, 4628@c maybe even touches on process control). 4629 4630@c -- @quote{To lose ones history is to lose ones soul.} 4631@c -- /// 4632@c -- ///Those who cannot remember the past are condemned to repeat it. 4633@c -- /// -- George Santayana 4634@c -- /// 4635 4636@sc{cvs} tries to make it easy for a group of people to work 4637together. This is done in two ways: 4638 4639@itemize @bullet 4640@item 4641Isolation---You have your own working copy of the 4642source. You are not affected by modifications made by 4643others until you decide to incorporate those changes 4644(via the @code{update} command---@pxref{update}). 4645 4646@item 4647Traceability---When something has changed, you can 4648always see @emph{exactly} what changed. 4649@end itemize 4650 4651There are several features of @sc{cvs} that together lead 4652to traceability: 4653 4654@itemize @bullet 4655@item 4656Each revision of a file has an accompanying log 4657message. 4658 4659@item 4660All commits are optionally logged to a central history 4661database. 4662 4663@item 4664Logging information can be sent to a user-defined 4665program (@pxref{loginfo}). 4666@end itemize 4667 4668@c -- More text here. 4669 4670This chapter should talk about the history file, the 4671@code{log} command, the usefulness of ChangeLogs 4672even when you run @sc{cvs}, and things like that. 4673 4674@end ignore 4675 4676@c kind of lame, in a lot of ways the above text inside 4677@c the @ignore motivates this chapter better 4678Once you have used @sc{cvs} to store a version control 4679history---what files have changed when, how, and by 4680whom, there are a variety of mechanisms for looking 4681through the history. 4682 4683@menu 4684* log messages:: Log messages 4685* history database:: The history database 4686* user-defined logging:: User-defined logging 4687* annotate:: What revision modified each line of a file? 4688@end menu 4689 4690@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4691@node log messages 4692@section Log messages 4693 4694@c FIXME: @xref to place where we talk about how to 4695@c specify message to commit. 4696Whenever you commit a file you specify a log message. 4697 4698@c FIXME: bring the information here, and get rid of or 4699@c greatly shrink the "log" node. 4700To look through the log messages which have been 4701specified for every revision which has been committed, 4702use the @code{cvs log} command (@pxref{log}). 4703 4704@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4705@node history database 4706@section The history database 4707 4708@c FIXME: bring the information from the history file 4709@c and history nodes here. Rewrite it to be motivated 4710@c better (start out by clearly explaining what gets 4711@c logged in history, for example). 4712You can use the history file (@pxref{history file}) to 4713log various @sc{cvs} actions. To retrieve the 4714information from the history file, use the @code{cvs 4715history} command (@pxref{history}). 4716 4717@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4718@node user-defined logging 4719@section User-defined logging 4720 4721@c FIXME: should probably also mention the fact the -l 4722@c global option can disable most of the mechanisms 4723@c discussed here (why? What is the -l global option for?). 4724@c 4725@c FIXME: probably should centralize this information 4726@c here, at least to some extent. Maybe by moving the 4727@c loginfo, etc., nodes here and replacing 4728@c the "user-defined logging" node with one node for 4729@c each method. 4730You can customize @sc{cvs} to log various kinds of 4731actions, in whatever manner you choose. These 4732mechanisms operate by executing a script at various 4733times. The script might append a message to a file 4734listing the information and the programmer who created 4735it, or send mail to a group of developers, or, perhaps, 4736post a message to a particular newsgroup. To log 4737commits, use the @file{loginfo} file (@pxref{loginfo}). 4738@c FIXME: What is difference between doing it in the 4739@c modules file and using loginfo/taginfo? Why should 4740@c user use one or the other? 4741To log commits, checkouts, exports, and tags, 4742respectively, you can also use the @samp{-i}, 4743@samp{-o}, @samp{-e}, and @samp{-t} options in the 4744modules file. For a more flexible way of giving 4745notifications to various users, which requires less in 4746the way of keeping centralized scripts up to date, use 4747the @code{cvs watch add} command (@pxref{Getting 4748Notified}); this command is useful even if you are not 4749using @code{cvs watch on}. 4750 4751@cindex taginfo 4752The @file{taginfo} file defines programs to execute 4753when someone executes a @code{tag} or @code{rtag} 4754command. The @file{taginfo} file has the standard form 4755for administrative files (@pxref{Administrative 4756files}), where each line is a regular expression 4757followed by a command to execute. The arguments passed 4758to the command are, in order, the @var{tagname}, 4759@var{operation} (@code{add} for @code{tag}, 4760@code{mov} for @code{tag -F}, and @code{del} for 4761@code{tag -d}), @var{repository}, and any remaining are 4762pairs of @var{filename} @var{revision}. A non-zero 4763exit of the filter program will cause the tag to be 4764aborted. 4765 4766@node annotate 4767@section Annotate command 4768@cindex annotate (subcommand) 4769 4770@deffn Command {cvs annotate} [@code{-lf}] [@code{-r rev}|@code{-D date}] files @dots{} 4771 4772For each file in @var{files}, print the head revision 4773of the trunk, together with information on the last 4774modification for each line. For example: 4775 4776@example 4777$ cvs annotate ssfile 4778Annotations for ssfile 4779*************** 47801.1 (mary 27-Mar-96): ssfile line 1 47811.2 (joe 28-Mar-96): ssfile line 2 4782@end example 4783 4784The file @file{ssfile} currently contains two lines. 4785The @code{ssfile line 1} line was checked in by 4786@code{mary} on March 27. Then, on March 28, @code{joe} 4787added a line @code{ssfile line 2}, without modifying 4788the @code{ssfile line 1} line. This report doesn't 4789tell you anything about lines which have been deleted 4790or replaced; you need to use @code{cvs diff} for that 4791(@pxref{diff}). 4792 4793@end deffn 4794 4795The options to @code{cvs annotate} are listed in 4796@ref{Invoking CVS}, and can be used to select the files 4797and revisions to annotate. The options are described 4798in more detail in @ref{Common options}. 4799 4800@c FIXME: maybe an example using the options? Just 4801@c what it means to select a revision might be worth a 4802@c few words of explanation ("you want to see who 4803@c changed this line *before* 1.4"...). 4804 4805@c --------------------------------------------------------------------- 4806@node Keyword substitution 4807@chapter Keyword substitution 4808@cindex Keyword substitution 4809@cindex Keyword expansion 4810@cindex Identifying files 4811 4812@comment Be careful when editing this chapter. 4813@comment Remember that this file is kept under 4814@comment version control, so we must not accidentally 4815@comment include a valid keyword in the running text. 4816 4817As long as you edit source files inside your working 4818copy of a module you can always find out the state of 4819your files via @samp{cvs status} and @samp{cvs log}. 4820But as soon as you export the files from your 4821development environment it becomes harder to identify 4822which revisions they are. 4823 4824@sc{Rcs} uses a mechanism known as @dfn{keyword 4825substitution} (or @dfn{keyword expansion}) to help 4826identifying the files. Embedded strings of the form 4827@code{$@var{keyword}$} and 4828@code{$@var{keyword}:@dots{}$} in a file are replaced 4829with strings of the form 4830@code{$@var{keyword}:@var{value}$} whenever you obtain 4831a new revision of the file. 4832 4833@menu 4834* Keyword list:: RCS Keywords 4835* Using keywords:: Using keywords 4836* Avoiding substitution:: Avoiding substitution 4837* Substitution modes:: Substitution modes 4838* Log keyword:: Problems with the $@asis{}Log$ keyword. 4839@end menu 4840 4841@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4842@node Keyword list 4843@section RCS Keywords 4844@cindex RCS keywords 4845 4846This is a list of the keywords that @sc{rcs} currently 4847(in release 5.6.0.1) supports: 4848 4849@table @code 4850@cindex Author keyword 4851@item $@asis{Author}$ 4852The login name of the user who checked in the revision. 4853 4854@cindex Date keyword 4855@item $@asis{Date}$ 4856The date and time (UTC) the revision was checked in. 4857 4858@cindex Header keyword 4859@item $@asis{Header}$ 4860A standard header containing the full pathname of the 4861@sc{rcs} file, the revision number, the date (UTC), the 4862author, the state, and the locker (if locked). Files 4863will normally never be locked when you use @sc{cvs}. 4864 4865@cindex Id keyword 4866@item $@asis{Id}$ 4867Same as @code{$@asis{Header}$}, except that the @sc{rcs} 4868filename is without a path. 4869 4870@cindex Name keyword 4871@item $@asis{Name}$ 4872Tag name used to check out this file. 4873@c FIXME: should supply an example (e.g. "if you use 4874@c "cvs update -r foo" then Name expands to "foo"). Also 4875@c should add Name to testsuite (best way to ensure 4876@c that the example is correct!) 4877 4878@cindex Locker keyword 4879@item $@asis{Locker}$ 4880The login name of the user who locked the revision 4881(empty if not locked, and thus almost always useless 4882when you are using @sc{cvs}). 4883 4884@cindex Log keyword 4885@item $@asis{Log}$ 4886The log message supplied during commit, preceded by a 4887header containing the @sc{rcs} filename, the revision 4888number, the author, and the date (UTC). Existing log 4889messages are @emph{not} replaced. Instead, the new log 4890message is inserted after @code{$@asis{Log:@dots{}}$}. 4891Each new line is prefixed with a @dfn{comment leader} 4892which @sc{rcs} guesses from the file name extension. 4893It can be changed with @code{cvs admin -c}. 4894@xref{admin options}. This keyword is useful for 4895accumulating a complete change log in a source file, 4896but for several reasons it can be problematic. 4897@xref{Log keyword}. 4898 4899@cindex RCSfile keyword 4900@item $@asis{RCSfile}$ 4901The name of the RCS file without a path. 4902 4903@cindex Revision keyword 4904@item $@asis{Revision}$ 4905The revision number assigned to the revision. 4906 4907@cindex Source keyword 4908@item $@asis{Source}$ 4909The full pathname of the RCS file. 4910 4911@cindex State keyword 4912@item $@asis{State}$ 4913The state assigned to the revision. States can be 4914assigned with @code{cvs admin -s}---@xref{admin options}. 4915 4916@end table 4917 4918@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4919@node Using keywords 4920@section Using keywords 4921 4922To include a keyword string you simply include the 4923relevant text string, such as @code{$@asis{Id}$}, inside the 4924file, and commit the file. @sc{cvs} will automatically 4925expand the string as part of the commit operation. 4926 4927@need 800 4928It is common to embed @code{$@asis{}Id$} string in the 4929C source code. This example shows the first few lines 4930of a typical file, after keyword substitution has been 4931performed: 4932 4933@example 4934static char *rcsid="$@asis{}Id: samp.c,v 1.5 1993/10/19 14:57:32 ceder Exp $"; 4935/* @r{The following lines will prevent @code{gcc} version 2.@var{x}} 4936 @r{from issuing an "unused variable" warning}. */ 4937#if __GNUC__ == 2 4938#define USE(var) static void * use_##var = (&use_##var, (void *) &var) 4939USE (rcsid); 4940#endif 4941@end example 4942 4943Even though a clever optimizing compiler could remove 4944the unused variable @code{rcsid}, most compilers tend 4945to include the string in the binary. Some compilers 4946have a @code{#pragma} directive to include literal text 4947in the binary. 4948 4949@cindex Ident (shell command) 4950The @code{ident} command (which is part of the @sc{rcs} 4951package) can be used to extract keywords and their 4952values from a file. This can be handy for text files, 4953but it is even more useful for extracting keywords from 4954binary files. 4955 4956@example 4957$ ident samp.c 4958samp.c: 4959 $@asis{}Id: samp.c,v 1.5 1993/10/19 14:57:32 ceder Exp $ 4960$ gcc samp.c 4961$ ident a.out 4962a.out: 4963 $@asis{}Id: samp.c,v 1.5 1993/10/19 14:57:32 ceder Exp $ 4964@end example 4965 4966@cindex What (shell command) 4967S@sc{ccs} is another popular revision control system. 4968It has a command, @code{what}, which is very similar to 4969@code{ident} and used for the same purpose. Many sites 4970without @sc{rcs} have @sc{sccs}. Since @code{what} 4971looks for the character sequence @code{@@(#)} it is 4972easy to include keywords that are detected by either 4973command. Simply prefix the @sc{rcs} keyword with the 4974magic @sc{sccs} phrase, like this: 4975 4976@example 4977static char *id="@@(#) $@asis{}Id: ab.c,v 1.5 1993/10/19 14:57:32 ceder Exp $"; 4978@end example 4979 4980@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4981@node Avoiding substitution 4982@section Avoiding substitution 4983 4984Keyword substitution has its disadvantages. Sometimes 4985you might want the literal text string 4986@samp{$@asis{}Author$} to appear inside a file without 4987@sc{rcs} interpreting it as a keyword and expanding it 4988into something like @samp{$@asis{}Author: ceder $}. 4989 4990There is unfortunately no way to selectively turn off 4991keyword substitution. You can use @samp{-ko} 4992(@pxref{Substitution modes}) to turn off keyword 4993substitution entirely. 4994 4995In many cases you can avoid using @sc{rcs} keywords in 4996the source, even though they appear in the final 4997product. For example, the source for this manual 4998contains @samp{$@@asis@{@}Author$} whenever the text 4999@samp{$@asis{}Author$} should appear. In @code{nroff} 5000and @code{troff} you can embed the null-character 5001@code{\&} inside the keyword for a similar effect. 5002 5003@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5004@node Substitution modes 5005@section Substitution modes 5006@cindex -k (RCS kflags) 5007@cindex Kflag 5008 5009@c FIXME: This could be made more coherent, by expanding it 5010@c with more examples or something. 5011Each file has a stored default substitution mode, and 5012each working directory copy of a file also has a 5013substitution mode. The former is set by the @samp{-k} 5014option to @code{cvs add} and @code{cvs admin}; the 5015latter is set by the -k or -A options to @code{cvs 5016checkout} or @code{cvs update}. @code{cvs diff} also 5017has a @samp{-k} option. For some examples, 5018@xref{Binary files}. 5019 5020The modes available are: 5021 5022@table @samp 5023@item -kkv 5024Generate keyword strings using the default form, e.g. 5025@code{$@asis{}Revision: 5.7 $} for the @code{Revision} 5026keyword. 5027 5028@item -kkvl 5029Like @samp{-kkv}, except that a locker's name is always 5030inserted if the given revision is currently locked. 5031This option is normally not useful when @sc{cvs} is used. 5032 5033@item -kk 5034Generate only keyword names in keyword strings; omit 5035their values. For example, for the @code{Revision} 5036keyword, generate the string @code{$@asis{}Revision$} 5037instead of @code{$@asis{}Revision: 5.7 $}. This option 5038is useful to ignore differences due to keyword 5039substitution when comparing different revisions of a 5040file. 5041 5042@item -ko 5043Generate the old keyword string, present in the working 5044file just before it was checked in. For example, for 5045the @code{Revision} keyword, generate the string 5046@code{$@asis{}Revision: 1.1 $} instead of 5047@code{$@asis{}Revision: 5.7 $} if that is how the 5048string appeared when the file was checked in. 5049 5050@item -kb 5051Like @samp{-ko}, but also inhibit conversion of line 5052endings between the canonical form in which they are 5053stored in the repository (linefeed only), and the form 5054appropriate to the operating system in use on the 5055client. For systems, like unix, which use linefeed 5056only to terminate lines, this is the same as 5057@samp{-ko}. For more information on binary files, see 5058@ref{Binary files}. 5059 5060@item -kv 5061Generate only keyword values for keyword strings. For 5062example, for the @code{Revision} keyword, generate the string 5063@code{5.7} instead of @code{$@asis{}Revision: 5.7 $}. 5064This can help generate files in programming languages 5065where it is hard to strip keyword delimiters like 5066@code{$@asis{}Revision: $} from a string. However, 5067further keyword substitution cannot be performed once 5068the keyword names are removed, so this option should be 5069used with care. 5070 5071One often would like to use @samp{-kv} with @code{cvs 5072export}---@pxref{export}. But be aware that doesn't 5073handle an export containing binary files correctly. 5074 5075@end table 5076 5077@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5078@node Log keyword 5079@section Problems with the $@asis{}Log$ keyword. 5080 5081The @code{$@asis{}Log$} keyword is somewhat 5082controversial. As long as you are working on your 5083development system the information is easily accessible 5084even if you do not use the @code{$@asis{}Log$} 5085keyword---just do a @code{cvs log}. Once you export 5086the file the history information might be useless 5087anyhow. 5088 5089A more serious concern is that @sc{rcs} is not good at 5090handling @code{$@asis{}Log$} entries when a branch is 5091merged onto the main trunk. Conflicts often result 5092from the merging operation. 5093 5094People also tend to "fix" the log entries in the file 5095(correcting spelling mistakes and maybe even factual 5096errors). If that is done the information from 5097@code{cvs log} will not be consistent with the 5098information inside the file. This may or may not be a 5099problem in real life. 5100 5101It has been suggested that the @code{$@asis{}Log$} 5102keyword should be inserted @emph{last} in the file, and 5103not in the files header, if it is to be used at all. 5104That way the long list of change messages will not 5105interfere with everyday source file browsing. 5106 5107@c --------------------------------------------------------------------- 5108@node Binary files 5109@chapter Handling binary files 5110@cindex Binary files 5111 5112There are two issues with using @sc{cvs} to store 5113binary files. The first is that @sc{cvs} by default 5114convert line endings between the canonical form in 5115which they are stored in the repository (linefeed 5116only), and the form appropriate to the operating system 5117in use on the client (for example, carriage return 5118followed by line feed for Windows NT). 5119 5120The second is that a binary file might happen to 5121contain data which looks like a keyword (@pxref{Keyword 5122substitution}), so keyword expansion must be turned 5123off. 5124 5125The @samp{-kb} option available with some @sc{cvs} 5126commands insures that neither line ending conversion 5127nor keyword expansion will be done. If you are using 5128an old version of @sc{rcs} without this option, and you 5129are using an operating system, such as unix, which 5130terminates lines with linefeeds only, you can use 5131@samp{-ko} instead; if you are on another operating 5132system, upgrade to a version of @sc{rcs}, such as 5.7 5133or later, which supports @samp{-kb}. 5134 5135Here is an example of how you can create a new file 5136using the @samp{-kb} flag: 5137 5138@example 5139$ echo '$@asis{}Id$' > kotest 5140$ cvs add -kb -m"A test file" kotest 5141$ cvs ci -m"First checkin; contains a keyword" kotest 5142@end example 5143 5144If a file accidentally gets added without @samp{-kb}, 5145one can use the @code{cvs admin} command to recover. 5146For example: 5147 5148@example 5149$ echo '$@asis{}Id$' > kotest 5150$ cvs add -m"A test file" kotest 5151$ cvs ci -m"First checkin; contains a keyword" kotest 5152$ cvs admin -kb kotest 5153$ cvs update -A kotest 5154$ cvs commit -m "make it binary" kotest # @r{For non-unix systems} 5155@end example 5156 5157When you check in the file @file{kotest} the keywords 5158are expanded. (Try the above example, and do a 5159@code{cat kotest} after every command). The @code{cvs 5160admin -kb} command sets the default keyword 5161substitution method for this file, but it does not 5162alter the working copy of the file that you have. The 5163easiest way to get the unexpanded version of 5164@file{kotest} is @code{cvs update -A}. If you need to 5165cope with line endings (that is, you are using a 5166@sc{cvs} client on a non-unix system), then you need to 5167check in a new copy of the file, as shown by the 5168@code{cvs commit} command above. 5169@c FIXME: should also describe what the *other users* 5170@c need to do, if they have checked out copies which 5171@c have been corrupted by lack of -kb. I think maybe 5172@c "cvs update -kb" or "cvs 5173@c update -A" would suffice, although the user who 5174@c reported this suggested removing the file, manually 5175@c removing it from CVS/Entries, and then "cvs update" 5176 5177However, in using @code{cvs admin -k} to change the 5178keyword expansion, be aware that the keyword expansion 5179mode is not version controlled. This means that, for 5180example, that if you have a text file in old releases, 5181and a binary file with the same name in new releases, 5182@sc{cvs} provides no way to check out the file in text 5183or binary mode depending on what version you are 5184checking out. There is no good workaround for this 5185problem. 5186 5187You can also set a default for whether @code{cvs add} 5188and @code{cvs import} treat a file as binary based on 5189its name; for example you could say that files who 5190names end in @samp{.exe} are binary. @xref{Wrappers}. 5191 5192@c I'm not sure about the best location for this. In 5193@c one sense, it might belong right after we've introduced 5194@c CVS's basic version control model, because people need 5195@c to figure out builds right away. The current location 5196@c is based on the theory that it kind of akin to the 5197@c "Revision management" section. 5198@node Builds 5199@chapter How your build system interacts with CVS 5200@cindex builds 5201@cindex make 5202 5203As mentioned in the introduction, @sc{cvs} does not 5204contain software for building your software from source 5205code. This section describes how various aspects of 5206your build system might interact with @sc{cvs}. 5207 5208@c Is there a way to discuss this without reference to 5209@c tools other than CVS? I'm not sure there is; I 5210@c wouldn't think that people who learn CVS first would 5211@c even have this concern. 5212One common question, especially from people who are 5213accustomed to @sc{rcs}, is how to make their build get 5214an up to date copy of the sources. The answer to this 5215with @sc{cvs} is two-fold. First of all, since 5216@sc{cvs} itself can recurse through directories, there 5217is no need to modify your @file{Makefile} (or whatever 5218configuration file your build tool uses) to make sure 5219each file is up to date. Instead, just use two 5220commands, first @code{cvs -q update} and then 5221@code{make} or whatever the command is to invoke your 5222build tool. Secondly, you do not necessarily 5223@emph{want} to get a copy of a change someone else made 5224until you have finished your own work. One suggested 5225approach is to first update your sources, then 5226implement, build and 5227test the change you were thinking of, and then commit 5228your sources (updating first if necessary). By 5229periodically (in between changes, using the approach 5230just described) updating your entire tree, you ensure 5231that your sources are sufficiently up to date. 5232 5233@cindex bill of materials 5234One common need is to record which versions of which 5235source files went into a particular build. This kind 5236of functionality is sometimes called @dfn{bill of 5237materials} or something similar. The best way to do 5238this with @sc{cvs} is to use the @code{tag} command to 5239record which versions went into a given build 5240(@pxref{Tags}). 5241 5242Using @sc{cvs} in the most straightforward manner 5243possible, each developer will have a copy of the entire 5244source tree which is used in a particular build. If 5245the source tree is small, or if developers are 5246geographically dispersed, this is the preferred 5247solution. In fact one approach for larger projects is 5248to break a project down into smaller 5249@c I say subsystem instead of module because they may or 5250@c may not use the modules file. 5251separately-compiled subsystems, and arrange a way of 5252releasing them internally so that each developer need 5253check out only those subsystems which are they are 5254actively working on. 5255 5256Another approach is to set up a structure which allows 5257developers to have their own copies of some files, and 5258for other files to access source files from a central 5259location. Many people have come up with some such a 5260@c two such people are paul@sander.cupertino.ca.us (for 5261@c a previous employer) 5262@c and gtornblo@senet.abb.se (spicm and related tools), 5263@c but as far as I know 5264@c noone has nicely packaged or released such a system (or 5265@c instructions for constructing one). 5266system using features such as the symbolic link feature 5267found in many operating systems, or the @code{VPATH} 5268feature found in many versions of @code{make}. One build 5269tool which is designed to help with this kind of thing 5270is Odin (see 5271@code{ftp://ftp.cs.colorado.edu/pub/distribs/odin}). 5272@c Should we be saying more about Odin? Or how you use 5273@c it with CVS? Also, the Prime Time Freeware for Unix 5274@c disk (see http://www.ptf.com/) has Odin (with a nice 5275@c paragraph summarizing it on the web), so that might be a 5276@c semi-"official" place to point people. 5277@c 5278@c Of course, many non-CVS systems have this kind of 5279@c functionality, for example OSF's ODE 5280@c (http://www.osf.org/ode/) or mk 5281@c (http://www.io.org/~pzi/heading.html; 5282@c ftp://ftp.interlog.com/pub/unix/mk is out of date). But I'm not sure 5283@c there is any point in mentioning them here unless they 5284@c can work with CVS. 5285 5286@node Compatibility 5287@chapter Compatibility between CVS Versions 5288 5289@cindex CVS, versions of 5290@cindex versions, of CVS 5291@cindex compatibility, between CVS versions 5292@c We don't mention versions older than CVS 1.3 5293@c on the theory that it would clutter it up for the vast 5294@c majority of people, who don't have anything that old. 5295@c 5296The repository format is compatible going back to 5297@sc{cvs} 1.3. But see @ref{Watches Compatibility}, if 5298you have copies of @sc{cvs} 1.6 or older and you want 5299to use the optional developer communication features. 5300@c If you "cvs rm" and commit using 1.3, then you'll 5301@c want to run "rcs -sdead <file,v>" on each of the 5302@c files in the Attic if you then want 1.5 and 5303@c later to recognize those files as dead (I think the 5304@c symptom if this is not done is that files reappear 5305@c in joins). (Wait: the above will work but really to 5306@c be strictly correct we should suggest checking 5307@c in a new revision rather than just changing the 5308@c state of the head revision, shouldn't we?). 5309@c The old convert.sh script was for this, but it never 5310@c did get updated to reflect use of the RCS "dead" 5311@c state. 5312@c Note: this is tricky to document without confusing 5313@c people--need to carefully say what CVS version we 5314@c are talking about and keep in mind the distinction 5315@c between a 5316@c repository created with 1.3 and on which one now 5317@c uses 1.5+, and a repository on which one wants to 5318@c use both versions side by side (e.g. during a 5319@c transition period). 5320@c We might want to separate out the 1.3 compatibility 5321@c section (for repository & working directory) from the 5322@c rest--that might help avoid confusing people who 5323@c are upgrading (for example) from 1.6 to 1.8. 5324 5325The working directory format is compatible going back 5326to @sc{cvs} 1.5. It did change between @sc{cvs} 1.3 5327and @sc{cvs} 1.5. If you run @sc{cvs} 1.5 or newer on 5328a working directory checked out with @sc{cvs} 1.3, 5329@sc{cvs} will convert it, but to go back to @sc{cvs} 53301.3 you need to check out a new working directory with 5331@sc{cvs} 1.3. 5332 5333The remote protocol is interoperable going back to @sc{cvs} 1.5, but no 5334further (1.5 was the first official release with the remote protocol, 5335but some older versions might still be floating around). In many 5336cases you need to upgrade both the client and the server to take 5337advantage of new features and bugfixes, however. 5338 5339@c --------------------------------------------------------------------- 5340@node Revision management 5341@chapter Revision management 5342@cindex Revision management 5343 5344@c -- This chapter could be expanded a lot. 5345@c -- Experiences are very welcome! 5346 5347If you have read this far, you probably have a pretty 5348good grasp on what @sc{cvs} can do for you. This 5349chapter talks a little about things that you still have 5350to decide. 5351 5352If you are doing development on your own using @sc{cvs} 5353you could probably skip this chapter. The questions 5354this chapter takes up become more important when more 5355than one person is working in a repository. 5356 5357@menu 5358* When to commit:: Some discussion on the subject 5359@end menu 5360 5361@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5362@node When to commit 5363@section When to commit? 5364@cindex When to commit 5365@cindex Commit, when to 5366@cindex Policy 5367 5368Your group should decide which policy to use regarding 5369commits. Several policies are possible, and as your 5370experience with @sc{cvs} grows you will probably find 5371out what works for you. 5372 5373If you commit files too quickly you might commit files 5374that do not even compile. If your partner updates his 5375working sources to include your buggy file, he will be 5376unable to compile the code. On the other hand, other 5377persons will not be able to benefit from the 5378improvements you make to the code if you commit very 5379seldom, and conflicts will probably be more common. 5380 5381It is common to only commit files after making sure 5382that they can be compiled. Some sites require that the 5383files pass a test suite. Policies like this can be 5384enforced using the commitinfo file 5385(@pxref{commitinfo}), but you should think twice before 5386you enforce such a convention. By making the 5387development environment too controlled it might become 5388too regimented and thus counter-productive to the real 5389goal, which is to get software written. 5390 5391@c --------------------------------------------------------------------- 5392@node CVS commands 5393@appendix Guide to CVS commands 5394 5395This appendix describes the overall structure of 5396@sc{cvs} commands, and describes some commands in 5397detail (others are described elsewhere; for a quick 5398reference to @sc{cvs} commands, @pxref{Invoking CVS}). 5399@c The idea is that we want to move the commands which 5400@c are described here into the main body of the manual, 5401@c in the process reorganizing the manual to be 5402@c organized around what the user wants to do, not 5403@c organized around CVS commands. 5404 5405@menu 5406* Structure:: Overall structure of CVS commands 5407* ~/.cvsrc:: Default options with the ~/.csvrc file 5408* Global options:: Options you give to the left of cvs_command 5409* Common options:: Options you give to the right of cvs_command 5410* admin:: Administration front end for rcs 5411* checkout:: Checkout sources for editing 5412* commit:: Check files into the repository 5413* diff:: Run diffs between revisions 5414* export:: Export sources from CVS, similar to checkout 5415* history:: Show status of files and users 5416* import:: Import sources into CVS, using vendor branches 5417* log:: Print out 'rlog' information for files 5418* rdiff:: 'patch' format diffs between releases 5419* release:: Indicate that a Module is no longer in use 5420* rtag:: Add a tag to a module 5421* status:: Status info on the revisions 5422* tag:: Add a tag to checked out version 5423* update:: Bring work tree in sync with repository 5424@end menu 5425 5426@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5427@node Structure 5428@appendixsec Overall structure of CVS commands 5429@cindex Structure 5430@cindex CVS command structure 5431@cindex Command structure 5432@cindex Format of CVS commands 5433 5434The overall format of all @sc{cvs} commands is: 5435 5436@example 5437cvs [ cvs_options ] cvs_command [ command_options ] [ command_args ] 5438@end example 5439 5440@table @code 5441@item cvs 5442The name of the @sc{cvs} program. 5443 5444@item cvs_options 5445Some options that affect all sub-commands of @sc{cvs}. These are 5446described below. 5447 5448@item cvs_command 5449One of several different sub-commands. Some of the commands have 5450aliases that can be used instead; those aliases are noted in the 5451reference manual for that command. There are only two situations 5452where you may omit @samp{cvs_command}: @samp{cvs -H} elicits a 5453list of available commands, and @samp{cvs -v} displays version 5454information on @sc{cvs} itself. 5455 5456@item command_options 5457Options that are specific for the command. 5458 5459@item command_args 5460Arguments to the commands. 5461@end table 5462 5463There is unfortunately some confusion between 5464@code{cvs_options} and @code{command_options}. 5465@samp{-l}, when given as a @code{cvs_option}, only 5466affects some of the commands. When it is given as a 5467@code{command_option} is has a different meaning, and 5468is accepted by more commands. In other words, do not 5469take the above categorization too seriously. Look at 5470the documentation instead. 5471 5472@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5473@node ~/.cvsrc 5474@appendixsec Default options and the ~/.cvsrc file 5475@cindex .cvsrc file 5476@cindex option defaults 5477 5478There are some @code{command_options} that are used so 5479often that you might have set up an alias or some other 5480means to make sure you always specify that option. One 5481example (the one that drove the implementation of the 5482.cvsrc support, actually) is that many people find the 5483default output of the @samp{diff} command to be very 5484hard to read, and that either context diffs or unidiffs 5485are much easier to understand. 5486 5487The @file{~/.cvsrc} file is a way that you can add 5488default options to @code{cvs_commands} within cvs, 5489instead of relying on aliases or other shell scripts. 5490 5491The format of the @file{~/.cvsrc} file is simple. The 5492file is searched for a line that begins with the same 5493name as the @code{cvs_command} being executed. If a 5494match is found, then the remainder of the line is split 5495up (at whitespace characters) into separate options and 5496added to the command arguments @emph{before} any 5497options from the command line. 5498 5499If a command has two names (e.g., @code{checkout} and 5500@code{co}), the official name, not necessarily the one 5501used on the command line, will be used to match against 5502the file. So if this is the contents of the user's 5503@file{~/.cvsrc} file: 5504 5505@example 5506log -N 5507diff -u 5508update -P 5509co -P 5510@end example 5511 5512@noindent 5513the command @samp{cvs checkout foo} would have the 5514@samp{-P} option added to the arguments, as well as 5515@samp{cvs co foo}. 5516 5517With the example file above, the output from @samp{cvs 5518diff foobar} will be in unidiff format. @samp{cvs diff 5519-c foobar} will provide context diffs, as usual. 5520Getting "old" format diffs would be slightly more 5521complicated, because @code{diff} doesn't have an option 5522to specify use of the "old" format, so you would need 5523@samp{cvs -f diff foobar}. 5524 5525In place of the command name you can use @code{cvs} to 5526specify global options (@pxref{Global options}). For 5527example the following line in @file{.cvsrc} 5528 5529@example 5530cvs -z6 5531@end example 5532 5533causes @sc{cvs} to use compression level 6 5534 5535@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5536@node Global options 5537@appendixsec Global options 5538@cindex Options, global 5539@cindex Global options 5540@cindex Left-hand options 5541 5542The available @samp{cvs_options} (that are given to the 5543left of @samp{cvs_command}) are: 5544 5545@table @code 5546@cindex RCSBIN, overriding 5547@cindex Overriding RCSBIN 5548@item -b @var{bindir} 5549Use @var{bindir} as the directory where @sc{rcs} programs are 5550located. Overrides the setting of the @code{$RCSBIN} environment 5551variable and any precompiled directory. This parameter should be 5552specified as an absolute pathname. 5553 5554@cindex TMPDIR, overriding 5555@cindex Overriding TMPDIR 5556@item -T @var{tempdir} 5557Use @var{tempdir} as the directory where temporary files are 5558located. Overrides the setting of the @code{$TMPDIR} environment 5559variable and any precompiled directory. This parameter should be 5560specified as an absolute pathname. 5561 5562@cindex CVSROOT, overriding 5563@cindex Overriding CVSROOT 5564@item -d @var{cvs_root_directory} 5565Use @var{cvs_root_directory} as the root directory 5566pathname of the repository. Overrides the setting of 5567the @code{$CVSROOT} environment variable. @xref{Repository}. 5568 5569@cindex EDITOR, overriding 5570@cindex Overriding EDITOR 5571@item -e @var{editor} 5572Use @var{editor} to enter revision log information. Overrides the 5573setting of the @code{$CVSEDITOR} and @code{$EDITOR} environment variables. 5574 5575@item -f 5576Do not read the @file{~/.cvsrc} file. This 5577option is most often used because of the 5578non-orthogonality of the @sc{cvs} option set. For 5579example, the @samp{cvs log} option @samp{-N} (turn off 5580display of tag names) does not have a corresponding 5581option to turn the display on. So if you have 5582@samp{-N} in the @file{~/.cvsrc} entry for @samp{log}, 5583you may need to use @samp{-f} to show the tag names. 5584 5585@item -H 5586@itemx --help 5587Display usage information about the specified @samp{cvs_command} 5588(but do not actually execute the command). If you don't specify 5589a command name, @samp{cvs -H} displays overall help for 5590@sc{cvs}, including a list of other help options. 5591@c It seems to me it is better to document it this way 5592@c rather than trying to update this documentation 5593@c every time that we add a --help-foo option. But 5594@c perhaps that is confusing... 5595 5596@item -l 5597Do not log the cvs_command in the command history (but execute it 5598anyway). @xref{history}, for information on command history. 5599 5600@cindex Read-only mode 5601@item -n 5602Do not change any files. Attempt to execute the 5603@samp{cvs_command}, but only to issue reports; do not remove, 5604update, or merge any existing files, or create any new files. 5605 5606@item -Q 5607Cause the command to be really quiet; the command will only 5608generate output for serious problems. 5609 5610@item -q 5611Cause the command to be somewhat quiet; informational messages, 5612such as reports of recursion through subdirectories, are 5613suppressed. 5614 5615@cindex read-only files, and -r 5616@item -r 5617Make new working files files read-only. Same effect 5618as if the @code{$CVSREAD} environment variable is set 5619(@pxref{Environment variables}). The default is to 5620make working files writable, unless watches are on 5621(@pxref{Watches}). 5622 5623@item -s @var{variable}=@var{value} 5624Set a user variable (@pxref{Variables}). 5625 5626@cindex Trace 5627@item -t 5628Trace program execution; display messages showing the steps of 5629@sc{cvs} activity. Particularly useful with @samp{-n} to explore the 5630potential impact of an unfamiliar command. 5631 5632@item -v 5633@item --version 5634Display version and copyright information for @sc{cvs}. 5635 5636@cindex CVSREAD, overriding 5637@cindex Overriding CVSREAD 5638@item -w 5639Make new working files read-write. Overrides the 5640setting of the @code{$CVSREAD} environment variable. 5641Files are created read-write by default, unless @code{$CVSREAD} is 5642set or @samp{-r} is given. 5643 5644@item -x 5645Encrypt all communication between the client and the 5646server. Only has an effect on the @sc{cvs} client. As 5647of this writing, this is only implemented when using a 5648Kerberos connection (@pxref{Kerberos authenticated}). 5649Encryption support is not available by default; it must 5650be enabled using a special configure option, 5651@file{--enable-encryption}, when you build @sc{cvs}. 5652 5653@item -z @var{gzip-level} 5654Set the compression level. Only has an effect on the 5655@sc{cvs} client. 5656 5657@end table 5658 5659@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5660@node Common options 5661@appendixsec Common command options 5662@cindex Common options 5663@cindex Right-hand options 5664 5665This section describes the @samp{command_options} that 5666are available across several @sc{cvs} commands. These 5667options are always given to the right of 5668@samp{cvs_command}. Not all 5669commands support all of these options; each option is 5670only supported for commands where it makes sense. 5671However, when a command has one of these options you 5672can almost always count on the same behavior of the 5673option as in other commands. (Other command options, 5674which are listed with the individual commands, may have 5675different behavior from one @sc{cvs} command to the other). 5676 5677@strong{Warning:} the @samp{history} command is an exception; it supports 5678many options that conflict even with these standard options. 5679 5680@table @code 5681@cindex Dates 5682@cindex Time 5683@cindex Specifying dates 5684@item -D @var{date_spec} 5685Use the most recent revision no later than @var{date_spec}. 5686@var{date_spec} is a single argument, a date description 5687specifying a date in the past. 5688 5689The specification is @dfn{sticky} when you use it to make a 5690private copy of a source file; that is, when you get a working 5691file using @samp{-D}, @sc{cvs} records the date you specified, so that 5692further updates in the same directory will use the same date 5693(for more information on sticky tags/dates, @pxref{Sticky tags}). 5694 5695@samp{-D} is available with the @code{checkout}, 5696@code{diff}, @code{export}, @code{history}, 5697@code{rdiff}, @code{rtag}, and @code{update} commands. 5698(The @code{history} command uses this option in a 5699slightly different way; @pxref{history options}). 5700 5701@c What other formats should we accept? I don't want 5702@c to start accepting a whole mess of non-standard 5703@c new formats (there are a lot which are in wide use in 5704@c one context or another), but practicality does 5705@c dictate some level of flexibility. 5706@c * POSIX.2 (e.g. touch, ls output, date) and other 5707@c POSIX and/or de facto unix standards (e.g. at). The 5708@c practice here is too inconsistent to be of any use. 5709@c * VMS dates. This is not a formal standard, but 5710@c there is a published specification (see SYS$ASCTIM 5711@c and SYS$BINTIM in the _VMS System Services Reference 5712@c Manual_), it is implemented consistently in VMS 5713@c utilities, and VMS users will expect CVS running on 5714@c VMS to support this format (and if we're going to do 5715@c that, better to make CVS support it on all 5716@c platforms. Maybe). 5717@c 5718@c NOTE: The tar manual has some documentation for 5719@c getdate.y (just for our info; we don't want to 5720@c attempt to document all the formats accepted by 5721@c getdate.y). 5722@c 5723@c One more note: In output, CVS should consistently 5724@c use one date format, and that format should be one that 5725@c it accepts in input as well. The former isn't 5726@c really true (see survey below), and I'm not 5727@c sure that either of those formats is accepted in 5728@c input. 5729@c 5730@c cvs log 5731@c current 1996/01/02 13:45:31 5732@c Internet 02 Jan 1996 13:45:31 UT 5733@c ISO 1996-01-02 13:45:31 5734@c cvs ann 5735@c current 02-Jan-96 5736@c Internet-like 02 Jan 96 5737@c ISO 96-01-02 5738@c cvs status 5739@c current Tue Jun 11 02:54:53 1996 5740@c Internet [Tue,] 11 Jun 1996 02:54:53 5741@c ISO 1996-06-11 02:54:53 5742@c note: date possibly should be omitted entirely for 5743@c other reasons. 5744@c any others? 5745@c There is a good chance the proper solution has to 5746@c involve at least some level of letting the user 5747@c decide which format (with the default being the 5748@c formats CVS has always used; changing these might be 5749@c _very_ disruptive since scripts may very well be 5750@c parsing them). 5751@c 5752@c Another random bit of prior art concerning dates is 5753@c the strptime function which takes templates such as 5754@c "%m/%d/%y", and apparent a variant of getdate() 5755@c which also honors them. See 5756@c X/Open CAE Specification, System Interfaces and 5757@c Headers Issue 4, Version 2 (September 1994), in the 5758@c entry for getdate() on page 231 5759 5760@cindex timezone, in input 5761@cindex zone, time, in input 5762A wide variety of date formats are supported by 5763@sc{cvs}. The most standard ones are ISO8601 (from the 5764International Standards Organization) and the Internet 5765e-mail standard (specified in RFC822 as amended by 5766RFC1123). 5767 5768@c Probably should be doing more to spell out just what 5769@c the rules are, rather than just giving examples. 5770@c But I want to keep this simple too. 5771@c So I don't know.... 5772@c A few specific issues: (1) Maybe should reassure 5773@c people that years after 2000 5774@c work (they are in the testsuite, so they do indeed 5775@c work). (2) What do two digit years 5776@c mean? Where do we accept them? (3) Local times can 5777@c be ambiguous or nonexistent if they fall during the 5778@c hour when daylight savings time goes into or out of 5779@c effect. Pretty obscure, so I'm not at all sure we 5780@c should be documenting the behavior in that case. 5781ISO8601 dates have many variants but a few examples 5782are: 5783 5784@example 57851972-09-24 57861972-09-24 20:05 5787@end example 5788@c I doubt we really accept all ISO8601 format dates 5789@c (for example, decimal hours like 1972-09-24 20,2) 5790@c I'm not sure we should, many of them are pretty 5791@c bizarre and it has lots of gratuitous multiple ways 5792@c to specify the same thing. 5793 5794See 5795@file{http://www.ft.uni-erlangen.de/~mskuhn/iso-time.html} 5796for more details about ISO8601 dates. 5797@c Perhaps we want to also cite other sources in 5798@c case that page goes away. For example: 5799@c http://www.dsi.unimi.it/Users/Students/pensa/standard/ISO8601.html 5800 5801In addition to the dates allowed in Internet e-mail 5802itself, @sc{cvs} also allows some of the fields to be 5803omitted. For example: 5804@c FIXME: Need to figure out better, and document, 5805@c what we want to allow the user to omit. 5806@c NOTE: "omit" does not imply "reorder". 5807@c FIXME: Need to cite a web page describing how to get 5808@c RFC's. 5809 5810@example 581124 Sep 1972 20:05 581224 Sep 5813@end example 5814 5815The date is interpreted as being in the 5816local timezone, unless a specific timezone is 5817specified. 5818 5819These two date formats are preferred. However, 5820@sc{cvs} currently accepts a wide variety of other date 5821formats. They are intentionally not documented here in 5822any detail, and future versions of @sc{cvs} might not 5823accept all of them. 5824@c Maybe at 5825@c some point have CVS start give warnings on "unofficial" 5826@c formats (many of which might be typos or user 5827@c misunderstandings, and/or formats people never/rarely 5828@c use to specify dates)? 5829 5830One such format is 5831@code{@var{month}/@var{day}/@var{year}}. This may 5832confuse people who are accustomed to having the month 5833and day in the other order; @samp{1/4/96} is January 4, 5834not April 1. 5835 5836Remember to quote the argument to the @samp{-D} 5837flag so that your shell doesn't interpret spaces as 5838argument separators. A command using the @samp{-D} 5839flag can look like this: 5840 5841@example 5842$ cvs diff -D "1 hour ago" cvs.texinfo 5843@end example 5844 5845@cindex Forcing a tag match 5846@item -f 5847When you specify a particular date or tag to @sc{cvs} commands, they 5848normally ignore files that do not contain the tag (or did not 5849exist prior to the date) that you specified. Use the @samp{-f} option 5850if you want files retrieved even when there is no match for the 5851tag or date. (The most recent revision of the file 5852will be used). 5853 5854@need 800 5855@samp{-f} is available with these commands: 5856@code{annotate}, @code{checkout}, @code{export}, 5857@code{rdiff}, @code{rtag}, and @code{update}. 5858 5859@strong{Warning:} The @code{commit} command also has a 5860@samp{-f} option, but it has a different behavior for 5861that command. @xref{commit options}. 5862 5863@item -k @var{kflag} 5864Alter the default @sc{rcs} processing of keywords. 5865@xref{Keyword substitution}, for the meaning of 5866@var{kflag}. Your @var{kflag} specification is 5867@dfn{sticky} when you use it to create a private copy 5868of a source file; that is, when you use this option 5869with the @code{checkout} or @code{update} commands, 5870@sc{cvs} associates your selected @var{kflag} with the 5871file, and continues to use it with future update 5872commands on the same file until you specify otherwise. 5873 5874The @samp{-k} option is available with the @code{add}, 5875@code{checkout}, @code{diff}, @code{import} and 5876@code{update} commands. 5877 5878@item -l 5879Local; run only in current working directory, rather than 5880recursing through subdirectories. 5881 5882@strong{Warning:} this is not the same 5883as the overall @samp{cvs -l} option, which you can specify to the 5884left of a cvs command! 5885 5886Available with the following commands: @code{checkout}, 5887@code{commit}, @code{diff}, @code{export}, @code{log}, 5888@code{remove}, @code{rdiff}, @code{rtag}, 5889@code{status}, @code{tag}, and @code{update}. 5890 5891@cindex Editor, avoiding invocation of 5892@cindex Avoiding editor invocation 5893@item -m @var{message} 5894Use @var{message} as log information, instead of 5895invoking an editor. 5896 5897Available with the following commands: @code{add}, 5898@code{commit} and @code{import}. 5899 5900@item -n 5901Do not run any checkout/commit/tag program. (A program can be 5902specified to run on each of these activities, in the modules 5903database (@pxref{modules}); this option bypasses it). 5904 5905@strong{Warning:} this is not the same as the overall @samp{cvs -n} 5906option, which you can specify to the left of a cvs command! 5907 5908Available with the @code{checkout}, @code{commit}, @code{export}, 5909and @code{rtag} commands. 5910 5911@item -P 5912Prune empty directories. See @xref{Removing directories}. 5913 5914@item -p 5915Pipe the files retrieved from the repository to standard output, 5916rather than writing them in the current directory. Available 5917with the @code{checkout} and @code{update} commands. 5918 5919@item -W 5920Specify file names that should be filtered. You can 5921use this option repeatedly. The spec can be a file 5922name pattern of the same type that you can specify in 5923the @file{.cvswrappers} file. 5924Avaliable with the following commands: @code{import}, 5925and @code{update}. 5926 5927@item -r @var{tag} 5928Use the revision specified by the @var{tag} argument instead of the 5929default @dfn{head} revision. As well as arbitrary tags defined 5930with the @code{tag} or @code{rtag} command, two special tags are 5931always available: @samp{HEAD} refers to the most recent version 5932available in the repository, and @samp{BASE} refers to the 5933revision you last checked out into the current working directory. 5934 5935@c FIXME: What does HEAD really mean? I believe that 5936@c the current answer is the head of the default branch 5937@c for all cvs commands except diff. For diff, it 5938@c seems to be (a) the head of the trunk (or the default 5939@c branch?) if there is no sticky tag, (b) the head of the 5940@c branch if there is a branch sticky tag, and (c) the 5941@c same as BASE if there is a non-branch sticky tag. (c) 5942@c would appear to be strange, maybe accidental, and so there would 5943@c presumably be 5944@c little problem changing it. (b) is ugly as it differs 5945@c from what HEAD means for other commands, but people 5946@c might be used to it (note a change in NEWS? Or provide 5947@c advance warning of it changing?) and possible useful 5948@c (could be fixed by a new tag ".bhead" which would mean 5949@c the head of the appropriate branch). This 5950@c should be investigated, test cases written, and 5951@c documented (but HEAD should mean the same thing for all 5952@c CVS commands, so I don't know if we should be 5953@c documenting the current "cvs diff" behavior). 5954 5955The tag specification is sticky when you use this 5956@c option 5957with @code{checkout} or @code{update} to make your own 5958copy of a file: @sc{cvs} remembers the tag and continues to use it on 5959future update commands, until you specify otherwise (for more information 5960on sticky tags/dates, @pxref{Sticky tags}). The 5961tag can be either a symbolic or numeric tag. 5962@xref{Tags}. 5963 5964Specifying the @samp{-q} global option along with the 5965@samp{-r} command option is often useful, to suppress 5966the warning messages when the @sc{rcs} history file 5967does not contain the specified tag. 5968 5969@strong{Warning:} this is not the same as the overall `cvs -r' option, 5970which you can specify to the left of a cvs command! 5971 5972@samp{-r} is available with the @code{checkout}, @code{commit}, 5973@code{diff}, @code{history}, @code{export}, @code{rdiff}, 5974@code{rtag}, and @code{update} commands. 5975 5976@end table 5977 5978@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5979@node admin 5980@appendixsec admin---Administration front end for rcs 5981@cindex Admin (subcommand) 5982 5983@itemize @bullet 5984@item 5985Requires: repository, working directory. 5986@item 5987Changes: repository. 5988@item 5989Synonym: rcs 5990@end itemize 5991 5992This is the @sc{cvs} interface to assorted administrative @sc{rcs} 5993facilities, documented in rcs(1). @code{admin} simply passes 5994all its options and arguments to the @code{rcs} command; it does 5995no filtering or other processing. This command @emph{does} work 5996recursively, however, so extreme care should be used. 5997 5998@c "group" should probably read "unix group" (but what 5999@c does NT local do?). "compiled in value" is 6000@c unclear--compiled in to what? 6001If there is a group whose name matches a compiled in 6002value which defaults to @code{cvsadmin}, only members 6003of that group can use @code{cvs admin}. To disallow 6004@code{cvs admin} for all users, create a group with no 6005users in it. 6006 6007@menu 6008* admin options:: admin options 6009* admin examples:: admin examples 6010@end menu 6011 6012@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6013@node admin options 6014@appendixsubsec admin options 6015 6016Not all valid @code{rcs} options are useful together 6017with @sc{cvs}. Some even makes it impossible to use 6018@sc{cvs} until you undo the effect! 6019 6020This description of the available options is based on 6021the @samp{rcs(1)} man page, but modified to suit 6022readers that are more interested in @sc{cvs} than 6023@sc{rcs}. 6024 6025@table @code 6026@item -A@var{oldfile} 6027Might not work together with @sc{cvs}. Append the 6028access list of @var{oldfile} to the access list of the 6029@sc{rcs} file. 6030 6031@item -a@var{logins} 6032Might not work together with @sc{cvs}. Append the 6033login names appearing in the comma-separated list 6034@var{logins} to the access list of the @sc{rcs} file. 6035 6036@item -b[@var{rev}] 6037When used with bare @sc{rcs}, this 6038option sets the default branch to @var{rev}; in 6039@sc{cvs} sticky tags (@pxref{Sticky tags}) are a better 6040way to decide which branch you want to work on. There 6041is one use with @sc{cvs}: to revert to the vendor's 6042version when using vendor branches (@pxref{Reverting 6043local changes}). 6044 6045@item -c@var{string} 6046Useful with @sc{cvs}. Sets the comment leader to 6047@var{string}. The comment leader is printed before 6048every log message line generated by the keyword 6049@code{$@asis{}Log$} (@pxref{Keyword substitution}). 6050This is useful for programming languages without 6051multi-line comments. @sc{Rcs} initially guesses the 6052value of the comment leader from the file name 6053extension when the file is first committed. 6054 6055@item -e[@var{logins}] 6056Might not work together with @sc{cvs}. Erase the login 6057names appearing in the comma-separated list 6058@var{logins} from the access list of the RCS file. If 6059@var{logins} is omitted, erase the entire access list. 6060 6061@c FIXME: Doesn't work with client/server CVS; we 6062@c should probably just not accept the option. 6063@item -I 6064Run interactively, even if the standard input is not a 6065terminal. 6066 6067@item -i 6068Useless with @sc{cvs}. When using bare @sc{rcs}, this 6069is used to create and initialize a new @sc{rcs} file, 6070without depositing a revision. 6071 6072@item -k@var{subst} 6073Useful with @sc{cvs}. Set the default keyword 6074substitution to @var{subst}. @xref{Keyword 6075substitution}. Giving an explicit @samp{-k} option to 6076@code{cvs update}, @code{cvs export}, or @code{cvs 6077checkout} overrides this default. 6078 6079@item -l[@var{rev}] 6080Lock the revision with number @var{rev}. If a branch 6081is given, lock the latest revision on that branch. If 6082@var{rev} is omitted, lock the latest revision on the 6083default branch. 6084 6085This can be used in conjunction with the 6086@file{rcslock.pl} script in the @file{contrib} 6087directory of the @sc{cvs} source distribution to 6088provide reserved checkouts (where only one user can be 6089editing a given file at a time). See the comments in 6090that file for details (and see the @file{README} file 6091in that directory for disclaimers about the unsupported 6092nature of contrib). According to comments in that 6093file, locking must set to strict (which is the default). 6094 6095@item -L 6096Set locking to strict. Strict locking means that the 6097owner of an RCS file is not exempt from locking for 6098checkin. For use with @sc{cvs}, strict locking must be 6099set; see the discussion under the @samp{-l} option above. 6100 6101@cindex Changing a log message 6102@cindex Replacing a log message 6103@cindex Correcting a log message 6104@cindex Fixing a log message 6105@cindex Log message, correcting 6106@item -m@var{rev}:@var{msg} 6107Replace the log message of revision @var{rev} with 6108@var{msg}. 6109 6110@item -N@var{name}[:[@var{rev}]] 6111Act like @samp{-n}, except override any previous 6112assignment of @var{name}. 6113 6114@item -n@var{name}[:[@var{rev}]] 6115Associate the symbolic name @var{name} with the branch 6116or revision @var{rev}. It is normally better to use 6117@samp{cvs tag} or @samp{cvs rtag} instead. Delete the 6118symbolic name if both @samp{:} and @var{rev} are 6119omitted; otherwise, print an error message if 6120@var{name} is already associated with another number. 6121If @var{rev} is symbolic, it is expanded before 6122association. A @var{rev} consisting of a branch number 6123followed by a @samp{.} stands for the current latest 6124revision in the branch. A @samp{:} with an empty 6125@var{rev} stands for the current latest revision on the 6126default branch, normally the trunk. For example, 6127@samp{rcs -n@var{name}: RCS/*} associates @var{name} with the 6128current latest revision of all the named RCS files; 6129this contrasts with @samp{rcs -n@var{name}:$ RCS/*} which 6130associates @var{name} with the revision numbers 6131extracted from keyword strings in the corresponding 6132working files. 6133 6134@cindex Deleting revisions 6135@cindex Outdating revisions 6136@cindex Saving space 6137@item -o@var{range} 6138Potentially useful, but dangerous, with @sc{cvs} (see below). 6139Deletes (@dfn{outdates}) the revisions given by 6140@var{range}. A range consisting of a single revision 6141number means that revision. A range consisting of a 6142branch number means the latest revision on that branch. 6143A range of the form @samp{@var{rev1}:@var{rev2}} means 6144revisions @var{rev1} to @var{rev2} on the same branch, 6145@samp{:@var{rev}} means from the beginning of the 6146branch containing @var{rev} up to and including 6147@var{rev}, and @samp{@var{rev}:} means from revision 6148@var{rev} to the end of the branch containing 6149@var{rev}. None of the outdated revisions may have 6150branches or locks. 6151 6152Due to the way @sc{cvs} handles branches @var{rev} 6153cannot be specified symbolically if it is a branch. 6154@xref{Magic branch numbers}, for an explanation. 6155 6156Make sure that no-one has checked out a copy of the 6157revision you outdate. Strange things will happen if he 6158starts to edit it and tries to check it back in. For 6159this reason, this option is not a good way to take back 6160a bogus commit; commit a new revision undoing the bogus 6161change instead (@pxref{Merging two revisions}). 6162 6163@item -q 6164Run quietly; do not print diagnostics. 6165 6166@item -s@var{state}[:@var{rev}] 6167Useful with @sc{cvs}. Set the state attribute of the 6168revision @var{rev} to @var{state}. If @var{rev} is a 6169branch number, assume the latest revision on that 6170branch. If @var{rev} is omitted, assume the latest 6171revision on the default branch. Any identifier is 6172acceptable for @var{state}. A useful set of states is 6173@samp{Exp} (for experimental), @samp{Stab} (for 6174stable), and @samp{Rel} (for released). By default, 6175the state of a new revision is set to @samp{Exp} when 6176it is created. The state is visible in the output from 6177@var{cvs log} (@pxref{log}), and in the 6178@samp{$@asis{}Log$} and @samp{$@asis{}State$} keywords 6179(@pxref{Keyword substitution}). Note that @sc{cvs} 6180uses the @code{dead} state for its own purposes; to 6181take a file to or from the @code{dead} state use 6182commands like @code{cvs remove} and @code{cvs add}, not 6183@code{cvs admin -s}. 6184 6185@item -t[@var{file}] 6186Useful with @sc{cvs}. Write descriptive text from the 6187contents of the named @var{file} into the RCS file, 6188deleting the existing text. The @var{file} pathname 6189may not begin with @samp{-}. If @var{file} is omitted, 6190obtain the text from standard input, terminated by 6191end-of-file or by a line containing @samp{.} by itself. 6192Prompt for the text if interaction is possible; see 6193@samp{-I}. The descriptive text can be seen in the 6194output from @samp{cvs log} (@pxref{log}). 6195 6196@item -t-@var{string} 6197Similar to @samp{-t@var{file}}. Write descriptive text 6198from the @var{string} into the @sc{rcs} file, deleting 6199the existing text. 6200 6201@item -U 6202Set locking to non-strict. Non-strict locking means 6203that the owner of a file need not lock a revision for 6204checkin. For use with @sc{cvs}, strict locking must be 6205set; see the discussion under the @samp{-l} option 6206above. 6207 6208@item -u[@var{rev}] 6209See the option @samp{-l} above, for a discussion of 6210using this option with @sc{cvs}. Unlock the revision 6211with number @var{rev}. If a branch is given, unlock 6212the latest revision on that branch. If @var{rev} is 6213omitted, remove the latest lock held by the caller. 6214Normally, only the locker of a revision may unlock it. 6215Somebody else unlocking a revision breaks the lock. 6216This causes a mail message to be sent to the original 6217locker. The message contains a commentary solicited 6218from the breaker. The commentary is terminated by 6219end-of-file or by a line containing @code{.} by itself. 6220 6221@item -V@var{n} 6222Emulate @sc{rcs} version @var{n}. Use -V@var{n} to make 6223an @sc{rcs} file acceptable to @sc{rcs} version @var{n} 6224by discarding information that would confuse version 6225@var{n}. 6226 6227@item -x@var{suffixes} 6228Useless with @sc{cvs}. Use @var{suffixes} to 6229characterize RCS files. 6230@end table 6231 6232 6233@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6234@node admin examples 6235@appendixsubsec admin examples 6236 6237@appendixsubsubsec Outdating is dangerous 6238 6239First, an example of how @emph{not} to use the 6240@code{admin} command. It is included to stress the 6241fact that this command can be quite dangerous unless 6242you know @emph{exactly} what you are doing. 6243 6244The @samp{-o} option can be used to @dfn{outdate} old revisions 6245from the history file. If you are short on disc this option 6246might help you. But think twice before using it---there is no 6247way short of restoring the latest backup to undo this command! 6248 6249The next line is an example of a command that you would 6250@emph{not} like to execute. 6251 6252@example 6253$ cvs admin -o:R_1_02 . 6254@end example 6255 6256The above command will delete all revisions up to, and 6257including, the revision that corresponds to the tag 6258R_1_02. But beware! If there are files that have not 6259changed between R_1_02 and R_1_03 the file will have 6260@emph{the same} numerical revision number assigned to 6261the tags R_1_02 and R_1_03. So not only will it be 6262impossible to retrieve R_1_02; R_1_03 will also have to 6263be restored from the tapes! 6264 6265@appendixsubsubsec Comment leaders 6266@cindex Comment leader 6267@cindex Log keyword, selecting comment leader 6268@cindex Nroff (selecting comment leader) 6269 6270If you use the @code{$@asis{}Log$} keyword and you do 6271not agree with the guess for comment leader that 6272@sc{cvs} has done, you can enforce your will with 6273@code{cvs admin -c}. This might be suitable for 6274@code{nroff} source: 6275 6276@example 6277$ cvs admin -c'.\" ' *.man 6278$ rm *.man 6279$ cvs update 6280@end example 6281 6282The two last steps are to make sure that you get the 6283versions with correct comment leaders in your working 6284files. 6285 6286@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6287@node checkout 6288@appendixsec checkout---Check out sources for editing 6289@cindex Checkout (subcommand) 6290@cindex Co (subcommand) 6291 6292@itemize @bullet 6293@item 6294Synopsis: checkout [options] modules@dots{} 6295@item 6296Requires: repository. 6297@item 6298Changes: working directory. 6299@item 6300Synonyms: co, get 6301@end itemize 6302 6303Make a working directory containing copies of the 6304source files specified by @var{modules}. You must execute 6305@code{checkout} before using most of the other @sc{cvs} 6306commands, since most of them operate on your working 6307directory. 6308 6309The @var{modules} part of the command are either 6310symbolic names for some 6311collection of source directories and files, or paths to 6312directories or files in the repository. The symbolic 6313names are defined in the @samp{modules} file. 6314@xref{modules}. 6315 6316Depending on the modules you specify, @code{checkout} may 6317recursively create directories and populate them with 6318the appropriate source files. You can then edit these 6319source files at any time (regardless of whether other 6320software developers are editing their own copies of the 6321sources); update them to include new changes applied by 6322others to the source repository; or commit your work as 6323a permanent change to the source repository. 6324 6325Note that @code{checkout} is used to create 6326directories. The top-level directory created is always 6327added to the directory where @code{checkout} is 6328invoked, and usually has the same name as the specified 6329module. In the case of a module alias, the created 6330sub-directory may have a different name, but you can be 6331sure that it will be a sub-directory, and that 6332@code{checkout} will show the relative path leading to 6333each file as it is extracted into your private work 6334area (unless you specify the @samp{-Q} global option). 6335 6336The files created by @code{checkout} are created 6337read-write, unless the @samp{-r} option to @sc{cvs} 6338(@pxref{Global options}) is specified, the 6339@code{CVSREAD} environment variable is specified 6340(@pxref{Environment variables}), or a watch is in 6341effect for that file (@pxref{Watches}). 6342 6343@c FIXME: misleading--checkout takes a module as 6344@c argument, and update does not--so -d behavior is not the only 6345@c difference. 6346Running @code{checkout} on a directory that was already 6347built by a prior @code{checkout} is also permitted, and 6348has the same effect as specifying the @samp{-d} option 6349to the @code{update} command, that is, any new 6350directories that have been created in the repository 6351will appear in your work area. @xref{update}. 6352 6353For the output produced by the @code{checkout} command 6354see @ref{update output}. 6355 6356@menu 6357* checkout options:: checkout options 6358* checkout examples:: checkout examples 6359@end menu 6360 6361@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6362@node checkout options 6363@appendixsubsec checkout options 6364 6365These standard options are supported by @code{checkout} 6366(@pxref{Common options}, for a complete description of 6367them): 6368 6369@table @code 6370@item -D @var{date} 6371Use the most recent revision no later than @var{date}. 6372This option is sticky, and implies @samp{-P}. See 6373@ref{Sticky tags}, for more information on sticky tags/dates. 6374 6375@item -f 6376Only useful with the @samp{-D @var{date}} or @samp{-r 6377@var{tag}} flags. If no matching revision is found, 6378retrieve the most recent revision (instead of ignoring 6379the file). 6380 6381@item -k @var{kflag} 6382Process @sc{rcs} keywords according to @var{kflag}. See 6383co(1). This option is sticky; future updates of 6384this file in this working directory will use the same 6385@var{kflag}. The @code{status} command can be viewed 6386to see the sticky options. @xref{status}. 6387 6388@item -l 6389Local; run only in current working directory. 6390 6391@item -n 6392Do not run any checkout program (as specified 6393with the @samp{-o} option in the modules file; 6394@pxref{modules}). 6395 6396@item -P 6397Prune empty directories. See @ref{Moving directories}. 6398 6399@item -p 6400Pipe files to the standard output. 6401 6402@item -r @var{tag} 6403Use revision @var{tag}. This option is sticky, and implies @samp{-P}. 6404See @ref{Sticky tags}, for more information on sticky tags/dates. 6405@end table 6406 6407In addition to those, you can use these special command 6408options with @code{checkout}: 6409 6410@table @code 6411@item -A 6412Reset any sticky tags, dates, or @samp{-k} options. 6413See @ref{Sticky tags}, for more information on sticky tags/dates. 6414 6415@item -c 6416Copy the module file, sorted, to the standard output, 6417instead of creating or modifying any files or 6418directories in your working directory. 6419 6420@c Should clarify whether dir can specify a 6421@c subdirectory (for example "foo/bar"). As of May, 6422@c 1996, it is said to work for local CVS if the parent 6423@c directories already exist, and not at all for remote 6424@c CVS. The remote CVS behavior at least seems like it 6425@c is clearly a bug. 6426@item -d @var{dir} 6427Create a directory called @var{dir} for the working 6428files, instead of using the module name. Unless you 6429also use @samp{-N}, the paths created under @var{dir} 6430will be as short as possible. 6431@c FIXME: What the #$@!#$# does "short as possible" mean? 6432 6433@item -j @var{tag} 6434With two @samp{-j} options, merge changes from the 6435revision specified with the first @samp{-j} option to 6436the revision specified with the second @samp{j} option, 6437into the working directory. 6438 6439With one @samp{-j} option, merge changes from the 6440ancestor revision to the revision specified with the 6441@samp{-j} option, into the working directory. The 6442ancestor revision is the common ancestor of the 6443revision which the working directory is based on, and 6444the revision specified in the @samp{-j} option. 6445 6446In addition, each -j option can contain an optional 6447date specification which, when used with branches, can 6448limit the chosen revision to one within a specific 6449date. An optional date is specified by adding a colon 6450(:) to the tag: 6451@samp{-j@var{Symbolic_Tag}:@var{Date_Specifier}}. 6452 6453@xref{Merging}. 6454 6455@item -N 6456Only useful together with @samp{-d @var{dir}}. With this 6457option, @sc{cvs} will not shorten module paths in your 6458working directory. (Normally, @sc{cvs} shortens paths as 6459much as possible when you specify an explicit target 6460directory). 6461 6462@item -s 6463Like @samp{-c}, but include the status of all modules, 6464and sort it by the status string. @xref{modules}, for 6465info about the @samp{-s} option that is used inside the 6466modules file to set the module status. 6467@end table 6468 6469@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6470@node checkout examples 6471@appendixsubsec checkout examples 6472 6473Get a copy of the module @samp{tc}: 6474 6475@example 6476$ cvs checkout tc 6477@end example 6478 6479Get a copy of the module @samp{tc} as it looked one day 6480ago: 6481 6482@example 6483$ cvs checkout -D yesterday tc 6484@end example 6485 6486@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6487@node commit 6488@appendixsec commit---Check files into the repository 6489@cindex Commit (subcommand) 6490 6491@itemize @bullet 6492@item 6493Version 1.3 Synopsis: commit [-lnR] [-m 'log_message' | 6494-f file] [-r revision] [files@dots{}] 6495@item 6496Version 1.3.1 Synopsis: commit [-lnRf] [-m 'log_message' | 6497-F file] [-r revision] [files@dots{}] 6498@c -- rename-f-F-- 6499@item 6500Requires: working directory, repository. 6501@item 6502Changes: repository. 6503@item 6504Synonym: ci 6505@end itemize 6506 6507@strong{Warning:} The @samp{-f @var{file}} option will 6508probably be renamed to @samp{-F @var{file}}, and @samp{-f} 6509will be given a new behavior in future releases of @sc{cvs}. 6510@c -- rename-f-F-- 6511 6512Use @code{commit} when you want to incorporate changes 6513from your working source files into the source 6514repository. 6515 6516If you don't specify particular files to commit, all of 6517the files in your working current directory are 6518examined. @code{commit} is careful to change in the 6519repository only those files that you have really 6520changed. By default (or if you explicitly specify the 6521@samp{-R} option), files in subdirectories are also 6522examined and committed if they have changed; you can 6523use the @samp{-l} option to limit @code{commit} to the 6524current directory only. 6525 6526@code{commit} verifies that the selected files are up 6527to date with the current revisions in the source 6528repository; it will notify you, and exit without 6529committing, if any of the specified files must be made 6530current first with @code{update} (@pxref{update}). 6531@code{commit} does not call the @code{update} command 6532for you, but rather leaves that for you to do when the 6533time is right. 6534 6535When all is well, an editor is invoked to allow you to 6536enter a log message that will be written to one or more 6537logging programs (@pxref{modules}, and @pxref{loginfo}) 6538and placed in the @sc{rcs} history file inside the 6539repository. This log message can be retrieved with the 6540@code{log} command; @xref{log}. You can specify the 6541log message on the command line with the @samp{-m 6542@var{message}} option, and thus avoid the editor invocation, 6543or use the @samp{-f @var{file}} option to specify 6544@c -- rename-f-F-- 6545that the argument file contains the log message. 6546 6547@menu 6548* commit options:: commit options 6549* commit examples:: commit examples 6550@end menu 6551 6552@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6553@node commit options 6554@appendixsubsec commit options 6555 6556These standard options are supported by @code{commit} 6557(@pxref{Common options}, for a complete description of 6558them): 6559 6560@table @code 6561@item -l 6562Local; run only in current working directory. 6563 6564@item -n 6565Do not run any module program. 6566 6567@item -R 6568Commit directories recursively. This is on by default. 6569 6570@item -r @var{revision} 6571Commit to @var{revision}. @var{revision} must be 6572either a branch, or a revision on the main trunk that 6573is higher than any existing revision number 6574(@pxref{Assigning revisions}). You 6575cannot commit to a specific revision on a branch. 6576@c FIXME: Need xref for branch case. 6577@end table 6578 6579@code{commit} also supports these options: 6580 6581@table @code 6582@item -F @var{file} 6583Read the log message from @var{file}, instead 6584of invoking an editor. 6585 6586@item -f 6587Note that this is not the standard behavior of 6588the @samp{-f} option as defined in @xref{Common options}. 6589 6590Force @sc{cvs} to commit a new revision even if you haven't 6591made any changes to the file. If the current revision 6592of @var{file} is 1.7, then the following two commands 6593are equivalent: 6594 6595@example 6596$ cvs commit -f @var{file} 6597$ cvs commit -r 1.8 @var{file} 6598@end example 6599 6600@c This is odd, but it's how CVS has worked for some 6601@c time. 6602The @samp{-f} option disables recursion (i.e., it 6603implies @samp{-l}). To force @sc{cvs} to commit a new 6604revision for all files in all subdirectories, you must 6605use @samp{-f -R}. 6606 6607@item -m @var{message} 6608Use @var{message} as the log message, instead of 6609invoking an editor. 6610@end table 6611 6612@need 2000 6613@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6614@node commit examples 6615@appendixsubsec commit examples 6616 6617@appendixsubsubsec Committing to a branch 6618 6619You can commit to a branch revision (one that has an 6620even number of dots) with the @samp{-r} option. To 6621create a branch revision, use the @samp{-b} option 6622of the @code{rtag} or @code{tag} commands (@pxref{tag} 6623or @pxref{rtag}). Then, either @code{checkout} or 6624@code{update} can be used to base your sources on the 6625newly created branch. From that point on, all 6626@code{commit} changes made within these working sources 6627will be automatically added to a branch revision, 6628thereby not disturbing main-line development in any 6629way. For example, if you had to create a patch to the 66301.2 version of the product, even though the 2.0 version 6631is already under development, you might do: 6632 6633@example 6634$ cvs rtag -b -r FCS1_2 FCS1_2_Patch product_module 6635$ cvs checkout -r FCS1_2_Patch product_module 6636$ cd product_module 6637[[ hack away ]] 6638$ cvs commit 6639@end example 6640 6641@noindent 6642This works automatically since the @samp{-r} option is 6643sticky. 6644 6645@appendixsubsubsec Creating the branch after editing 6646 6647Say you have been working on some extremely 6648experimental software, based on whatever revision you 6649happened to checkout last week. If others in your 6650group would like to work on this software with you, but 6651without disturbing main-line development, you could 6652commit your change to a new branch. Others can then 6653checkout your experimental stuff and utilize the full 6654benefit of @sc{cvs} conflict resolution. The scenario might 6655look like: 6656 6657@c FIXME: Should we be recommending tagging the branchpoint? 6658@example 6659[[ hacked sources are present ]] 6660$ cvs tag -b EXPR1 6661$ cvs update -r EXPR1 6662$ cvs commit 6663@end example 6664 6665The @code{update} command will make the @samp{-r 6666EXPR1} option sticky on all files. Note that your 6667changes to the files will never be removed by the 6668@code{update} command. The @code{commit} will 6669automatically commit to the correct branch, because the 6670@samp{-r} is sticky. You could also do like this: 6671 6672@c FIXME: Should we be recommending tagging the branchpoint? 6673@example 6674[[ hacked sources are present ]] 6675$ cvs tag -b EXPR1 6676$ cvs commit -r EXPR1 6677@end example 6678 6679@noindent 6680but then, only those files that were changed by you 6681will have the @samp{-r EXPR1} sticky flag. If you hack 6682away, and commit without specifying the @samp{-r EXPR1} 6683flag, some files may accidentally end up on the main 6684trunk. 6685 6686To work with you on the experimental change, others 6687would simply do 6688 6689@example 6690$ cvs checkout -r EXPR1 whatever_module 6691@end example 6692 6693@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6694@node diff 6695@appendixsec diff---Run diffs between revisions 6696@cindex Diff (subcommand) 6697 6698@itemize @bullet 6699@item 6700Synopsis: diff [-l] [rcsdiff_options] [[-r rev1 | -D date1] [-r rev2 | -D date2]] [files@dots{}] 6701@item 6702Requires: working directory, repository. 6703@item 6704Changes: nothing. 6705@end itemize 6706 6707The @code{diff} command is used to compare different 6708revisions of files. The default action is to compare 6709your working files with the revisions they were based 6710on, and report any differences that are found. 6711 6712If any file names are given, only those files are 6713compared. If any directories are given, all files 6714under them will be compared. 6715 6716The exit status will be 0 if no differences were found, 67171 if some differences were found, and 2 if any error 6718occurred. 6719 6720@menu 6721* diff options:: diff options 6722* diff examples:: diff examples 6723@end menu 6724 6725@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6726@node diff options 6727@appendixsubsec diff options 6728 6729These standard options are supported by @code{diff} 6730(@pxref{Common options}, for a complete description of 6731them): 6732 6733@table @code 6734@item -D @var{date} 6735Use the most recent revision no later than @var{date}. 6736See @samp{-r} for how this affects the comparison. 6737 6738@item -k @var{kflag} 6739Process @sc{rcs} keywords according to @var{kflag}. See 6740co(1). 6741 6742@item -l 6743Local; run only in current working directory. 6744 6745@item -R 6746Examine directories recursively. This option is on by 6747default. 6748 6749@item -r @var{tag} 6750Compare with revision @var{tag}. Zero, one or two 6751@samp{-r} options can be present. With no @samp{-r} 6752option, the working file will be compared with the 6753revision it was based on. With one @samp{-r}, that 6754revision will be compared to your current working file. 6755With two @samp{-r} options those two revisions will be 6756compared (and your working file will not affect the 6757outcome in any way). 6758 6759One or both @samp{-r} options can be replaced by a 6760@samp{-D @var{date}} option, described above. 6761 6762@item --ifdef=@var{arg} 6763Output in ifdef format. Consult the documentation of 6764your underlying diff program concerning the @samp{-D} 6765option to diff, for more information on this format. 6766@end table 6767 6768@c FIXME? Probably should document -c here, and 6769@c perhaps arrange for CVS to support it via a diff library or 6770@c some such. Or perhaps figure that "all" diff 6771@c programs support -c? Ideas is to preserve the 6772@c ability to pass the buck to diff on all the hairy 6773@c stuff, while still providing at least one, and 6774@c perhaps several popular standard formats. But this 6775@c is all in the idea stage, and probably needs more 6776@c thought and refinement. -u might be similar, in 6777@c terms of being something that it might make sense to 6778@c document here. 6779@c FIXME: also should be a way to pass through 6780@c arbitrary options, so that the user can do 6781@c "--pass=-Z --pass=foo" or something even if CVS 6782@c doesn't know about the -Z option to diff. 6783@c Note on -N: The current CVS implementation does require that the 6784@c underlying diff supports -N so we can document it as 6785@c a pass-through even if the implementation details 6786@c are more complicated. 6787@c 6788@c FIXME? Reference to discussion of which diff CVS 6789@c uses (one in path, or....). 6790The following options are passed through to 6791@code{rcsdiff}, which in turn passes them to 6792@code{diff}. The exact meaning of the options depends 6793on which @code{diff} you are using. See the 6794documentation for your @code{diff} for details. 6795 6796@code{-a} @code{-b} @code{-B} @code{-c} @w{@code{-C} 6797@var{nlines}} @code{-d} @code{-e} @code{-f} @code{-h} 6798@code{-H} @code{-i} @code{-n} @code{-N} @code{-p} 6799@code{-s} @code{-t} @code{-u} @code{-U} @var{nlines} 6800@w{@code{-F} @var{regexp}} @w{@code{-I} @var{regexp}} 6801@w{@code{-L} @var{label}} @code{-T} @w{@code{-V} 6802@var{arg}} @w{@code{-W} @var{columns}} @code{-w} 6803@code{-y} @code{-0} @code{-1} @code{-2} @code{-3} 6804@code{-4} @code{-5} @code{-6} @code{-7} @code{-8} 6805@code{-9} @code{--binary} @code{--brief} 6806@code{--changed-group-format=@var{arg}} 6807@code{--context[=@var{lines}]} @code{--ed} 6808@code{--expand-tabs} @code{--forward-ed} 6809@code{--horizon-lines=@var{arg}} 6810@code{--ignore-all-space} @code{--ignore-blank-lines} 6811@code{--ignore-case} 6812@code{--ignore-matching-lines=@var{regexp}} 6813@code{--ignore-space-change} @code{--initial-tab} 6814@code{--label=@var{label}} @code{--left-column} 6815@code{--minimal} @code{--new-file} 6816@code{--new-line-format=@var{arg}} 6817@code{--old-line-format=@var{arg}} @code{--paginate} 6818@code{--rcs} @code{--report-identical-files} 6819@code{--code-c-function} @code{--side-by-side} 6820@code{--show-function-line=@var{regexp}} 6821@code{--speed-large-files} 6822@code{--suppress-common-lines} @code{--text} 6823@code{--unchanged-group-format=@var{arg}} 6824@code{--unified[=@var{lines}]} 6825@code{--width=@var{columns}} 6826 6827@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6828@node diff examples 6829@appendixsubsec diff examples 6830 6831The following line produces a Unidiff (@samp{-u} flag) 6832between revision 1.14 and 1.19 of 6833@file{backend.c}. Due to the @samp{-kk} flag no 6834keywords are substituted, so differences that only depend 6835on keyword substitution are ignored. 6836 6837@example 6838$ cvs diff -kk -u -r 1.14 -r 1.19 backend.c 6839@end example 6840 6841Suppose the experimental branch EXPR1 was based on a 6842set of files tagged RELEASE_1_0. To see what has 6843happened on that branch, the following can be used: 6844 6845@example 6846$ cvs diff -r RELEASE_1_0 -r EXPR1 6847@end example 6848 6849A command like this can be used to produce a context 6850diff between two releases: 6851 6852@example 6853$ cvs diff -c -r RELEASE_1_0 -r RELEASE_1_1 > diffs 6854@end example 6855 6856If you are maintaining ChangeLogs, a command like the following 6857just before you commit your changes may help you write 6858the ChangeLog entry. All local modifications that have 6859not yet been committed will be printed. 6860 6861@example 6862$ cvs diff -u | less 6863@end example 6864 6865@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6866@node export 6867@appendixsec export---Export sources from CVS, similar to checkout 6868@cindex Export (subcommand) 6869 6870@itemize @bullet 6871@item 6872Synopsis: export [-flNn] [-r rev|-D date] [-k subst] [-d dir] module@dots{} 6873@item 6874Requires: repository. 6875@item 6876Changes: current directory. 6877@end itemize 6878 6879This command is a variant of @code{checkout}; use it 6880when you want a copy of the source for module without 6881the @sc{cvs} administrative directories. For example, you 6882might use @code{export} to prepare source for shipment 6883off-site. This command requires that you specify a 6884date or tag (with @samp{-D} or @samp{-r}), so that you 6885can count on reproducing the source you ship to others. 6886 6887One often would like to use @samp{-kv} with @code{cvs 6888export}. This causes any @sc{rcs} keywords to be 6889expanded such that an import done at some other site 6890will not lose the keyword revision information. But be 6891aware that doesn't handle an export containing binary 6892files correctly. Also be aware that after having used 6893@samp{-kv}, one can no longer use the @code{ident} 6894command (which is part of the @sc{rcs} suite---see 6895ident(1)) which looks for @sc{rcs} keyword strings. If 6896you want to be able to use @code{ident} you must not 6897use @samp{-kv}. 6898 6899@menu 6900* export options:: export options 6901@end menu 6902 6903@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6904@node export options 6905@appendixsubsec export options 6906 6907These standard options are supported by @code{export} 6908(@pxref{Common options}, for a complete description of 6909them): 6910 6911@table @code 6912@item -D @var{date} 6913Use the most recent revision no later than @var{date}. 6914 6915@item -f 6916If no matching revision is found, retrieve the most 6917recent revision (instead of ignoring the file). 6918 6919@item -l 6920Local; run only in current working directory. 6921 6922@item -n 6923Do not run any checkout program. 6924 6925@item -R 6926Export directories recursively. This is on by default. 6927 6928@item -r @var{tag} 6929Use revision @var{tag}. 6930@end table 6931 6932In addition, these options (that are common to 6933@code{checkout} and @code{export}) are also supported: 6934 6935@table @code 6936@item -d @var{dir} 6937Create a directory called @var{dir} for the working 6938files, instead of using the module name. Unless you 6939also use @samp{-N}, the paths created under @var{dir} 6940will be as short as possible. 6941 6942@item -k @var{subst} 6943Set keyword expansion mode (@pxref{Substitution modes}). 6944 6945@item -N 6946Only useful together with @samp{-d @var{dir}}. With this 6947option, @sc{cvs} will not shorten module paths in your 6948working directory. (Normally, @sc{cvs} shortens paths as 6949much as possible when you specify an explicit target 6950directory.) 6951@end table 6952 6953@ignore 6954@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6955@c @node export examples 6956@appendixsubsec export examples 6957 6958Contributed examples are gratefully accepted. 6959@c -- Examples here!! 6960@end ignore 6961 6962@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 6963@node history 6964@appendixsec history---Show status of files and users 6965@cindex History (subcommand) 6966 6967@itemize @bullet 6968@item 6969Synopsis: history [-report] [-flags] [-options args] [files@dots{}] 6970@item 6971Requires: the file @file{$CVSROOT/CVSROOT/history} 6972@item 6973Changes: nothing. 6974@end itemize 6975 6976@sc{cvs} can keep a history file that tracks each use of the 6977@code{checkout}, @code{commit}, @code{rtag}, 6978@code{update}, and @code{release} commands. You can 6979use @code{history} to display this information in 6980various formats. 6981 6982Logging must be enabled by creating the file 6983@file{$CVSROOT/CVSROOT/history}. 6984 6985@strong{Warning:} @code{history} uses @samp{-f}, @samp{-l}, 6986@samp{-n}, and @samp{-p} in ways that conflict with the 6987normal use inside @sc{cvs} (@pxref{Common options}). 6988 6989@menu 6990* history options:: history options 6991@end menu 6992 6993@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6994@node history options 6995@appendixsubsec history options 6996 6997Several options (shown above as @samp{-report}) control what 6998kind of report is generated: 6999 7000@table @code 7001@item -c 7002Report on each time commit was used (i.e., each time 7003the repository was modified). 7004 7005@item -e 7006Everything (all record types); equivalent to specifying 7007@samp{-xMACFROGWUT}. 7008 7009@item -m @var{module} 7010Report on a particular module. (You can meaningfully 7011use @samp{-m} more than once on the command line.) 7012 7013@item -o 7014Report on checked-out modules. 7015 7016@item -T 7017Report on all tags. 7018 7019@item -x @var{type} 7020Extract a particular set of record types @var{type} from the @sc{cvs} 7021history. The types are indicated by single letters, 7022which you may specify in combination. 7023 7024Certain commands have a single record type: 7025 7026@table @code 7027@item F 7028release 7029@item O 7030checkout 7031@item E 7032export 7033@item T 7034rtag 7035@end table 7036 7037@noindent 7038One of four record types may result from an update: 7039 7040@table @code 7041@item C 7042A merge was necessary but collisions were 7043detected (requiring manual merging). 7044@item G 7045A merge was necessary and it succeeded. 7046@item U 7047A working file was copied from the repository. 7048@item W 7049The working copy of a file was deleted during 7050update (because it was gone from the repository). 7051@end table 7052 7053@noindent 7054One of three record types results from commit: 7055 7056@table @code 7057@item A 7058A file was added for the first time. 7059@item M 7060A file was modified. 7061@item R 7062A file was removed. 7063@end table 7064@end table 7065 7066The options shown as @samp{-flags} constrain or expand 7067the report without requiring option arguments: 7068 7069@table @code 7070@item -a 7071Show data for all users (the default is to show data 7072only for the user executing @code{history}). 7073 7074@item -l 7075Show last modification only. 7076 7077@item -w 7078Show only the records for modifications done from the 7079same working directory where @code{history} is 7080executing. 7081@end table 7082 7083The options shown as @samp{-options @var{args}} constrain the report 7084based on an argument: 7085 7086@table @code 7087@item -b @var{str} 7088Show data back to a record containing the string 7089@var{str} in either the module name, the file name, or 7090the repository path. 7091 7092@item -D @var{date} 7093Show data since @var{date}. This is slightly different 7094from the normal use of @samp{-D @var{date}}, which 7095selects the newest revision older than @var{date}. 7096 7097@item -p @var{repository} 7098Show data for a particular source repository (you 7099can specify several @samp{-p} options on the same command 7100line). 7101 7102@item -r @var{rev} 7103Show records referring to revisions since the revision 7104or tag named @var{rev} appears in individual @sc{rcs} 7105files. Each @sc{rcs} file is searched for the revision or 7106tag. 7107 7108@item -t @var{tag} 7109Show records since tag @var{tag} was last added to the the 7110history file. This differs from the @samp{-r} flag 7111above in that it reads only the history file, not the 7112@sc{rcs} files, and is much faster. 7113 7114@item -u @var{name} 7115Show records for user @var{name}. 7116@end table 7117 7118@ignore 7119@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7120@c @node history examples 7121@appendixsubsec history examples 7122 7123Contributed examples will gratefully be accepted. 7124@c -- Examples here! 7125@end ignore 7126 7127@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 7128@node import 7129@appendixsec import---Import sources into CVS, using vendor branches 7130@cindex Import (subcommand) 7131 7132@c FIXME: This node is way too long for one which has subnodes. 7133 7134@itemize @bullet 7135@item 7136Synopsis: import [-options] repository vendortag releasetag@dots{} 7137@item 7138Requires: Repository, source distribution directory. 7139@item 7140Changes: repository. 7141@end itemize 7142 7143Use @code{import} to incorporate an entire source 7144distribution from an outside source (e.g., a source 7145vendor) into your source repository directory. You can 7146use this command both for initial creation of a 7147repository, and for wholesale updates to the module 7148from the outside source. @xref{Tracking sources}, for 7149a discussion on this subject. 7150 7151The @var{repository} argument gives a directory name 7152(or a path to a directory) under the @sc{cvs} root directory 7153for repositories; if the directory did not exist, 7154import creates it. 7155 7156When you use import for updates to source that has been 7157modified in your source repository (since a prior 7158import), it will notify you of any files that conflict 7159in the two branches of development; use @samp{checkout 7160-j} to reconcile the differences, as import instructs 7161you to do. 7162 7163If @sc{cvs} decides a file should be ignored 7164(@pxref{cvsignore}), it does not import it and prints 7165@samp{I } followed by the filename (@pxref{import output}, for a 7166complete description of the output). 7167 7168If the file @file{$CVSROOT/CVSROOT/cvswrappers} exists, 7169any file whose names match the specifications in that 7170file will be treated as packages and the appropriate 7171filtering will be performed on the file/directory 7172before being imported, @xref{Wrappers}. 7173 7174The outside source is saved in a first-level @sc{rcs} 7175branch, by default 1.1.1. Updates are leaves of this 7176branch; for example, files from the first imported 7177collection of source will be revision 1.1.1.1, then 7178files from the first imported update will be revision 71791.1.1.2, and so on. 7180 7181At least three arguments are required. 7182@var{repository} is needed to identify the collection 7183of source. @var{vendortag} is a tag for the entire 7184branch (e.g., for 1.1.1). You must also specify at 7185least one @var{releasetag} to identify the files at 7186the leaves created each time you execute @code{import}. 7187 7188@c I'm not completely sure this belongs here. But 7189@c we need to say it _somewhere_ reasonably obvious; it 7190@c is a common misconception among people first learning CVS 7191Note that @code{import} does @emph{not} change the 7192directory in which you invoke it. In particular, it 7193does not set up that directory as a @sc{cvs} working 7194directory; if you want to work with the sources import 7195them first and then check them out into a different 7196directory (@pxref{Getting the source}). 7197 7198@menu 7199* import options:: import options 7200* import output:: import output 7201* import examples:: import examples 7202@end menu 7203 7204@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7205@node import options 7206@appendixsubsec import options 7207 7208This standard option is supported by @code{import} 7209(@pxref{Common options}, for a complete description): 7210 7211@table @code 7212@item -m @var{message} 7213Use @var{message} as log information, instead of 7214invoking an editor. 7215@end table 7216 7217There are three additional special options. 7218 7219@table @code 7220@item -b @var{branch} 7221Specify a first-level branch other than 1.1.1. Unless 7222the @samp{-b @var{branch}} flag is given, revisions will 7223@emph{always} be made to the branch 1.1.1---even if a 7224@var{vendortag} that matches another branch is given! 7225What happens in that case, is that the tag will be 7226reset to 1.1.1. Warning: This behavior might change 7227in the future. 7228 7229@item -k @var{subst} 7230Indicate the RCS keyword expansion mode desired. This 7231setting will apply to all files created during the 7232import, but not to any files that previously existed in 7233the repository. See @ref{Substitution modes}, for a 7234list of valid @samp{-k} settings. 7235 7236@item -I @var{name} 7237Specify file names that should be ignored during 7238import. You can use this option repeatedly. To avoid 7239ignoring any files at all (even those ignored by 7240default), specify `-I !'. 7241 7242@var{name} can be a file name pattern of the same type 7243that you can specify in the @file{.cvsignore} file. 7244@xref{cvsignore}. 7245@c -- Is this really true? 7246 7247@item -W @var{spec} 7248Specify file names that should be filtered during 7249import. You can use this option repeatedly. 7250 7251@var{spec} can be a file name pattern of the same type 7252that you can specify in the @file{.cvswrappers} 7253file. @xref{Wrappers}. 7254@end table 7255 7256@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7257@node import output 7258@appendixsubsec import output 7259 7260@code{import} keeps you informed of its progress by printing a line 7261for each file, preceded by one character indicating the status of the file: 7262 7263@table @code 7264@item U @var{file} 7265The file already exists in the repository and has not been locally 7266modified; a new revision has been created (if necessary). 7267 7268@item N @var{file} 7269The file is a new file which has been added to the repository. 7270 7271@item C @var{file} 7272The file already exists in the repository but has been locally modified; 7273you will have to merge the changes. 7274 7275@item I @var{file} 7276The file is being ignored (@pxref{cvsignore}). 7277 7278@cindex symbolic link, importing 7279@cindex link, symbolic, importing 7280@c FIXME: also (somewhere else) probably 7281@c should be documenting what happens if you "cvs add" 7282@c a symbolic link. Also maybe what happens if 7283@c you manually create symbolic links within the 7284@c repository (? - not sure why we'd want to suggest 7285@c doing that). 7286@item L @var{file} 7287The file is a symbolic link; @code{cvs import} ignores symbolic links. 7288People periodically suggest that this behavior should 7289be changed, but if there is a consensus on what it 7290should be changed to, it doesn't seem to be apparent. 7291(Various options in the @file{modules} file can be used 7292to recreate symbolic links on checkout, update, etc.; 7293@pxref{modules}.) 7294@end table 7295 7296@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7297@node import examples 7298@appendixsubsec import examples 7299 7300@xref{Tracking sources}, and @xref{From files}. 7301 7302@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 7303@node log 7304@appendixsec log---Print out log information for files 7305@cindex Log (subcommand) 7306 7307@itemize @bullet 7308@item 7309Synopsis: log [options] [files@dots{}] 7310@item 7311Requires: repository, working directory. 7312@item 7313Changes: nothing. 7314@end itemize 7315 7316Display log information for files. @code{log} used to 7317call the @sc{rcs} utility @code{rlog}. Although this 7318is no longer true in the current sources, this history 7319determines the format of the output and the options, 7320which are not quite in the style of the other @sc{cvs} 7321commands. 7322 7323@cindex timezone, in output 7324@cindex zone, time, in output 7325@c Kind of a funny place to document the timezone used 7326@c in output from commands other than @code{log}. 7327@c There is also more we need to say about this, 7328@c including what happens in a client/server environment. 7329The output includes the location of the @sc{rcs} file, 7330the @dfn{head} revision (the latest revision on the 7331trunk), all symbolic names (tags) and some other 7332things. For each revision, the revision number, the 7333author, the number of lines added/deleted and the log 7334message are printed. All times are displayed in 7335Coordinated Universal Time (UTC). (Other parts of 7336@sc{cvs} print times in the local timezone). 7337@c FIXCVS: need a better way to control the timezone 7338@c used in output. Previous/current versions of CVS did/do 7339@c sometimes support -z in RCSINIT, and/or an 7340@c undocumented (except by reference to 'rlog') -z option 7341@c to cvs log, but this has not been a consistent, 7342@c documented feature. Perhaps a new global option, 7343@c where LT means the client's timezone, which the 7344@c client then communicates to the server, is the 7345@c right solution. 7346 7347@menu 7348* log options:: log options 7349* log examples:: log examples 7350@end menu 7351 7352@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7353@node log options 7354@appendixsubsec log options 7355 7356By default, @code{log} prints all information that is 7357available. All other options restrict the output. 7358 7359@table @code 7360@item -b 7361Print information about the revisions on the default 7362branch, normally the highest branch on the trunk. 7363 7364@item -d @var{dates} 7365Print information about revisions with a checkin 7366date/time in the range given by the 7367semicolon-separated list of dates. The date formats 7368accepted are those accepted by the @samp{-D} option to 7369many other @sc{cvs} commands (@pxref{Common options}). 7370Dates can be combined into ranges as follows: 7371 7372@c Should we be thinking about accepting ISO8601 7373@c ranges? For example "1972-09-10/1972-09-12". 7374@table @code 7375@item @var{d1}<@var{d2} 7376@itemx @var{d2}>@var{d1} 7377Select the revisions that were deposited between 7378@var{d1} and @var{d2}. 7379 7380@item <@var{d} 7381@itemx @var{d}> 7382Select all revisions dated @var{d} or earlier. 7383 7384@item @var{d}< 7385@itemx >@var{d} 7386Select all revisions dated @var{d} or later. 7387 7388@item @var{d} 7389Select the single, latest revision dated @var{d} or 7390earlier. 7391@end table 7392 7393The @samp{>} or @samp{<} characters may be followed by 7394@samp{=} to indicate an inclusive range rather than an 7395exclusive one. 7396 7397Note that the separator is a semicolon (;). 7398 7399@item -h 7400Print only the @sc{rcs} pathname, working pathname, head, 7401default branch, access list, locks, symbolic names, and 7402suffix. 7403 7404@item -l 7405Local; run only in current working directory. (Default 7406is to run recursively). 7407 7408@item -N 7409Do not print the list of tags for this file. This 7410option can be very useful when your site uses a lot of 7411tags, so rather than "more"'ing over 3 pages of tag 7412information, the log information is presented without 7413tags at all. 7414 7415@item -R 7416Print only the name of the @sc{rcs} history file. 7417 7418@item -r@var{revisions} 7419Print information about revisions given in the 7420comma-separated list @var{revisions} of revisions and 7421ranges. The following table explains the available 7422range formats: 7423 7424@table @code 7425@item @var{rev1}:@var{rev2} 7426Revisions @var{rev1} to @var{rev2} (which must be on 7427the same branch). 7428 7429@item :@var{rev} 7430Revisions from the beginning of the branch up to 7431and including @var{rev}. 7432 7433@item @var{rev}: 7434Revisions starting with @var{rev} to the end of the 7435branch containing @var{rev}. 7436 7437@item @var{branch} 7438An argument that is a branch means all revisions on 7439that branch. 7440 7441@item @var{branch1}:@var{branch2} 7442A range of branches means all revisions 7443on the branches in that range. 7444 7445@item @var{branch}. 7446The latest revision in @var{branch}. 7447@end table 7448 7449A bare @samp{-r} with no revisions means the latest 7450revision on the default branch, normally the trunk. 7451There can be no space between the @samp{-r} option and 7452its argument. 7453 7454@item -s @var{states} 7455Print information about revisions whose state 7456attributes match one of the states given in the 7457comma-separated list @var{states}. 7458 7459@item -t 7460Print the same as @samp{-h}, plus the descriptive text. 7461 7462@item -w@var{logins} 7463Print information about revisions checked in by users 7464with login names appearing in the comma-separated list 7465@var{logins}. If @var{logins} is omitted, the user's 7466login is assumed. There can be no space between the 7467@samp{-w} option and its argument. 7468@end table 7469 7470@code{log} prints the intersection of the revisions 7471selected with the options @samp{-d}, @samp{-s}, and 7472@samp{-w}, intersected with the union of the revisions 7473selected by @samp{-b} and @samp{-r}. 7474 7475@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7476@node log examples 7477@appendixsubsec log examples 7478 7479Contributed examples are gratefully accepted. 7480 7481@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 7482@node rdiff 7483@appendixsec rdiff---'patch' format diffs between releases 7484@cindex Rdiff (subcommand) 7485 7486@itemize @bullet 7487@item 7488rdiff [-flags] [-V vn] [-r t|-D d [-r t2|-D d2]] modules@dots{} 7489@item 7490Requires: repository. 7491@item 7492Changes: nothing. 7493@item 7494Synonym: patch 7495@end itemize 7496 7497Builds a Larry Wall format patch(1) file between two 7498releases, that can be fed directly into the patch 7499program to bring an old release up-to-date with the new 7500release. (This is one of the few @sc{cvs} commands that 7501operates directly from the repository, and doesn't 7502require a prior checkout.) The diff output is sent to 7503the standard output device. 7504 7505You can specify (using the standard @samp{-r} and 7506@samp{-D} options) any combination of one or two 7507revisions or dates. If only one revision or date is 7508specified, the patch file reflects differences between 7509that revision or date and the current head revisions in 7510the @sc{rcs} file. 7511 7512Note that if the software release affected is contained 7513in more than one directory, then it may be necessary to 7514specify the @samp{-p} option to the patch command when 7515patching the old sources, so that patch is able to find 7516the files that are located in other directories. 7517 7518@menu 7519* rdiff options:: rdiff options 7520* rdiff examples:: rdiff examples 7521@end menu 7522 7523@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7524@node rdiff options 7525@appendixsubsec rdiff options 7526 7527These standard options are supported by @code{rdiff} 7528(@pxref{Common options}, for a complete description of 7529them): 7530 7531@table @code 7532@item -D @var{date} 7533Use the most recent revision no later than @var{date}. 7534 7535@item -f 7536If no matching revision is found, retrieve the most 7537recent revision (instead of ignoring the file). 7538 7539@item -l 7540Local; don't descend subdirectories. 7541 7542@item -r @var{tag} 7543Use revision @var{tag}. 7544@end table 7545 7546In addition to the above, these options are available: 7547 7548@table @code 7549@item -c 7550Use the context diff format. This is the default format. 7551 7552@item -s 7553Create a summary change report instead of a patch. The 7554summary includes information about files that were 7555changed or added between the releases. It is sent to 7556the standard output device. This is useful for finding 7557out, for example, which files have changed between two 7558dates or revisions. 7559 7560@item -t 7561A diff of the top two revisions is sent to the standard 7562output device. This is most useful for seeing what the 7563last change to a file was. 7564 7565@item -u 7566Use the unidiff format for the context diffs. 7567This option is not available if your diff does not 7568support the unidiff format. Remember that old versions 7569of the @code{patch} program can't handle the unidiff 7570format, so if you plan to post this patch to the net 7571you should probably not use @samp{-u}. 7572 7573@item -V @var{vn} 7574Expand @sc{rcs} keywords according to the rules current in 7575@sc{rcs} version @var{vn} (the expansion format changed with 7576@sc{rcs} version 5). 7577@end table 7578 7579@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7580@node rdiff examples 7581@appendixsubsec rdiff examples 7582 7583Suppose you receive mail from @t{foo@@bar.com} asking for an 7584update from release 1.2 to 1.4 of the tc compiler. You 7585have no such patches on hand, but with @sc{cvs} that can 7586easily be fixed with a command such as this: 7587 7588@example 7589$ cvs rdiff -c -r FOO1_2 -r FOO1_4 tc | \ 7590$$ Mail -s 'The patches you asked for' foo@@bar.com 7591@end example 7592 7593Suppose you have made release 1.3, and forked a branch 7594called @samp{R_1_3fix} for bugfixes. @samp{R_1_3_1} 7595corresponds to release 1.3.1, which was made some time 7596ago. Now, you want to see how much development has been 7597done on the branch. This command can be used: 7598 7599@example 7600$ cvs patch -s -r R_1_3_1 -r R_1_3fix module-name 7601cvs rdiff: Diffing module-name 7602File ChangeLog,v changed from revision 1.52.2.5 to 1.52.2.6 7603File foo.c,v changed from revision 1.52.2.3 to 1.52.2.4 7604File bar.h,v changed from revision 1.29.2.1 to 1.2 7605@end example 7606 7607@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 7608@node release 7609@appendixsec release---Indicate that a Module is no longer in use 7610@cindex Release (subcommand) 7611 7612@itemize @bullet 7613@item 7614release [-d] directories@dots{} 7615@item 7616Requires: Working directory. 7617@item 7618Changes: Working directory, history log. 7619@end itemize 7620 7621This command is meant to safely cancel the effect of 7622@samp{cvs checkout}. Since @sc{cvs} doesn't lock files, it 7623isn't strictly necessary to use this command. You can 7624always simply delete your working directory, if you 7625like; but you risk losing changes you may have 7626forgotten, and you leave no trace in the @sc{cvs} history 7627file (@pxref{history file}) that you've abandoned your 7628checkout. 7629 7630Use @samp{cvs release} to avoid these problems. This 7631command checks that no uncommitted changes are 7632present; that you are executing it from immediately 7633above a @sc{cvs} working directory; and that the repository 7634recorded for your files is the same as the repository 7635defined in the module database. 7636 7637If all these conditions are true, @samp{cvs release} 7638leaves a record of its execution (attesting to your 7639intentionally abandoning your checkout) in the @sc{cvs} 7640history log. 7641 7642@menu 7643* release options:: release options 7644* release output:: release output 7645* release examples:: release examples 7646@end menu 7647 7648@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7649@node release options 7650@appendixsubsec release options 7651 7652The @code{release} command supports one command option: 7653 7654@table @code 7655@item -d 7656Delete your working copy of the file if the release 7657succeeds. If this flag is not given your files will 7658remain in your working directory. 7659 7660@strong{Warning:} The @code{release} command deletes 7661all directories and files recursively. This 7662has the very serious side-effect that any directory 7663that you have created inside your checked-out sources, 7664and not added to the repository (using the @code{add} 7665command; @pxref{Adding files}) will be silently deleted---even 7666if it is non-empty! 7667@end table 7668 7669@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7670@node release output 7671@appendixsubsec release output 7672 7673Before @code{release} releases your sources it will 7674print a one-line message for any file that is not 7675up-to-date. 7676 7677@strong{Warning:} Any new directories that you have 7678created, but not added to the @sc{cvs} directory hierarchy 7679with the @code{add} command (@pxref{Adding files}) will be 7680silently ignored (and deleted, if @samp{-d} is 7681specified), even if they contain files. 7682@c FIXCVS: This is a bug. But is it true? I think 7683@c maybe they print "? dir" now. 7684 7685@table @code 7686@item U @var{file} 7687@itemx P @var{file} 7688There exists a newer revision of this file in the 7689repository, and you have not modified your local copy 7690of the file (@samp{U} and @samp{P} mean the same thing). 7691 7692@item A @var{file} 7693The file has been added to your private copy of the 7694sources, but has not yet been committed to the 7695repository. If you delete your copy of the sources 7696this file will be lost. 7697 7698@item R @var{file} 7699The file has been removed from your private copy of the 7700sources, but has not yet been removed from the 7701repository, since you have not yet committed the 7702removal. @xref{commit}. 7703 7704@item M @var{file} 7705The file is modified in your working directory. There 7706might also be a newer revision inside the repository. 7707 7708@item ? @var{file} 7709@var{file} is in your working directory, but does not 7710correspond to anything in the source repository, and is 7711not in the list of files for @sc{cvs} to ignore (see the 7712description of the @samp{-I} option, and 7713@pxref{cvsignore}). If you remove your working 7714sources, this file will be lost. 7715@end table 7716 7717@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7718@node release examples 7719@appendixsubsec release examples 7720 7721Release the module, and delete your local working copy 7722of the files. 7723 7724@example 7725$ cd .. # @r{You must stand immediately above the} 7726 # @r{sources when you issue @samp{cvs release}.} 7727$ cvs release -d tc 7728You have [0] altered files in this repository. 7729Are you sure you want to release (and delete) module `tc': y 7730$ 7731@end example 7732 7733@node rtag 7734@appendixsec rtag---Add a symbolic tag to a module 7735@cindex Rtag (subcommand) 7736 7737@itemize @bullet 7738@item 7739rtag [-falnR] [-b] [-d] [-r tag | -Ddate] symbolic_tag modules@dots{} 7740@item 7741Requires: repository. 7742@item 7743Changes: repository. 7744@item 7745Synonym: rfreeze 7746@end itemize 7747 7748You can use this command to assign symbolic tags to 7749particular, explicitly specified source revisions in 7750the repository. @code{rtag} works directly on the 7751repository contents (and requires no prior checkout). 7752Use @code{tag} instead (@pxref{tag}), to base the 7753selection of revisions on the contents of your 7754working directory. 7755 7756If you attempt to use a tag name that already exists, 7757@sc{cvs} will complain and not overwrite that tag. Use 7758the @samp{-F} option to force the new tag value. 7759 7760@menu 7761* rtag options:: rtag options 7762@end menu 7763 7764@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7765@node rtag options 7766@appendixsubsec rtag options 7767 7768These standard options are supported by @code{rtag} 7769(@pxref{Common options}, for a complete description of 7770them): 7771 7772@table @code 7773@item -D @var{date} 7774Tag the most recent revision no later than @var{date}. 7775 7776@item -f 7777Only useful with the @samp{-D @var{date}} or @samp{-r @var{tag}} 7778flags. If no matching revision is found, use the most 7779recent revision (instead of ignoring the file). 7780 7781@item -F 7782Overwrite an existing tag of the same name on a 7783different revision. This option is new in @sc{cvs} 77841.4. The old behavior is matched by @samp{cvs tag -F}. 7785 7786@item -l 7787Local; run only in current working directory. 7788 7789@item -n 7790Do not run any tag program that was specified with the 7791@samp{-t} flag inside the @file{modules} file. 7792(@pxref{modules}). 7793 7794@item -R 7795Commit directories recursively. This is on by default. 7796 7797@item -r @var{tag} 7798Only tag those files that contain @var{tag}. This can 7799be used to rename a tag: tag only the files identified 7800by the old tag, then delete the old tag, leaving the 7801new tag on exactly the same files as the old tag. 7802@end table 7803 7804In addition to the above common options, these options 7805are available: 7806 7807@table @code 7808@item -a 7809@c FIXME: What is an "Attic"? And what does this 7810@c option mean in terms of user concepts, not CVS 7811@c internals? 7812@c FIXME-also: Need to explain attic somewhere, since 7813@c it appears in user messages. Should clarify that 7814@c whether a file is in the attic is not something users 7815@c should worry about. Need index entry for "attic". 7816Use the @samp{-a} option to have @code{rtag} look in the 7817@file{Attic} (@pxref{Removing files}) for removed files 7818that contain the specified tag. The tag is removed from 7819these files, which makes it convenient to re-use a 7820symbolic tag as development continues (and files get 7821removed from the up-coming distribution). 7822 7823@item -b 7824Make the tag a branch tag. @xref{Revisions and branches}. 7825 7826@item -d 7827Delete the tag instead of creating it. 7828 7829In general, tags (often the symbolic names of software 7830distributions) should not be removed, but the @samp{-d} 7831option is available as a means to remove completely 7832obsolete symbolic names if necessary (as might be the 7833case for an Alpha release, or if you mistagged a 7834module). 7835@end table 7836 7837@ignore 7838@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7839@c @node rtag examples 7840@appendixsubsec rtag examples 7841 7842@c -- Examples here! 7843@end ignore 7844 7845@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 7846@node status 7847@appendixsec status---Display status information on checked out files 7848@cindex Status (subcommand) 7849 7850@c It is not clear to me what the best home for this 7851@c information is. Probably put a @deffn in "File 7852@c status" listing options and documenting -l and -R, 7853@c and refer to Sticky tags, 7854@c Tags, and <something for sticky options> for the more 7855@c obscure features. 7856 7857@itemize @bullet 7858@item 7859status [-lR] [-v] [files@dots{}] 7860@item 7861Requires: working directory, repository. 7862@item 7863Changes: nothing. 7864@end itemize 7865 7866Display a brief report on the current status of files 7867with respect to the source repository. For information 7868on the basic output see @ref{File status}. For 7869information on the @code{Sticky tag} and @code{Sticky 7870date} output, see @ref{Sticky tags}. For information 7871on the @code{Sticky options} output, see the @samp{-k} 7872option in @ref{update options}. 7873 7874You can also use this command to determine the 7875potential impact of a @samp{cvs update} on your working 7876source directory---but remember that things might 7877change in the repository before you run @code{update}. 7878 7879@menu 7880* status options:: status options 7881@end menu 7882 7883@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7884@node status options 7885@appendixsubsec status options 7886 7887These standard options are supported by @code{status} 7888(@pxref{Common options}, for a complete description of 7889them): 7890 7891@table @code 7892@item -l 7893Local; run only in current working directory. 7894 7895@item -R 7896Commit directories recursively. This is on by default. 7897@end table 7898 7899There is one additional option: 7900 7901@table @code 7902@item -v 7903Verbose. In addition to the information normally 7904displayed, print all symbolic tags, together with the 7905numerical value of the revision or branch they refer 7906to. For more information, see @ref{Tags} 7907@end table 7908 7909@ignore 7910@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7911@c @node status examples 7912@appendixsubsec status examples 7913 7914@c -- FIXME 7915@end ignore 7916 7917@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 7918@node tag 7919@appendixsec tag---Add a symbolic tag to checked out versions of files 7920@c -- //////// - unnecessary. Also 7921@c -- in a lot of other 7922@c -- places. 7923@cindex Tag (subcommand) 7924 7925@itemize @bullet 7926@item 7927tag [-lR] [-b] [-c] [-d] symbolic_tag [files@dots{}] 7928@item 7929Requires: working directory, repository. 7930@item 7931Changes: repository. 7932@item 7933Synonym: freeze 7934@end itemize 7935 7936Use this command to assign symbolic tags to the nearest 7937repository versions to your working sources. The tags 7938are applied immediately to the repository, as with 7939@code{rtag}, but the versions are supplied implicitly by the 7940@sc{cvs} records of your working files' history rather than 7941applied explicitly. 7942 7943One use for tags is to record a snapshot of the 7944current sources when the software freeze date of a 7945project arrives. As bugs are fixed after the freeze 7946date, only those changed sources that are to be part of 7947the release need be re-tagged. 7948 7949The symbolic tags are meant to permanently record which 7950revisions of which files were used in creating a 7951software distribution. The @code{checkout} and 7952@code{update} commands allow you to extract an exact 7953copy of a tagged release at any time in the future, 7954regardless of whether files have been changed, added, 7955or removed since the release was tagged. 7956 7957This command can also be used to delete a symbolic tag, 7958or to create a branch. See the options section below. 7959 7960If you attempt to use a tag name that already exists, 7961@sc{cvs} will complain and not overwrite that tag. Use 7962the @samp{-F} option to force the new tag value. 7963 7964 7965@menu 7966* tag options:: tag options 7967@end menu 7968 7969@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7970@node tag options 7971@appendixsubsec tag options 7972 7973These standard options are supported by @code{tag} 7974(@pxref{Common options}, for a complete description of 7975them): 7976 7977@table @code 7978@item -F 7979Overwrite an existing tag of the same name on a 7980different revision. This option is new in @sc{cvs} 79811.4. The old behavior is matched by @samp{cvs tag -F}. 7982 7983@item -l 7984Local; run only in current working directory. 7985 7986@item -R 7987Commit directories recursively. This is on by default. 7988@end table 7989 7990Two special options are available: 7991 7992@table @code 7993@item -b 7994The -b option makes the tag a branch tag 7995(@pxref{Revisions and branches}), allowing concurrent, isolated 7996development. This is most useful for creating a patch 7997to a previously released software distribution. 7998 7999@item -c 8000The -c option checks that all files which are to be tagged are 8001unmodified. This can be used to make sure that you can reconstruct the 8002current file contents. 8003 8004@item -d 8005Delete a tag. 8006 8007If you use @samp{cvs tag -d symbolic_tag}, the symbolic 8008tag you specify is deleted instead of being added. 8009Warning: Be very certain of your ground before you 8010delete a tag; doing this permanently discards some 8011historical information, which may later turn out to 8012be valuable. 8013@end table 8014 8015@ignore 8016@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8017@c @node tag examples 8018@appendixsubsec tag examples 8019 8020@c -- FIXME 8021@end ignore 8022 8023@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 8024@node update 8025@appendixsec update---Bring work tree in sync with repository 8026@cindex Update (subcommand) 8027 8028@itemize @bullet 8029@item 8030update [-AdflPpR] [-d] [-r tag|-D date] files@dots{} 8031@item 8032Requires: repository, working directory. 8033@item 8034Changes: working directory. 8035@end itemize 8036 8037After you've run checkout to create your private copy 8038of source from the common repository, other developers 8039will continue changing the central source. From time 8040to time, when it is convenient in your development 8041process, you can use the @code{update} command from 8042within your working directory to reconcile your work 8043with any revisions applied to the source repository 8044since your last checkout or update. 8045 8046@menu 8047* update options:: update options 8048* update output:: update output 8049* update examples:: update examples 8050@end menu 8051 8052@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8053@node update options 8054@appendixsubsec update options 8055 8056These standard options are available with @code{update} 8057(@pxref{Common options}, for a complete description of 8058them): 8059 8060@table @code 8061@item -D date 8062Use the most recent revision no later than @var{date}. 8063This option is sticky, and implies @samp{-P}. 8064See @ref{Sticky tags}, for more information on sticky tags/dates. 8065 8066@item -f 8067Only useful with the @samp{-D @var{date}} or @samp{-r 8068@var{tag}} flags. If no matching revision is found, 8069retrieve the most recent revision (instead of ignoring 8070the file). 8071 8072@item -k @var{kflag} 8073Process @sc{rcs} keywords according to @var{kflag}. See 8074co(1). This option is sticky; future updates of 8075this file in this working directory will use the same 8076@var{kflag}. The @code{status} command can be viewed 8077to see the sticky options. @xref{status}. 8078 8079@item -l 8080Local; run only in current working directory. @xref{Recursive behavior}. 8081 8082@item -P 8083Prune empty directories. See @ref{Moving directories}. 8084 8085@item -p 8086Pipe files to the standard output. 8087 8088@item -R 8089Operate recursively (default). @xref{Recursive 8090behavior}. 8091 8092@item -r tag 8093Retrieve revision @var{tag}. This option is sticky, 8094and implies @samp{-P}. 8095See @ref{Sticky tags}, for more information on sticky tags/dates. 8096@end table 8097 8098@need 800 8099These special options are also available with 8100@code{update}. 8101 8102@table @code 8103@item -A 8104Reset any sticky tags, dates, or @samp{-k} options. 8105See @ref{Sticky tags}, for more information on sticky tags/dates. 8106 8107@item -d 8108Create any directories that exist in the repository if 8109they're missing from the working directory. Normally, 8110@code{update} acts only on directories and files that 8111were already enrolled in your working directory. 8112 8113This is useful for updating directories that were 8114created in the repository since the initial checkout; 8115but it has an unfortunate side effect. If you 8116deliberately avoided certain directories in the 8117repository when you created your working directory 8118(either through use of a module name or by listing 8119explicitly the files and directories you wanted on the 8120command line), then updating with @samp{-d} will create 8121those directories, which may not be what you want. 8122 8123@item -I @var{name} 8124Ignore files whose names match @var{name} (in your 8125working directory) during the update. You can specify 8126@samp{-I} more than once on the command line to specify 8127several files to ignore. Use @samp{-I !} to avoid 8128ignoring any files at all. @xref{cvsignore}, for other 8129ways to make @sc{cvs} ignore some files. 8130 8131@item -W@var{spec} 8132Specify file names that should be filtered during 8133update. You can use this option repeatedly. 8134 8135@var{spec} can be a file name pattern of the same type 8136that you can specify in the @file{.cvswrappers} 8137file. @xref{Wrappers}. 8138 8139@item -j@var{revision} 8140With two @samp{-j} options, merge changes from the 8141revision specified with the first @samp{-j} option to 8142the revision specified with the second @samp{j} option, 8143into the working directory. 8144 8145With one @samp{-j} option, merge changes from the 8146ancestor revision to the revision specified with the 8147@samp{-j} option, into the working directory. The 8148ancestor revision is the common ancestor of the 8149revision which the working directory is based on, and 8150the revision specified in the @samp{-j} option. 8151 8152In addition, each -j option can contain an optional 8153date specification which, when used with branches, can 8154limit the chosen revision to one within a specific 8155date. An optional date is specified by adding a colon 8156(:) to the tag: 8157@samp{-j@var{Symbolic_Tag}:@var{Date_Specifier}}. 8158 8159@xref{Merging}. 8160 8161@end table 8162 8163@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8164@node update output 8165@appendixsubsec update output 8166 8167@code{update} and @code{checkout} keep you informed of 8168its progress by printing a line for each file, preceded 8169by one character indicating the status of the file: 8170 8171@table @code 8172@item U @var{file} 8173The file was brought up to date with respect to the 8174repository. This is done for any file that exists in 8175the repository but not in your source, and for files 8176that you haven't changed but are not the most recent 8177versions available in the repository. 8178 8179@item P @var{file} 8180Like @samp{U}, but the @sc{cvs} server sends a patch 8181instead of an entire file. These two things accomplish 8182the same thing. 8183 8184@item A @var{file} 8185The file has been added to your private copy of the 8186sources, and will be added to the source repository 8187when you run @code{commit} on the file. This is a 8188reminder to you that the file needs to be committed. 8189 8190@item R @var{file} 8191The file has been removed from your private copy of the 8192sources, and will be removed from the source repository 8193when you run @code{commit} on the file. This is a 8194reminder to you that the file needs to be committed. 8195 8196@item M @var{file} 8197The file is modified in your working directory. 8198 8199@samp{M} can indicate one of two states for a file 8200you're working on: either there were no modifications 8201to the same file in the repository, so that your file 8202remains as you last saw it; or there were modifications 8203in the repository as well as in your copy, but they 8204were merged successfully, without conflict, in your 8205working directory. 8206 8207@sc{cvs} will print some messages if it merges your work, 8208and a backup copy of your working file (as it looked 8209before you ran @code{update}) will be made. The exact 8210name of that file is printed while @code{update} runs. 8211 8212@item C @var{file} 8213@cindex .# files 8214@cindex __ files (VMS) 8215A conflict was detected while trying to merge your 8216changes to @var{file} with changes from the source 8217repository. @var{file} (the copy in your working 8218directory) is now the output of the rcsmerge(1) command 8219on the two revisions; an unmodified copy of your file 8220is also in your working directory, with the name 8221@file{.#@var{file}.@var{revision}} where @var{revision} 8222is the @sc{rcs} revision that your modified file started 8223from. Resolve the conflict as described in 8224@ref{Conflicts example} 8225@c "some systems" as in out-of-the-box OSes? Not as 8226@c far as I know. We need to advise sysadmins as well 8227@c as users how to set up this kind of purge, if that is 8228@c what they want. 8229@c We also might want to think about cleaner solutions, 8230@c like having CVS remove the .# file once the conflict 8231@c has been resolved or something like that. 8232(Note that some systems automatically purge 8233files that begin with @file{.#} if they have not been 8234accessed for a few days. If you intend to keep a copy 8235of your original file, it is a very good idea to rename 8236it.) Under @sc{vms}, the file name starts with 8237@file{__} rather than @file{.#}. 8238 8239@item ? @var{file} 8240@var{file} is in your working directory, but does not 8241correspond to anything in the source repository, and is 8242not in the list of files for @sc{cvs} to ignore (see the 8243description of the @samp{-I} option, and 8244@pxref{cvsignore}). 8245@end table 8246 8247@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8248@node update examples 8249@appendixsubsec update examples 8250 8251The following line will display all files which are not 8252up-to-date without actually change anything in your 8253working directory. It can be used to check what has 8254been going on with the project. 8255 8256@example 8257$ cvs -n -q update 8258@end example 8259 8260@node Invoking CVS 8261@appendix Quick reference to CVS commands 8262@cindex Command reference 8263@cindex Reference, commands 8264@cindex Invoking CVS 8265 8266This appendix describes how to invoke @sc{cvs}, with 8267references to where each command or feature is 8268described in detail. Other relevant references are the 8269@samp{--help}/@samp{-H} option to @sc{cvs} 8270(@pxref{Global options}) and @ref{Index}. 8271 8272@c The idea behind this table is that we want each item 8273@c to be a sentence or two at most. Preferably a 8274@c single line. 8275@c 8276@c In some cases refs to "foo options" are just to get 8277@c this thing written quickly, not because the "foo 8278@c options" node is really the best place to point. 8279@table @code 8280@item add [@var{options}] [@var{files}@dots{}] 8281Add a new file/directory. See @ref{Adding files}. 8282 8283@table @code 8284@item -k @var{kflag} 8285Set keyword expansion. 8286 8287@item -m @var{msg} 8288Set file description. 8289@end table 8290 8291@item admin [@var{options}] [@var{files}@dots{}] 8292Administration of history files in the repository. See 8293@ref{admin}. 8294@c This list omits those options which are not 8295@c documented as being useful with CVS. That might be 8296@c a mistake... 8297 8298@table @code 8299@item -b[@var{rev}] 8300Set default branch. 8301@c FIXME: Should xref to a section which describes how 8302@c to use this with the vendor branch. 8303 8304@item -c@var{string} 8305Set comment leader. 8306 8307@item -k@var{subst} 8308Set keyword substitution. See @ref{Keyword 8309substitution}. 8310 8311@item -l[@var{rev}] 8312Lock revision @var{rev}, or latest revision. 8313 8314@item -m@var{rev}:@var{msg} 8315Replace the log message of revision @var{rev} with 8316@var{msg}. 8317 8318@item -o@var{range} 8319Delete revisions from the history files 8320 8321@item -q 8322Run quietly; do not print diagnostics. 8323 8324@item -s@var{state}[:@var{rev}] 8325Set the state. 8326 8327@c Does not work for client/server CVS 8328@item -t 8329Set file description from standard input. 8330 8331@item -t@var{file} 8332Set file description from @var{file}. 8333 8334@item -t-@var{string} 8335Set file description to @var{string}. 8336 8337@item -u[@var{rev}] 8338Unlock revision @var{rev}, or latest revision. 8339@end table 8340 8341@item annotate [@var{options}] [@var{files}@dots{}] 8342Show last revision where each line was modified. See 8343@ref{annotate}. 8344 8345@table @code 8346@item -D @var{date} 8347Annotate the most recent revision no later than 8348@var{date}. See @ref{Common options}. 8349 8350@item -f 8351Use head revision if tag/date not found. See 8352@ref{Common options}. 8353 8354@item -l 8355Local; run only in current working directory. @xref{Recursive behavior}. 8356 8357@item -r @var{tag} 8358Annotate revision @var{tag}. See @ref{Common options}. 8359@end table 8360 8361@item checkout [@var{options}] @var{modules}@dots{} 8362Get a copy of the sources. See @ref{checkout}. 8363 8364@table @code 8365@item -A 8366Reset any sticky tags/date/kopts. See @ref{Sticky 8367tags} and @ref{Keyword substitution}. 8368 8369@item -c 8370Output the module database. See @ref{checkout options}. 8371 8372@item -D @var{date} 8373Check out revisions as of @var{date} (is sticky). See 8374@ref{Common options}. 8375 8376@item -d @var{dir} 8377Check out into @var{dir}. See @ref{checkout options}. 8378 8379@item -f 8380Use head revision if tag/date not found. See 8381@ref{Common options}. 8382 8383@c Probably want to use rev1/rev2 style like for diff 8384@c -r. Here and in on-line help. 8385@item -j @var{rev} 8386Merge in changes. See @ref{checkout options}. 8387 8388@item -k @var{kflag} 8389Use @var{kflag} keyword expansion. See 8390@ref{Substitution modes}. 8391 8392@item -l 8393Local; run only in current working directory. @xref{Recursive behavior}. 8394 8395@item -N 8396Don't shorten module paths if -d specified. See @ref{checkout options}. 8397 8398@item -n 8399Do not run module program (if any). See @ref{checkout options}. 8400 8401@item -P 8402Prune empty directories. See @ref{Moving directories}. 8403 8404@item -p 8405Check out files to standard output (avoids 8406stickiness). See @ref{checkout options}. 8407 8408@item -r @var{tag} 8409Checkout revision @var{tag} (is sticky). See @ref{Common options}. 8410 8411@item -s 8412Like -c, but include module status. See @ref{checkout options}. 8413@end table 8414 8415@item commit [@var{options}] [@var{files}@dots{}] 8416Check changes into the repository. See @ref{commit}. 8417 8418@table @code 8419@item -F @var{file} 8420Read log message from @var{file}. See @ref{commit options}. 8421 8422@item -f 8423@c What is this "disables recursion"? It is from the 8424@c on-line help; is it documented in this manual? 8425Force the file to be committed; disables recursion. 8426See @ref{commit options}. 8427 8428@item -l 8429Local; run only in current working directory. See @ref{Recursive behavior}. 8430 8431@item -m @var{msg} 8432Use @var{msg} as log message. See @ref{commit options}. 8433 8434@item -n 8435Do not run module program (if any). See @ref{commit options}. 8436 8437@item -R 8438Operate recursively (default). @xref{Recursive 8439behavior}. 8440 8441@item -r @var{rev} 8442Commit to @var{rev}. See @ref{commit options}. 8443@c FIXME: should be dragging over text from 8444@c commit options, especially if it can be cleaned up 8445@c and made concise enough. 8446@end table 8447 8448@item diff [@var{options}] [@var{files}@dots{}] 8449Show differences between revisions. See @ref{diff}. 8450In addition to the options shown below, accepts a wide 8451variety of options to control output style, for example 8452@samp{-c} for context diffs. 8453 8454@table @code 8455@item -D @var{date1} 8456Diff revision for date against working file. See 8457@ref{diff options}. 8458 8459@item -D @var{date2} 8460Diff @var{rev1}/@var{date1} against @var{date2}. See 8461@ref{diff options}. 8462 8463@item -l 8464Local; run only in current working directory. See @ref{Recursive behavior}. 8465 8466@item -N 8467Include diffs for added and removed files. See 8468@ref{diff options}. 8469 8470@item -r @var{rev1} 8471Diff revision for @var{rev1} against working file. See 8472@ref{diff options}. 8473 8474@item -r @var{rev2} 8475Diff rev1/date1 against rev2. See @ref{diff options}. 8476@end table 8477 8478@item edit [@var{options}] [@var{files}@dots{}] 8479Get ready to edit a watched file. See @ref{Editing files}. 8480 8481@table @code 8482@item -a @var{actions} 8483Specify actions for temporary watch, where 8484@var{actions} is @code{edit}, @code{unedit}, 8485@code{commit}, @code{all}, or @code{none}. See 8486@ref{Editing files}. 8487 8488@item -l 8489Local; run only in current working directory. See @ref{Recursive behavior}. 8490@end table 8491 8492@item editors [@var{options}] [@var{files}@dots{}] 8493See who is editing a watched file. See @ref{Watch information}. 8494 8495@table @code 8496@item -l 8497Local; run only in current working directory. See @ref{Recursive behavior}. 8498@end table 8499 8500@item export [@var{options}] @var{modules}@dots{} 8501Export files from CVS. See @ref{export}. 8502 8503@table @code 8504@item -D @var{date} 8505Check out revisions as of @var{date}. See 8506@ref{Common options}. 8507 8508@item -d @var{dir} 8509Check out into @var{dir}. See @ref{export options}. 8510 8511@item -f 8512Use head revision if tag/date not found. See 8513@ref{Common options}. 8514 8515@item -k @var{kflag} 8516Use @var{kflag} keyword expansion. See 8517@ref{Substitution modes}. 8518 8519@item -l 8520Local; run only in current working directory. @xref{Recursive behavior}. 8521 8522@item -N 8523Don't shorten module paths if -d specified. See @ref{export options}. 8524 8525@item -n 8526Do not run module program (if any). See @ref{export options}. 8527 8528@item -P 8529Prune empty directories. See @ref{Moving directories}. 8530 8531@item -r @var{tag} 8532Checkout revision @var{tag} (is sticky). See @ref{Common options}. 8533@end table 8534 8535@item history [@var{options}] [@var{files}@dots{}] 8536Show repository access history. See @ref{history}. 8537 8538@table @code 8539@item -a 8540All users (default is self). See @ref{history options}. 8541 8542@item -b @var{str} 8543Back to record with @var{str} in module/file/repos 8544field. See @ref{history options}. 8545 8546@item -c 8547Report on committed (modified) files. See @ref{history options}. 8548 8549@item -D @var{date} 8550Since @var{date}. See @ref{history options}. 8551 8552@item -e 8553Report on all record types. See @ref{history options}. 8554 8555@item -l 8556Last modified (committed or modified report). See @ref{history options}. 8557 8558@item -m @var{module} 8559Report on @var{module} (repeatable). See @ref{history 8560options}. 8561 8562@item -n @var{module} 8563In @var{module}. See @ref{history options}. 8564 8565@item -o 8566Report on checked out modules. See @ref{history options}. 8567 8568@item -r @var{rev} 8569Since revision @var{rev}. See @ref{history options}. 8570 8571@item -T 8572@c What the @#$@# is a TAG? Same as a tag? This 8573@c wording is also in the online-line help. 8574Produce report on all TAGs. See @ref{history options}. 8575 8576@item -t @var{tag} 8577Since tag record placed in history file (by anyone). 8578See @ref{history options}. 8579 8580@item -u @var{user} 8581For user @var{user} (repeatable). See @ref{history 8582options}. 8583 8584@item -w 8585Working directory must match. See @ref{history options}. 8586 8587@item -x @var{types} 8588Report on @var{types}, one or more of 8589@code{TOEFWUCGMAR}. See @ref{history options}. 8590 8591@item -z @var{zone} 8592Output for time zone @var{zone}. See @ref{history 8593options}. 8594@end table 8595 8596@item import [@var{options}] @var{repository} @var{vendor-tag} @var{release-tags}@dots{} 8597Import files into CVS, using vendor branches. See 8598@ref{import}. 8599 8600@table @code 8601@item -b @var{bra} 8602Import to vendor branch @var{bra}. See 8603@ref{import options}. 8604 8605@item -d 8606Use the file's modification time as the time of 8607import. See @ref{import options}. 8608 8609@item -k @var{kflag} 8610Set default RCS keyword substitution mode. See 8611@ref{import options}. 8612 8613@item -m @var{msg} 8614Use @var{msg} for log message. See 8615@ref{import options}. 8616 8617@item -I @var{ign} 8618More files to ignore (! to reset). See 8619@ref{import options}. 8620 8621@item -W @var{spec} 8622More wrappers. See @ref{import options}. 8623@end table 8624 8625@item init 8626Create a CVS repository if it doesn't exist. See 8627@ref{Creating a repository}. 8628 8629@item log [@var{options}] [@var{files}@dots{}] 8630Print out history information for files. See @ref{log}. 8631 8632@table @code 8633@item -b 8634Only list revisions on the default branch. See @ref{log options}. 8635 8636@item -d @var{dates} 8637Specify dates (@var{d1}<@var{d2} for range, @var{d} for 8638latest before). See @ref{log options}. 8639 8640@item -h 8641Only print header. See @ref{log options}. 8642 8643@item -l 8644Local; run only in current working directory. See @ref{Recursive behavior}. 8645 8646@item -N 8647Do not list tags. See @ref{log options}. 8648 8649@item -R 8650Only print name of RCS file. See @ref{log options}. 8651 8652@item -r @var{revs} 8653Only list revisions @var{revs}. See @ref{log options}. 8654 8655@item -s @var{states} 8656Only list revisions with specified states. See @ref{log options}. 8657 8658@item -t 8659Only print header and descriptive text. See @ref{log 8660options}. 8661 8662@item -w @var{logins} 8663Only list revisions checked in by specified logins. See @ref{log options}. 8664@end table 8665 8666@item login 8667Prompt for password for authenticating server. See 8668@ref{Password authentication client}. 8669 8670@item logout 8671Remove stored password for authenticating server. See 8672@ref{Password authentication client}. 8673 8674@item rdiff [@var{options}] @var{modules}@dots{} 8675Show differences between releases. See @ref{rdiff}. 8676 8677@table @code 8678@item -c 8679Context diff output format (default). See @ref{rdiff options}. 8680 8681@item -D @var{date} 8682Select revisions based on @var{date}. See @ref{Common options}. 8683 8684@item -f 8685Use head revision if tag/date not found. See 8686@ref{Common options}. 8687 8688@item -l 8689Local; run only in current working directory. See @ref{Recursive behavior}. 8690 8691@item -r @var{rev} 8692Select revisions based on @var{rev}. See @ref{Common options}. 8693 8694@item -s 8695Short patch - one liner per file. See @ref{rdiff options}. 8696 8697@item -t 8698Top two diffs - last change made to the file. See 8699@ref{diff options}. 8700 8701@item -u 8702Unidiff output format. See @ref{rdiff options}. 8703 8704@item -V @var{vers} 8705Use RCS Version @var{vers} for keyword expansion. See 8706@ref{rdiff options}. 8707@end table 8708 8709@item release [@var{options}] @var{directory} 8710Indicate that a directory is no longer in use. See 8711@ref{release}. 8712 8713@table @code 8714@item -d 8715Delete the given directory. See @ref{release options}. 8716@end table 8717 8718@item remove [@var{options}] [@var{files}@dots{}] 8719Remove an entry from the repository. See @ref{Removing files}. 8720 8721@table @code 8722@item -f 8723Delete the file before removing it. See @ref{Removing files}. 8724 8725@item -l 8726Local; run only in current working directory. See @ref{Recursive behavior}. 8727 8728@item -R 8729Operate recursively (default). @xref{Recursive 8730behavior}. 8731@end table 8732 8733@item rtag [@var{options}] @var{tag} @var{modules}@dots{} 8734Add a symbolic tag to a module. See @ref{rtag}. 8735 8736@table @code 8737@c Is this one of those dumb options which used to 8738@c work around the lack of death support? 8739@item -a 8740Clear tag from removed files that would not otherwise 8741be tagged. See @ref{rtag options}. 8742 8743@item -b 8744Create a branch named @var{tag}. See @ref{rtag options}. 8745 8746@item -D @var{date} 8747Tag revisions as of @var{date}. See @ref{rtag options}. 8748 8749@item -d 8750Delete the given tag. See @ref{rtag options}. 8751 8752@item -F 8753Move tag if it already exists. See @ref{rtag options}. 8754 8755@item -f 8756Force a head revision match if tag/date not found. 8757See @ref{rtag options}. 8758 8759@item -l 8760Local; run only in current working directory. See @ref{Recursive behavior}. 8761 8762@item -n 8763No execution of tag program. See @ref{rtag options}. 8764 8765@item -R 8766Operate recursively (default). @xref{Recursive 8767behavior}. 8768 8769@item -r @var{tag} 8770Tag existing tag @var{tag}. See @ref{rtag options}. 8771@end table 8772 8773@item status [@var{options}] @var{files}@dots{} 8774Display status information in a working directory. See 8775@ref{status}. 8776 8777@table @code 8778@item -l 8779Local; run only in current working directory. See @ref{Recursive behavior}. 8780 8781@item -R 8782Operate recursively (default). @xref{Recursive 8783behavior}. 8784 8785@item -v 8786Include tag information for file. See @ref{status options}. 8787@end table 8788 8789@item tag [@var{options}] @var{tag} [@var{files}@dots{}] 8790Add a symbolic tag to checked out version of files. 8791See @ref{tag}. 8792 8793@table @code 8794@item -b 8795Create a branch named @var{tag}. See @ref{tag options}. 8796 8797@item -D @var{date} 8798Tag revisions as of @var{date}. See @ref{tag options}. 8799 8800@item -d 8801Delete the given tag. See @ref{tag options}. 8802 8803@item -F 8804Move tag if it already exists. See @ref{tag options}. 8805 8806@item -f 8807Force a head revision match if tag/date not found. 8808See @ref{tag options}. 8809 8810@item -l 8811Local; run only in current working directory. See @ref{Recursive behavior}. 8812 8813@item -n 8814No execution of tag program. See @ref{tag options}. 8815 8816@item -R 8817Operate recursively (default). @xref{Recursive 8818behavior}. 8819 8820@item -r @var{tag} 8821Tag existing tag @var{tag}. See @ref{tag options}. 8822@end table 8823 8824@item unedit [@var{options}] [@var{files}@dots{}] 8825Undo an edit command. See @ref{Editing files}. 8826 8827@table @code 8828@item -a @var{actions} 8829Specify actions for temporary watch, where 8830@var{actions} is @code{edit}, @code{unedit}, 8831@code{commit}, @code{all}, or @code{none}. See 8832@ref{Editing files}. 8833 8834@item -l 8835Local; run only in current working directory. See @ref{Recursive behavior}. 8836@end table 8837 8838@item update [@var{options}] [@var{files}@dots{}] 8839Bring work tree in sync with repository. See 8840@ref{update}. 8841 8842@table @code 8843@item -A 8844Reset any sticky tags/date/kopts. See @ref{Sticky 8845tags} and @ref{Keyword substitution}. 8846 8847@item -D @var{date} 8848Check out revisions as of @var{date} (is sticky). See 8849@ref{Common options}. 8850 8851@item -d 8852Create directories. See @ref{update options}. 8853 8854@item -f 8855Use head revision if tag/date not found. See 8856@ref{Common options}. 8857 8858@item -I @var{ign} 8859More files to ignore (! to reset). See 8860@ref{import options}. 8861 8862@c Probably want to use rev1/rev2 style like for diff 8863@c -r. Here and in on-line help. 8864@item -j @var{rev} 8865Merge in changes. See @ref{update options}. 8866 8867@item -k @var{kflag} 8868Use @var{kflag} keyword expansion. See 8869@ref{Substitution modes}. 8870 8871@item -l 8872Local; run only in current working directory. @xref{Recursive behavior}. 8873 8874@item -P 8875Prune empty directories. See @ref{Moving directories}. 8876 8877@item -p 8878Check out files to standard output (avoids 8879stickiness). See @ref{update options}. 8880 8881@item -R 8882Operate recursively (default). @xref{Recursive 8883behavior}. 8884 8885@item -r @var{tag} 8886Checkout revision @var{tag} (is sticky). See @ref{Common options}. 8887 8888@item -W @var{spec} 8889More wrappers. See @ref{import options}. 8890@end table 8891 8892@item watch [on|off|add|remove] [@var{options}] [@var{files}@dots{}] 8893 8894on/off: turn on/off read-only checkouts of files. See 8895@ref{Setting a watch}. 8896 8897add/remove: add or remove notification on actions. See 8898@ref{Getting Notified}. 8899 8900@table @code 8901@item -a @var{actions} 8902Specify actions for temporary watch, where 8903@var{actions} is @code{edit}, @code{unedit}, 8904@code{commit}, @code{all}, or @code{none}. See 8905@ref{Editing files}. 8906 8907@item -l 8908Local; run only in current working directory. See @ref{Recursive behavior}. 8909@end table 8910 8911@item watchers [@var{options}] [@var{files}@dots{}] 8912See who is watching a file. See @ref{Watch information}. 8913 8914@table @code 8915@item -l 8916Local; run only in current working directory. See @ref{Recursive behavior}. 8917@end table 8918 8919@end table 8920 8921@c --------------------------------------------------------------------- 8922@node Administrative files 8923@appendix Reference manual for the Administrative files 8924@cindex Administrative files (reference) 8925@cindex Files, reference manual 8926@cindex Reference manual (files) 8927@cindex CVSROOT (file) 8928 8929Inside the repository, in the directory 8930@file{$CVSROOT/CVSROOT}, there are a number of 8931supportive files for @sc{cvs}. You can use @sc{cvs} in a limited 8932fashion without any of them, but if they are set up 8933properly they can help make life easier. For a 8934discussion of how to edit them, @xref{Intro 8935administrative files}. 8936 8937The most important of these files is the @file{modules} 8938file, which defines the modules inside the repository. 8939 8940@menu 8941* modules:: Defining modules 8942* Wrappers:: Treat directories as files 8943* commit files:: The commit support files 8944* commitinfo:: Pre-commit checking 8945* verifymsg:: How are log messages evaluated? 8946* editinfo:: Specifying how log messages are created 8947 (obsolete) 8948* loginfo:: Where should log messages be sent? 8949* rcsinfo:: Templates for the log messages 8950* cvsignore:: Ignoring files via cvsignore 8951* history file:: History information 8952* Variables:: Various variables are expanded 8953@end menu 8954 8955@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 8956@node modules 8957@appendixsec The modules file 8958@cindex Modules (admin file) 8959@cindex Defining modules (reference manual) 8960 8961The @file{modules} file records your definitions of 8962names for collections of source code. @sc{cvs} will 8963use these definitions if you use @sc{cvs} to update the 8964modules file (use normal commands like @code{add}, 8965@code{commit}, etc). 8966 8967The @file{modules} file may contain blank lines and 8968comments (lines beginning with @samp{#}) as well as 8969module definitions. Long lines can be continued on the 8970next line by specifying a backslash (@samp{\}) as the 8971last character on the line. 8972 8973A module definition is a single line of the 8974@file{modules} file, in either of two formats. In both 8975cases, @var{mname} represents the symbolic module name, 8976and the remainder of the line is its definition. 8977 8978@table @code 8979@item @var{mname} -a @var{aliases}@dots{} 8980This represents the simplest way of defining a module 8981@var{mname}. The @samp{-a} flags the definition as a 8982simple alias: @sc{cvs} will treat any use of @var{mname} (as 8983a command argument) as if the list of names 8984@var{aliases} had been specified instead. 8985@var{aliases} may contain either other module names or 8986paths. When you use paths in aliases, @code{checkout} 8987creates all intermediate directories in the working 8988directory, just as if the path had been specified 8989explicitly in the @sc{cvs} arguments. 8990 8991@item @var{mname} [ options ] @var{dir} [ @var{files}@dots{} ] [ &@var{module}@dots{} ] 8992In the simplest case, this form of module definition 8993reduces to @samp{@var{mname} @var{dir}}. This defines 8994all the files in directory @var{dir} as module mname. 8995@var{dir} is a relative path (from @code{$CVSROOT}) to a 8996directory of source in the source repository. In this 8997case, on checkout, a single directory called 8998@var{mname} is created as a working directory; no 8999intermediate directory levels are used by default, even 9000if @var{dir} was a path involving several directory 9001levels. 9002 9003By explicitly specifying files in the module definition 9004after @var{dir}, you can select particular files from 9005directory @var{dir}. The sample definition for 9006@samp{modules} is an example of a module defined with a 9007single file from a particular directory. Here is 9008another example: 9009 9010@example 9011m4test unsupported/gnu/m4 foreach.m4 forloop.m4 9012@end example 9013 9014@noindent 9015With this definition, executing @samp{cvs checkout 9016m4test} will create a single working directory 9017@file{m4test} containing the two files listed, which 9018both come from a common directory several levels deep 9019in the @sc{cvs} source repository. 9020 9021A module definition can refer to other modules by 9022including @samp{&@var{module}} in its definition. 9023@code{checkout} creates a subdirectory for each such 9024module, in the directory containing the module. For 9025example, if modules contains 9026 9027@example 9028m4test &unsupported 9029@end example 9030 9031then a checkout will create an @code{m4test} directory 9032which contains a directory called @code{unsupported}, 9033which in turns contains all the directories and files 9034which live there. 9035@c FIXME: this is hard to describe since we don't tell 9036@c the user what the repository contains. Best way to 9037@c fix this whole mess is an extended example where we 9038@c first say what is in the repository, then show a 9039@c regular module, an alias module, and an & module. 9040@c We should mention the concept of options only 9041@c *after* we've taken care of those basics. 9042@c 9043@c FIXCVS: What happens if regular and & modules are 9044@c combined, as in "ampermodule first-dir &second-dir"? 9045@c When I tried it, it seemed to just ignore the 9046@c "first-dir". I think perhaps it should be an error 9047@c (but this needs further investigation). 9048@c In addition to discussing what each one does, we 9049@c should put in a few words about why you would use one or 9050@c the other in various situations. 9051 9052@table @code 9053@item -d @var{name} 9054Name the working directory something other than the 9055module name. 9056 9057@cindex Export program 9058@item -e @var{prog} 9059Specify a program @var{prog} to run whenever files in a 9060module are exported. @var{prog} runs with a single 9061argument, the module name. 9062@c FIXME: Is it run on server? client? 9063 9064@cindex Checkin program 9065@item -i @var{prog} 9066Specify a program @var{prog} to run whenever files in a 9067module are committed. @var{prog} runs with a single 9068argument, the full pathname of the affected directory 9069in a source repository. The @file{commitinfo}, 9070@file{loginfo}, and @file{verifymsg} files provide other 9071ways to call a program on commit. 9072@c FIXME: Is it run on server? client? 9073 9074@cindex Checkout program 9075@item -o @var{prog} 9076Specify a program @var{prog} to run whenever files in a 9077module are checked out. @var{prog} runs with a single 9078argument, the module name. 9079@c FIXME: Is it run on server? client? 9080 9081@cindex Status of a module 9082@cindex Module status 9083@item -s @var{status} 9084Assign a status to the module. When the module file is 9085printed with @samp{cvs checkout -s} the modules are 9086sorted according to primarily module status, and 9087secondarily according to the module name. This option 9088has no other meaning. You can use this option for 9089several things besides status: for instance, list the 9090person that is responsible for this module. 9091 9092@cindex Tag program 9093@item -t @var{prog} 9094Specify a program @var{prog} to run whenever files in a 9095module are tagged with @code{rtag}. @var{prog} runs 9096with two arguments: the module name and the symbolic 9097tag specified to @code{rtag}. There is no way to 9098specify a program to run when @code{tag} is executed. 9099@c FIXME: Is it run on server? client? 9100 9101@cindex Update program 9102@item -u @var{prog} 9103Specify a program @var{prog} to run whenever @samp{cvs 9104update} is executed from the top-level directory of the 9105checked-out module. @var{prog} runs with a single 9106argument, the full path to the source repository for 9107this module. 9108@c FIXME: Is it run on server? client? 9109@end table 9110@end table 9111 9112@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9113@node Wrappers 9114@appendixsec The cvswrappers file 9115@cindex cvswrappers (admin file) 9116@cindex CVSWRAPPERS, environment variable 9117@cindex Wrappers 9118 9119@c FIXME: need some better way of separating this out 9120@c by functionality. -t/-f is one feature, -m is 9121@c another, and -k is a third. And this discussion 9122@c should be better motivated (e.g. start with the 9123@c problems, then explain how the feature solves it). 9124 9125Wrappers allow you to set a hook which transforms files on 9126their way in and out of @sc{cvs}. 9127 9128The file @file{cvswrappers} defines the script that will be 9129run on a file when its name matches a regular 9130expresion. There are two scripts that can be run on a 9131file or directory. One script is executed on the file/directory 9132before being checked into the repository (this is denoted 9133with the @code{-t} flag) and the other when the file is 9134checked out of the repository (this is denoted with the 9135@code{-f} flag). The @samp{-t}/@samp{-f} feature does 9136not work with client/server @sc{cvs}. 9137 9138The @file{cvswrappers} also has a @samp{-m} option to 9139specify the merge methodology that should be used when 9140the file is updated. @code{MERGE} means the usual 9141@sc{cvs} behavior: try to merge the files (this 9142generally will not work for binary files). @code{COPY} 9143means that @code{cvs update} will merely copy one 9144version over the other, and require the user using 9145mechanisms outside @sc{cvs}, to insert any necessary 9146changes. 9147@c FIXME: which version is copied over which version? 9148The @samp{-m} wrapper option only affects behavior when 9149merging is done on update; it does not affect how files 9150are stored. See @xref{Binary files}, for more on 9151binary files. 9152 9153The basic format of the file @file{cvswrappers} is: 9154 9155@c FIXME: @example is all wrong for this. Use @deffn or 9156@c something more sensible. 9157@example 9158wildcard [option value][option value]... 9159 9160where option is one of 9161-f from cvs filter value: path to filter 9162-t to cvs filter value: path to filter 9163-m update methodology value: MERGE or COPY 9164-k keyword expansion value: expansion mode 9165 9166and value is a single-quote delimited value. 9167@end example 9168 9169@example 9170*.nib -f 'unwrap %s' -t 'wrap %s %s' -m 'COPY' 9171*.c -t 'indent %s %s' 9172@end example 9173 9174@noindent 9175The above example of a @file{cvswrappers} file 9176states that all files/directories that end with a @code{.nib} 9177should be filtered with the @file{wrap} program before 9178checking the file into the repository. The file should 9179be filtered though the @file{unwrap} program when the 9180file is checked out of the repository. The 9181@file{cvswrappers} file also states that a @code{COPY} 9182methodology should be used when updating the files in 9183the repository (that is no merging should be performed). 9184 9185@c What pitfalls arise when using indent this way? Is 9186@c it a winning thing to do? Would be nice to at least 9187@c hint at those issues; we want our examples to tell 9188@c how to solve problems, not just to say that cvs can 9189@c do certain things. 9190The last example line says that all files that end with 9191a @code{*.c} should be filtered with @file{indent} 9192before being checked into the repository. Unlike the previous 9193example no filtering of the @code{*.c} file is done when 9194it is checked out of the repository. 9195@noindent 9196The @code{-t} filter is called with two arguments, 9197the first is the name of the file/directory to filter 9198and the second is the pathname to where the resulting 9199filtered file should be placed. 9200 9201@noindent 9202The @code{-f} filter is called with one argument, 9203which is the name of the file to filter from. The end 9204result of this filter will be a file in the users directory 9205that they can work on as they normally would. 9206 9207Note that the @samp{-t}/@samp{-f} features do not 9208conveniently handle one portion of CVS's operation: 9209determining when files are modified. CVS will still 9210want a file (or directory) to exist, and it will use 9211its modification time to determine whether a file is 9212modified. If CVS erroneously thinks a file is 9213unmodified (for example, a directory is unchanged but 9214one of the files within it is changed), you can force 9215it to check in the file anyway by specifying the 9216@samp{-f} option to @code{cvs commit} (@pxref{commit 9217options}). 9218@c This is, of course, a serious design flaw in -t/-f. 9219@c Probably the whole functionality needs to be 9220@c redesigned (starting from requirements) to fix this. 9221 9222For another example, the following command imports a 9223directory, treating files whose name ends in 9224@samp{.exe} as binary: 9225 9226@example 9227cvs import -I ! -W "*.exe -k 'b'" first-dir vendortag reltag 9228@end example 9229 9230@c Another good example, would be storing files 9231@c (e.g. binary files) compressed in the repository. 9232@c :::::::::::::::::: 9233@c cvswrappers 9234@c :::::::::::::::::: 9235@c *.t12 -m 'COPY' 9236@c *.t[0-9][0-9] -f 'gunzipcp %s' -t 'gzipcp %s %s' -m 'COPY' 9237@c 9238@c :::::::::::::::::: 9239@c gunzipcp 9240@c :::::::::::::::::: 9241@c : 9242@c [ -f $1 ] || exit 1 9243@c zcat $1 > /tmp/.#$1.$$ 9244@c mv /tmp/.#$1.$$ $1 9245@c 9246@c :::::::::::::::::: 9247@c gzipcp 9248@c :::::::::::::::::: 9249@c : 9250@c DIRNAME=`echo $1 | sed -e "s|/.*/||g"` 9251@c if [ ! -d $DIRNAME ] ; then 9252@c DIRNAME=`echo $1 | sed -e "s|.*/||g"` 9253@c fi 9254@c gzip -c $DIRNAME > $2 9255@c One catch--"cvs diff" will not invoke the wrappers 9256@c (probably a CVS bug, although I haven't thought it out). 9257 9258@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9259@node commit files 9260@appendixsec The commit support files 9261@cindex Commit files 9262 9263The @samp{-i} flag in the @file{modules} file can be 9264used to run a certain program whenever files are 9265committed (@pxref{modules}). The files described in 9266this section provide other, more flexible, ways to run 9267programs whenever something is committed. 9268 9269There are three kind of programs that can be run on 9270commit. They are specified in files in the repository, 9271as described below. The following table summarizes the 9272file names and the purpose of the corresponding 9273programs. 9274 9275@table @file 9276@item commitinfo 9277The program is responsible for checking that the commit 9278is allowed. If it exits with a non-zero exit status 9279the commit will be aborted. 9280 9281@item verifymsg 9282The specified program is used to evaluate the log message, 9283and possibly verify that it contains all required 9284fields. This is most useful in combination with the 9285@file{rcsinfo} file, which can hold a log message 9286template (@pxref{rcsinfo}). 9287 9288@item editinfo 9289The specified program is used to edit the log message, 9290and possibly verify that it contains all required 9291fields. This is most useful in combination with the 9292@file{rcsinfo} file, which can hold a log message 9293template (@pxref{rcsinfo}). (obsolete) 9294 9295@item loginfo 9296The specified program is called when the commit is 9297complete. It receives the log message and some 9298additional information and can store the log message in 9299a file, or mail it to appropriate persons, or maybe 9300post it to a local newsgroup, or@dots{} Your 9301imagination is the limit! 9302@end table 9303 9304@menu 9305* syntax:: The common syntax 9306@end menu 9307 9308@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9309@node syntax 9310@appendixsubsec The common syntax 9311@cindex Info files (syntax) 9312@cindex Syntax of info files 9313@cindex Common syntax of info files 9314 9315@c FIXME: having this so totally separate from the 9316@c Variables node is rather bogus. 9317 9318The administrative files such as @file{commitinfo}, 9319@file{loginfo}, @file{rcsinfo}, @file{verifymsg}, etc., 9320all have a common format. The purpose of the files are 9321described later on. The common syntax is described 9322here. 9323 9324@cindex regular expression syntax 9325Each line contains the following: 9326@itemize @bullet 9327@item 9328@c Say anything about DEFAULT and ALL? Right now we 9329@c leave that to the description of each file (and in fact 9330@c the practice is inconsistent which is really annoying). 9331A regular expression. This is a basic regular 9332expression in the syntax used by GNU emacs. 9333@c FIXME: What we probably should be saying is "POSIX Basic 9334@c Regular Expression with the following extensions (`\(' 9335@c `\|' '+' etc)" 9336@c rather than define it with reference to emacs. 9337@c The reference to emacs is not strictly speaking 9338@c true, as we don't support \=, \s, or \S. Also it isn't 9339@c clear we should document and/or promise to continue to 9340@c support all the obscure emacs extensions like \<. 9341@c Also need to better cite (or include) full 9342@c documentation for the syntax. 9343 9344@item 9345A whitespace separator---one or more spaces and/or tabs. 9346 9347@item 9348A file name or command-line template. 9349@end itemize 9350 9351@noindent 9352Blank lines are ignored. Lines that start with the 9353character @samp{#} are treated as comments. Long lines 9354unfortunately can @emph{not} be broken in two parts in 9355any way. 9356 9357The first regular expression that matches the current 9358directory name in the repository is used. The rest of the line 9359is used as a file name or command-line as appropriate. 9360 9361@c FIXME: need an example. In particular, show what 9362@c the regular expression is matched against (one 9363@c ordinarily clueful person got confused about whether it 9364@c includes the filename--"directory name" above should be 9365@c unambiguous but there is nothing like an example to 9366@c confirm people's understanding of this sort of thing). 9367 9368@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9369@node commitinfo 9370@appendixsec Commitinfo 9371@cindex Commitinfo 9372@cindex Checking commits 9373@cindex Precommit checking 9374 9375The @file{commitinfo} file defines programs to execute 9376whenever @samp{cvs commit} is about to execute. These 9377programs are used for pre-commit checking to verify 9378that the modified, added and removed files are really 9379ready to be committed. This could be used, for 9380instance, to verify that the changed files conform to 9381to your site's standards for coding practice. 9382 9383As mentioned earlier, each line in the 9384@file{commitinfo} file consists of a regular expression 9385and a command-line template. The template can include 9386a program name and any number of arguments you wish to 9387supply to it. The full path to the current source 9388repository is appended to the template, followed by the 9389file names of any files involved in the commit (added, 9390removed, and modified files). 9391 9392The first line with a regular expression matching the 9393relative path to the module will be used. If the 9394command returns a non-zero exit status the commit will 9395be aborted. 9396 9397@cindex DEFAULT in commitinfo 9398If the repository name does not match any of the 9399regular expressions in this file, the @samp{DEFAULT} 9400line is used, if it is specified. 9401 9402@cindex ALL in commitinfo 9403All occurances of the name @samp{ALL} appearing as a 9404regular expression are used in addition to the first 9405matching regular expression or the name @samp{DEFAULT}. 9406 9407Note: when @sc{CVS} is accessing a remote repository, 9408@file{commitinfo} will be run on the @emph{remote} 9409(i.e., server) side, not the client side (@pxref{Remote 9410repositories}). 9411 9412@c FIXME: should discuss using commitinfo to control 9413@c who has checkin access to what (e.g. Joe can check into 9414@c directories a, b, and c, and Mary can check into 9415@c directories b, c, and d--note this case cannot be 9416@c conveniently handled with unix groups). Of course, 9417@c adding a new set of features to CVS might be a more 9418@c natural way to fix this problem than telling people to 9419@c use commitinfo. 9420@c FIXME: Should make some reference, especially in 9421@c the context of controlling who has access, to the fact 9422@c that commitinfo can be circumvented. Perhaps 9423@c mention SETXID (but has it been carefully examined 9424@c for holes?). This fits in with the discussion of 9425@c general CVS security in "Password authentication 9426@c security" (the bit which is not pserver-specific). 9427 9428@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9429@node verifymsg 9430@appendixsec Verifying log messages 9431@cindex verifymsg (admin file) 9432@cindex log message, verifying 9433 9434Once you have entered a log message, you can evaluate 9435that message to check for specific content, such as 9436a bug ID. Use the @file{verifymsg} file to 9437specify a program that is used to verify the log message. 9438This program could be a simple script that checks 9439that the entered message contains the required fields. 9440 9441The @file{verifymsg} file is often most useful together 9442with the @file{rcsinfo} file, which can be used to 9443specify a log message template. 9444 9445Each line in the @file{verifymsg} file consists of a 9446regular expression and a command-line template. The 9447template must include a program name, and can include 9448any number of arguments. The full path to the current 9449log message template file is appended to the template. 9450 9451One thing that should be noted is that the @samp{ALL} 9452keyword is not supported. If more than one matching 9453line is found, the first one is used. This can be 9454useful for specifying a default verification script in a 9455module, and then overriding it in a subdirectory. 9456 9457@cindex DEFAULT in verifymsg 9458If the repository name does not match any of the 9459regular expressions in this file, the @samp{DEFAULT} 9460line is used, if it is specified. 9461 9462If the verification script exits with a non-zero exit status, 9463the commit is aborted. 9464 9465Note that the verification script cannot change the log 9466message; it can merely accept it or reject it. 9467@c FIXME? Is this an annoying limitation? It would be 9468@c relatively easy to fix (although it would *not* be a 9469@c good idea for a verifymsg script to interact with the user 9470@c at least in the client/server case because of locks 9471@c and all that jazz). 9472 9473The following is a little silly example of a 9474@file{verifymsg} file, together with the corresponding 9475@file{rcsinfo} file, the log message template and an 9476verification script. We begin with the log message template. 9477We want to always record a bug-id number on the first 9478line of the log message. The rest of log message is 9479free text. The following template is found in the file 9480@file{/usr/cvssupport/tc.template}. 9481 9482@example 9483BugId: 9484@end example 9485 9486The script @file{/usr/cvssupport/bugid.verify} is used to 9487evaluate the log message. 9488 9489@example 9490#!/bin/sh 9491# 9492# bugid.verify filename 9493# 9494# Verify that the log message contains a valid bugid 9495# on the first line. 9496# 9497if head -1 < $1 | grep '^BugId:[ ]*[0-9][0-9]*$' > /dev/null; then 9498 exit 0 9499else 9500 echo "No BugId found." 9501 exit 1 9502fi 9503@end example 9504 9505The @file{verifymsg} file contains this line: 9506 9507@example 9508^tc /usr/cvssupport/bugid.edit 9509@end example 9510 9511The @file{rcsinfo} file contains this line: 9512 9513@example 9514^tc /usr/cvssupport/tc.template 9515@end example 9516 9517 9518 9519@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9520@node editinfo 9521@appendixsec Editinfo 9522@cindex editinfo (admin file) 9523@cindex Editor, specifying per module 9524@cindex Per-module editor 9525@cindex Log messages, editing 9526 9527@emph{NOTE:} The @file{editinfo} feature has been 9528rendered obsolete. To set a default editor for log 9529messages use the @code{EDITOR} environment variable 9530(@pxref{Environment variables}) or the @samp{-e} global 9531option (@pxref{Global options}). See @ref{verifymsg}, 9532for information on the use of the @file{verifymsg} 9533feature for evaluating log messages. 9534 9535If you want to make sure that all log messages look the 9536same way, you can use the @file{editinfo} file to 9537specify a program that is used to edit the log message. 9538This program could be a custom-made editor that always 9539enforces a certain style of the log message, or maybe a 9540simple shell script that calls an editor, and checks 9541that the entered message contains the required fields. 9542 9543If no matching line is found in the @file{editinfo} 9544file, the editor specified in the environment variable 9545@code{$CVSEDITOR} is used instead. If that variable is 9546not set, then the environment variable @code{$EDITOR} 9547is used instead. If that variable is not 9548set a precompiled default, normally @code{vi}, will be 9549used. 9550 9551The @file{editinfo} file is often most useful together 9552with the @file{rcsinfo} file, which can be used to 9553specify a log message template. 9554 9555Each line in the @file{editinfo} file consists of a 9556regular expression and a command-line template. The 9557template must include a program name, and can include 9558any number of arguments. The full path to the current 9559log message template file is appended to the template. 9560 9561One thing that should be noted is that the @samp{ALL} 9562keyword is not supported. If more than one matching 9563line is found, the first one is used. This can be 9564useful for specifying a default edit script in a 9565module, and then overriding it in a subdirectory. 9566 9567@cindex DEFAULT in editinfo 9568If the repository name does not match any of the 9569regular expressions in this file, the @samp{DEFAULT} 9570line is used, if it is specified. 9571 9572If the edit script exits with a non-zero exit status, 9573the commit is aborted. 9574 9575Note: when @sc{CVS} is accessing a remote repository, 9576or when the @samp{-m} or @samp{-F} options to @code{cvs 9577commit} are used, @file{editinfo} will not be consulted. 9578There is no good workaround for this; use 9579@file{verifymsg} instead. 9580 9581@menu 9582* editinfo example:: Editinfo example 9583@end menu 9584 9585@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9586@node editinfo example 9587@appendixsubsec Editinfo example 9588 9589The following is a little silly example of a 9590@file{editinfo} file, together with the corresponding 9591@file{rcsinfo} file, the log message template and an 9592editor script. We begin with the log message template. 9593We want to always record a bug-id number on the first 9594line of the log message. The rest of log message is 9595free text. The following template is found in the file 9596@file{/usr/cvssupport/tc.template}. 9597 9598@example 9599BugId: 9600@end example 9601 9602The script @file{/usr/cvssupport/bugid.edit} is used to 9603edit the log message. 9604 9605@example 9606#!/bin/sh 9607# 9608# bugid.edit filename 9609# 9610# Call $EDITOR on FILENAME, and verify that the 9611# resulting file contains a valid bugid on the first 9612# line. 9613if [ "x$EDITOR" = "x" ]; then EDITOR=vi; fi 9614if [ "x$CVSEDITOR" = "x" ]; then CVSEDITOR=$EDITOR; fi 9615$CVSEDITOR $1 9616until head -1|grep '^BugId:[ ]*[0-9][0-9]*$' < $1 9617do echo -n "No BugId found. Edit again? ([y]/n)" 9618 read ans 9619 case $@{ans@} in 9620 n*) exit 1;; 9621 esac 9622 $CVSEDITOR $1 9623done 9624@end example 9625 9626The @file{editinfo} file contains this line: 9627 9628@example 9629^tc /usr/cvssupport/bugid.edit 9630@end example 9631 9632The @file{rcsinfo} file contains this line: 9633 9634@example 9635^tc /usr/cvssupport/tc.template 9636@end example 9637 9638@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9639@node loginfo 9640@appendixsec Loginfo 9641@cindex loginfo (admin file) 9642@cindex Storing log messages 9643@cindex Mailing log messages 9644@cindex Distributing log messages 9645@cindex Log messages 9646 9647The @file{loginfo} file is used to control where 9648@samp{cvs commit} log information is sent. The first 9649entry on a line is a regular expression which is tested 9650against the directory that the change is being made to, 9651relative to the @code{$CVSROOT}. If a match is found, then 9652the remainder of the line is a filter program that 9653should expect log information on its standard input. 9654 9655If the repository name does not match any of the 9656regular expressions in this file, the @samp{DEFAULT} 9657line is used, if it is specified. 9658 9659All occurances of the name @samp{ALL} appearing as a 9660regular expression are used in addition to the first 9661matching regular expression or @samp{DEFAULT}. 9662 9663The first matching regular expression is used. 9664 9665@xref{commit files}, for a description of the syntax of 9666the @file{loginfo} file. 9667 9668The user may specify a format string as 9669part of the filter. The string is composed of a 9670@samp{%} followed by a space, or followed by a single 9671format character, or followed by a set of format 9672characters surrounded by @samp{@{} and @samp{@}} as 9673separators. The format characters are: 9674 9675@table @t 9676@item s 9677file name 9678@item V 9679old version number (pre-checkin) 9680@item v 9681new version number (post-checkin) 9682@end table 9683 9684All other characters that appear in a format string 9685expand to an empty field (commas separating fields are 9686still provided). 9687 9688For example, some valid format strings are @samp{%}, 9689@samp{%s}, @samp{%@{s@}}, and @samp{%@{sVv@}}. 9690 9691The output will be a string of tokens separated by 9692spaces. For backwards compatibility, the the first 9693token will be the repository name. The rest of the 9694tokens will be comma-delimited lists of the information 9695requested in the format string. For example, if 9696@samp{/u/src/master} is the repository, @samp{%@{sVv@}} 9697is the format string, and three files (@t{ChangeLog}, 9698@t{Makefile}, @t{foo.c}) were modified, the output 9699might be: 9700 9701@example 9702/u/src/master ChangeLog,1.1,1.2 Makefile,1.3,1.4 foo.c,1.12,1.13 9703@end example 9704 9705As another example, @samp{%@{@}} means that only the 9706name of the repository will be generated. 9707 9708Note: when @sc{CVS} is accessing a remote repository, 9709@file{loginfo} will be run on the @emph{remote} 9710(i.e., server) side, not the client side (@pxref{Remote 9711repositories}). 9712 9713@menu 9714* loginfo example:: Loginfo example 9715* Keeping a checked out copy:: Updating a tree on every checkin 9716@end menu 9717 9718@c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9719@node loginfo example 9720@appendixsubsec Loginfo example 9721 9722The following @file{loginfo} file, together with the 9723tiny shell-script below, appends all log messages 9724to the file @file{$CVSROOT/CVSROOT/commitlog}, 9725and any commits to the administrative files (inside 9726the @file{CVSROOT} directory) are also logged in 9727@file{/usr/adm/cvsroot-log}. 9728@c and mailed to @t{ceder}. 9729 9730@c FIXME: is it a CVS feature or bug that only the 9731@c first matching line is used? It is documented 9732@c above, but is it useful? This example (with the 9733@c mail to ceder put back in) is awkward to write if 9734@c only the first matching line is used. 9735@example 9736ALL /usr/local/bin/cvs-log $CVSROOT/CVSROOT/commitlog 9737@c ^CVSROOT Mail -s %s ceder 9738^CVSROOT /usr/local/bin/cvs-log /usr/adm/cvsroot-log 9739@end example 9740 9741The shell-script @file{/usr/local/bin/cvs-log} looks 9742like this: 9743 9744@example 9745#!/bin/sh 9746(echo "-----------------------------------------------------------------"; 9747 echo -n $USER" "; 9748 date; 9749 echo; 9750 sed '1s+'$@{CVSROOT@}'++') >> $1 9751@end example 9752 9753@node Keeping a checked out copy 9754@appendixsubsec Keeping a checked out copy 9755 9756@c What other index entries? It seems like 9757@c people might want to use a lot of different 9758@c words for this functionality. 9759@cindex keeping a checked out copy 9760@cindex checked out copy, keeping 9761@cindex web pages, maintaining with CVS 9762 9763It is often useful to maintain a directory tree which 9764contains files which correspond to the latest version 9765in the repository. For example, other developers might 9766want to refer to the latest sources without having to 9767check them out, or you might be maintaining a web site 9768with @sc{cvs} and want every checkin to cause the files 9769used by the web server to be updated. 9770@c Can we offer more details on the web example? Or 9771@c point the user at how to figure it out? This text 9772@c strikes me as sufficient for someone who already has 9773@c some idea of what we mean but not enough for the naive 9774@c user/sysadmin to understand it and set it up. 9775 9776The way to do this is by having loginfo invoke 9777@code{cvs update}. Doing so in the naive way will 9778cause a problem with locks, so the @code{cvs update} 9779must be run in the background. 9780@c Should we try to describe the problem with locks? 9781@c It seems like a digression for someone who just 9782@c wants to know how to make it work. 9783@c Another choice which might work for a single file 9784@c is to use "cvs -n update -p" which doesn't take 9785@c out locks (I think) but I don't see many advantages 9786@c of that and we might as well document something which 9787@c works for multiple files. 9788Here is an example (this should all be on one line): 9789 9790@example 9791^cyclic-pages (date; cat; (sleep 2; cd /u/www/local-docs; 9792 cvs -q update -d) &) >> $CVSROOT/CVSROOT/updatelog 2>&1 9793@end example 9794 9795This will cause checkins to repository directories 9796starting with @code{cyclic-pages} to update the checked 9797out tree in @file{/u/www/local-docs}. 9798@c More info on some of the details? The "sleep 2" is 9799@c so if we are lucky the lock will be gone by the time 9800@c we start and we can wait 2 seconds instead of 30. 9801 9802@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9803@node rcsinfo 9804@appendixsec Rcsinfo 9805@cindex rcsinfo (admin file) 9806@cindex Form for log message 9807@cindex Log message template 9808@cindex Template for log message 9809 9810The @file{rcsinfo} file can be used to specify a form to 9811edit when filling out the commit log. The 9812@file{rcsinfo} file has a syntax similar to the 9813@file{verifymsg}, @file{commitinfo} and @file{loginfo} 9814files. @xref{syntax}. Unlike the other files the second 9815part is @emph{not} a command-line template. Instead, 9816the part after the regular expression should be a full pathname to 9817a file containing the log message template. 9818 9819If the repository name does not match any of the 9820regular expressions in this file, the @samp{DEFAULT} 9821line is used, if it is specified. 9822 9823All occurances of the name @samp{ALL} appearing as a 9824regular expression are used in addition to the first 9825matching regular expression or @samp{DEFAULT}. 9826 9827The log message template will be used as a default log 9828message. If you specify a log message with @samp{cvs 9829commit -m @var{message}} or @samp{cvs commit -f 9830@var{file}} that log message will override the 9831template. 9832 9833@xref{verifymsg}, for an example @file{rcsinfo} 9834file. 9835 9836When @sc{CVS} is accessing a remote repository, 9837the contents of @file{rcsinfo} at the time a directory 9838is first checked out will specify a template which does 9839not then change. If you edit @file{rcsinfo} or its 9840templates, you may need to check out a new working 9841directory. 9842@c Would be nice to fix CVS so this isn't needed. For 9843@c example, a mechanism analogous to CVS/Entries, where 9844@c the client keeps track of what version of the template 9845@c it has. 9846 9847@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9848@node cvsignore 9849@appendixsec Ignoring files via cvsignore 9850@cindex cvsignore (admin file), global 9851@cindex Global cvsignore 9852@cindex Ignoring files 9853@c -- This chapter should maybe be moved to the 9854@c tutorial part of the manual? 9855 9856There are certain file names that frequently occur 9857inside your working copy, but that you don't want to 9858put under @sc{cvs} control. Examples are all the object 9859files that you get while you compile your sources. 9860Normally, when you run @samp{cvs update}, it prints a 9861line for each file it encounters that it doesn't know 9862about (@pxref{update output}). 9863 9864@sc{cvs} has a list of files (or sh(1) file name patterns) 9865that it should ignore while running @code{update}, 9866@code{import} and @code{release}. 9867@c -- Are those the only three commands affected? 9868This list is constructed in the following way. 9869 9870@itemize @bullet 9871@item 9872The list is initialized to include certain file name 9873patterns: names associated with @sc{cvs} 9874administration, or with other common source control 9875systems; common names for patch files, object files, 9876archive files, and editor backup files; and other names 9877that are usually artifacts of assorted utilities. 9878Currently, the default list of ignored file name 9879patterns is: 9880 9881@cindex Ignored files 9882@cindex Automatically ignored files 9883@example 9884 RCS SCCS CVS CVS.adm 9885 RCSLOG cvslog.* 9886 tags TAGS 9887 .make.state .nse_depinfo 9888 *~ #* .#* ,* _$* *$ 9889 *.old *.bak *.BAK *.orig *.rej .del-* 9890 *.a *.olb *.o *.obj *.so *.exe 9891 *.Z *.elc *.ln 9892 core 9893@end example 9894 9895@item 9896The per-repository list in 9897@file{$CVSROOT/CVSROOT/cvsignore} is appended to 9898the list, if that file exists. 9899 9900@item 9901The per-user list in @file{.cvsignore} in your home 9902directory is appended to the list, if it exists. 9903 9904@item 9905Any entries in the environment variable 9906@code{$CVSIGNORE} is appended to the list. 9907 9908@item 9909Any @samp{-I} options given to @sc{cvs} is appended. 9910 9911@item 9912As @sc{cvs} traverses through your directories, the contents 9913of any @file{.cvsignore} will be appended to the list. 9914The patterns found in @file{.cvsignore} are only valid 9915for the directory that contains them, not for 9916any sub-directories. 9917@end itemize 9918 9919In any of the 5 places listed above, a single 9920exclamation mark (@samp{!}) clears the ignore list. 9921This can be used if you want to store any file which 9922normally is ignored by @sc{cvs}. 9923 9924Specifying @samp{-I !} to @code{cvs import} will import 9925everything, which is generally what you want to do if 9926you are importing files from a pristine distribution or 9927any other source which is known to not contain any 9928extraneous files. However, looking at the rules above 9929you will see there is a fly in the ointment; if the 9930distribution contains any @file{.cvsignore} files, then 9931the patterns from those files will be processed even if 9932@samp{-I !} is specified. The only workaround is to 9933remove the @file{.cvsignore} files in order to do the 9934import. Because this is awkward, in the future 9935@samp{-I !} might be modified to override 9936@file{.cvsignore} files in each directory. 9937 9938@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 9939@node history file 9940@appendixsec The history file 9941@cindex History file 9942@cindex Log information, saving 9943 9944The file @file{$CVSROOT/CVSROOT/history} is used 9945to log information for the @code{history} command 9946(@pxref{history}). This file must be created to turn 9947on logging. This is done automatically if the 9948@code{cvs init} command is used to set up the 9949repository (@pxref{Creating a repository}). 9950 9951The file format of the @file{history} file is 9952documented only in comments in the @sc{cvs} source 9953code, but generally programs should use the @code{cvs 9954history} command to access it anyway, in case the 9955format changes with future releases of @sc{cvs}. 9956 9957@node Variables 9958@appendixsec Expansions in administrative files 9959 9960Sometimes in writing an administrative file, you might 9961want the file to be able to know various things based 9962on environment @sc{cvs} is running in. There are 9963several mechanisms to do that. 9964 9965To find the home directory of the user running @sc{cvs} 9966(from the @code{HOME} environment variable), use 9967@samp{~} followed by @samp{/} or the end of the line. 9968Likewise for the home directory of @var{user}, use 9969@samp{~@var{user}}. These variables are expanded on 9970the server machine, and don't get any resonable 9971expansion if pserver (@pxref{Password authenticated}) 9972is in used; therefore user variables (see below) may be 9973a better choice to customize behavior based on the user 9974running @sc{cvs}. 9975@c Based on these limitations, should we deprecate ~? 9976@c What is it good for? Are people using it? 9977 9978One may want to know about various pieces of 9979information internal to @sc{cvs}. A @sc{cvs} internal 9980variable has the syntax @code{$@{@var{variable}@}}, 9981where @var{variable} starts with a letter and consists 9982of alphanumberic characters and @samp{_}. If the 9983character following @var{variable} is a 9984non-alphanumeric character other than @samp{_}, the 9985@samp{@{} and @samp{@}} can be omitted. The @sc{cvs} 9986internal variables are: 9987 9988@table @code 9989@item CVSROOT 9990This is the value of the @sc{cvs} root in use. 9991@xref{Repository}, for a description of the various 9992ways to specify this. 9993 9994@item RCSBIN 9995This is the value @sc{cvs} is using for where to find 9996@sc{rcs} binaries. @xref{Global options}, for a 9997description of how to specify this. 9998 9999@item CVSEDITOR 10000@itemx VISUAL 10001@itemx EDITOR 10002These all expand to the same value, which is the editor 10003that @sc{cvs} is using. @xref{Global options}, for how 10004to specify this. 10005 10006@item USER 10007Username of the user running @sc{cvs} (on the @sc{cvs} 10008server machine). 10009@end table 10010 10011If you want to pass a value to the administrative files 10012which the user that is running @sc{cvs} can specify, 10013use a user variable. To expand a user variable, the 10014administrative file contains 10015@code{$@{=@var{variable}@}}. To set a user variable, 10016specify the global option @samp{-s} to @sc{cvs}, with 10017argument @code{@var{variable}=@var{value}}. It may be 10018particularly useful to specify this option via 10019@file{.cvsrc} (@pxref{~/.cvsrc}). 10020 10021For example, if you want the administrative file to 10022refer to a test directory you might create a user 10023variable @code{TESTDIR}. Then if @sc{cvs} is invoked 10024as @code{cvs -s TESTDIR=/work/local/tests}, and the 10025administrative file contains @code{sh 10026$@{=TESTDIR@}/runtests}, then that string is expanded 10027to @code{sh /work/local/tests/runtests}. 10028 10029All other strings containing @samp{$} are reserved; 10030there is no way to quote a @samp{$} character so that 10031@samp{$} represents itself. 10032 10033@c --------------------------------------------------------------------- 10034@node Environment variables 10035@appendix All environment variables which affect CVS 10036@cindex Environment variables 10037@cindex Reference manual for variables 10038 10039This is a complete list of all environment variables 10040that affect @sc{cvs}. 10041 10042@table @code 10043@cindex CVSIGNORE 10044@item $CVSIGNORE 10045A whitespace-separated list of file name patterns that 10046@sc{cvs} should ignore. @xref{cvsignore}. 10047 10048@cindex CVSWRAPPERS 10049@item $CVSWRAPPERS 10050A whitespace-separated list of file name patterns that 10051@sc{cvs} should treat as wrappers. @xref{Wrappers}. 10052 10053@cindex CVSREAD 10054@cindex read-only files, and CVSREAD 10055@item $CVSREAD 10056If this is set, @code{checkout} and @code{update} will 10057try hard to make the files in your working directory 10058read-only. When this is not set, the default behavior 10059is to permit modification of your working files. 10060 10061@cindex CVSROOT 10062@item $CVSROOT 10063Should contain the full pathname to the root of the @sc{cvs} 10064source repository (where the @sc{rcs} history files are 10065kept). This information must be available to @sc{cvs} for 10066most commands to execute; if @code{$CVSROOT} is not set, 10067or if you wish to override it for one invocation, you 10068can supply it on the command line: @samp{cvs -d cvsroot 10069cvs_command@dots{}} Once you have checked out a working 10070directory, @sc{cvs} stores the appropriate root (in 10071the file @file{CVS/Root}), so normally you only need to 10072worry about this when initially checking out a working 10073directory. 10074 10075@cindex EDITOR 10076@cindex CVSEDITOR 10077@item $EDITOR 10078@itemx $CVSEDITOR 10079Specifies the program to use for recording log messages 10080during commit. If not set, the default is 10081@samp{/usr/ucb/vi}. @code{$CVSEDITOR} overrides 10082@code{$EDITOR}. 10083 10084@cindex PATH 10085@item $PATH 10086If @code{$RCSBIN} is not set, and no path is compiled 10087into @sc{cvs}, it will use @code{$PATH} to try to find all 10088programs it uses. 10089 10090@cindex RCSBIN 10091@item $RCSBIN 10092This is the value @sc{cvs} is using for where to find 10093@sc{rcs} binaries. @xref{Global options}, for a 10094description of how to specify this. If not set, a 10095compiled-in value is used, or your @code{$PATH} is searched. 10096 10097@cindex HOME 10098@item $HOME 10099@cindex HOMEPATH 10100@item $HOMEPATH 10101Used to locate the directory where the @file{.cvsrc} 10102file is searched (@code{$HOMEPATH} is used for Windows-NT). 10103@pxref{~/.cvsrc} 10104 10105@cindex CVS_RSH 10106@item $CVS_RSH 10107Specifies the external program which CVS connects with, 10108when @code{:ext:} access method is specified. 10109@pxref{Connecting via rsh}. 10110 10111@item $CVS_SERVER 10112Used in client-server mode when accessing a remote 10113repository using @sc{rsh}. It specifies the name of 10114the program to start on the server side when accessing 10115a remote repository using @sc{rsh}. The default value 10116is @code{cvs}. @pxref{Connecting via rsh} 10117 10118@item $CVS_PASSFILE 10119Used in client-server mode when accessing the @code{cvs 10120login server}. Default value is @file{$HOME/.cvspass}. 10121@pxref{Password authentication client} 10122 10123@item $CVS_CLIENT_PORT 10124Used in client-server mode when accessing the server 10125via Kerberos. 10126@pxref{Kerberos authenticated} 10127 10128@cindex CVS_RCMD_PORT 10129@item $CVS_RCMD_PORT 10130Used in client-server mode. If set, specifies the port 10131number to be used when accessing the @sc{rcmd} demon on 10132the server side. (Currently not used for Unix clients). 10133 10134@cindex CVS_CLIENT_LOG 10135@item $CVS_CLIENT_LOG 10136Used for debugging only in client-server 10137mode. If set, everything send to the server is logged 10138into @file{@code{$CVS_CLIENT_LOG}.in} and everything 10139send from the server is logged into 10140@file{@code{$CVS_CLIENT_LOG}.out}. 10141 10142@cindex CVS_SERVER_SLEEP 10143@item $CVS_SERVER_SLEEP 10144Used only for debugging the server side in 10145client-server mode. If set, delays the start of the 10146server child process the the specified amount of 10147seconds so that you can attach to it with a debugger. 10148 10149@cindex CVS_IGNORE_REMOTE_ROOT 10150@item $CVS_IGNORE_REMOTE_ROOT 10151(What is the purpose of this variable?) 10152 10153@cindex COMSPEC 10154@item $COMSPEC 10155Used under OS/2 only. It specifies the name of the 10156command interpreter and defaults to @sc{cmd.exe}. 10157 10158@cindex TMPDIR 10159@item $TMPDIR 10160@cindex TMP 10161@itemx $TMP 10162@cindex TEMP 10163@itemx $TEMP 10164@cindex temporary files, location of 10165@c I'm not even sure I've documented all the 10166@c conventions here. Furthermore, those conventions are 10167@c pretty crazy and they should be simplified. 10168Directory in which temporary files are located. Those 10169parts of @sc{cvs} which are implemented using @sc{rcs} 10170inspect the above variables in the order they appear 10171above and the first value found is taken; if none of 10172them are set, a host-dependent default is used, 10173typically @file{/tmp}. The @sc{cvs} server uses 10174@code{TMPDIR}. @xref{Global options}, for a 10175description of how to specify this. 10176Some parts of @sc{cvs} will always use @file{/tmp} (via 10177the @code{tmpnam} function provided by the system). 10178 10179On Windows NT, @code{TMP} is used (via the @code{_tempnam} 10180function provided by the system). 10181 10182The @code{patch} program which is used by the @sc{cvs} 10183client uses @code{TMPDIR}, and if it is not set, uses 10184@file{/tmp} (at least with GNU patch 2.1). 10185@end table 10186 10187@sc{cvs} invokes @sc{rcs} to perform certain 10188operations. The following environment 10189variables affect @sc{rcs}. Note that if you are using 10190the client/server @sc{cvs}, these variables need to be 10191set on the server side (which may or not may be 10192possible depending on how you are connecting). There 10193is probably not any need to set any of them, however. 10194 10195@table @code 10196@cindex LOGNAME 10197@item $LOGNAME 10198@cindex USER 10199@itemx $USER 10200If set, they affect who @sc{rcs} thinks you are. If you 10201have trouble checking in files it might be because your 10202login name differs from the setting of e.g. 10203@code{$LOGNAME}. 10204 10205@cindex RCSINIT 10206@item $RCSINIT 10207Options prepended to the argument list, separated by 10208spaces. A backslash escapes spaces within an option. 10209The @code{$RCSINIT} options are prepended to the 10210argument lists of most @sc{rcs} commands. 10211@end table 10212 10213@c --------------------------------------------------------------------- 10214@node Troubleshooting 10215@appendix Troubleshooting 10216 10217@menu 10218* Magic branch numbers:: Magic branch numbers 10219@end menu 10220 10221@ignore 10222@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 10223@c @node Bad administrative files 10224@appendixsec Bad administrative files 10225 10226@c -- Give hints on how to fix them 10227@end ignore 10228 10229@c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 10230@node Magic branch numbers 10231@appendixsec Magic branch numbers 10232 10233@c Where does this go? I think probably in with 10234@c the details of where things are stored in the 10235@c repository (plus an xref from "log" and "admin"). 10236 10237Externally, branch numbers consist of an odd number of 10238dot-separated decimal integers. @xref{Revision 10239numbers}. That is not the whole truth, however. For 10240efficiency reasons @sc{cvs} sometimes inserts an extra 0 10241in the second rightmost position (1.2.3 becomes 102421.2.0.3, 8.9.10.11.12 becomes 8.9.10.11.0.12 and so 10243on). 10244 10245@sc{cvs} does a pretty good job at hiding these so 10246called magic branches, but in a few places the hiding 10247is incomplete: 10248 10249@itemize @bullet 10250@ignore 10251@c This is in ignore as I'm taking their word for it, 10252@c that this was fixed 10253@c a long time ago. But before deleting this 10254@c entirely, I'd rather verify it (and add a test 10255@c case to the testsuite). 10256@item 10257The magic branch can appear in the output from 10258@code{cvs status} in vanilla @sc{cvs} 1.3. This is 10259fixed in @sc{cvs} 1.3-s2. 10260 10261@end ignore 10262@item 10263The magic branch number appears in the output from 10264@code{cvs log}. 10265@c What output should appear instead? 10266 10267@item 10268You cannot specify a symbolic branch name to @code{cvs 10269admin}. 10270 10271@end itemize 10272 10273@c Can CVS do this automatically the first time 10274@c you check something in to that branch? Should 10275@c it? 10276You can use the @code{admin} command to reassign a 10277symbolic name to a branch the way @sc{rcs} expects it 10278to be. If @code{R4patches} is assigned to the branch 102791.4.2 (magic branch number 1.4.0.2) in file 10280@file{numbers.c} you can do this: 10281 10282@example 10283$ cvs admin -NR4patches:1.4.2 numbers.c 10284@end example 10285 10286It only works if at least one revision is already 10287committed on the branch. Be very careful so that you 10288do not assign the tag to the wrong number. (There is 10289no way to see how the tag was assigned yesterday). 10290 10291@c --------------------------------------------------------------------- 10292@node Copying 10293@appendix GNU GENERAL PUBLIC LICENSE 10294@center Version 2, June 1991 10295 10296@display 10297Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc. 1029859 Temple Place - Suite 330, Boston, MA 02111-1307, USA 10299 10300Everyone is permitted to copy and distribute verbatim copies 10301of this license document, but changing it is not allowed. 10302@end display 10303 10304@unnumberedsec Preamble 10305 10306 The licenses for most software are designed to take away your 10307freedom to share and change it. By contrast, the GNU General Public 10308License is intended to guarantee your freedom to share and change free 10309software---to make sure the software is free for all its users. This 10310General Public License applies to most of the Free Software 10311Foundation's software and to any other program whose authors commit to 10312using it. (Some other Free Software Foundation software is covered by 10313the GNU Library General Public License instead.) You can apply it to 10314your programs, too. 10315 10316 When we speak of free software, we are referring to freedom, not 10317price. Our General Public Licenses are designed to make sure that you 10318have the freedom to distribute copies of free software (and charge for 10319this service if you wish), that you receive source code or can get it 10320if you want it, that you can change the software or use pieces of it 10321in new free programs; and that you know you can do these things. 10322 10323 To protect your rights, we need to make restrictions that forbid 10324anyone to deny you these rights or to ask you to surrender the rights. 10325These restrictions translate to certain responsibilities for you if you 10326distribute copies of the software, or if you modify it. 10327 10328 For example, if you distribute copies of such a program, whether 10329gratis or for a fee, you must give the recipients all the rights that 10330you have. You must make sure that they, too, receive or can get the 10331source code. And you must show them these terms so they know their 10332rights. 10333 10334 We protect your rights with two steps: (1) copyright the software, and 10335(2) offer you this license which gives you legal permission to copy, 10336distribute and/or modify the software. 10337 10338 Also, for each author's protection and ours, we want to make certain 10339that everyone understands that there is no warranty for this free 10340software. If the software is modified by someone else and passed on, we 10341want its recipients to know that what they have is not the original, so 10342that any problems introduced by others will not reflect on the original 10343authors' reputations. 10344 10345 Finally, any free program is threatened constantly by software 10346patents. We wish to avoid the danger that redistributors of a free 10347program will individually obtain patent licenses, in effect making the 10348program proprietary. To prevent this, we have made it clear that any 10349patent must be licensed for everyone's free use or not licensed at all. 10350 10351 The precise terms and conditions for copying, distribution and 10352modification follow. 10353 10354@iftex 10355@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 10356@end iftex 10357@ifinfo 10358@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 10359@end ifinfo 10360 10361@enumerate 0 10362@item 10363This License applies to any program or other work which contains 10364a notice placed by the copyright holder saying it may be distributed 10365under the terms of this General Public License. The ``Program'', below, 10366refers to any such program or work, and a ``work based on the Program'' 10367means either the Program or any derivative work under copyright law: 10368that is to say, a work containing the Program or a portion of it, 10369either verbatim or with modifications and/or translated into another 10370language. (Hereinafter, translation is included without limitation in 10371the term ``modification''.) Each licensee is addressed as ``you''. 10372 10373Activities other than copying, distribution and modification are not 10374covered by this License; they are outside its scope. The act of 10375running the Program is not restricted, and the output from the Program 10376is covered only if its contents constitute a work based on the 10377Program (independent of having been made by running the Program). 10378Whether that is true depends on what the Program does. 10379 10380@item 10381You may copy and distribute verbatim copies of the Program's 10382source code as you receive it, in any medium, provided that you 10383conspicuously and appropriately publish on each copy an appropriate 10384copyright notice and disclaimer of warranty; keep intact all the 10385notices that refer to this License and to the absence of any warranty; 10386and give any other recipients of the Program a copy of this License 10387along with the Program. 10388 10389You may charge a fee for the physical act of transferring a copy, and 10390you may at your option offer warranty protection in exchange for a fee. 10391 10392@item 10393You may modify your copy or copies of the Program or any portion 10394of it, thus forming a work based on the Program, and copy and 10395distribute such modifications or work under the terms of Section 1 10396above, provided that you also meet all of these conditions: 10397 10398@enumerate a 10399@item 10400You must cause the modified files to carry prominent notices 10401stating that you changed the files and the date of any change. 10402 10403@item 10404You must cause any work that you distribute or publish, that in 10405whole or in part contains or is derived from the Program or any 10406part thereof, to be licensed as a whole at no charge to all third 10407parties under the terms of this License. 10408 10409@item 10410If the modified program normally reads commands interactively 10411when run, you must cause it, when started running for such 10412interactive use in the most ordinary way, to print or display an 10413announcement including an appropriate copyright notice and a 10414notice that there is no warranty (or else, saying that you provide 10415a warranty) and that users may redistribute the program under 10416these conditions, and telling the user how to view a copy of this 10417License. (Exception: if the Program itself is interactive but 10418does not normally print such an announcement, your work based on 10419the Program is not required to print an announcement.) 10420@end enumerate 10421 10422These requirements apply to the modified work as a whole. If 10423identifiable sections of that work are not derived from the Program, 10424and can be reasonably considered independent and separate works in 10425themselves, then this License, and its terms, do not apply to those 10426sections when you distribute them as separate works. But when you 10427distribute the same sections as part of a whole which is a work based 10428on the Program, the distribution of the whole must be on the terms of 10429this License, whose permissions for other licensees extend to the 10430entire whole, and thus to each and every part regardless of who wrote it. 10431 10432Thus, it is not the intent of this section to claim rights or contest 10433your rights to work written entirely by you; rather, the intent is to 10434exercise the right to control the distribution of derivative or 10435collective works based on the Program. 10436 10437In addition, mere aggregation of another work not based on the Program 10438with the Program (or with a work based on the Program) on a volume of 10439a storage or distribution medium does not bring the other work under 10440the scope of this License. 10441 10442@item 10443You may copy and distribute the Program (or a work based on it, 10444under Section 2) in object code or executable form under the terms of 10445Sections 1 and 2 above provided that you also do one of the following: 10446 10447@enumerate a 10448@item 10449Accompany it with the complete corresponding machine-readable 10450source code, which must be distributed under the terms of Sections 104511 and 2 above on a medium customarily used for software interchange; or, 10452 10453@item 10454Accompany it with a written offer, valid for at least three 10455years, to give any third party, for a charge no more than your 10456cost of physically performing source distribution, a complete 10457machine-readable copy of the corresponding source code, to be 10458distributed under the terms of Sections 1 and 2 above on a medium 10459customarily used for software interchange; or, 10460 10461@item 10462Accompany it with the information you received as to the offer 10463to distribute corresponding source code. (This alternative is 10464allowed only for noncommercial distribution and only if you 10465received the program in object code or executable form with such 10466an offer, in accord with Subsection b above.) 10467@end enumerate 10468 10469The source code for a work means the preferred form of the work for 10470making modifications to it. For an executable work, complete source 10471code means all the source code for all modules it contains, plus any 10472associated interface definition files, plus the scripts used to 10473control compilation and installation of the executable. However, as a 10474special exception, the source code distributed need not include 10475anything that is normally distributed (in either source or binary 10476form) with the major components (compiler, kernel, and so on) of the 10477operating system on which the executable runs, unless that component 10478itself accompanies the executable. 10479 10480If distribution of executable or object code is made by offering 10481access to copy from a designated place, then offering equivalent 10482access to copy the source code from the same place counts as 10483distribution of the source code, even though third parties are not 10484compelled to copy the source along with the object code. 10485 10486@item 10487You may not copy, modify, sublicense, or distribute the Program 10488except as expressly provided under this License. Any attempt 10489otherwise to copy, modify, sublicense or distribute the Program is 10490void, and will automatically terminate your rights under this License. 10491However, parties who have received copies, or rights, from you under 10492this License will not have their licenses terminated so long as such 10493parties remain in full compliance. 10494 10495@item 10496You are not required to accept this License, since you have not 10497signed it. However, nothing else grants you permission to modify or 10498distribute the Program or its derivative works. These actions are 10499prohibited by law if you do not accept this License. Therefore, by 10500modifying or distributing the Program (or any work based on the 10501Program), you indicate your acceptance of this License to do so, and 10502all its terms and conditions for copying, distributing or modifying 10503the Program or works based on it. 10504 10505@item 10506Each time you redistribute the Program (or any work based on the 10507Program), the recipient automatically receives a license from the 10508original licensor to copy, distribute or modify the Program subject to 10509these terms and conditions. You may not impose any further 10510restrictions on the recipients' exercise of the rights granted herein. 10511You are not responsible for enforcing compliance by third parties to 10512this License. 10513 10514@item 10515If, as a consequence of a court judgment or allegation of patent 10516infringement or for any other reason (not limited to patent issues), 10517conditions are imposed on you (whether by court order, agreement or 10518otherwise) that contradict the conditions of this License, they do not 10519excuse you from the conditions of this License. If you cannot 10520distribute so as to satisfy simultaneously your obligations under this 10521License and any other pertinent obligations, then as a consequence you 10522may not distribute the Program at all. For example, if a patent 10523license would not permit royalty-free redistribution of the Program by 10524all those who receive copies directly or indirectly through you, then 10525the only way you could satisfy both it and this License would be to 10526refrain entirely from distribution of the Program. 10527 10528If any portion of this section is held invalid or unenforceable under 10529any particular circumstance, the balance of the section is intended to 10530apply and the section as a whole is intended to apply in other 10531circumstances. 10532 10533It is not the purpose of this section to induce you to infringe any 10534patents or other property right claims or to contest validity of any 10535such claims; this section has the sole purpose of protecting the 10536integrity of the free software distribution system, which is 10537implemented by public license practices. Many people have made 10538generous contributions to the wide range of software distributed 10539through that system in reliance on consistent application of that 10540system; it is up to the author/donor to decide if he or she is willing 10541to distribute software through any other system and a licensee cannot 10542impose that choice. 10543 10544This section is intended to make thoroughly clear what is believed to 10545be a consequence of the rest of this License. 10546 10547@item 10548If the distribution and/or use of the Program is restricted in 10549certain countries either by patents or by copyrighted interfaces, the 10550original copyright holder who places the Program under this License 10551may add an explicit geographical distribution limitation excluding 10552those countries, so that distribution is permitted only in or among 10553countries not thus excluded. In such case, this License incorporates 10554the limitation as if written in the body of this License. 10555 10556@item 10557The Free Software Foundation may publish revised and/or new versions 10558of the General Public License from time to time. Such new versions will 10559be similar in spirit to the present version, but may differ in detail to 10560address new problems or concerns. 10561 10562Each version is given a distinguishing version number. If the Program 10563specifies a version number of this License which applies to it and ``any 10564later version'', you have the option of following the terms and conditions 10565either of that version or of any later version published by the Free 10566Software Foundation. If the Program does not specify a version number of 10567this License, you may choose any version ever published by the Free Software 10568Foundation. 10569 10570@item 10571If you wish to incorporate parts of the Program into other free 10572programs whose distribution conditions are different, write to the author 10573to ask for permission. For software which is copyrighted by the Free 10574Software Foundation, write to the Free Software Foundation; we sometimes 10575make exceptions for this. Our decision will be guided by the two goals 10576of preserving the free status of all derivatives of our free software and 10577of promoting the sharing and reuse of software generally. 10578 10579@iftex 10580@heading NO WARRANTY 10581@end iftex 10582@ifinfo 10583@center NO WARRANTY 10584@end ifinfo 10585 10586@item 10587BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 10588FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 10589OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 10590PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 10591OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 10592MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 10593TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 10594PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 10595REPAIR OR CORRECTION. 10596 10597@item 10598IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 10599WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 10600REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 10601INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 10602OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 10603TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 10604YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 10605PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 10606POSSIBILITY OF SUCH DAMAGES. 10607@end enumerate 10608 10609@iftex 10610@heading END OF TERMS AND CONDITIONS 10611@end iftex 10612@ifinfo 10613@center END OF TERMS AND CONDITIONS 10614@end ifinfo 10615 10616@page 10617@unnumberedsec How to Apply These Terms to Your New Programs 10618 10619 If you develop a new program, and you want it to be of the greatest 10620possible use to the public, the best way to achieve this is to make it 10621free software which everyone can redistribute and change under these terms. 10622 10623 To do so, attach the following notices to the program. It is safest 10624to attach them to the start of each source file to most effectively 10625convey the exclusion of warranty; and each file should have at least 10626the ``copyright'' line and a pointer to where the full notice is found. 10627 10628@smallexample 10629@var{one line to give the program's name and a brief idea of what it does.} 10630Copyright (C) 19@var{yy} @var{name of author} 10631 10632This program is free software; you can redistribute it and/or modify 10633it under the terms of the GNU General Public License as published by 10634the Free Software Foundation; either version 2 of the License, or 10635(at your option) any later version. 10636 10637This program is distributed in the hope that it will be useful, 10638but WITHOUT ANY WARRANTY; without even the implied warranty of 10639MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10640GNU General Public License for more details. 10641 10642You should have received a copy of the GNU General Public License 10643along with this program; if not, write to the Free Software 10644Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 10645@end smallexample 10646 10647Also add information on how to contact you by electronic and paper mail. 10648 10649If the program is interactive, make it output a short notice like this 10650when it starts in an interactive mode: 10651 10652@smallexample 10653Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author} 10654Gnomovision comes with ABSOLUTELY NO WARRANTY; for details 10655type `show w'. 10656This is free software, and you are welcome to redistribute it 10657under certain conditions; type `show c' for details. 10658@end smallexample 10659 10660The hypothetical commands @samp{show w} and @samp{show c} should show 10661the appropriate parts of the General Public License. Of course, the 10662commands you use may be called something other than @samp{show w} and 10663@samp{show c}; they could even be mouse-clicks or menu items---whatever 10664suits your program. 10665 10666You should also get your employer (if you work as a programmer) or your 10667school, if any, to sign a ``copyright disclaimer'' for the program, if 10668necessary. Here is a sample; alter the names: 10669 10670@smallexample 10671Yoyodyne, Inc., hereby disclaims all copyright interest in the program 10672`Gnomovision' (which makes passes at compilers) written by James Hacker. 10673 10674@var{signature of Ty Coon}, 1 April 1989 10675Ty Coon, President of Vice 10676@end smallexample 10677 10678This General Public License does not permit incorporating your program into 10679proprietary programs. If your program is a subroutine library, you may 10680consider it more useful to permit linking proprietary applications with the 10681library. If this is what you want to do, use the GNU Library General 10682Public License instead of this License. 10683 10684@c --------------------------------------------------------------------- 10685@node Index 10686@unnumbered Index 10687@cindex Index 10688 10689@printindex cp 10690 10691@summarycontents 10692 10693@contents 10694 10695@bye 10696 10697Local Variables: 10698fill-column: 55 10699End: 10700