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: Invoking CVS, Next: Administrative files, Prev: CVS commands, Up: Top 26 27Quick reference to CVS commands 28******************************* 29 30 This appendix describes how to invoke CVS, with references to where 31each command or feature is described in detail. For other references 32run the `cvs --help' command, or see *Note Index::. 33 34 A CVS command looks like: 35 36 cvs [ GLOBAL_OPTIONS ] COMMAND [ COMMAND_OPTIONS ] [ COMMAND_ARGS ] 37 38 Global options: 39 40`--allow-root=ROOTDIR' 41 Specify legal CVSROOT directory (server only) (not in CVS 1.9 and 42 older). See *Note Password authentication server::. 43 44`-a' 45 Authenticate all communication (client only) (not in CVS 1.9 and 46 older). See *Note Global options::. 47 48`-b' 49 Specify RCS location (CVS 1.9 and older). See *Note Global 50 options::. 51 52`-d ROOT' 53 Specify the CVSROOT. See *Note Repository::. 54 55`-e EDITOR' 56 Edit messages with EDITOR. See *Note Committing your changes::. 57 58`-f' 59 Do not read the `~/.cvsrc' file. See *Note Global options::. 60 61`-H' 62`--help' 63 Print a help message. See *Note Global options::. 64 65`-l' 66 Do not log in `$CVSROOT/CVSROOT/history' file. See *Note Global 67 options::. 68 69`-n' 70 Do not change any files. See *Note Global options::. 71 72`-Q' 73 Be really quiet. See *Note Global options::. 74 75`-q' 76 Be somewhat quiet. See *Note Global options::. 77 78`-r' 79 Make new working files read-only. See *Note Global options::. 80 81`-s VARIABLE=VALUE' 82 Set a user variable. See *Note Variables::. 83 84`-T TEMPDIR' 85 Put temporary files in TEMPDIR. See *Note Global options::. 86 87`-t' 88 Trace CVS execution. See *Note Global options::. 89 90`-v' 91 92`--version' 93 Display version and copyright information for CVS. 94 95`-w' 96 Make new working files read-write. See *Note Global options::. 97 98`-x' 99 Encrypt all communication (client only). See *Note Global 100 options::. 101 102`-z GZIP-LEVEL' 103 Set the compression level (client only). See *Note Global 104 options::. 105 106 Keyword expansion modes (*note Substitution modes::): 107 108 -kkv $Id: cvs.info-7,v 1.3 2001/09/30 19:44:54 tholo Exp $ 109 -kkvl $Id: cvs.info-7,v 1.3 2001/09/30 19:44:54 tholo Exp $ 110 -kk $Id: cvs.info-7,v 1.3 2001/09/30 19:44:54 tholo Exp $ 111 -kv file1,v 1.1 1993/12/09 03:21:13 joe Exp 112 -ko no expansion 113 -kb no expansion, file is binary 114 115 Keywords (*note Keyword list::): 116 117 $Author: tholo $ 118 $Date: 2001/09/30 19:44:54 $ 119 $Header: /home/cvs/src/gnu/usr.bin/cvs/doc/cvs.info-7,v 1.3 2001/09/30 19:44:54 tholo Exp $ 120 $Id: cvs.info-7,v 1.3 2001/09/30 19:44:54 tholo Exp $ 121 $Locker: $ 122 $Name: $ 123 $RCSfile: cvs.info-7,v $ 124 $Revision: 1.3 $ 125 $Source: /home/cvs/src/gnu/usr.bin/cvs/doc/cvs.info-7,v $ 126 $State: Exp $ 127 $Log: cvs.info-7,v $ 128 Revision 1.3 2001/09/30 19:44:54 tholo 129 Revert to distributed version 130 131 Revision 1.1.1.13 2001/09/28 22:48:51 tholo 132 Latest from Cyclic Software 133 134 Revision 1.1 1993/12/09 03:30:17 joe 135 Initial revision 136 137 Commands, command options, and command arguments: 138 139`add [OPTIONS] [FILES...]' 140 Add a new file/directory. See *Note Adding files::. 141 142 `-k KFLAG' 143 Set keyword expansion. 144 145 `-m MSG' 146 Set file description. 147 148`admin [OPTIONS] [FILES...]' 149 Administration of history files in the repository. See *Note 150 admin::. 151 152 `-b[REV]' 153 Set default branch. See *Note Reverting local changes::. 154 155 `-cSTRING' 156 Set comment leader. 157 158 `-kSUBST' 159 Set keyword substitution. See *Note Keyword substitution::. 160 161 `-l[REV]' 162 Lock revision REV, or latest revision. 163 164 `-mREV:MSG' 165 Replace the log message of revision REV with MSG. 166 167 `-oRANGE' 168 Delete revisions from the repository. See *Note admin 169 options::. 170 171 `-q' 172 Run quietly; do not print diagnostics. 173 174 `-sSTATE[:REV]' 175 Set the state. 176 177 `-t' 178 Set file description from standard input. 179 180 `-tFILE' 181 Set file description from FILE. 182 183 `-t-STRING' 184 Set file description to STRING. 185 186 `-u[REV]' 187 Unlock revision REV, or latest revision. 188 189`annotate [OPTIONS] [FILES...]' 190 Show last revision where each line was modified. See *Note 191 annotate::. 192 193 `-D DATE' 194 Annotate the most recent revision no later than DATE. See 195 *Note Common options::. 196 197 `-f' 198 Use head revision if tag/date not found. See *Note Common 199 options::. 200 201 `-l' 202 Local; run only in current working directory. *Note 203 Recursive behavior::. 204 205 `-R' 206 Operate recursively (default). *Note Recursive behavior::. 207 208 `-r TAG' 209 Annotate revision TAG. See *Note Common options::. 210 211`checkout [OPTIONS] MODULES...' 212 Get a copy of the sources. See *Note checkout::. 213 214 `-A' 215 Reset any sticky tags/date/options. See *Note Sticky tags:: 216 and *Note Keyword substitution::. 217 218 `-c' 219 Output the module database. See *Note checkout options::. 220 221 `-D DATE' 222 Check out revisions as of DATE (is sticky). See *Note Common 223 options::. 224 225 `-d DIR' 226 Check out into DIR. See *Note checkout options::. 227 228 `-f' 229 Use head revision if tag/date not found. See *Note Common 230 options::. 231 232 `-j REV' 233 Merge in changes. See *Note checkout options::. 234 235 `-k KFLAG' 236 Use KFLAG keyword expansion. See *Note Substitution modes::. 237 238 `-l' 239 Local; run only in current working directory. *Note 240 Recursive behavior::. 241 242 `-N' 243 Don't "shorten" module paths if -d specified. See *Note 244 checkout options::. 245 246 `-n' 247 Do not run module program (if any). See *Note checkout 248 options::. 249 250 `-P' 251 Prune empty directories. See *Note Moving directories::. 252 253 `-p' 254 Check out files to standard output (avoids stickiness). See 255 *Note checkout options::. 256 257 `-R' 258 Operate recursively (default). *Note Recursive behavior::. 259 260 `-r TAG' 261 Checkout revision TAG (is sticky). See *Note Common 262 options::. 263 264 `-s' 265 Like -c, but include module status. See *Note checkout 266 options::. 267 268`commit [OPTIONS] [FILES...]' 269 Check changes into the repository. See *Note commit::. 270 271 `-F FILE' 272 Read log message from FILE. See *Note commit options::. 273 274 `-f' 275 Force the file to be committed; disables recursion. See 276 *Note commit options::. 277 278 `-l' 279 Local; run only in current working directory. See *Note 280 Recursive behavior::. 281 282 `-m MSG' 283 Use MSG as log message. See *Note commit options::. 284 285 `-n' 286 Do not run module program (if any). See *Note commit 287 options::. 288 289 `-R' 290 Operate recursively (default). *Note Recursive behavior::. 291 292 `-r REV' 293 Commit to REV. See *Note commit options::. 294 295`diff [OPTIONS] [FILES...]' 296 Show differences between revisions. See *Note diff::. In 297 addition to the options shown below, accepts a wide variety of 298 options to control output style, for example `-c' for context 299 diffs. 300 301 `-D DATE1' 302 Diff revision for date against working file. See *Note diff 303 options::. 304 305 `-D DATE2' 306 Diff REV1/DATE1 against DATE2. See *Note diff options::. 307 308 `-l' 309 Local; run only in current working directory. See *Note 310 Recursive behavior::. 311 312 `-N' 313 Include diffs for added and removed files. See *Note diff 314 options::. 315 316 `-R' 317 Operate recursively (default). *Note Recursive behavior::. 318 319 `-r REV1' 320 Diff revision for REV1 against working file. See *Note diff 321 options::. 322 323 `-r REV2' 324 Diff REV1/DATE1 against REV2. See *Note diff options::. 325 326`edit [OPTIONS] [FILES...]' 327 Get ready to edit a watched file. See *Note Editing files::. 328 329 `-a ACTIONS' 330 Specify actions for temporary watch, where ACTIONS is `edit', 331 `unedit', `commit', `all', or `none'. See *Note Editing 332 files::. 333 334 `-l' 335 Local; run only in current working directory. See *Note 336 Recursive behavior::. 337 338 `-R' 339 Operate recursively (default). *Note Recursive behavior::. 340 341`editors [OPTIONS] [FILES...]' 342 See who is editing a watched file. See *Note Watch information::. 343 344 `-l' 345 Local; run only in current working directory. See *Note 346 Recursive behavior::. 347 348 `-R' 349 Operate recursively (default). *Note Recursive behavior::. 350 351`export [OPTIONS] MODULES...' 352 Export files from CVS. See *Note export::. 353 354 `-D DATE' 355 Check out revisions as of DATE. See *Note Common options::. 356 357 `-d DIR' 358 Check out into DIR. See *Note export options::. 359 360 `-f' 361 Use head revision if tag/date not found. See *Note Common 362 options::. 363 364 `-k KFLAG' 365 Use KFLAG keyword expansion. See *Note Substitution modes::. 366 367 `-l' 368 Local; run only in current working directory. *Note 369 Recursive behavior::. 370 371 `-N' 372 Don't "shorten" module paths if -d specified. See *Note 373 export options::. 374 375 `-n' 376 Do not run module program (if any). See *Note export 377 options::. 378 379 `-P' 380 Prune empty directories. See *Note Moving directories::. 381 382 `-R' 383 Operate recursively (default). *Note Recursive behavior::. 384 385 `-r TAG' 386 Checkout revision TAG. See *Note Common options::. 387 388`history [OPTIONS] [FILES...]' 389 Show repository access history. See *Note history::. 390 391 `-a' 392 All users (default is self). See *Note history options::. 393 394 `-b STR' 395 Back to record with STR in module/file/repos field. See 396 *Note history options::. 397 398 `-c' 399 Report on committed (modified) files. See *Note history 400 options::. 401 402 `-D DATE' 403 Since DATE. See *Note history options::. 404 405 `-e' 406 Report on all record types. See *Note history options::. 407 408 `-l' 409 Last modified (committed or modified report). See *Note 410 history options::. 411 412 `-m MODULE' 413 Report on MODULE (repeatable). See *Note history options::. 414 415 `-n MODULE' 416 In MODULE. See *Note history options::. 417 418 `-o' 419 Report on checked out modules. See *Note history options::. 420 421 `-r REV' 422 Since revision REV. See *Note history options::. 423 424 `-T' 425 Produce report on all TAGs. See *Note history options::. 426 427 `-t TAG' 428 Since tag record placed in history file (by anyone). See 429 *Note history options::. 430 431 `-u USER' 432 For user USER (repeatable). See *Note history options::. 433 434 `-w' 435 Working directory must match. See *Note history options::. 436 437 `-x TYPES' 438 Report on TYPES, one or more of `TOEFWUCGMAR'. See *Note 439 history options::. 440 441 `-z ZONE' 442 Output for time zone ZONE. See *Note history options::. 443 444`import [OPTIONS] REPOSITORY VENDOR-TAG RELEASE-TAGS...' 445 Import files into CVS, using vendor branches. See *Note import::. 446 447 `-b BRA' 448 Import to vendor branch BRA. See *Note Multiple vendor 449 branches::. 450 451 `-d' 452 Use the file's modification time as the time of import. See 453 *Note import options::. 454 455 `-k KFLAG' 456 Set default keyword substitution mode. See *Note import 457 options::. 458 459 `-m MSG' 460 Use MSG for log message. See *Note import options::. 461 462 `-I IGN' 463 More files to ignore (! to reset). See *Note import 464 options::. 465 466 `-W SPEC' 467 More wrappers. See *Note import options::. 468 469`init' 470 Create a CVS repository if it doesn't exist. See *Note Creating a 471 repository::. 472 473`log [OPTIONS] [FILES...]' 474 Print out history information for files. See *Note log::. 475 476 `-b' 477 Only list revisions on the default branch. See *Note log 478 options::. 479 480 `-d DATES' 481 Specify dates (D1<D2 for range, D for latest before). See 482 *Note log options::. 483 484 `-h' 485 Only print header. See *Note log options::. 486 487 `-l' 488 Local; run only in current working directory. See *Note 489 Recursive behavior::. 490 491 `-N' 492 Do not list tags. See *Note log options::. 493 494 `-R' 495 Only print name of RCS file. See *Note log options::. 496 497 `-rREVS' 498 Only list revisions REVS. See *Note log options::. 499 500 `-s STATES' 501 Only list revisions with specified states. See *Note log 502 options::. 503 504 `-t' 505 Only print header and descriptive text. See *Note log 506 options::. 507 508 `-wLOGINS' 509 Only list revisions checked in by specified logins. See 510 *Note log options::. 511 512`login' 513 Prompt for password for authenticating server. See *Note Password 514 authentication client::. 515 516`logout' 517 Remove stored password for authenticating server. See *Note 518 Password authentication client::. 519 520`rdiff [OPTIONS] MODULES...' 521 Show differences between releases. See *Note rdiff::. 522 523 `-c' 524 Context diff output format (default). See *Note rdiff 525 options::. 526 527 `-D DATE' 528 Select revisions based on DATE. See *Note Common options::. 529 530 `-f' 531 Use head revision if tag/date not found. See *Note Common 532 options::. 533 534 `-l' 535 Local; run only in current working directory. See *Note 536 Recursive behavior::. 537 538 `-R' 539 Operate recursively (default). *Note Recursive behavior::. 540 541 `-r REV' 542 Select revisions based on REV. See *Note Common options::. 543 544 `-s' 545 Short patch - one liner per file. See *Note rdiff options::. 546 547 `-t' 548 Top two diffs - last change made to the file. See *Note diff 549 options::. 550 551 `-u' 552 Unidiff output format. See *Note rdiff options::. 553 554 `-V VERS' 555 Use RCS Version VERS for keyword expansion (obsolete). See 556 *Note rdiff options::. 557 558`release [OPTIONS] DIRECTORY' 559 Indicate that a directory is no longer in use. See *Note 560 release::. 561 562 `-d' 563 Delete the given directory. See *Note release options::. 564 565`remove [OPTIONS] [FILES...]' 566 Remove an entry from the repository. See *Note Removing files::. 567 568 `-f' 569 Delete the file before removing it. See *Note Removing 570 files::. 571 572 `-l' 573 Local; run only in current working directory. See *Note 574 Recursive behavior::. 575 576 `-R' 577 Operate recursively (default). *Note Recursive behavior::. 578 579`rtag [OPTIONS] TAG MODULES...' 580 Add a symbolic tag to a module. See *Note Revisions:: and *Note 581 Branching and merging::. 582 583 `-a' 584 Clear tag from removed files that would not otherwise be 585 tagged. See *Note Tagging add/remove::. 586 587 `-b' 588 Create a branch named TAG. See *Note Branching and merging::. 589 590 `-D DATE' 591 Tag revisions as of DATE. See *Note Tagging by date/tag::. 592 593 `-d' 594 Delete TAG. See *Note Modifying tags::. 595 596 `-F' 597 Move TAG if it already exists. See *Note Modifying tags::. 598 599 `-f' 600 Force a head revision match if tag/date not found. See *Note 601 Tagging by date/tag::. 602 603 `-l' 604 Local; run only in current working directory. See *Note 605 Recursive behavior::. 606 607 `-n' 608 No execution of tag program. See *Note Common options::. 609 610 `-R' 611 Operate recursively (default). *Note Recursive behavior::. 612 613 `-r REV' 614 Tag existing tag REV. See *Note Tagging by date/tag::. 615 616`status [OPTIONS] FILES...' 617 Display status information in a working directory. See *Note File 618 status::. 619 620 `-l' 621 Local; run only in current working directory. See *Note 622 Recursive behavior::. 623 624 `-R' 625 Operate recursively (default). *Note Recursive behavior::. 626 627 `-v' 628 Include tag information for file. See *Note Tags::. 629 630`tag [OPTIONS] TAG [FILES...]' 631 Add a symbolic tag to checked out version of files. See *Note 632 Revisions:: and *Note Branching and merging::. 633 634 `-b' 635 Create a branch named TAG. See *Note Branching and merging::. 636 637 `-c' 638 Check that working files are unmodified. See *Note Tagging 639 the working directory::. 640 641 `-D DATE' 642 Tag revisions as of DATE. See *Note Tagging by date/tag::. 643 644 `-d' 645 Delete TAG. See *Note Modifying tags::. 646 647 `-F' 648 Move TAG if it already exists. See *Note Modifying tags::. 649 650 `-f' 651 Force a head revision match if tag/date not found. See *Note 652 Tagging by date/tag::. 653 654 `-l' 655 Local; run only in current working directory. See *Note 656 Recursive behavior::. 657 658 `-R' 659 Operate recursively (default). *Note Recursive behavior::. 660 661 `-r REV' 662 Tag existing tag REV. See *Note Tagging by date/tag::. 663 664`unedit [OPTIONS] [FILES...]' 665 Undo an edit command. See *Note Editing files::. 666 667 `-a ACTIONS' 668 Specify actions for temporary watch, where ACTIONS is `edit', 669 `unedit', `commit', `all', or `none'. See *Note Editing 670 files::. 671 672 `-l' 673 Local; run only in current working directory. See *Note 674 Recursive behavior::. 675 676 `-R' 677 Operate recursively (default). *Note Recursive behavior::. 678 679`update [OPTIONS] [FILES...]' 680 Bring work tree in sync with repository. See *Note update::. 681 682 `-A' 683 Reset any sticky tags/date/options. See *Note Sticky tags:: 684 and *Note Keyword substitution::. 685 686 `-C' 687 Overwrite locally modified files with clean copies from the 688 repository (the modified file is saved in `.#FILE.REVISION', 689 however). 690 691 `-D DATE' 692 Check out revisions as of DATE (is sticky). See *Note Common 693 options::. 694 695 `-d' 696 Create directories. See *Note update options::. 697 698 `-f' 699 Use head revision if tag/date not found. See *Note Common 700 options::. 701 702 `-I IGN' 703 More files to ignore (! to reset). See *Note import 704 options::. 705 706 `-j REV' 707 Merge in changes. See *Note update options::. 708 709 `-k KFLAG' 710 Use KFLAG keyword expansion. See *Note Substitution modes::. 711 712 `-l' 713 Local; run only in current working directory. *Note 714 Recursive behavior::. 715 716 `-P' 717 Prune empty directories. See *Note Moving directories::. 718 719 `-p' 720 Check out files to standard output (avoids stickiness). See 721 *Note update options::. 722 723 `-R' 724 Operate recursively (default). *Note Recursive behavior::. 725 726 `-r TAG' 727 Checkout revision TAG (is sticky). See *Note Common 728 options::. 729 730 `-W SPEC' 731 More wrappers. See *Note import options::. 732 733`version' 734 Display the version of CVS being used. If the repository is 735 remote, display both the client and server versions. 736 737`watch [on|off|add|remove] [OPTIONS] [FILES...]' 738 on/off: turn on/off read-only checkouts of files. See *Note 739 Setting a watch::. 740 741 add/remove: add or remove notification on actions. See *Note 742 Getting Notified::. 743 744 `-a ACTIONS' 745 Specify actions for temporary watch, where ACTIONS is `edit', 746 `unedit', `commit', `all', or `none'. See *Note Editing 747 files::. 748 749 `-l' 750 Local; run only in current working directory. See *Note 751 Recursive behavior::. 752 753 `-R' 754 Operate recursively (default). *Note Recursive behavior::. 755 756`watchers [OPTIONS] [FILES...]' 757 See who is watching a file. See *Note Watch information::. 758 759 `-l' 760 Local; run only in current working directory. See *Note 761 Recursive behavior::. 762 763 `-R' 764 Operate recursively (default). *Note Recursive behavior::. 765 766 767File: cvs.info, Node: Administrative files, Next: Environment variables, Prev: Invoking CVS, Up: Top 768 769Reference manual for Administrative files 770***************************************** 771 772 Inside the repository, in the directory `$CVSROOT/CVSROOT', there 773are a number of supportive files for CVS. You can use CVS in a limited 774fashion without any of them, but if they are set up properly they can 775help make life easier. For a discussion of how to edit them, see *Note 776Intro administrative files::. 777 778 The most important of these files is the `modules' file, which 779defines the modules inside the repository. 780 781* Menu: 782 783* modules:: Defining modules 784* Wrappers:: Specify binary-ness based on file name 785* commit files:: The commit support files 786* commitinfo:: Pre-commit checking 787* verifymsg:: How are log messages evaluated? 788* editinfo:: Specifying how log messages are created 789 (obsolete) 790* loginfo:: Where should log messages be sent? 791* rcsinfo:: Templates for the log messages 792* cvsignore:: Ignoring files via cvsignore 793* checkoutlist:: Adding your own administrative files 794* history file:: History information 795* Variables:: Various variables are expanded 796* config:: Miscellaneous CVS configuration 797 798 799File: cvs.info, Node: modules, Next: Wrappers, Up: Administrative files 800 801The modules file 802================ 803 804 The `modules' file records your definitions of names for collections 805of source code. CVS will use these definitions if you use CVS to 806update the modules file (use normal commands like `add', `commit', etc). 807 808 The `modules' file may contain blank lines and comments (lines 809beginning with `#') as well as module definitions. Long lines can be 810continued on the next line by specifying a backslash (`\') as the last 811character on the line. 812 813 There are three basic types of modules: alias modules, regular 814modules, and ampersand modules. The difference between them is the way 815that they map files in the repository to files in the working 816directory. In all of the following examples, the top-level repository 817contains a directory called `first-dir', which contains two files, 818`file1' and `file2', and a directory `sdir'. `first-dir/sdir' contains 819a file `sfile'. 820 821* Menu: 822 823* Alias modules:: The simplest kind of module 824* Regular modules:: 825* Ampersand modules:: 826* Excluding directories:: Excluding directories from a module 827* Module options:: Regular and ampersand modules can take options 828* Module program options:: How the modules ``program options'' programs 829 are run. 830 831 832File: cvs.info, Node: Alias modules, Next: Regular modules, Up: modules 833 834Alias modules 835------------- 836 837 Alias modules are the simplest kind of module: 838 839`MNAME -a ALIASES...' 840 This represents the simplest way of defining a module MNAME. The 841 `-a' flags the definition as a simple alias: CVS will treat any 842 use of MNAME (as a command argument) as if the list of names 843 ALIASES had been specified instead. ALIASES may contain either 844 other module names or paths. When you use paths in aliases, 845 `checkout' creates all intermediate directories in the working 846 directory, just as if the path had been specified explicitly in 847 the CVS arguments. 848 849 For example, if the modules file contains: 850 851 amodule -a first-dir 852 853then the following two commands are equivalent: 854 855 $ cvs co amodule 856 $ cvs co first-dir 857 858and they each would provide output such as: 859 860 cvs checkout: Updating first-dir 861 U first-dir/file1 862 U first-dir/file2 863 cvs checkout: Updating first-dir/sdir 864 U first-dir/sdir/sfile 865 866 867File: cvs.info, Node: Regular modules, Next: Ampersand modules, Prev: Alias modules, Up: modules 868 869Regular modules 870--------------- 871 872`MNAME [ options ] DIR [ FILES... ]' 873 In the simplest case, this form of module definition reduces to 874 `MNAME DIR'. This defines all the files in directory DIR as 875 module mname. DIR is a relative path (from `$CVSROOT') to a 876 directory of source in the source repository. In this case, on 877 checkout, a single directory called MNAME is created as a working 878 directory; no intermediate directory levels are used by default, 879 even if DIR was a path involving several directory levels. 880 881 For example, if a module is defined by: 882 883 regmodule first-dir 884 885then regmodule will contain the files from first-dir: 886 887 $ cvs co regmodule 888 cvs checkout: Updating regmodule 889 U regmodule/file1 890 U regmodule/file2 891 cvs checkout: Updating regmodule/sdir 892 U regmodule/sdir/sfile 893 $ 894 895 By explicitly specifying files in the module definition after DIR, 896you can select particular files from directory DIR. Here is an example: 897 898 regfiles first-dir/sdir sfile 899 900With this definition, getting the regfiles module will create a single 901working directory `regfiles' containing the file listed, which comes 902from a directory deeper in the CVS source repository: 903 904 $ cvs co regfiles 905 U regfiles/sfile 906 $ 907 908 909File: cvs.info, Node: Ampersand modules, Next: Excluding directories, Prev: Regular modules, Up: modules 910 911Ampersand modules 912----------------- 913 914 A module definition can refer to other modules by including 915`&MODULE' in its definition. 916 MNAME [ options ] &MODULE... 917 918 Then getting the module creates a subdirectory for each such module, 919in the directory containing the module. For example, if modules 920contains 921 922 ampermod &first-dir 923 924 then a checkout will create an `ampermod' directory which contains a 925directory called `first-dir', which in turns contains all the 926directories and files which live there. For example, the command 927 928 $ cvs co ampermod 929 930will create the following files: 931 932 ampermod/first-dir/file1 933 ampermod/first-dir/file2 934 ampermod/first-dir/sdir/sfile 935 936 There is one quirk/bug: the messages that CVS prints omit the 937`ampermod', and thus do not correctly display the location to which it 938is checking out the files: 939 940 $ cvs co ampermod 941 cvs checkout: Updating first-dir 942 U first-dir/file1 943 U first-dir/file2 944 cvs checkout: Updating first-dir/sdir 945 U first-dir/sdir/sfile 946 $ 947 948 Do not rely on this buggy behavior; it may get fixed in a future 949release of CVS. 950 951 952File: cvs.info, Node: Excluding directories, Next: Module options, Prev: Ampersand modules, Up: modules 953 954Excluding directories 955--------------------- 956 957 An alias module may exclude particular directories from other 958modules by using an exclamation mark (`!') before the name of each 959directory to be excluded. 960 961 For example, if the modules file contains: 962 963 exmodule -a !first-dir/sdir first-dir 964 965 then checking out the module `exmodule' will check out everything in 966`first-dir' except any files in the subdirectory `first-dir/sdir'. 967 968 969File: cvs.info, Node: Module options, Next: Module program options, Prev: Excluding directories, Up: modules 970 971Module options 972-------------- 973 974 Either regular modules or ampersand modules can contain options, 975which supply additional information concerning the module. 976 977`-d NAME' 978 Name the working directory something other than the module name. 979 980`-e PROG' 981 Specify a program PROG to run whenever files in a module are 982 exported. PROG runs with a single argument, the module name. 983 984`-i PROG' 985 Specify a program PROG to run whenever files in a module are 986 committed. PROG runs with a single argument, the full pathname of 987 the affected directory in a source repository. The `commitinfo', 988 `loginfo', and `verifymsg' files provide other ways to call a 989 program on commit. 990 991`-o PROG' 992 Specify a program PROG to run whenever files in a module are 993 checked out. PROG runs with a single argument, the module name. 994 995`-s STATUS' 996 Assign a status to the module. When the module file is printed 997 with `cvs checkout -s' the modules are sorted according to 998 primarily module status, and secondarily according to the module 999 name. This option has no other meaning. You can use this option 1000 for several things besides status: for instance, list the person 1001 that is responsible for this module. 1002 1003`-t PROG' 1004 Specify a program PROG to run whenever files in a module are 1005 tagged with `rtag'. PROG runs with two arguments: the module name 1006 and the symbolic tag specified to `rtag'. It is not run when 1007 `tag' is executed. Generally you will find that taginfo is a 1008 better solution (*note user-defined logging::). 1009 1010`-u PROG' 1011 Specify a program PROG to run whenever `cvs update' is executed 1012 from the top-level directory of the checked-out module. PROG runs 1013 with a single argument, the full path to the source repository for 1014 this module. 1015 1016 You should also see *note Module program options:: about how the 1017"program options" programs are run. 1018 1019 1020File: cvs.info, Node: Module program options, Prev: Module options, Up: modules 1021 1022How the modules file "program options" programs are run 1023------------------------------------------------------- 1024 1025For checkout, rtag, and export, the program is server-based, and as 1026such the following applies:- 1027 1028 If using remote access methods (pserver, ext, etc.), CVS will 1029execute this program on the server from a temporary directory. The path 1030is searched for this program. 1031 1032 If using "local access" (on a local or remote NFS filesystem, i.e. 1033repository set just to a path), the program will be executed from the 1034newly checked-out tree, if found there, or alternatively searched for 1035in the path if not. 1036 1037The commit and update programs are locally-based, and are run as 1038follows:- 1039 1040 The program is always run locally. One must re-checkout the tree one 1041is using if these options are updated in the modules administrative 1042file. The file CVS/Checkin.prog contains the value of the option `-i' 1043set in the modules file, and similarly for the file CVS/Update.prog and 1044`-u'. The program is always executed from the top level of the 1045checked-out copy on the client. Again, the program is first searched 1046for in the checked-out copy and then using the path. 1047 1048 The programs are all run after the operation has effectively 1049completed. 1050 1051 1052File: cvs.info, Node: Wrappers, Next: commit files, Prev: modules, Up: Administrative files 1053 1054The cvswrappers file 1055==================== 1056 1057 Wrappers refers to a CVS feature which lets you control certain 1058settings based on the name of the file which is being operated on. The 1059settings are `-k' for binary files, and `-m' for nonmergeable text 1060files. 1061 1062 The `-m' option specifies the merge methodology that should be used 1063when a non-binary file is updated. `MERGE' means the usual CVS 1064behavior: try to merge the files. `COPY' means that `cvs update' will 1065refuse to merge files, as it also does for files specified as binary 1066with `-kb' (but if the file is specified as binary, there is no need to 1067specify `-m 'COPY''). CVS will provide the user with the two versions 1068of the files, and require the user using mechanisms outside CVS, to 1069insert any necessary changes. *WARNING*: do not use `COPY' with CVS 10701.9 or earlier-such versions of CVS will copy one version of your file 1071over the other, wiping out the previous contents. The `-m' wrapper 1072option only affects behavior when merging is done on update; it does 1073not affect how files are stored. See *Note Binary files::, for more on 1074binary files. 1075 1076 The basic format of the file `cvswrappers' is: 1077 1078 wildcard [option value][option value]... 1079 1080 where option is one of 1081 -m update methodology value: MERGE or COPY 1082 -k keyword expansion value: expansion mode 1083 1084 and value is a single-quote delimited value. 1085 1086 For example, the following command imports a directory, treating 1087files whose name ends in `.exe' as binary: 1088 1089 cvs import -I ! -W "*.exe -k 'b'" first-dir vendortag reltag 1090 1091 1092File: cvs.info, Node: commit files, Next: commitinfo, Prev: Wrappers, Up: Administrative files 1093 1094The commit support files 1095======================== 1096 1097 The `-i' flag in the `modules' file can be used to run a certain 1098program whenever files are committed (*note modules::). The files 1099described in this section provide other, more flexible, ways to run 1100programs whenever something is committed. 1101 1102 There are three kind of programs that can be run on commit. They 1103are specified in files in the repository, as described below. The 1104following table summarizes the file names and the purpose of the 1105corresponding programs. 1106 1107`commitinfo' 1108 The program is responsible for checking that the commit is 1109 allowed. If it exits with a non-zero exit status the commit will 1110 be aborted. 1111 1112`verifymsg' 1113 The specified program is used to evaluate the log message, and 1114 possibly verify that it contains all required fields. This is 1115 most useful in combination with the `rcsinfo' file, which can hold 1116 a log message template (*note rcsinfo::). 1117 1118`editinfo' 1119 The specified program is used to edit the log message, and 1120 possibly verify that it contains all required fields. This is 1121 most useful in combination with the `rcsinfo' file, which can hold 1122 a log message template (*note rcsinfo::). (obsolete) 1123 1124`loginfo' 1125 The specified program is called when the commit is complete. It 1126 receives the log message and some additional information and can 1127 store the log message in a file, or mail it to appropriate 1128 persons, or maybe post it to a local newsgroup, or... Your 1129 imagination is the limit! 1130 1131* Menu: 1132 1133* syntax:: The common syntax 1134 1135 1136File: cvs.info, Node: syntax, Up: commit files 1137 1138The common syntax 1139----------------- 1140 1141 The administrative files such as `commitinfo', `loginfo', `rcsinfo', 1142`verifymsg', etc., all have a common format. The purpose of the files 1143are described later on. The common syntax is described here. 1144 1145 Each line contains the following: 1146 * A regular expression. This is a basic regular expression in the 1147 syntax used by GNU emacs. 1148 1149 * A whitespace separator--one or more spaces and/or tabs. 1150 1151 * A file name or command-line template. 1152 1153Blank lines are ignored. Lines that start with the character `#' are 1154treated as comments. Long lines unfortunately can _not_ be broken in 1155two parts in any way. 1156 1157 The first regular expression that matches the current directory name 1158in the repository is used. The rest of the line is used as a file name 1159or command-line as appropriate. 1160 1161 1162File: cvs.info, Node: commitinfo, Next: verifymsg, Prev: commit files, Up: Administrative files 1163 1164Commitinfo 1165========== 1166 1167 The `commitinfo' file defines programs to execute whenever `cvs 1168commit' is about to execute. These programs are used for pre-commit 1169checking to verify that the modified, added and removed files are really 1170ready to be committed. This could be used, for instance, to verify 1171that the changed files conform to to your site's standards for coding 1172practice. 1173 1174 As mentioned earlier, each line in the `commitinfo' file consists of 1175a regular expression and a command-line template. The template can 1176include a program name and any number of arguments you wish to supply 1177to it. The full path to the current source repository is appended to 1178the template, followed by the file names of any files involved in the 1179commit (added, removed, and modified files). 1180 1181 The first line with a regular expression matching the directory 1182within the repository will be used. If the command returns a non-zero 1183exit status the commit will be aborted. 1184 1185 If the repository name does not match any of the regular expressions 1186in this file, the `DEFAULT' line is used, if it is specified. 1187 1188 All occurrences of the name `ALL' appearing as a regular expression 1189are used in addition to the first matching regular expression or the 1190name `DEFAULT'. 1191 1192 Note: when CVS is accessing a remote repository, `commitinfo' will 1193be run on the _remote_ (i.e., server) side, not the client side (*note 1194Remote repositories::). 1195 1196 1197File: cvs.info, Node: verifymsg, Next: editinfo, Prev: commitinfo, Up: Administrative files 1198 1199Verifying log messages 1200====================== 1201 1202 Once you have entered a log message, you can evaluate that message 1203to check for specific content, such as a bug ID. Use the `verifymsg' 1204file to specify a program that is used to verify the log message. This 1205program could be a simple script that checks that the entered message 1206contains the required fields. 1207 1208 The `verifymsg' file is often most useful together with the 1209`rcsinfo' file, which can be used to specify a log message template. 1210 1211 Each line in the `verifymsg' file consists of a regular expression 1212and a command-line template. The template must include a program name, 1213and can include any number of arguments. The full path to the current 1214log message template file is appended to the template. 1215 1216 One thing that should be noted is that the `ALL' keyword is not 1217supported. If more than one matching line is found, the first one is 1218used. This can be useful for specifying a default verification script 1219in a directory, and then overriding it in a subdirectory. 1220 1221 If the repository name does not match any of the regular expressions 1222in this file, the `DEFAULT' line is used, if it is specified. 1223 1224 If the verification script exits with a non-zero exit status, the 1225commit is aborted. 1226 1227 Note that the verification script cannot change the log message; it 1228can merely accept it or reject it. 1229 1230 The following is a little silly example of a `verifymsg' file, 1231together with the corresponding `rcsinfo' file, the log message 1232template and an verification script. We begin with the log message 1233template. We want to always record a bug-id number on the first line 1234of the log message. The rest of log message is free text. The 1235following template is found in the file `/usr/cvssupport/tc.template'. 1236 1237 BugId: 1238 1239 The script `/usr/cvssupport/bugid.verify' is used to evaluate the 1240log message. 1241 1242 #!/bin/sh 1243 # 1244 # bugid.verify filename 1245 # 1246 # Verify that the log message contains a valid bugid 1247 # on the first line. 1248 # 1249 if head -1 < $1 | grep '^BugId:[ ]*[0-9][0-9]*$' > /dev/null; then 1250 exit 0 1251 else 1252 echo "No BugId found." 1253 exit 1 1254 fi 1255 1256 The `verifymsg' file contains this line: 1257 1258 ^tc /usr/cvssupport/bugid.verify 1259 1260 The `rcsinfo' file contains this line: 1261 1262 ^tc /usr/cvssupport/tc.template 1263 1264 1265File: cvs.info, Node: editinfo, Next: loginfo, Prev: verifymsg, Up: Administrative files 1266 1267Editinfo 1268======== 1269 1270 _NOTE:_ The `editinfo' feature has been rendered obsolete. To set a 1271default editor for log messages use the `EDITOR' environment variable 1272(*note Environment variables::) or the `-e' global option (*note Global 1273options::). See *Note verifymsg::, for information on the use of the 1274`verifymsg' feature for evaluating log messages. 1275 1276 If you want to make sure that all log messages look the same way, 1277you can use the `editinfo' file to specify a program that is used to 1278edit the log message. This program could be a custom-made editor that 1279always enforces a certain style of the log message, or maybe a simple 1280shell script that calls an editor, and checks that the entered message 1281contains the required fields. 1282 1283 If no matching line is found in the `editinfo' file, the editor 1284specified in the environment variable `$CVSEDITOR' is used instead. If 1285that variable is not set, then the environment variable `$EDITOR' is 1286used instead. If that variable is not set a default will be used. See 1287*Note Committing your changes::. 1288 1289 The `editinfo' file is often most useful together with the `rcsinfo' 1290file, which can be used to specify a log message template. 1291 1292 Each line in the `editinfo' file consists of a regular expression 1293and a command-line template. The template must include a program name, 1294and can include any number of arguments. The full path to the current 1295log message template file is appended to the template. 1296 1297 One thing that should be noted is that the `ALL' keyword is not 1298supported. If more than one matching line is found, the first one is 1299used. This can be useful for specifying a default edit script in a 1300module, and then overriding it in a subdirectory. 1301 1302 If the repository name does not match any of the regular expressions 1303in this file, the `DEFAULT' line is used, if it is specified. 1304 1305 If the edit script exits with a non-zero exit status, the commit is 1306aborted. 1307 1308 Note: when CVS is accessing a remote repository, or when the `-m' or 1309`-F' options to `cvs commit' are used, `editinfo' will not be consulted. 1310There is no good workaround for this; use `verifymsg' instead. 1311 1312* Menu: 1313 1314* editinfo example:: Editinfo example 1315 1316 1317File: cvs.info, Node: editinfo example, Up: editinfo 1318 1319Editinfo example 1320---------------- 1321 1322 The following is a little silly example of a `editinfo' file, 1323together with the corresponding `rcsinfo' file, the log message 1324template and an editor script. We begin with the log message template. 1325We want to always record a bug-id number on the first line of the log 1326message. The rest of log message is free text. The following template 1327is found in the file `/usr/cvssupport/tc.template'. 1328 1329 BugId: 1330 1331 The script `/usr/cvssupport/bugid.edit' is used to edit the log 1332message. 1333 1334 #!/bin/sh 1335 # 1336 # bugid.edit filename 1337 # 1338 # Call $EDITOR on FILENAME, and verify that the 1339 # resulting file contains a valid bugid on the first 1340 # line. 1341 if [ "x$EDITOR" = "x" ]; then EDITOR=vi; fi 1342 if [ "x$CVSEDITOR" = "x" ]; then CVSEDITOR=$EDITOR; fi 1343 $CVSEDITOR $1 1344 until head -1|grep '^BugId:[ ]*[0-9][0-9]*$' < $1 1345 do echo -n "No BugId found. Edit again? ([y]/n)" 1346 read ans 1347 case ${ans} in 1348 n*) exit 1;; 1349 esac 1350 $CVSEDITOR $1 1351 done 1352 1353 The `editinfo' file contains this line: 1354 1355 ^tc /usr/cvssupport/bugid.edit 1356 1357 The `rcsinfo' file contains this line: 1358 1359 ^tc /usr/cvssupport/tc.template 1360 1361 1362File: cvs.info, Node: loginfo, Next: rcsinfo, Prev: editinfo, Up: Administrative files 1363 1364Loginfo 1365======= 1366 1367 The `loginfo' file is used to control where `cvs commit' log 1368information is sent. The first entry on a line is a regular expression 1369which is tested against the directory that the change is being made to, 1370relative to the `$CVSROOT'. If a match is found, then the remainder of 1371the line is a filter program that should expect log information on its 1372standard input. 1373 1374 If the repository name does not match any of the regular expressions 1375in this file, the `DEFAULT' line is used, if it is specified. 1376 1377 All occurrences of the name `ALL' appearing as a regular expression 1378are used in addition to the first matching regular expression or 1379`DEFAULT'. 1380 1381 The first matching regular expression is used. 1382 1383 *Note commit files::, for a description of the syntax of the 1384`loginfo' file. 1385 1386 The user may specify a format string as part of the filter. The 1387string is composed of a `%' followed by a space, or followed by a single 1388format character, or followed by a set of format characters surrounded 1389by `{' and `}' as separators. The format characters are: 1390 1391s 1392 file name 1393 1394V 1395 old version number (pre-checkin) 1396 1397v 1398 new version number (post-checkin) 1399 1400 All other characters that appear in a format string expand to an 1401empty field (commas separating fields are still provided). 1402 1403 For example, some valid format strings are `%', `%s', `%{s}', and 1404`%{sVv}'. 1405 1406 The output will be a string of tokens separated by spaces. For 1407backwards compatibility, the first token will be the repository 1408subdirectory. The rest of the tokens will be comma-delimited lists of 1409the information requested in the format string. For example, if 1410`/u/src/master/yoyodyne/tc' is the repository, `%{sVv}' is the format 1411string, and three files (ChangeLog, Makefile, foo.c) were modified, the 1412output might be: 1413 1414 yoyodyne/tc ChangeLog,1.1,1.2 Makefile,1.3,1.4 foo.c,1.12,1.13 1415 1416 As another example, `%{}' means that only the name of the repository 1417will be generated. 1418 1419 Note: when CVS is accessing a remote repository, `loginfo' will be 1420run on the _remote_ (i.e., server) side, not the client side (*note 1421Remote repositories::). 1422 1423* Menu: 1424 1425* loginfo example:: Loginfo example 1426* Keeping a checked out copy:: Updating a tree on every checkin 1427 1428 1429File: cvs.info, Node: loginfo example, Next: Keeping a checked out copy, Up: loginfo 1430 1431Loginfo example 1432--------------- 1433 1434 The following `loginfo' file, together with the tiny shell-script 1435below, appends all log messages to the file 1436`$CVSROOT/CVSROOT/commitlog', and any commits to the administrative 1437files (inside the `CVSROOT' directory) are also logged in 1438`/usr/adm/cvsroot-log'. Commits to the `prog1' directory are mailed to 1439ceder. 1440 1441 ALL /usr/local/bin/cvs-log $CVSROOT/CVSROOT/commitlog $USER 1442 ^CVSROOT /usr/local/bin/cvs-log /usr/adm/cvsroot-log 1443 ^prog1 Mail -s %s ceder 1444 1445 The shell-script `/usr/local/bin/cvs-log' looks like this: 1446 1447 #!/bin/sh 1448 (echo "------------------------------------------------------"; 1449 echo -n $2" "; 1450 date; 1451 echo; 1452 cat) >> $1 1453 1454 1455File: cvs.info, Node: Keeping a checked out copy, Prev: loginfo example, Up: loginfo 1456 1457Keeping a checked out copy 1458-------------------------- 1459 1460 It is often useful to maintain a directory tree which contains files 1461which correspond to the latest version in the repository. For example, 1462other developers might want to refer to the latest sources without 1463having to check them out, or you might be maintaining a web site with 1464CVS and want every checkin to cause the files used by the web server to 1465be updated. 1466 1467 The way to do this is by having loginfo invoke `cvs update'. Doing 1468so in the naive way will cause a problem with locks, so the `cvs update' 1469must be run in the background. Here is an example for unix (this 1470should all be on one line): 1471 1472 ^cyclic-pages (date; cat; (sleep 2; cd /u/www/local-docs; 1473 cvs -q update -d) &) >> $CVSROOT/CVSROOT/updatelog 2>&1 1474 1475 This will cause checkins to repository directories starting with 1476`cyclic-pages' to update the checked out tree in `/u/www/local-docs'. 1477 1478 1479File: cvs.info, Node: rcsinfo, Next: cvsignore, Prev: loginfo, Up: Administrative files 1480 1481Rcsinfo 1482======= 1483 1484 The `rcsinfo' file can be used to specify a form to edit when 1485filling out the commit log. The `rcsinfo' file has a syntax similar to 1486the `verifymsg', `commitinfo' and `loginfo' files. *Note syntax::. 1487Unlike the other files the second part is _not_ a command-line 1488template. Instead, the part after the regular expression should be a 1489full pathname to a file containing the log message template. 1490 1491 If the repository name does not match any of the regular expressions 1492in this file, the `DEFAULT' line is used, if it is specified. 1493 1494 All occurrences of the name `ALL' appearing as a regular expression 1495are used in addition to the first matching regular expression or 1496`DEFAULT'. 1497 1498 The log message template will be used as a default log message. If 1499you specify a log message with `cvs commit -m MESSAGE' or `cvs commit -f 1500FILE' that log message will override the template. 1501 1502 *Note verifymsg::, for an example `rcsinfo' file. 1503 1504 When CVS is accessing a remote repository, the contents of `rcsinfo' 1505at the time a directory is first checked out will specify a template 1506which does not then change. If you edit `rcsinfo' or its templates, 1507you may need to check out a new working directory. 1508 1509