xref: /openbsd/gnu/usr.bin/cvs/doc/cvs.info-5 (revision e77048c1)
1This is cvs.info, produced by makeinfo version 4.0 from ./cvs.texinfo.
2
3START-INFO-DIR-ENTRY
4* CVS: (cvs).          Concurrent Versions System
5END-INFO-DIR-ENTRY
6
7   Copyright (C) 1992, 1993 Signum Support AB Copyright (C) 1993, 1994
8Free Software Foundation, Inc.
9
10   Permission is granted to make and distribute verbatim copies of this
11manual provided the copyright notice and this permission notice are
12preserved on all copies.
13
14   Permission is granted to copy and distribute modified versions of
15this manual under the conditions for verbatim copying, provided also
16that the entire resulting derived work is distributed under the terms
17of a permission notice identical to this one.
18
19   Permission is granted to copy and distribute translations of this
20manual into another language, under the above conditions for modified
21versions, except that this permission notice may be stated in a
22translation approved by the Free Software Foundation.
23
24
25File: cvs.info,  Node: First import,  Next: Update imports,  Up: Tracking sources
26
27Importing for the first time
28============================
29
30   Use the `import' command to check in the sources for the first time.
31When you use the `import' command to track third-party sources, the
32"vendor tag" and "release tags" are useful.  The "vendor tag" is a
33symbolic name for the branch (which is always 1.1.1, unless you use the
34`-b BRANCH' flag--*Note Multiple vendor branches::.).  The "release
35tags" are symbolic names for a particular release, such as `FSF_0_04'.
36
37   Note that `import' does _not_ change the directory in which you
38invoke it.  In particular, it does not set up that directory as a CVS
39working directory; if you want to work with the sources import them
40first and then check them out into a different directory (*note Getting
41the source::).
42
43   Suppose you have the sources to a program called `wdiff' in a
44directory `wdiff-0.04', and are going to make private modifications
45that you want to be able to use even when new releases are made in the
46future.  You start by importing the source to your repository:
47
48     $ cd wdiff-0.04
49     $ cvs import -m "Import of FSF v. 0.04" fsf/wdiff FSF_DIST WDIFF_0_04
50
51   The vendor tag is named `FSF_DIST' in the above example, and the
52only release tag assigned is `WDIFF_0_04'.
53
54
55File: cvs.info,  Node: Update imports,  Next: Reverting local changes,  Prev: First import,  Up: Tracking sources
56
57Updating with the import command
58================================
59
60   When a new release of the source arrives, you import it into the
61repository with the same `import' command that you used to set up the
62repository in the first place.  The only difference is that you specify
63a different release tag this time.
64
65     $ tar xfz wdiff-0.05.tar.gz
66     $ cd wdiff-0.05
67     $ cvs import -m "Import of FSF v. 0.05" fsf/wdiff FSF_DIST WDIFF_0_05
68
69   For files that have not been modified locally, the newly created
70revision becomes the head revision.  If you have made local changes,
71`import' will warn you that you must merge the changes into the main
72trunk, and tell you to use `checkout -j' to do so.
73
74     $ cvs checkout -jFSF_DIST:yesterday -jFSF_DIST wdiff
75
76The above command will check out the latest revision of `wdiff',
77merging the changes made on the vendor branch `FSF_DIST' since
78yesterday into the working copy.  If any conflicts arise during the
79merge they should be resolved in the normal way (*note Conflicts
80example::).  Then, the modified files may be committed.
81
82   Using a date, as suggested above, assumes that you do not import
83more than one release of a product per day. If you do, you can always
84use something like this instead:
85
86     $ cvs checkout -jWDIFF_0_04 -jWDIFF_0_05 wdiff
87
88In this case, the two above commands are equivalent.
89
90
91File: cvs.info,  Node: Reverting local changes,  Next: Binary files in imports,  Prev: Update imports,  Up: Tracking sources
92
93Reverting to the latest vendor release
94======================================
95
96   You can also revert local changes completely and return to the
97latest vendor release by changing the `head' revision back to the
98vendor branch on all files.  For example, if you have a checked-out
99copy of the sources in `~/work.d/wdiff', and you want to revert to the
100vendor's version for all the files in that directory, you would type:
101
102     $ cd ~/work.d/wdiff
103     $ cvs admin -bWDIFF .
104
105You must specify the `-bWDIFF' without any space after the `-b'.  *Note
106admin options::.
107
108
109File: cvs.info,  Node: Binary files in imports,  Next: Keywords in imports,  Prev: Reverting local changes,  Up: Tracking sources
110
111How to handle binary files with cvs import
112==========================================
113
114   Use the `-k' wrapper option to tell import which files are binary.
115*Note Wrappers::.
116
117
118File: cvs.info,  Node: Keywords in imports,  Next: Multiple vendor branches,  Prev: Binary files in imports,  Up: Tracking sources
119
120How to handle keyword substitution with cvs import
121==================================================
122
123   The sources which you are importing may contain keywords (*note
124Keyword substitution::).  For example, the vendor may use CVS or some
125other system which uses similar keyword expansion syntax.  If you just
126import the files in the default fashion, then the keyword expansions
127supplied by the vendor will be replaced by keyword expansions supplied
128by your own copy of CVS.  It may be more convenient to maintain the
129expansions supplied by the vendor, so that this information can supply
130information about the sources that you imported from the vendor.
131
132   To maintain the keyword expansions supplied by the vendor, supply
133the `-ko' option to `cvs import' the first time you import the file.
134This will turn off keyword expansion for that file entirely, so if you
135want to be more selective you'll have to think about what you want and
136use the `-k' option to `cvs update' or `cvs admin' as appropriate.
137
138
139File: cvs.info,  Node: Multiple vendor branches,  Prev: Keywords in imports,  Up: Tracking sources
140
141Multiple vendor branches
142========================
143
144   All the examples so far assume that there is only one vendor from
145which you are getting sources.  In some situations you might get
146sources from a variety of places.  For example, suppose that you are
147dealing with a project where many different people and teams are
148modifying the software.  There are a variety of ways to handle this,
149but in some cases you have a bunch of source trees lying around and
150what you want to do more than anything else is just to all put them in
151CVS so that you at least have them in one place.
152
153   For handling situations in which there may be more than one vendor,
154you may specify the `-b' option to `cvs import'.  It takes as an
155argument the vendor branch to import to.  The default is `-b 1.1.1'.
156
157   For example, suppose that there are two teams, the red team and the
158blue team, that are sending you sources.  You want to import the red
159team's efforts to branch 1.1.1 and use the vendor tag RED.  You want to
160import the blue team's efforts to branch 1.1.3 and use the vendor tag
161BLUE.  So the commands you might use are:
162
163     $ cvs import dir RED RED_1-0
164     $ cvs import -b 1.1.3 dir BLUE BLUE_1-5
165
166   Note that if your vendor tag does not match your `-b' option, CVS
167will not detect this case!  For example,
168
169     $ cvs import -b 1.1.3 dir RED RED_1-0
170
171Be careful; this kind of mismatch is sure to sow confusion or worse.  I
172can't think of a useful purpose for the ability to specify a mismatch
173here, but if you discover such a use, don't.  CVS is likely to make this
174an error in some future release.
175
176
177File: cvs.info,  Node: Builds,  Next: Special Files,  Prev: Tracking sources,  Up: Top
178
179How your build system interacts with CVS
180****************************************
181
182   As mentioned in the introduction, CVS does not contain software for
183building your software from source code.  This section describes how
184various aspects of your build system might interact with CVS.
185
186   One common question, especially from people who are accustomed to
187RCS, is how to make their build get an up to date copy of the sources.
188The answer to this with CVS is two-fold.  First of all, since CVS
189itself can recurse through directories, there is no need to modify your
190`Makefile' (or whatever configuration file your build tool uses) to
191make sure each file is up to date.  Instead, just use two commands,
192first `cvs -q update' and then `make' or whatever the command is to
193invoke your build tool.  Secondly, you do not necessarily _want_ to get
194a copy of a change someone else made until you have finished your own
195work.  One suggested approach is to first update your sources, then
196implement, build and test the change you were thinking of, and then
197commit your sources (updating first if necessary).  By periodically (in
198between changes, using the approach just described) updating your
199entire tree, you ensure that your sources are sufficiently up to date.
200
201   One common need is to record which versions of which source files
202went into a particular build.  This kind of functionality is sometimes
203called "bill of materials" or something similar.  The best way to do
204this with CVS is to use the `tag' command to record which versions went
205into a given build (*note Tags::).
206
207   Using CVS in the most straightforward manner possible, each
208developer will have a copy of the entire source tree which is used in a
209particular build.  If the source tree is small, or if developers are
210geographically dispersed, this is the preferred solution.  In fact one
211approach for larger projects is to break a project down into smaller
212separately-compiled subsystems, and arrange a way of releasing them
213internally so that each developer need check out only those subsystems
214which are they are actively working on.
215
216   Another approach is to set up a structure which allows developers to
217have their own copies of some files, and for other files to access
218source files from a central location.  Many people have come up with
219some such a system using features such as the symbolic link feature
220found in many operating systems, or the `VPATH' feature found in many
221versions of `make'.  One build tool which is designed to help with this
222kind of thing is Odin (see
223`ftp://ftp.cs.colorado.edu/pub/distribs/odin').
224
225
226File: cvs.info,  Node: Special Files,  Next: CVS commands,  Prev: Builds,  Up: Top
227
228Special Files
229*************
230
231   In normal circumstances, CVS works only with regular files.  Every
232file in a project is assumed to be persistent; it must be possible to
233open, read and close them; and so on.  CVS also ignores file
234permissions and ownerships, leaving such issues to be resolved by the
235developer at installation time.  In other words, it is not possible to
236"check in" a device into a repository; if the device file cannot be
237opened, CVS will refuse to handle it.  Files also lose their ownerships
238and permissions during repository transactions.
239
240
241File: cvs.info,  Node: CVS commands,  Next: Invoking CVS,  Prev: Special Files,  Up: Top
242
243Guide to CVS commands
244*********************
245
246   This appendix describes the overall structure of CVS commands, and
247describes some commands in detail (others are described elsewhere; for
248a quick reference to CVS commands, *note Invoking CVS::).
249
250* Menu:
251
252* Structure::                   Overall structure of CVS commands
253* Exit status::                 Indicating CVS's success or failure
254* ~/.cvsrc::                    Default options with the ~/.csvrc file
255* Global options::              Options you give to the left of cvs_command
256* Common options::              Options you give to the right of cvs_command
257* admin::                       Administration
258* checkout::                    Checkout sources for editing
259* commit::                      Check files into the repository
260* diff::                        Show differences between revisions
261* export::                      Export sources from CVS, similar to checkout
262* history::                     Show status of files and users
263* import::                      Import sources into CVS, using vendor branches
264* log::                         Show log messages for files
265* rdiff::                       'patch' format diffs between releases
266* release::                     Indicate that a directory is no longer in use
267* update::                      Bring work tree in sync with repository
268
269
270File: cvs.info,  Node: Structure,  Next: Exit status,  Up: CVS commands
271
272Overall structure of CVS commands
273=================================
274
275   The overall format of all CVS commands is:
276
277     cvs [ cvs_options ] cvs_command [ command_options ] [ command_args ]
278
279`cvs'
280     The name of the CVS program.
281
282`cvs_options'
283     Some options that affect all sub-commands of CVS.  These are
284     described below.
285
286`cvs_command'
287     One of several different sub-commands.  Some of the commands have
288     aliases that can be used instead; those aliases are noted in the
289     reference manual for that command.  There are only two situations
290     where you may omit `cvs_command': `cvs -H' elicits a list of
291     available commands, and `cvs -v' displays version information on
292     CVS itself.
293
294`command_options'
295     Options that are specific for the command.
296
297`command_args'
298     Arguments to the commands.
299
300   There is unfortunately some confusion between `cvs_options' and
301`command_options'.  `-l', when given as a `cvs_option', only affects
302some of the commands.  When it is given as a `command_option' is has a
303different meaning, and is accepted by more commands.  In other words,
304do not take the above categorization too seriously.  Look at the
305documentation instead.
306
307
308File: cvs.info,  Node: Exit status,  Next: ~/.cvsrc,  Prev: Structure,  Up: CVS commands
309
310CVS's exit status
311=================
312
313   CVS can indicate to the calling environment whether it succeeded or
314failed by setting its "exit status".  The exact way of testing the exit
315status will vary from one operating system to another.  For example in
316a unix shell script the `$?' variable will be 0 if the last command
317returned a successful exit status, or greater than 0 if the exit status
318indicated failure.
319
320   If CVS is successful, it returns a successful status; if there is an
321error, it prints an error message and returns a failure status.  The
322one exception to this is the `cvs diff' command.  It will return a
323successful status if it found no differences, or a failure status if
324there were differences or if there was an error.  Because this behavior
325provides no good way to detect errors, in the future it is possible that
326`cvs diff' will be changed to behave like the other CVS commands.
327
328
329File: cvs.info,  Node: ~/.cvsrc,  Next: Global options,  Prev: Exit status,  Up: CVS commands
330
331Default options and the ~/.cvsrc file
332=====================================
333
334   There are some `command_options' that are used so often that you
335might have set up an alias or some other means to make sure you always
336specify that option.  One example (the one that drove the
337implementation of the `.cvsrc' support, actually) is that many people
338find the default output of the `diff' command to be very hard to read,
339and that either context diffs or unidiffs are much easier to understand.
340
341   The `~/.cvsrc' file is a way that you can add default options to
342`cvs_commands' within cvs, instead of relying on aliases or other shell
343scripts.
344
345   The format of the `~/.cvsrc' file is simple.  The file is searched
346for a line that begins with the same name as the `cvs_command' being
347executed.  If a match is found, then the remainder of the line is split
348up (at whitespace characters) into separate options and added to the
349command arguments _before_ any options from the command line.
350
351   If a command has two names (e.g., `checkout' and `co'), the official
352name, not necessarily the one used on the command line, will be used to
353match against the file.  So if this is the contents of the user's
354`~/.cvsrc' file:
355
356     log -N
357     diff -u
358     update -P
359     checkout -P
360
361the command `cvs checkout foo' would have the `-P' option added to the
362arguments, as well as `cvs co foo'.
363
364   With the example file above, the output from `cvs diff foobar' will
365be in unidiff format.  `cvs diff -c foobar' will provide context diffs,
366as usual.  Getting "old" format diffs would be slightly more
367complicated, because `diff' doesn't have an option to specify use of
368the "old" format, so you would need `cvs -f diff foobar'.
369
370   In place of the command name you can use `cvs' to specify global
371options (*note Global options::).  For example the following line in
372`.cvsrc'
373
374     cvs -z6
375
376   causes CVS to use compression level 6.
377
378
379File: cvs.info,  Node: Global options,  Next: Common options,  Prev: ~/.cvsrc,  Up: CVS commands
380
381Global options
382==============
383
384   The available `cvs_options' (that are given to the left of
385`cvs_command') are:
386
387`--allow-root=ROOTDIR'
388     Specify legal CVSROOT directory.  See *Note Password
389     authentication server::.
390
391`-a'
392     Authenticate all communication between the client and the server.
393     Only has an effect on the CVS client.  As of this writing, this is
394     only implemented when using a GSSAPI connection (*note GSSAPI
395     authenticated::).  Authentication prevents certain sorts of attacks
396     involving hijacking the active TCP connection.  Enabling
397     authentication does not enable encryption.
398
399`-b BINDIR'
400     In CVS 1.9.18 and older, this specified that RCS programs are in
401     the BINDIR directory.  Current versions of CVS do not run RCS
402     programs; for compatibility this option is accepted, but it does
403     nothing.
404
405`-T TEMPDIR'
406     Use TEMPDIR as the directory where temporary files are located.
407     Overrides the setting of the `$TMPDIR' environment variable and
408     any precompiled directory.  This parameter should be specified as
409     an absolute pathname.
410
411`-d CVS_ROOT_DIRECTORY'
412     Use CVS_ROOT_DIRECTORY as the root directory pathname of the
413     repository.  Overrides the setting of the `$CVSROOT' environment
414     variable.  *Note Repository::.
415
416`-e EDITOR'
417     Use EDITOR to enter revision log information.  Overrides the
418     setting of the `$CVSEDITOR' and `$EDITOR' environment variables.
419     For more information, see *Note Committing your changes::.
420
421`-f'
422     Do not read the `~/.cvsrc' file.  This option is most often used
423     because of the non-orthogonality of the CVS option set.  For
424     example, the `cvs log' option `-N' (turn off display of tag names)
425     does not have a corresponding option to turn the display on.  So
426     if you have `-N' in the `~/.cvsrc' entry for `log', you may need
427     to use `-f' to show the tag names.
428
429`-H'
430`--help'
431     Display usage information about the specified `cvs_command' (but
432     do not actually execute the command).  If you don't specify a
433     command name, `cvs -H' displays overall help for CVS, including a
434     list of other help options.
435
436`-l'
437     Do not log the `cvs_command' in the command history (but execute it
438     anyway).  *Note history::, for information on command history.
439
440`-n'
441     Do not change any files.  Attempt to execute the `cvs_command',
442     but only to issue reports; do not remove, update, or merge any
443     existing files, or create any new files.
444
445     Note that CVS will not necessarily produce exactly the same output
446     as without `-n'.  In some cases the output will be the same, but
447     in other cases CVS will skip some of the processing that would
448     have been required to produce the exact same output.
449
450`-Q'
451     Cause the command to be really quiet; the command will only
452     generate output for serious problems.
453
454`-q'
455     Cause the command to be somewhat quiet; informational messages,
456     such as reports of recursion through subdirectories, are
457     suppressed.
458
459`-r'
460     Make new working files read-only.  Same effect as if the
461     `$CVSREAD' environment variable is set (*note Environment
462     variables::).  The default is to make working files writable,
463     unless watches are on (*note Watches::).
464
465`-s VARIABLE=VALUE'
466     Set a user variable (*note Variables::).
467
468`-t'
469     Trace program execution; display messages showing the steps of CVS
470     activity.  Particularly useful with `-n' to explore the potential
471     impact of an unfamiliar command.
472
473`-v'
474
475`--version'
476     Display version and copyright information for CVS.
477
478`-w'
479     Make new working files read-write.  Overrides the setting of the
480     `$CVSREAD' environment variable.  Files are created read-write by
481     default, unless `$CVSREAD' is set or `-r' is given.
482
483`-x'
484     Encrypt all communication between the client and the server.  Only
485     has an effect on the CVS client.  As of this writing, this is only
486     implemented when using a GSSAPI connection (*note GSSAPI
487     authenticated::) or a Kerberos connection (*note Kerberos
488     authenticated::).  Enabling encryption implies that message
489     traffic is also authenticated.  Encryption support is not
490     available by default; it must be enabled using a special configure
491     option, `--enable-encryption', when you build CVS.
492
493`-z GZIP-LEVEL'
494     Set the compression level.  Valid levels are 1 (high speed, low
495     compression) to 9 (low speed, high compression), or 0 to disable
496     compression (the default).  Only has an effect on the CVS client.
497
498
499File: cvs.info,  Node: Common options,  Next: admin,  Prev: Global options,  Up: CVS commands
500
501Common command options
502======================
503
504   This section describes the `command_options' that are available
505across several CVS commands.  These options are always given to the
506right of `cvs_command'. Not all commands support all of these options;
507each option is only supported for commands where it makes sense.
508However, when a command has one of these options you can almost always
509count on the same behavior of the option as in other commands.  (Other
510command options, which are listed with the individual commands, may have
511different behavior from one CVS command to the other).
512
513   *Warning:* the `history' command is an exception; it supports many
514options that conflict even with these standard options.
515
516`-D DATE_SPEC'
517     Use the most recent revision no later than DATE_SPEC.  DATE_SPEC
518     is a single argument, a date description specifying a date in the
519     past.
520
521     The specification is "sticky" when you use it to make a private
522     copy of a source file; that is, when you get a working file using
523     `-D', CVS records the date you specified, so that further updates
524     in the same directory will use the same date (for more information
525     on sticky tags/dates, *note Sticky tags::).
526
527     `-D' is available with the `checkout', `diff', `export', `history',
528     `rdiff', `rtag', and `update' commands.  (The `history' command
529     uses this option in a slightly different way; *note history
530     options::).
531
532     A wide variety of date formats are supported by CVS.  The most
533     standard ones are ISO8601 (from the International Standards
534     Organization) and the Internet e-mail standard (specified in
535     RFC822 as amended by RFC1123).
536
537     ISO8601 dates have many variants but a few examples are:
538
539          1972-09-24
540          1972-09-24 20:05
541
542     There are a lot more ISO8601 date formats, and CVS accepts many of
543     them, but you probably don't want to hear the _whole_ long story
544     :-).
545
546     In addition to the dates allowed in Internet e-mail itself, CVS
547     also allows some of the fields to be omitted.  For example:
548
549          24 Sep 1972 20:05
550          24 Sep
551
552     The date is interpreted as being in the local timezone, unless a
553     specific timezone is specified.
554
555     These two date formats are preferred.  However, CVS currently
556     accepts a wide variety of other date formats.  They are
557     intentionally not documented here in any detail, and future
558     versions of CVS might not accept all of them.
559
560     One such format is `MONTH/DAY/YEAR'.  This may confuse people who
561     are accustomed to having the month and day in the other order;
562     `1/4/96' is January 4, not April 1.
563
564     Remember to quote the argument to the `-D' flag so that your shell
565     doesn't interpret spaces as argument separators.  A command using
566     the `-D' flag can look like this:
567
568          $ cvs diff -D "1 hour ago" cvs.texinfo
569
570`-f'
571     When you specify a particular date or tag to CVS commands, they
572     normally ignore files that do not contain the tag (or did not
573     exist prior to the date) that you specified.  Use the `-f' option
574     if you want files retrieved even when there is no match for the
575     tag or date.  (The most recent revision of the file will be used).
576
577     Note that even with `-f', a tag that you specify must exist (that
578     is, in some file, not necessary in every file).  This is so that
579     CVS will continue to give an error if you mistype a tag name.
580
581     `-f' is available with these commands: `annotate', `checkout',
582     `export', `rdiff', `rtag', and `update'.
583
584     *Warning:*  The `commit' and `remove' commands also have a `-f'
585     option, but it has a different behavior for those commands.  See
586     *Note commit options::, and *Note Removing files::.
587
588`-k KFLAG'
589     Alter the default processing of keywords.  *Note Keyword
590     substitution::, for the meaning of KFLAG.  Your KFLAG
591     specification is "sticky" when you use it to create a private copy
592     of a source file; that is, when you use this option with the
593     `checkout' or `update' commands, CVS associates your selected
594     KFLAG with the file, and continues to use it with future update
595     commands on the same file until you specify otherwise.
596
597     The `-k' option is available with the `add', `checkout', `diff',
598     `import' and `update' commands.
599
600`-l'
601     Local; run only in current working directory, rather than
602     recursing through subdirectories.
603
604     *Warning:* this is not the same as the overall `cvs -l' option,
605     which you can specify to the left of a cvs command!
606
607     Available with the following commands: `annotate', `checkout',
608     `commit', `diff', `edit', `editors', `export', `log', `rdiff',
609     `remove', `rtag', `status', `tag', `unedit', `update', `watch',
610     and `watchers'.
611
612`-m MESSAGE'
613     Use MESSAGE as log information, instead of invoking an editor.
614
615     Available with the following commands: `add', `commit' and
616     `import'.
617
618`-n'
619     Do not run any checkout/commit/tag program.  (A program can be
620     specified to run on each of these activities, in the modules
621     database (*note modules::); this option bypasses it).
622
623     *Warning:* this is not the same as the overall `cvs -n' option,
624     which you can specify to the left of a cvs command!
625
626     Available with the `checkout', `commit', `export', and `rtag'
627     commands.
628
629`-P'
630     Prune empty directories.  See *Note Removing directories::.
631
632`-p'
633     Pipe the files retrieved from the repository to standard output,
634     rather than writing them in the current directory.  Available with
635     the `checkout' and `update' commands.
636
637`-R'
638     Process directories recursively.  This is on by default.
639
640     Available with the following commands: `annotate', `checkout',
641     `commit', `diff', `edit', `editors', `export', `rdiff', `remove',
642     `rtag', `status', `tag', `unedit', `update', `watch', and
643     `watchers'.
644
645`-r TAG'
646     Use the revision specified by the TAG argument instead of the
647     default "head" revision.  As well as arbitrary tags defined with
648     the `tag' or `rtag' command, two special tags are always
649     available: `HEAD' refers to the most recent version available in
650     the repository, and `BASE' refers to the revision you last checked
651     out into the current working directory.
652
653     The tag specification is sticky when you use this with `checkout'
654     or `update' to make your own copy of a file: CVS remembers the tag
655     and continues to use it on future update commands, until you
656     specify otherwise (for more information on sticky tags/dates,
657     *note Sticky tags::).
658
659     The tag can be either a symbolic or numeric tag, as described in
660     *Note Tags::, or the name of a branch, as described in *Note
661     Branching and merging::.
662
663     Specifying the `-q' global option along with the `-r' command
664     option is often useful, to suppress the warning messages when the
665     RCS file does not contain the specified tag.
666
667     *Warning:* this is not the same as the overall `cvs -r' option,
668     which you can specify to the left of a CVS command!
669
670     `-r' is available with the `checkout', `commit', `diff',
671     `history', `export', `rdiff', `rtag', and `update' commands.
672
673`-W'
674     Specify file names that should be filtered.  You can use this
675     option repeatedly.  The spec can be a file name pattern of the
676     same type that you can specify in the `.cvswrappers' file.
677     Available with the following commands: `import', and `update'.
678
679
680File: cvs.info,  Node: admin,  Next: checkout,  Prev: Common options,  Up: CVS commands
681
682admin--Administration
683=====================
684
685   * Requires: repository, working directory.
686
687   * Changes: repository.
688
689   * Synonym: rcs
690
691   This is the CVS interface to assorted administrative facilities.
692Some of them have questionable usefulness for CVS but exist for
693historical purposes.  Some of the questionable options are likely to
694disappear in the future.  This command _does_ work recursively, so
695extreme care should be used.
696
697   On unix, if there is a group named `cvsadmin', only members of that
698group can run `cvs admin' (except for the `cvs admin -k' command, which
699can be run by anybody).  This group should exist on the server, or any
700system running the non-client/server CVS.  To disallow `cvs admin' for
701all users, create a group with no users in it.  On NT, the `cvsadmin'
702feature does not exist and all users can run `cvs admin'.
703
704* Menu:
705
706* admin options::               admin options
707
708
709File: cvs.info,  Node: admin options,  Up: admin
710
711admin options
712-------------
713
714   Some of these options have questionable usefulness for CVS but exist
715for historical purposes.  Some even make it impossible to use CVS until
716you undo the effect!
717
718`-AOLDFILE'
719     Might not work together with CVS.  Append the access list of
720     OLDFILE to the access list of the RCS file.
721
722`-aLOGINS'
723     Might not work together with CVS.  Append the login names
724     appearing in the comma-separated list LOGINS to the access list of
725     the RCS file.
726
727`-b[REV]'
728     Set the default branch to REV.  In CVS, you normally do not
729     manipulate default branches; sticky tags (*note Sticky tags::) are
730     a better way to decide which branch you want to work on.  There is
731     one reason to run `cvs admin -b': to revert to the vendor's
732     version when using vendor branches (*note Reverting local
733     changes::).  There can be no space between `-b' and its argument.
734
735`-cSTRING'
736     Sets the comment leader to STRING.  The comment leader is not used
737     by current versions of CVS or RCS 5.7.  Therefore, you can almost
738     surely not worry about it.  *Note Keyword substitution::.
739
740`-e[LOGINS]'
741     Might not work together with CVS.  Erase the login names appearing
742     in the comma-separated list LOGINS from the access list of the RCS
743     file.  If LOGINS is omitted, erase the entire access list.  There
744     can be no space between `-e' and its argument.
745
746`-I'
747     Run interactively, even if the standard input is not a terminal.
748     This option does not work with the client/server CVS and is likely
749     to disappear in a future release of CVS.
750
751`-i'
752     Useless with CVS.  This creates and initializes a new RCS file,
753     without depositing a revision.  With CVS, add files with the `cvs
754     add' command (*note Adding files::).
755
756`-kSUBST'
757     Set the default keyword substitution to SUBST.  *Note Keyword
758     substitution::.  Giving an explicit `-k' option to `cvs update',
759     `cvs export', or `cvs checkout' overrides this default.
760
761`-l[REV]'
762     Lock the revision with number REV.  If a branch is given, lock the
763     latest revision on that branch.  If REV is omitted, lock the
764     latest revision on the default branch.  There can be no space
765     between `-l' and its argument.
766
767     This can be used in conjunction with the `rcslock.pl' script in
768     the `contrib' directory of the CVS source distribution to provide
769     reserved checkouts (where only one user can be editing a given
770     file at a time).  See the comments in that file for details (and
771     see the `README' file in that directory for disclaimers about the
772     unsupported nature of contrib).  According to comments in that
773     file, locking must set to strict (which is the default).
774
775`-L'
776     Set locking to strict.  Strict locking means that the owner of an
777     RCS file is not exempt from locking for checkin.  For use with
778     CVS, strict locking must be set; see the discussion under the `-l'
779     option above.
780
781`-mREV:MSG'
782     Replace the log message of revision REV with MSG.
783
784`-NNAME[:[REV]]'
785     Act like `-n', except override any previous assignment of NAME.
786     For use with magic branches, see *Note Magic branch numbers::.
787
788`-nNAME[:[REV]]'
789     Associate the symbolic name NAME with the branch or revision REV.
790     It is normally better to use `cvs tag' or `cvs rtag' instead.
791     Delete the symbolic name if both `:' and REV are omitted;
792     otherwise, print an error message if NAME is already associated
793     with another number.  If REV is symbolic, it is expanded before
794     association.  A REV consisting of a branch number followed by a
795     `.' stands for the current latest revision in the branch.  A `:'
796     with an empty REV stands for the current latest revision on the
797     default branch, normally the trunk.  For example, `cvs admin
798     -nNAME:' associates NAME with the current latest revision of all
799     the RCS files; this contrasts with `cvs admin -nNAME:$' which
800     associates NAME with the revision numbers extracted from keyword
801     strings in the corresponding working files.
802
803`-oRANGE'
804     Deletes ("outdates") the revisions given by RANGE.
805
806     Note that this command can be quite dangerous unless you know
807     _exactly_ what you are doing (for example see the warnings below
808     about how the REV1:REV2 syntax is confusing).
809
810     If you are short on disc this option might help you.  But think
811     twice before using it--there is no way short of restoring the
812     latest backup to undo this command!  If you delete different
813     revisions than you planned, either due to carelessness or (heaven
814     forbid) a CVS bug, there is no opportunity to correct the error
815     before the revisions are deleted.  It probably would be a good
816     idea to experiment on a copy of the repository first.
817
818     Specify RANGE in one of the following ways:
819
820    `REV1::REV2'
821          Collapse all revisions between rev1 and rev2, so that CVS
822          only stores the differences associated with going from rev1
823          to rev2, not intermediate steps.  For example, after `-o
824          1.3::1.5' one can retrieve revision 1.3, revision 1.5, or the
825          differences to get from 1.3 to 1.5, but not the revision 1.4,
826          or the differences between 1.3 and 1.4.  Other examples: `-o
827          1.3::1.4' and `-o 1.3::1.3' have no effect, because there are
828          no intermediate revisions to remove.
829
830    `::REV'
831          Collapse revisions between the beginning of the branch
832          containing REV and REV itself.  The branchpoint and REV are
833          left intact.  For example, `-o ::1.3.2.6' deletes revision
834          1.3.2.1, revision 1.3.2.5, and everything in between, but
835          leaves 1.3 and 1.3.2.6 intact.
836
837    `REV::'
838          Collapse revisions between REV and the end of the branch
839          containing REV.  Revision REV is left intact but the head
840          revision is deleted.
841
842    `REV'
843          Delete the revision REV.  For example, `-o 1.3' is equivalent
844          to `-o 1.2::1.4'.
845
846    `REV1:REV2'
847          Delete the revisions from REV1 to REV2, inclusive, on the
848          same branch.  One will not be able to retrieve REV1 or REV2
849          or any of the revisions in between.  For example, the command
850          `cvs admin -oR_1_01:R_1_02 .' is rarely useful.  It means to
851          delete revisions up to, and including, the tag R_1_02.  But
852          beware!  If there are files that have not changed between
853          R_1_02 and R_1_03 the file will have _the same_ numerical
854          revision number assigned to the tags R_1_02 and R_1_03.  So
855          not only will it be impossible to retrieve R_1_02; R_1_03
856          will also have to be restored from the tapes!  In most cases
857          you want to specify REV1::REV2 instead.
858
859    `:REV'
860          Delete revisions from the beginning of the branch containing
861          REV up to and including REV.
862
863    `REV:'
864          Delete revisions from revision REV, including REV itself, to
865          the end of the branch containing REV.
866
867     None of the revisions to be deleted may have branches or locks.
868
869     If any of the revisions to be deleted have symbolic names, and one
870     specifies one of the `::' syntaxes, then CVS will give an error
871     and not delete any revisions.  If you really want to delete both
872     the symbolic names and the revisions, first delete the symbolic
873     names with `cvs tag -d', then run `cvs admin -o'.  If one
874     specifies the non-`::' syntaxes, then CVS will delete the
875     revisions but leave the symbolic names pointing to nonexistent
876     revisions.  This behavior is preserved for compatibility with
877     previous versions of CVS, but because it isn't very useful, in the
878     future it may change to be like the `::' case.
879
880     Due to the way CVS handles branches REV cannot be specified
881     symbolically if it is a branch.  *Note Magic branch numbers::, for
882     an explanation.
883
884     Make sure that no-one has checked out a copy of the revision you
885     outdate.  Strange things will happen if he starts to edit it and
886     tries to check it back in.  For this reason, this option is not a
887     good way to take back a bogus commit; commit a new revision
888     undoing the bogus change instead (*note Merging two revisions::).
889
890`-q'
891     Run quietly; do not print diagnostics.
892
893`-sSTATE[:REV]'
894     Useful with CVS.  Set the state attribute of the revision REV to
895     STATE.  If REV is a branch number, assume the latest revision on
896     that branch.  If REV is omitted, assume the latest revision on the
897     default branch.  Any identifier is acceptable for STATE.  A useful
898     set of states is `Exp' (for experimental), `Stab' (for stable),
899     and `Rel' (for released).  By default, the state of a new revision
900     is set to `Exp' when it is created.  The state is visible in the
901     output from CVS LOG (*note log::), and in the `$Log: cvs.info-5,v $
902     output from CVS LOG (*note log::), and in the `Revision 1.1.1.17  2001/02/10 19:03:17  tholo
903     output from CVS LOG (*note log::), and in the `Latest from Cyclic Software
904     output from CVS LOG (*note log::), and in the `' and
905     `$State: Exp $' keywords (*note Keyword substitution::).  Note that CVS
906     uses the `dead' state for its own purposes; to take a file to or
907     from the `dead' state use commands like `cvs remove' and `cvs
908     add', not `cvs admin -s'.
909
910`-t[FILE]'
911     Useful with CVS.  Write descriptive text from the contents of the
912     named FILE into the RCS file, deleting the existing text.  The
913     FILE pathname may not begin with `-'.  The descriptive text can be
914     seen in the output from `cvs log' (*note log::).  There can be no
915     space between `-t' and its argument.
916
917     If FILE is omitted, obtain the text from standard input,
918     terminated by end-of-file or by a line containing `.' by itself.
919     Prompt for the text if interaction is possible; see `-I'.
920
921`-t-STRING'
922     Similar to `-tFILE'. Write descriptive text from the STRING into
923     the RCS file, deleting the existing text.  There can be no space
924     between `-t' and its argument.
925
926`-U'
927     Set locking to non-strict.  Non-strict locking means that the
928     owner of a file need not lock a revision for checkin.  For use
929     with CVS, strict locking must be set; see the discussion under the
930     `-l' option above.
931
932`-u[REV]'
933     See the option `-l' above, for a discussion of using this option
934     with CVS.  Unlock the revision with number REV.  If a branch is
935     given, unlock the latest revision on that branch.  If REV is
936     omitted, remove the latest lock held by the caller.  Normally,
937     only the locker of a revision may unlock it.  Somebody else
938     unlocking a revision breaks the lock.  This causes a mail message
939     to be sent to the original locker.  The message contains a
940     commentary solicited from the breaker.  The commentary is
941     terminated by end-of-file or by a line containing `.' by itself.
942     There can be no space between `-u' and its argument.
943
944`-VN'
945     In previous versions of CVS, this option meant to write an RCS
946     file which would be acceptable to RCS version N, but it is now
947     obsolete and specifying it will produce an error.
948
949`-xSUFFIXES'
950     In previous versions of CVS, this was documented as a way of
951     specifying the names of the RCS files.  However, CVS has always
952     required that the RCS files used by CVS end in `,v', so this
953     option has never done anything useful.
954
955
956File: cvs.info,  Node: checkout,  Next: commit,  Prev: admin,  Up: CVS commands
957
958checkout--Check out sources for editing
959=======================================
960
961   * Synopsis: checkout [options] modules...
962
963   * Requires: repository.
964
965   * Changes: working directory.
966
967   * Synonyms: co, get
968
969   Create or update a working directory containing copies of the source
970files specified by MODULES.  You must execute `checkout' before using
971most of the other CVS commands, since most of them operate on your
972working directory.
973
974   The MODULES are either symbolic names for some collection of source
975directories and files, or paths to directories or files in the
976repository.  The symbolic names are defined in the `modules' file.
977*Note modules::.
978
979   Depending on the modules you specify, `checkout' may recursively
980create directories and populate them with the appropriate source files.
981You can then edit these source files at any time (regardless of
982whether other software developers are editing their own copies of the
983sources); update them to include new changes applied by others to the
984source repository; or commit your work as a permanent change to the
985source repository.
986
987   Note that `checkout' is used to create directories.  The top-level
988directory created is always added to the directory where `checkout' is
989invoked, and usually has the same name as the specified module.  In the
990case of a module alias, the created sub-directory may have a different
991name, but you can be sure that it will be a sub-directory, and that
992`checkout' will show the relative path leading to each file as it is
993extracted into your private work area (unless you specify the `-Q'
994global option).
995
996   The files created by `checkout' are created read-write, unless the
997`-r' option to CVS (*note Global options::) is specified, the `CVSREAD'
998environment variable is specified (*note Environment variables::), or a
999watch is in effect for that file (*note Watches::).
1000
1001   Note that running `checkout' on a directory that was already built
1002by a prior `checkout' is also permitted.  This is similar to specifying
1003the `-d' option to the `update' command in the sense that new
1004directories that have been created in the repository will appear in
1005your work area.  However, `checkout' takes a module name whereas
1006`update' takes a directory name.  Also to use `checkout' this way it
1007must be run from the top level directory (where you originally ran
1008`checkout' from), so before you run `checkout' to update an existing
1009directory, don't forget to change your directory to the top level
1010directory.
1011
1012   For the output produced by the `checkout' command see *Note update
1013output::.
1014
1015* Menu:
1016
1017* checkout options::            checkout options
1018* checkout examples::           checkout examples
1019
1020
1021File: cvs.info,  Node: checkout options,  Next: checkout examples,  Up: checkout
1022
1023checkout options
1024----------------
1025
1026   These standard options are supported by `checkout' (*note Common
1027options::, for a complete description of them):
1028
1029`-D DATE'
1030     Use the most recent revision no later than DATE.  This option is
1031     sticky, and implies `-P'.  See *Note Sticky tags::, for more
1032     information on sticky tags/dates.
1033
1034`-f'
1035     Only useful with the `-D DATE' or `-r TAG' flags.  If no matching
1036     revision is found, retrieve the most recent revision (instead of
1037     ignoring the file).
1038
1039`-k KFLAG'
1040     Process keywords according to KFLAG.  See *Note Keyword
1041     substitution::.  This option is sticky; future updates of this
1042     file in this working directory will use the same KFLAG.  The
1043     `status' command can be viewed to see the sticky options.  See
1044     *Note Invoking CVS::, for more information on the `status' command.
1045
1046`-l'
1047     Local; run only in current working directory.
1048
1049`-n'
1050     Do not run any checkout program (as specified with the `-o' option
1051     in the modules file; *note modules::).
1052
1053`-P'
1054     Prune empty directories.  See *Note Moving directories::.
1055
1056`-p'
1057     Pipe files to the standard output.
1058
1059`-R'
1060     Checkout directories recursively.  This option is on by default.
1061
1062`-r TAG'
1063     Use revision TAG.  This option is sticky, and implies `-P'.  See
1064     *Note Sticky tags::, for more information on sticky tags/dates.
1065
1066   In addition to those, you can use these special command options with
1067`checkout':
1068
1069`-A'
1070     Reset any sticky tags, dates, or `-k' options.  See *Note Sticky
1071     tags::, for more information on sticky tags/dates.
1072
1073`-c'
1074     Copy the module file, sorted, to the standard output, instead of
1075     creating or modifying any files or directories in your working
1076     directory.
1077
1078`-d DIR'
1079     Create a directory called DIR for the working files, instead of
1080     using the module name.  In general, using this flag is equivalent
1081     to using `mkdir DIR; cd DIR' followed by the checkout command
1082     without the `-d' flag.
1083
1084     There is an important exception, however.  It is very convenient
1085     when checking out a single item to have the output appear in a
1086     directory that doesn't contain empty intermediate directories.  In
1087     this case _only_, CVS tries to "shorten" pathnames to avoid those
1088     empty directories.
1089
1090     For example, given a module `foo' that contains the file `bar.c',
1091     the command `cvs co -d dir foo' will create directory `dir' and
1092     place `bar.c' inside.  Similarly, given a module `bar' which has
1093     subdirectory `baz' wherein there is a file `quux.c', the command
1094     `cvs -d dir co bar/baz' will create directory `dir' and place
1095     `quux.c' inside.
1096
1097     Using the `-N' flag will defeat this behavior.  Given the same
1098     module definitions above, `cvs co -N -d dir foo' will create
1099     directories `dir/foo' and place `bar.c' inside, while `cvs co -N -d
1100     dir bar/baz' will create directories `dir/bar/baz' and place
1101     `quux.c' inside.
1102
1103`-j TAG'
1104     With two `-j' options, merge changes from the revision specified
1105     with the first `-j' option to the revision specified with the
1106     second `j' option, into the working directory.
1107
1108     With one `-j' option, merge changes from the ancestor revision to
1109     the revision specified with the `-j' option, into the working
1110     directory.  The ancestor revision is the common ancestor of the
1111     revision which the working directory is based on, and the revision
1112     specified in the `-j' option.
1113
1114     In addition, each -j option can contain an optional date
1115     specification which, when used with branches, can limit the chosen
1116     revision to one within a specific date.  An optional date is
1117     specified by adding a colon (:) to the tag:
1118     `-jSYMBOLIC_TAG:DATE_SPECIFIER'.
1119
1120     *Note Branching and merging::.
1121
1122`-N'
1123     Only useful together with `-d DIR'.  With this option, CVS will
1124     not "shorten" module paths in your working directory when you
1125     check out a single module.  See the `-d' flag for examples and a
1126     discussion.
1127
1128`-s'
1129     Like `-c', but include the status of all modules, and sort it by
1130     the status string.  *Note modules::, for info about the `-s'
1131     option that is used inside the modules file to set the module
1132     status.
1133
1134
1135File: cvs.info,  Node: checkout examples,  Prev: checkout options,  Up: checkout
1136
1137checkout examples
1138-----------------
1139
1140   Get a copy of the module `tc':
1141
1142     $ cvs checkout tc
1143
1144   Get a copy of the module `tc' as it looked one day ago:
1145
1146     $ cvs checkout -D yesterday tc
1147
1148
1149File: cvs.info,  Node: commit,  Next: diff,  Prev: checkout,  Up: CVS commands
1150
1151commit--Check files into the repository
1152=======================================
1153
1154   * Synopsis: commit [-lnRf] [-m 'log_message' | -F file] [-r
1155     revision] [files...]
1156
1157   * Requires: working directory, repository.
1158
1159   * Changes: repository.
1160
1161   * Synonym: ci
1162
1163   Use `commit' when you want to incorporate changes from your working
1164source files into the source repository.
1165
1166   If you don't specify particular files to commit, all of the files in
1167your working current directory are examined.  `commit' is careful to
1168change in the repository only those files that you have really changed.
1169By default (or if you explicitly specify the `-R' option), files in
1170subdirectories are also examined and committed if they have changed;
1171you can use the `-l' option to limit `commit' to the current directory
1172only.
1173
1174   `commit' verifies that the selected files are up to date with the
1175current revisions in the source repository; it will notify you, and
1176exit without committing, if any of the specified files must be made
1177current first with `update' (*note update::).  `commit' does not call
1178the `update' command for you, but rather leaves that for you to do when
1179the time is right.
1180
1181   When all is well, an editor is invoked to allow you to enter a log
1182message that will be written to one or more logging programs (*note
1183modules::, and *note loginfo::) and placed in the RCS file inside the
1184repository.  This log message can be retrieved with the `log' command;
1185see *Note log::.  You can specify the log message on the command line
1186with the `-m MESSAGE' option, and thus avoid the editor invocation, or
1187use the `-F FILE' option to specify that the argument file contains the
1188log message.
1189
1190* Menu:
1191
1192* commit options::              commit options
1193* commit examples::             commit examples
1194
1195