home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / cvs-1.8.7-bin.lha / info / cvs.info-5 < prev    next >
Encoding:
GNU Info File  |  1996-10-12  |  38.7 KB  |  990 lines

  1. This is Info file cvs.info, produced by Makeinfo-1.64 from the input
  2. file /ade-src/fsf/cvs/doc/cvs.texinfo.
  3.  
  4.    Copyright (C) 1992, 1993 Signum Support AB Copyright (C) 1993, 1994
  5. Free Software Foundation, Inc.
  6.  
  7.    Permission is granted to make and distribute verbatim copies of this
  8. manual provided the copyright notice and this permission notice are
  9. preserved on all copies.
  10.  
  11.    Permission is granted to copy and distribute modified versions of
  12. this manual under the conditions for verbatim copying, provided also
  13. that the section entitled "GNU General Public License" is included
  14. exactly as in the original, and provided that the entire resulting
  15. derived work is distributed under the terms of a permission notice
  16. identical to this one.
  17.  
  18.    Permission is granted to copy and distribute translations of this
  19. manual into another language, under the above conditions for modified
  20. versions, except that the section entitled "GNU General Public License"
  21. and this permission notice may be included in translations approved by
  22. the Free Software Foundation instead of in the original English.
  23.  
  24. 
  25. File: cvs.info,  Node: update options,  Next: update output,  Up: update
  26.  
  27. update options
  28. --------------
  29.  
  30.    These standard options are available with `update' (*note Common
  31. options::., for a complete description of them):
  32.  
  33. `-D date'
  34.      Use the most recent revision no later than DATE.  This option is
  35.      sticky, and implies `-P'.  See *Note Sticky tags::, for more
  36.      information on sticky tags/dates.
  37.  
  38. `-f'
  39.      Only useful with the `-D DATE' or `-r TAG' flags.  If no matching
  40.      revision is found, retrieve the most recent revision (instead of
  41.      ignoring the file).
  42.  
  43. `-k KFLAG'
  44.      Process RCS keywords according to KFLAG.  See co(1).  This option
  45.      is sticky; future updates of this file in this working directory
  46.      will use the same KFLAG.  The `status' command can be viewed to
  47.      see the sticky options.  *Note status::.
  48.  
  49. `-l'
  50.      Local; run only in current working directory.  *Note Recursive
  51.      behavior::.
  52.  
  53. `-P'
  54.      Prune empty directories.
  55.  
  56. `-p'
  57.      Pipe files to the standard output.
  58.  
  59. `-R'
  60.      Operate recursively.  This is on by default.  *Note Recursive
  61.      behavior::.
  62.  
  63. `-r tag'
  64.      Retrieve revision TAG.  This option is sticky, and implies `-P'.
  65.      See *Note Sticky tags::, for more information on sticky tags/dates.
  66.  
  67.    These special options are also available with `update'.
  68.  
  69. `-A'
  70.      Reset any sticky tags, dates, or `-k' options.  See *Note Sticky
  71.      tags::, for more information on sticky tags/dates.
  72.  
  73. `-d'
  74.      Create any directories that exist in the repository if they're
  75.      missing from the working directory.  Normally, `update' acts only
  76.      on directories and files that were already enrolled in your
  77.      working directory.
  78.  
  79.      This is useful for updating directories that were created in the
  80.      repository since the initial checkout; but it has an unfortunate
  81.      side effect.  If you deliberately avoided certain directories in
  82.      the repository when you created your working directory (either
  83.      through use of a module name or by listing explicitly the files
  84.      and directories you wanted on the command line), then updating
  85.      with `-d' will create those directories, which may not be what you
  86.      want.
  87.  
  88. `-I NAME'
  89.      Ignore files whose names match NAME (in your working directory)
  90.      during the update.  You can specify `-I' more than once on the
  91.      command line to specify several files to ignore.  Use `-I !' to
  92.      avoid ignoring any files at all.  *Note cvsignore::, for other
  93.      ways to make CVS ignore some files.
  94.  
  95. `-WSPEC'
  96.      Specify file names that should be filtered during update.  You can
  97.      use this option repeatedly.
  98.  
  99.      SPEC can be a file name pattern of the same type that you can
  100.      specify in the `.cvswrappers' file. *Note Wrappers::.
  101.  
  102. `-jREVISION'
  103.      With two `-j' options, merge changes from the revision specified
  104.      with the first `-j' option to the revision specified with the
  105.      second `j' option, into the working directory.
  106.  
  107.      With one `-j' option, merge changes from the ancestor revision to
  108.      the revision specified with the `-j' option, into the working
  109.      directory.  The ancestor revision is the common ancestor of the
  110.      revision which the working directory is based on, and the revision
  111.      specified in the `-j' option.
  112.  
  113.      In addition, each -j option can contain an optional date
  114.      specification which, when used with branches, can limit the chosen
  115.      revision to one within a specific date.  An optional date is
  116.      specified by adding a colon (:) to the tag:
  117.      `-jSYMBOLIC_TAG:DATE_SPECIFIER'.
  118.  
  119.      *Note Merging::.
  120.  
  121. 
  122. File: cvs.info,  Node: update output,  Next: update examples,  Prev: update options,  Up: update
  123.  
  124. update output
  125. -------------
  126.  
  127.    `update' keeps you informed of its progress by printing a line for
  128. each file, preceded by one character indicating the status of the file:
  129.  
  130. `U FILE'
  131.      The file was brought up to date with respect to the repository.
  132.      This is done for any file that exists in the repository but not in
  133.      your source, and for files that you haven't changed but are not
  134.      the most recent versions available in the repository.
  135.  
  136. `A FILE'
  137.      The file has been added to your private copy of the sources, and
  138.      will be added to the source repository when you run `commit' on
  139.      the file.  This is a reminder to you that the file needs to be
  140.      committed.
  141.  
  142. `R FILE'
  143.      The file has been removed from your private copy of the sources,
  144.      and will be removed from the source repository when you run
  145.      `commit' on the file.  This is a reminder to you that the file
  146.      needs to be committed.
  147.  
  148. `M FILE'
  149.      The file is modified in  your  working  directory.
  150.  
  151.      `M' can indicate one of two states for a file you're working on:
  152.      either there were no modifications to the same file in the
  153.      repository, so that your file remains as you last saw it; or there
  154.      were modifications in the repository as well as in your copy, but
  155.      they were merged successfully, without conflict, in your working
  156.      directory.
  157.  
  158.      CVS will print some messages if it merges your work, and a backup
  159.      copy of your working file (as it looked before you ran `update')
  160.      will be made.  The exact name of that file is printed while
  161.      `update' runs.
  162.  
  163. `C FILE'
  164.      A conflict was detected while trying to merge your changes to FILE
  165.      with changes from the source repository.  FILE (the copy in your
  166.      working directory) is now the output of the rcsmerge(1) command on
  167.      the two revisions; an unmodified copy of your file is also in your
  168.      working directory, with the name `.#FILE.REVISION' where REVISION
  169.      is the RCS revision that your modified file started from.  (Note
  170.      that some systems automatically purge files that begin with `.#'
  171.      if they have not been accessed for a few days.  If you intend to
  172.      keep a copy of your original file, it is a very good idea to rename
  173.      it.)
  174.  
  175. `? FILE'
  176.      FILE is in your working directory, but does not correspond to
  177.      anything in the source repository, and is not in the list of files
  178.      for CVS to ignore (see the description of the `-I' option, and
  179.      *note cvsignore::.).
  180.  
  181.      Note that no warning message like this is printed for spurious
  182.      directories that CVS encounters.  The directory, and all its
  183.      contents, are silently ignored.
  184.  
  185. 
  186. File: cvs.info,  Node: update examples,  Prev: update output,  Up: update
  187.  
  188. update examples
  189. ---------------
  190.  
  191.    The following line will display all files which are not up-to-date
  192. without actually change anything in your working directory.  It can be
  193. used to check what has been going on with the project.
  194.  
  195.      $ cvs -n -q update
  196.  
  197. 
  198. File: cvs.info,  Node: Administrative files,  Next: Environment variables,  Prev: Invoking CVS,  Up: Top
  199.  
  200. Reference manual for the Administrative files
  201. *********************************************
  202.  
  203.    Inside the repository, in the directory `$CVSROOT/CVSROOT', there
  204. are a number of supportive files for CVS.  You can use CVS in a limited
  205. fashion without any of them, but if they are set up properly they can
  206. help make life easier.  For a discussion of how to edit them, *Note
  207. Intro administrative files::.
  208.  
  209.    The most important of these files is the `modules' file, which
  210. defines the modules inside the repository.
  211.  
  212. * Menu:
  213.  
  214. * modules::                     Defining modules
  215. * Wrappers::                    Treat directories as files
  216. * commit files::                The commit support files
  217. * commitinfo::                  Pre-commit checking
  218. * editinfo::                    Specifying how log messages are created
  219. * loginfo::                     Where should log messages be sent?
  220. * rcsinfo::                     Templates for the log messages
  221. * cvsignore::                   Ignoring files via cvsignore
  222. * history file::                History information
  223. * Variables::                   Various variables are expanded
  224.  
  225. 
  226. File: cvs.info,  Node: modules,  Next: Wrappers,  Up: Administrative files
  227.  
  228. The modules file
  229. ================
  230.  
  231.    The `modules' file records your definitions of names for collections
  232. of source code.  CVS will use these definitions if you use CVS to
  233. update the modules file (use normal commands like `add', `commit', etc).
  234.  
  235.    The `modules' file may contain blank lines and comments (lines
  236. beginning with `#') as well as module definitions.  Long lines can be
  237. continued on the next line by specifying a backslash (`\') as the last
  238. character on the line.
  239.  
  240.    A module definition is a single line of the `modules' file, in
  241. either of two formats.  In both cases, MNAME represents the symbolic
  242. module name, and the remainder of the line is its definition.
  243.  
  244. `MNAME -a ALIASES...'
  245.      This represents the simplest way of defining a module MNAME.  The
  246.      `-a' flags the definition as a simple alias: CVS will treat any
  247.      use of MNAME (as a command argument) as if the list of names
  248.      ALIASES had been specified instead.  ALIASES may contain either
  249.      other module names or paths.  When you use paths in aliases,
  250.      `checkout' creates all intermediate directories in the working
  251.      directory, just as if the path had been specified explicitly in
  252.      the CVS arguments.
  253.  
  254. `MNAME [ options ] DIR [ FILES... ] [ &MODULE... ]'
  255.      In the simplest case, this form of module definition reduces to
  256.      `MNAME DIR'.  This defines all the files in directory DIR as
  257.      module mname.  DIR is a relative path (from `$CVSROOT') to a
  258.      directory of source in the source repository.  In this case, on
  259.      checkout, a single directory called MNAME is created as a working
  260.      directory; no intermediate directory levels are used by default,
  261.      even if DIR was a path involving several directory levels.
  262.  
  263.      By explicitly specifying files in the module definition after DIR,
  264.      you can select particular files from directory DIR.  The sample
  265.      definition for `modules' is an example of a module defined with a
  266.      single file from a particular directory.  Here is another example:
  267.  
  268.           m4test  unsupported/gnu/m4 foreach.m4 forloop.m4
  269.  
  270.      With this definition, executing `cvs checkout m4test' will create
  271.      a single working directory `m4test' containing the two files
  272.      listed, which both come from a common directory several levels deep
  273.      in the CVS source repository.
  274.  
  275.      A module definition can refer to other modules by including
  276.      `&MODULE' in its definition.  `checkout' creates a subdirectory
  277.      for each such module, in your working directory.
  278.  
  279.     `-d NAME'
  280.           Name the working directory something other than the module
  281.           name.
  282.  
  283.     `-e PROG'
  284.           Specify a program PROG to run whenever files in a module are
  285.           exported.  PROG runs with a single argument, the module name.
  286.  
  287.     `-i PROG'
  288.           Specify a program PROG to run whenever files in a module are
  289.           committed.  PROG runs with a single argument, the full
  290.           pathname of the affected directory in a source repository.
  291.           The `commitinfo', `loginfo', and `editinfo' files provide
  292.           other ways to call a program on commit.
  293.  
  294.     `-o PROG'
  295.           Specify a program PROG to run whenever files in a module are
  296.           checked out.  PROG runs with a single argument, the module
  297.           name.
  298.  
  299.     `-s STATUS'
  300.           Assign a status to the module.  When the module file is
  301.           printed with `cvs checkout -s' the modules are sorted
  302.           according to primarily module status, and secondarily
  303.           according to the module name.  This option has no other
  304.           meaning.  You can use this option for several things besides
  305.           status: for instance, list the person that is responsible for
  306.           this module.
  307.  
  308.     `-t PROG'
  309.           Specify a program PROG to run whenever files in a module are
  310.           tagged with `rtag'.  PROG runs with two arguments: the module
  311.           name and the symbolic tag specified to `rtag'.  There is no
  312.           way to specify a program to run when `tag' is executed.
  313.  
  314.     `-u PROG'
  315.           Specify a program PROG to run whenever `cvs update' is
  316.           executed from the top-level directory of the checked-out
  317.           module.  PROG runs with a single argument, the full path to
  318.           the source repository for this module.
  319.  
  320. 
  321. File: cvs.info,  Node: Wrappers,  Next: commit files,  Prev: modules,  Up: Administrative files
  322.  
  323. The cvswrappers file
  324. ====================
  325.  
  326.    Wrappers allow you to set a hook which transforms files on their way
  327. in and out of CVS.  Most or all of the wrappers features do not work
  328. with client/server CVS.
  329.  
  330.    The file `cvswrappers' defines the script that will be run on a file
  331. when its name matches a regular expresion. There are two scripts that
  332. can be run on a file or directory. One script is executed on the
  333. file/directory before being checked into the repository (this is denoted
  334. with the `-t' flag) and the other when the file is checked out of the
  335. repository (this is denoted with the `-f' flag)
  336.  
  337.    The `cvswrappers' also has a `-m' option to specify the merge
  338. methodology that should be used when the file is updated.  `MERGE'
  339. means the usual CVS behavior: try to merge the files (this generally
  340. will not work for binary files).  `COPY' means that `cvs update' will
  341. merely copy one version over the other, and require the user using
  342. mechanisms outside CVS, to insert any necessary changes.  The `-m'
  343. wrapper option only affects behavior when merging is done on update; it
  344. does not affect how files are stored.  See *Note Binary files::, for
  345. more on binary files.
  346.  
  347.    The basic format of the file `cvswrappers' is:
  348.  
  349.      wildcard     [option value][option value]...
  350.      
  351.      where option is one of
  352.      -f           from cvs filter         value: path to filter
  353.      -t           to cvs filter           value: path to filter
  354.      -m           update methodology      value: MERGE or COPY
  355.      -k           keyword expansion       value: expansion mode
  356.      
  357.      and value is a single-quote delimited value.
  358.  
  359.      *.nib    -f 'unwrap %s' -t 'wrap %s %s' -m 'COPY'
  360.      *.c      -t 'indent %s %s'
  361.  
  362. The above example of a `cvswrappers' file states that all
  363. files/directories that end with a `.nib' should be filtered with the
  364. `wrap' program before checking the file into the repository. The file
  365. should be filtered though the `unwrap' program when the file is checked
  366. out of the repository. The `cvswrappers' file also states that a `COPY'
  367. methodology should be used when updating the files in the repository
  368. (that is no merging should be performed).
  369.  
  370.    The last example line says that all files that end with a `*.c'
  371. should be filtered with `indent' before being checked into the
  372. repository. Unlike the previous example no filtering of the `*.c' file
  373. is done when it is checked out of the repository.
  374.  
  375. The `-t' filter is called with two arguments, the first is the name of
  376. the file/directory to filter and the second is the pathname to where
  377. the resulting filtered file should be placed.
  378.  
  379. The `-f' filter is called with one argument, which is the name of the
  380. file to filter from. The end result of this filter will be a file in
  381. the users directory that they can work on as they normally would.
  382.  
  383.    For another example, the following command imports a directory,
  384. treating files whose name ends in `.exe' as binary:
  385.  
  386.      cvs import -I ! -W "*.exe -k 'b'" first-dir vendortag reltag
  387.  
  388. 
  389. File: cvs.info,  Node: commit files,  Next: commitinfo,  Prev: Wrappers,  Up: Administrative files
  390.  
  391. The commit support files
  392. ========================
  393.  
  394.    The `-i' flag in the `modules' file can be used to run a certain
  395. program whenever files are committed (*note modules::.).  The files
  396. described in this section provide other, more flexible, ways to run
  397. programs whenever something is committed.
  398.  
  399.    There are three kind of programs that can be run on commit.  They
  400. are specified in files in the repository, as described below.  The
  401. following table summarizes the file names and the purpose of the
  402. corresponding programs.
  403.  
  404. `commitinfo'
  405.      The program is responsible for checking that the commit is
  406.      allowed.  If it exits with a non-zero exit status the commit will
  407.      be aborted.
  408.  
  409. `editinfo'
  410.      The specified program is used to edit the log message, and
  411.      possibly verify that it contains all required fields.  This is
  412.      most useful in combination with the `rcsinfo' file, which can hold
  413.      a log message template (*note rcsinfo::.).
  414.  
  415. `loginfo'
  416.      The specified program is called when the commit is complete.  It
  417.      receives the log message and some additional information and can
  418.      store the log message in a file, or mail it to appropriate
  419.      persons, or maybe post it to a local newsgroup, or...  Your
  420.      imagination is the limit!
  421.  
  422. * Menu:
  423.  
  424. * syntax::                      The common syntax
  425.  
  426. 
  427. File: cvs.info,  Node: syntax,  Up: commit files
  428.  
  429. The common syntax
  430. -----------------
  431.  
  432.    The four files `commitinfo', `loginfo', `rcsinfo' and `editinfo' all
  433. have a common format.  The purpose of the files are described later on.
  434. The common syntax is described here.
  435.  
  436.    Each line contains the following:
  437.    * A regular expression
  438.  
  439.    * A whitespace separator--one or more spaces and/or tabs.
  440.  
  441.    * A file name or command-line template.
  442.  
  443. Blank lines are ignored.  Lines that start with the character `#' are
  444. treated as comments.  Long lines unfortunately can *not* be broken in
  445. two parts in any way.
  446.  
  447.    The first regular expression that matches the current directory name
  448. in the repository is used.  The rest of the line is used as a file name
  449. or command-line as appropriate.
  450.  
  451. 
  452. File: cvs.info,  Node: commitinfo,  Next: editinfo,  Prev: commit files,  Up: Administrative files
  453.  
  454. Commitinfo
  455. ==========
  456.  
  457.    The `commitinfo' file defines programs to execute whenever `cvs
  458. commit' is about to execute.  These programs are used for pre-commit
  459. checking to verify that the modified, added and removed files are really
  460. ready to be committed.  This could be used, for instance, to verify
  461. that the changed files conform to to your site's standards for coding
  462. practice.
  463.  
  464.    As mentioned earlier, each line in the `commitinfo' file consists of
  465. a regular expression and a command-line template.  The template can
  466. include a program name and any number of arguments you wish to supply
  467. to it.  The full path to the current source repository is appended to
  468. the template, followed by the file names of any files involved in the
  469. commit (added, removed, and modified files).
  470.  
  471.    The first line with a regular expression matching the relative path
  472. to the module will be used.  If the command returns a non-zero exit
  473. status the commit will be aborted.
  474.  
  475.    If the repository name does not match any of the regular expressions
  476. in this file, the `DEFAULT' line is used, if it is specified.
  477.  
  478.    All occurances of the name `ALL' appearing as a regular expression
  479. are used in addition to the first matching regular expression or the
  480. name `DEFAULT'.
  481.  
  482.    Note: when CVS is accessing a remote repository, `commitinfo' will
  483. be run on the *remote* (i.e., server) side, not the client side (*note
  484. Remote repositories::.).
  485.  
  486. 
  487. File: cvs.info,  Node: editinfo,  Next: loginfo,  Prev: commitinfo,  Up: Administrative files
  488.  
  489. Editinfo
  490. ========
  491.  
  492.    If you want to make sure that all log messages look the same way,
  493. you can use the `editinfo' file to specify a program that is used to
  494. edit the log message.  This program could be a custom-made editor that
  495. always enforces a certain style of the log message, or maybe a simple
  496. shell script that calls an editor, and checks that the entered message
  497. contains the required fields.
  498.  
  499.    If no matching line is found in the `editinfo' file, the editor
  500. specified in the environment variable `$CVSEDITOR' is used instead.  If
  501. that variable is not set, then the environment variable `$EDITOR' is
  502. used instead.  If that variable is not set a precompiled default,
  503. normally `vi', will be used.
  504.  
  505.    The `editinfo' file is often most useful together with the `rcsinfo'
  506. file, which can be used to specify a log message template.
  507.  
  508.    Each line in the `editinfo' file consists of a regular expression
  509. and a command-line template.  The template must include a program name,
  510. and can include any number of arguments.  The full path to the current
  511. log message template file is appended to the template.
  512.  
  513.    One thing that should be noted is that the `ALL' keyword is not
  514. supported.  If more than one matching line is found, the first one is
  515. used.  This can be useful for specifying a default edit script in a
  516. module, and then overriding it in a subdirectory.
  517.  
  518.    If the repository name does not match any of the regular expressions
  519. in this file, the `DEFAULT' line is used, if it is specified.
  520.  
  521.    If the edit script exits with a non-zero exit status, the commit is
  522. aborted.
  523.  
  524.    Note: when CVS is accessing a remote repository, or when the `-m' or
  525. `-F' options to `cvs commit' are used, `editinfo' will not be consulted.
  526. There is no good workaround for this.
  527.  
  528. * Menu:
  529.  
  530. * editinfo example::            Editinfo example
  531.  
  532. 
  533. File: cvs.info,  Node: editinfo example,  Up: editinfo
  534.  
  535. Editinfo example
  536. ----------------
  537.  
  538.    The following is a little silly example of a `editinfo' file,
  539. together with the corresponding `rcsinfo' file, the log message
  540. template and an editor script.  We begin with the log message template.
  541. We want to always record a bug-id number on the first line of the log
  542. message.  The rest of log message is free text.  The following template
  543. is found in the file `/usr/cvssupport/tc.template'.
  544.  
  545.      BugId:
  546.  
  547.    The script `/usr/cvssupport/bugid.edit' is used to edit the log
  548. message.
  549.  
  550.      #!/bin/sh
  551.      #
  552.      #       bugid.edit filename
  553.      #
  554.      #  Call $EDITOR on FILENAME, and verify that the
  555.      #  resulting file contains a valid bugid on the first
  556.      #  line.
  557.      if [ "x$EDITOR" = "x" ]; then EDITOR=vi; fi
  558.      if [ "x$CVSEDITOR" = "x" ]; then CVSEDITOR=$EDITOR; fi
  559.      $CVSEDITOR $1
  560.      until head -1|grep '^BugId:[ ]*[0-9][0-9]*$' < $1
  561.      do  echo -n  "No BugId found.  Edit again? ([y]/n)"
  562.          read ans
  563.          case ${ans} in
  564.              n*) exit 1;;
  565.          esac
  566.          $CVSEDITOR $1
  567.      done
  568.  
  569.    The `editinfo' file contains this line:
  570.  
  571.      ^tc     /usr/cvssupport/bugid.edit
  572.  
  573.    The `rcsinfo' file contains this line:
  574.  
  575.      ^tc     /usr/cvssupport/tc.template
  576.  
  577. 
  578. File: cvs.info,  Node: loginfo,  Next: rcsinfo,  Prev: editinfo,  Up: Administrative files
  579.  
  580. Loginfo
  581. =======
  582.  
  583.    The `loginfo' file is used to control where `cvs commit' log
  584. information is sent.  The first entry on a line is a regular expression
  585. which is tested against the directory that the change is being made to,
  586. relative to the `$CVSROOT'.  If a match is found, then the remainder of
  587. the line is a filter program that should expect log information on its
  588. standard input.
  589.  
  590.    The filter program may use one and only one % modifier (a la
  591. printf).  If `%s' is specified in the filter program, a brief title is
  592. included (enclosed in single quotes) showing the modified file names.
  593.  
  594.    If the repository name does not match any of the regular expressions
  595. in this file, the `DEFAULT' line is used, if it is specified.
  596.  
  597.    All occurances of the name `ALL' appearing as a regular expression
  598. are used in addition to the first matching regular expression or
  599. `DEFAULT'.
  600.  
  601.    The first matching regular expression is used.
  602.  
  603.    *Note commit files::, for a description of the syntax of the
  604. `loginfo' file.
  605.  
  606.    Note: when CVS is accessing a remote repository, `loginfo' will be
  607. run on the *remote* (i.e., server) side, not the client side (*note
  608. Remote repositories::.).
  609.  
  610. * Menu:
  611.  
  612. * loginfo example::             Loginfo example
  613.  
  614. 
  615. File: cvs.info,  Node: loginfo example,  Up: loginfo
  616.  
  617. Loginfo example
  618. ---------------
  619.  
  620.    The following `loginfo' file, together with the tiny shell-script
  621. below, appends all log messages to the file
  622. `$CVSROOT/CVSROOT/commitlog', and any commits to the administrative
  623. files (inside the `CVSROOT' directory) are also logged in
  624. `/usr/adm/cvsroot-log'.
  625.  
  626.      ALL             /usr/local/bin/cvs-log $CVSROOT/CVSROOT/commitlog
  627.      ^CVSROOT        /usr/local/bin/cvs-log /usr/adm/cvsroot-log
  628.  
  629.    The shell-script `/usr/local/bin/cvs-log' looks like this:
  630.  
  631.      #!/bin/sh
  632.      (echo "-----------------------------------------------------------------";
  633.       echo -n $USER"  ";
  634.       date;
  635.       echo;
  636.       sed '1s+'${CVSROOT}'++') >> $1
  637.  
  638. 
  639. File: cvs.info,  Node: rcsinfo,  Next: cvsignore,  Prev: loginfo,  Up: Administrative files
  640.  
  641. Rcsinfo
  642. =======
  643.  
  644.    The `rcsinfo' file can be used to specify a form to edit when
  645. filling out the commit log.  The `rcsinfo' file has a syntax similar to
  646. the `editinfo', `commitinfo' and `loginfo' files.  *Note syntax::.
  647. Unlike the other files the second part is *not* a command-line
  648. template.  Instead, the part after the regular expression should be a
  649. full pathname to a file containing the log message template.
  650.  
  651.    If the repository name does not match any of the regular expressions
  652. in this file, the `DEFAULT' line is used, if it is specified.
  653.  
  654.    All occurances of the name `ALL' appearing as a regular expression
  655. are used in addition to the first matching regular expression or
  656. `DEFAULT'.
  657.  
  658.    The log message template will be used as a default log message.  If
  659. you specify a log message with `cvs commit -m MESSAGE' or `cvs commit -f
  660. FILE' that log message will override the template.
  661.  
  662.    *Note editinfo example::, for an example `rcsinfo' file.
  663.  
  664.    When CVS is accessing a remote repository, the contents of `rcsinfo'
  665. at the time a directory is first checked out will specify a template
  666. which does not then change.  If you edit `rcsinfo' or its templates,
  667. you may need to check out a new working directory.
  668.  
  669. 
  670. File: cvs.info,  Node: cvsignore,  Next: history file,  Prev: rcsinfo,  Up: Administrative files
  671.  
  672. Ignoring files via cvsignore
  673. ============================
  674.  
  675.    There are certain file names that frequently occur inside your
  676. working copy, but that you don't want to put under CVS control.
  677. Examples are all the object files that you get while you compile your
  678. sources.  Normally, when you run `cvs update', it prints a line for
  679. each file it encounters that it doesn't know about (*note update
  680. output::.).
  681.  
  682.    CVS has a list of files (or sh(1) file name patterns) that it should
  683. ignore while running `update', `import' and `release'.  This list is
  684. constructed in the following way.
  685.  
  686.    * The list is initialized to include certain file name patterns:
  687.      names associated with CVS administration, or with other common
  688.      source control systems; common names for patch files, object files,
  689.      archive files, and editor backup files; and other names that are
  690.      usually artifacts of assorted utilities.  Currently, the default
  691.      list of ignored file name patterns is:
  692.  
  693.               RCS     SCCS    CVS     CVS.adm
  694.               RCSLOG  cvslog.*
  695.               tags    TAGS
  696.               .make.state     .nse_depinfo
  697.               *~      #*      .#*     ,*      _$*     *$
  698.               *.old   *.bak   *.BAK   *.orig  *.rej   .del-*
  699.               *.a     *.olb   *.o     *.obj   *.so    *.exe
  700.               *.Z     *.elc   *.ln
  701.               core
  702.  
  703.    * The per-repository list in `$CVSROOT/CVSROOT/cvsignore' is
  704.      appended to the list, if that file exists.
  705.  
  706.    * The per-user list in `.cvsignore' in your home directory is
  707.      appended to the list, if it exists.
  708.  
  709.    * Any entries in the environment variable `$CVSIGNORE' is appended
  710.      to the list.
  711.  
  712.    * Any `-I' options given to CVS is appended.
  713.  
  714.    * As CVS traverses through your directories, the contents of any
  715.      `.cvsignore' will be appended to the list.  The patterns found in
  716.      `.cvsignore' are only valid for the directory that contains them,
  717.      not for any sub-directories.
  718.  
  719.    In any of the 5 places listed above, a single exclamation mark (`!')
  720. clears the ignore list.  This can be used if you want to store any file
  721. which normally is ignored by CVS.
  722.  
  723. 
  724. File: cvs.info,  Node: history file,  Next: Variables,  Prev: cvsignore,  Up: Administrative files
  725.  
  726. The history file
  727. ================
  728.  
  729.    The file `$CVSROOT/CVSROOT/history' is used to log information for
  730. the `history' command (*note history::.).  This file must be created to
  731. turn on logging.  This is done automatically if the `cvs init' command
  732. is used to set up the repository (*note Creating a repository::.).
  733.  
  734.    The file format of the `history' file is documented only in comments
  735. in the CVS source code, but generally programs should use the `cvs
  736. history' command to access it anyway, in case the format changes with
  737. future releases of CVS.
  738.  
  739. 
  740. File: cvs.info,  Node: Variables,  Prev: history file,  Up: Administrative files
  741.  
  742. Expansions in administrative files
  743. ==================================
  744.  
  745.    Sometimes in writing an administrative file, you might want the file
  746. to be able to know various things based on environment CVS is running
  747. in.  There are several mechanisms to do that.
  748.  
  749.    To find the home directory of the user running CVS (from the `HOME'
  750. environment variable), use `~' followed by `/' or the end of the line.
  751. Likewise for the home directory of USER, use `~USER'.  These variables
  752. are expanded on the server machine, and don't get any resonable
  753. expansion if pserver (*note Password authenticated::.) is in used;
  754. therefore user variables (see below) may be a better choice to
  755. customize behavior based on the user running CVS.
  756.  
  757.    One may want to know about various pieces of information internal to
  758. CVS.  A CVS internal variable has the syntax `${VARIABLE}', where
  759. VARIABLE starts with a letter and consists of alphanumberic characters
  760. and `_'.  If the character following VARIABLE is a non-alphanumeric
  761. character other than `_', the `{' and `}' can be omitted.  The CVS
  762. internal variables are:
  763.  
  764. `CVSROOT'
  765.      This is the value of the CVS root in use.  *Note Repository::, for
  766.      a description of the various ways to specify this.
  767.  
  768. `RCSBIN'
  769.      This is the value CVS is using for where to find RCS binaries.
  770.      *Note Global options::, for a description of how to specify this.
  771.  
  772. `CVSEDITOR'
  773. `VISUAL'
  774. `EDITOR'
  775.      These all expand to the same value, which is the editor that CVS
  776.      is using.  *Note Global options::, for how to specify this.
  777.  
  778. `USER'
  779.      Username of the user running CVS (on the CVS server machine).
  780.  
  781.    If you want to pass a value to the administrative files which the
  782. user that is running CVS can specify, use a user variable.  To expand a
  783. user variable, the administrative file contains `${=VARIABLE}'.  To set
  784. a user variable, specify the global option `-s' to CVS, with argument
  785. `VARIABLE=VALUE'.  It may be particularly useful to specify this option
  786. via `.cvsrc' (*note ~/.cvsrc::.).
  787.  
  788.    For example, if you want the administrative file to refer to a test
  789. directory you might create a user variable `TESTDIR'.  Then if CVS is
  790. invoked as `cvs -s TESTDIR=/work/local/tests', and the administrative
  791. file contains `sh ${=TESTDIR}/runtests', then that string is expanded
  792. to `sh /work/local/tests/runtests'.
  793.  
  794.    All other strings containing `$' are reserved; there is no way to
  795. quote a `$' character so that `$' represents itself.
  796.  
  797. 
  798. File: cvs.info,  Node: Environment variables,  Next: Troubleshooting,  Prev: Administrative files,  Up: Top
  799.  
  800. All environment variables which affect CVS
  801. ******************************************
  802.  
  803.    This is a complete list of all environment variables that affect CVS.
  804.  
  805. `$CVSIGNORE'
  806.      A whitespace-separated list of file name patterns that CVS should
  807.      ignore. *Note cvsignore::.
  808.  
  809. `$CVSWRAPPERS'
  810.      A whitespace-separated list of file name patterns that CVS should
  811.      treat as wrappers. *Note Wrappers::.
  812.  
  813. `$CVSREAD'
  814.      If this is set, `checkout' and `update' will try hard to make the
  815.      files in your working directory read-only.  When this is not set,
  816.      the default behavior is to permit modification of your working
  817.      files.
  818.  
  819. `$CVSROOT'
  820.      Should contain the full pathname to the root of the CVS source
  821.      repository (where the RCS history files are kept).  This
  822.      information must be available to CVS for most commands to execute;
  823.      if `$CVSROOT' is not set, or if you wish to override it for one
  824.      invocation, you can supply it on the command line: `cvs -d cvsroot
  825.      cvs_command...' Once you have checked out a working directory, CVS
  826.      stores the appropriate root (in the file `CVS/Root'), so normally
  827.      you only need to worry about this when initially checking out a
  828.      working directory.
  829.  
  830. `$EDITOR'
  831. `$CVSEDITOR'
  832.      Specifies the program to use for recording log messages during
  833.      commit.  If not set, the default is `/usr/ucb/vi'.  `$CVSEDITOR'
  834.      overrides `$EDITOR'.  `$CVSEDITOR' does not exist in CVS 1.3, but
  835.      the next release will probably include it.
  836.  
  837. `$PATH'
  838.      If `$RCSBIN' is not set, and no path is compiled into CVS, it will
  839.      use `$PATH' to try to find all programs it uses.
  840.  
  841. `$RCSBIN'
  842.      Specifies the full pathname of the location of RCS programs, such
  843.      as co(1) and ci(1).  If not set, a compiled-in value is used, or
  844.      your `$PATH' is searched.
  845.  
  846. `$HOME'
  847. `$HOMEPATH'
  848.      Used to locate the directory where the `.cvsrc' file is searched
  849.      (`$HOMEPATH' is used for Windows-NT).  *note ~/.cvsrc::.
  850.  
  851. `$CVS_RSH'
  852.      Used in client-server mode when accessing a remote repository
  853.      using RSH.  The default value is `rsh'.  You can set it to use
  854.      another program for accssing the remote server (e.g. for HP-UX 9,
  855.      you should set it to `remsh' because `rsh' invokes the restricted
  856.      shell).  *note Connecting via rsh::.
  857.  
  858. `$CVS_SERVER'
  859.      Used in client-server mode when accessing a remote repository
  860.      using RSH.  It specifies the name of the program to start on the
  861.      server side when accessing a remote repository using RSH.  The
  862.      default value is `cvs'.  *note Connecting via rsh::.
  863.  
  864. `$CVS_PASSFILE'
  865.      Used in client-server mode when accessing the `cvs login server'.
  866.      Default value is `$HOME/.cvspass'.  *note Password authentication
  867.      client::.
  868.  
  869. `$CVS_PASSWORD'
  870.      Used in client-server mode when accessing the `cvs login server'.
  871.      *note Password authentication client::.
  872.  
  873. `$CVS_CLIENT_PORT'
  874.      Used in client-server mode when accessing the server via Kerberos.
  875.      *note Kerberos authenticated::.
  876.  
  877. `$CVS_RCMD_PORT'
  878.      Used in client-server mode.  If set, specifies the port number to
  879.      be used when accessing the RCMD demon on the server side.
  880.      (Currently not used for Unix clients).
  881.  
  882. `$CVS_CLIENT_LOG'
  883.      Used for debugging only in client-server mode.  If set, everything
  884.      send to the server is logged into ``$CVS_CLIENT_LOG'.in' and
  885.      everything send from the server is logged into
  886.      ``$CVS_CLIENT_LOG'.out'.
  887.  
  888. `$CVS_SERVER_SLEEP'
  889.      Used only for debugging the server side in client-server mode.  If
  890.      set, delays the start of the server child process the the
  891.      specified amount of seconds so that you can attach to it with a
  892.      debugger.
  893.  
  894. `$CVS_IGNORE_REMOTE_ROOT'
  895.      (What is the purpose of this variable?)
  896.  
  897. `$COMSPEC'
  898.      Used under OS/2 only.  It specifies the name of the command
  899.      interpreter and defaults to CMD.EXE.
  900.  
  901. `$TMPDIR'
  902. `$TMP'
  903. `$TEMP'
  904.      Directory in which temporary files are located.  Those parts of
  905.      CVS which are implemented using RCS inspect the above variables in
  906.      the order they appear above and the first value found is taken; if
  907.      none of them are set, a host-dependent default is used, typically
  908.      `/tmp'.  The CVS server checks `TMPDIR', and if not set, it uses
  909.      `/tmp'.  Some parts of CVS will always use `/tmp' (via the
  910.      `tmpnam' function provided by the system).
  911.  
  912.      On Windows NT, `TMP' is used (via the `_tempnam' function provided
  913.      by the system).
  914.  
  915.      The `patch' program which is used by the CVS client uses `TMPDIR',
  916.      and if it is not set, uses `/tmp' (at least with GNU patch 2.1).
  917.  
  918.    CVS invokes RCS to perform certain operations.  The following
  919. environment variables affect RCS.  Note that if you are using the
  920. client/server CVS, these variables need to be set on the server side
  921. (which may or not may be possible depending on how you are connecting).
  922. There is probably not any need to set any of them, however.
  923.  
  924. `$LOGNAME'
  925. `$USER'
  926.      If set, they affect who RCS thinks you are.  If you have trouble
  927.      checking in files it might be because your login name differs from
  928.      the setting of e.g.  `$LOGNAME'.
  929.  
  930. `$RCSINIT'
  931.      Options prepended to the argument list, separated by spaces.  A
  932.      backslash escapes spaces within an option.  The `$RCSINIT' options
  933.      are prepended to the argument lists of most RCS commands.
  934.  
  935. 
  936. File: cvs.info,  Node: Troubleshooting,  Next: Copying,  Prev: Environment variables,  Up: Top
  937.  
  938. Troubleshooting
  939. ***************
  940.  
  941. * Menu:
  942.  
  943. * Magic branch numbers::        Magic branch numbers
  944.  
  945. 
  946. File: cvs.info,  Node: Magic branch numbers,  Up: Troubleshooting
  947.  
  948. Magic branch numbers
  949. ====================
  950.  
  951.    Externally, branch numbers consist of an odd number of dot-separated
  952. decimal integers.  *Note Revision numbers::.  That is not the whole
  953. truth, however.  For efficiency reasons CVS sometimes inserts an extra 0
  954. in the second rightmost position (1.2.3 becomes 1.2.0.3, 8.9.10.11.12
  955. becomes 8.9.10.11.0.12 and so on).
  956.  
  957.    CVS does a pretty good job at hiding these so called magic branches,
  958. but in at least four places the hiding is incomplete.
  959.  
  960.    * The magic branch can appear in the output from `cvs status' in
  961.      vanilla CVS 1.3.  This is fixed in CVS 1.3-s2.
  962.  
  963.    * The magic branch number appears in the output from `cvs log'.
  964.      This is much harder to fix, since `cvs log' runs `rlog' (which is
  965.      part of the RCS distribution), and modifying `rlog' to know about
  966.      magic branches would probably break someone's habits (if they use
  967.      branch 0 for their own purposes).
  968.  
  969.    * You cannot specify a symbolic branch name to `cvs log'.
  970.  
  971.    * You cannot specify a symbolic branch name to `cvs admin'.
  972.  
  973.    You can use the `admin' command to reassign a symbolic name to a
  974. branch the way RCS expects it to be.  If `R4patches' is assigned to the
  975. branch 1.4.2 (magic branch number 1.4.0.2) in file `numbers.c' you can
  976. do this:
  977.  
  978.      $ cvs admin -NR4patches:1.4.2 numbers.c
  979.  
  980.    It only works if at least one revision is already committed on the
  981. branch.  Be very careful so that you do not assign the tag to the wrong
  982. number.  (There is no way to see how the tag was assigned yesterday).
  983.  
  984. 
  985. File: cvs.info,  Node: Copying,  Next: Index,  Prev: Troubleshooting,  Up: Top
  986.  
  987. GNU GENERAL PUBLIC LICENSE
  988. **************************
  989.  
  990.