home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / rcs / ci.man < prev    next >
Text File  |  1992-02-19  |  20KB  |  443 lines

  1. NAME
  2.      ci - check in RCS revisions
  3.  
  4. SYNOPSIS
  5.      ci [options] file ...
  6.  
  7. DESCRIPTION
  8.      ci stores new revisions into RCS files.  Each pathname
  9.      matching an RCS suffix is taken to be an RCS file.  All
  10.      others are assumed to be working files containing new
  11.      revisions.  ci deposits the contents of each working file
  12.      into the corresponding RCS file.  If only a working file is
  13.      given, ci tries to find the corresponding RCS file in an RCS
  14.      subdirectory and then in the working file's directory.  For
  15.      more details, see FILE NAMING below.
  16.  
  17.      For ci to work, the caller's login must be on the access
  18.      list, except if the access list is empty or the caller is
  19.      the superuser or the owner of the file.  To append a new
  20.      revision to an existing branch, the tip revision on that
  21.      branch must be locked by the caller.  Otherwise, only a new
  22.      branch can be created.  This restriction is not enforced for
  23.      the owner of the file if non-strict locking is used (see
  24.      rcs(1)).  A lock held by someone else may be broken with the
  25.      rcs command.
  26.  
  27.      Unless the -f option is given, ci checks whether the
  28.      revision to be deposited differs from the preceding one.  If
  29.      not, instead of creating a new revision ci reverts to the
  30.      preceding one.  To revert, ordinary ci removes the working
  31.      file and any lock; ci -l keeps and ci -u removes any lock,
  32.      and then they both generate a new working file much as if
  33.      co -l or co -u had been applied to the preceding revision.
  34.      When reverting, any -n and -s options apply to the preceding
  35.      revision.
  36.  
  37.      For each revision deposited, ci prompts for a log message.
  38.      The log message should summarize the change and must be
  39.      terminated by end-of-file or by a line containing . by
  40.      itself.  If several files are checked in ci asks whether to
  41.      reuse the previous log message.  If the standard input is
  42.      not a terminal, ci suppresses the prompt and uses the same
  43.      log message for all files.  See also -m.
  44.  
  45.      If the RCS file does not exist, ci creates it and deposits
  46.      the contents of the working file as the initial revision
  47.      (default number: 1.1).  The access list is initialized to
  48.      empty.  Instead of the log message, ci requests descriptive
  49.      text (see -t below).
  50.  
  51.      The number rev of the deposited revision can be given by any
  52.      of the options -f, -I, -k, -l, -M, -q, -r, or -u.  rev may
  53.      be symbolic, numeric, or mixed.  If rev is $, ci determines
  54.      the revision number from keyword values in the working file.
  55.  
  56.      If rev is a revision number, it must be higher than the
  57.      latest one on the branch to which rev belongs, or must start
  58.      a new branch.
  59.  
  60.      If rev is a branch rather than a revision number, the new
  61.      revision is appended to that branch.  The level number is
  62.      obtained by incrementing the tip revision number of that
  63.      branch.  If rev indicates a non-existing branch, that branch
  64.      is created with the initial revision numbered rev.1.
  65.  
  66.      If rev is omitted, ci tries to derive the new revision
  67.      number from the caller's last lock.  If the caller has
  68.      locked the tip revision of a branch, the new revision is
  69.      appended to that branch.  The new revision number is
  70.      obtained by incrementing the tip revision number.  If the
  71.      caller locked a non-tip revision, a new branch is started at
  72.      that revision by incrementing the highest branch number at
  73.      that revision.  The default initial branch and level numbers
  74.      are 1.
  75.  
  76.      If rev is omitted and the caller has no lock, but owns the
  77.      file and locking is not set to strict, then the revision is
  78.      appended to the default branch (normally the trunk; see the
  79.      -b option of rcs(1)).
  80.  
  81.      Exception: On the trunk, revisions can be appended to the
  82.      end, but not inserted.
  83.  
  84. OPTIONS
  85.      -rrev
  86.           Check in revision rev.
  87.  
  88.      -r   The bare -r option (without any revision) has an
  89.           unusual meaning in ci.  With other RCS commands, a bare
  90.           -r option specifies the most recent revision on the
  91.           default branch, but with ci, a bare -r option
  92.           reestablishes the default behavior of releasing a lock
  93.           and removing the working file, and is used to override
  94.           any default -l or -u options established by shell
  95.           aliases or scripts.
  96.  
  97.      -l[rev]
  98.           works like -r, except it performs an additional co -l
  99.           for the deposited revision.  Thus, the deposited
  100.           revision is immediately checked out again and locked.
  101.           This is useful for saving a revision although one wants
  102.           to continue editing it after the checkin.
  103.  
  104.      -u[rev]
  105.           works like -l, except that the deposited revision is
  106.           not locked.  This lets one read the working file
  107.           immediately after checkin.
  108.  
  109.           The -l, bare -r, and -u options are mutually exclusive
  110.           and silently override each other.  For example,
  111.           ci -u -r is equivalent to ci -r because bare -r
  112.           overrides -u.
  113.  
  114.      -f[rev]
  115.           forces a deposit; the new revision is deposited even it
  116.           is not different from the preceding one.
  117.  
  118.      -k[rev]
  119.           searches the working file for keyword values to
  120.           determine its revision number, creation date, state,
  121.           and author (see co(1)), and assigns these values to the
  122.           deposited revision, rather than computing them locally.
  123.           It also generates a default login message noting the
  124.           login of the caller and the actual checkin date.  This
  125.           option is useful for software distribution.  A revision
  126.           that is sent to several sites should be checked in with
  127.           the -k option at these sites to preserve the original
  128.           number, date, author, and state.  The extracted keyword
  129.           values and the default log message may be overridden
  130.           with the options -d, -m, -s, -w, and any option that
  131.           carries a revision number.
  132.  
  133.      -q[rev]
  134.           quiet mode; diagnostic output is not printed.  A
  135.           revision that is not different from the preceding one
  136.           is not deposited, unless -f is given.
  137.  
  138.      -I[rev]
  139.           interactive mode; the user is prompted and questioned
  140.           even if the standard input is not a terminal.
  141.  
  142.      -d[date]
  143.           uses date for the checkin date and time.  The date is
  144.           specified in free format as explained in co(1).  This
  145.           is useful for lying about the checkin date, and for -k
  146.           if no date is available.  If date is empty, the working
  147.           file's time of last modification is used.
  148.  
  149.      -M[rev]
  150.           Set the modification time on any new working file to be
  151.           the date of the retrieved revision.  For example,
  152.           ci -d -M -u f does not alter f's modification time,
  153.           even if f's contents change due to keyword
  154.           substitution.  Use this option with care; it can
  155.           confuse make(1).
  156.  
  157.      -mmsg
  158.           uses the string msg as the log message for all
  159.           revisions checked in.
  160.  
  161.      -nname
  162.           assigns the symbolic name name to the number of the
  163.           checked-in revision.  ci prints an error message if
  164.           name is already assigned to another number.
  165.  
  166.      -Nname
  167.           same as -n, except that it overrides a previous
  168.           assignment of name.
  169.  
  170.      -sstate
  171.           sets the state of the checked-in revision to the
  172.           identifier state.  The default state is Exp.
  173.  
  174.      -tfile
  175.           writes descriptive text from the contents of the named
  176.           file into the RCS file, deleting the existing text.
  177.           The file may not begin with -.
  178.  
  179.      -t-string
  180.           Write descriptive text from the string into the RCS
  181.           file, deleting the existing text.
  182.  
  183.           The -t option, in both its forms, has effect only
  184.           during an initial checkin; it is silently ignored
  185.           otherwise.
  186.  
  187.           During the initial checkin, if -t is not given, ci
  188.           obtains the text from standard input, terminated by
  189.           end-of-file or by a line containing . by itself.  The
  190.           user is prompted for the text if interaction is
  191.           possible; see -I.
  192.  
  193.           For backward compatibility with older versions of RCS,
  194.           a bare -t option is ignored.
  195.  
  196.      -T   Preserve the modification time on the RCS file unless a
  197.           new revision is added.  If you have locked a revision,
  198.           ci usually updates the RCS file's modification time
  199.           even when reverting to the previous revision, because
  200.           the lock is stored in the RCS file and removing the
  201.           lock requires changing the RCS file.  However, ci -T
  202.           preserves the RCS file's modification time if no new
  203.           revision is added, even if the RCS file changes because
  204.           a lock is removed or because the -n or -s options
  205.           affect the previous revision.  This option can suppress
  206.           extensive recompilation caused by a make(1) dependency
  207.           of some other copy of the working file on the RCS file.
  208.           Use this option with care; it can suppress
  209.           recompilation even when it is needed, i.e. when the
  210.           change of lock, symbolic name, or state would mean a
  211.           change to keyword strings in the other working file.
  212.  
  213.      -wlogin
  214.           uses login for the author field of the deposited
  215.           revision.  Useful for lying about the author, and for
  216.           -k if no author is available.
  217.  
  218.      -Vn  Emulate RCS version n.  See co(1) for details.
  219.  
  220.      -xsuffixes
  221.           specifies the suffixes for RCS files.  A nonempty
  222.           suffix matches any pathname ending in the suffix.  An
  223.           empty suffix matches any pathname of the form RCS/path
  224.           or path1/RCS/path2.  The -x option can specify a list
  225.           of suffixes separated by /.  For example, -x,v/
  226.           specifies two suffixes: ,v and the empty suffix.  If
  227.           two or more suffixes are specified, they are tried in
  228.           order when looking for an RCS file; the first one that
  229.           works is used for that file.  If no RCS file is found
  230.           but an RCS file can be created, the suffixes are tried
  231.           in order to determine the new RCS file's name.  The
  232.           default for suffixes is installation-dependent;
  233.           normally it is ,v/ for hosts like Unix that permit
  234.           commas in file names, and is empty (i.e. just the empty
  235.           suffix) for other hosts.
  236.  
  237. FILE NAMING
  238.      Pairs of RCS files and working files may be specified in
  239.      three ways (see also the example section).
  240.  
  241.      1) Both the RCS file and the working file are given.  The
  242.      RCS pathname is of the form path1/workfileX and the working
  243.      pathname is of the form path2/workfile where path1/ and
  244.      path2/ are (possibly different or empty) paths, workfile is
  245.      a filename, and X is an RCS suffix.  If X is empty, path1/
  246.      must start with RCS/ or must contain /RCS/.
  247.  
  248.      2) Only the RCS file is given.  Then the working file is
  249.      created in the current directory and its name is derived
  250.      from the name of the RCS file by removing path1/ and the
  251.      suffix X.
  252.  
  253.      3) Only the working file is given.  Then ci considers each
  254.      RCS suffix X in turn, looking for an RCS file of the form
  255.      path2/RCS/workfileX or (if the former is not found and X is
  256.      nonempty) path2/workfileX.
  257.  
  258.      If the RCS file is specified without a path in 1) and 2), ci
  259.      looks for the RCS file first in the directory ./RCS and then
  260.      in the current directory.
  261.  
  262.      ci reports an error if an attempt to open an RCS file fails
  263.      for an unusual reason, even if the RCS file's pathname is
  264.      just one of several possibilities.  For example, to suppress
  265.      use of RCS commands in a directory d, create a regular file
  266.      named d/RCS so that casual attempts to use RCS commands in d
  267.      fail because d/RCS is not a directory.
  268.  
  269. EXAMPLES
  270.      Suppose ,v is an RCS suffix and the current directory
  271.      contains a subdirectory RCS with an RCS file io.c,v.  Then
  272.      each of the following commands check in a copy of io.c into
  273.      RCS/io.c,v as the latest revision, removing io.c.
  274.  
  275.           ci  io.c;    ci  RCS/io.c,v;   ci  io.c,v;
  276.           ci  io.c  RCS/io.c,v;    ci  io.c  io.c,v;
  277.           ci  RCS/io.c,v  io.c;    ci  io.c,v  io.c;
  278.  
  279.      Suppose instead that the empty suffix is an RCS suffix and
  280.      the current directory contains a subdirectory RCS with an
  281.      RCS file io.c.  The each of the following commands checks in
  282.      a new revision.
  283.  
  284.           ci  io.c;    ci  RCS/io.c;
  285.           ci  io.c  RCS/io.c;
  286.           ci  RCS/io.c  io.c;
  287.  
  288. FILE MODES
  289.      An RCS file created by ci inherits the read and execute
  290.      permissions from the working file.  If the RCS file exists
  291.      already, ci preserves its read and execute permissions.  ci
  292.      always turns off all write permissions of RCS files.
  293.  
  294. FILES
  295.      Several temporary files may be created in the directory
  296.      containing the working file, and also in the temporary
  297.      directory (see TMPDIR under ENVIRONMENT).  A semaphore file
  298.      or files are created in the directory containing the RCS
  299.      file.  With a nonempty suffix, the semaphore names begin
  300.      with the first character of the suffix; therefore, do not
  301.      specify an suffix whose first character could be that of a
  302.      working filename.  With an empty suffix, the semaphore names
  303.      end with _ so working filenames should not end in _.
  304.  
  305.      ci never changes an RCS or working file.  Normally, ci
  306.      unlinks the file and creates a new one; but instead of
  307.      breaking a chain of one or more symbolic links to an RCS
  308.      file, it unlinks the destination file instead.  Therefore,
  309.      ci breaks any hard or symbolic links to any working file it
  310.      changes; and hard links to RCS files are ineffective, but
  311.      symbolic links to RCS files are preserved.
  312.  
  313.      The effective user must be able to search and write the
  314.      directory containing the RCS file.  Normally, the real user
  315.      must be able to read the RCS and working files and to search
  316.      and write the directory containing the working file;
  317.      however, some older hosts cannot easily switch between real
  318.      and effective users, so on these hosts the effective user is
  319.      used for all accesses.  The effective user is the same as
  320.      the real user unless your copies of ci and co have setuid
  321.      privileges.  As described in the next section, these
  322.      privileges yield extra security if the effective user owns
  323.      all RCS files and directories, and if only the effective
  324.      user can write RCS directories.
  325.  
  326.      Users can control access to RCS files by setting the
  327.      permissions of the directory containing the files; only
  328.      users with write access to the directory can use RCS
  329.      commands to change its RCS files.  For example, in hosts
  330.      that allow a user to belong to several groups, one can make
  331.      a group's RCS directories writable to that group only.  This
  332.      approach suffices for informal projects, but it means that
  333.      any group member can arbitrarily change the group's RCS
  334.      files, and can even remove them entirely.  Hence more formal
  335.      projects sometimes distinguish between an RCS administrator,
  336.      who can change the RCS files at will, and other project
  337.      members, who can check in new revisions but cannot otherwise
  338.      change the RCS files.
  339.  
  340. SETUID USE
  341.      To prevent anybody but their RCS administrator from deleting
  342.      revisions, a set of users can employ setuid privileges as
  343.      follows.
  344.  
  345.      + Check that the host supports RCS setuid use.  Consult a
  346.        trustworthy expert if there are any doubts.  It is best if
  347.        the seteuid() system call works as described in Posix
  348.        1003.1a Draft 5, because RCS can switch back and forth
  349.        easily between real and effective users, even if the real
  350.        user is root.  If not, the second best is if the setuid()
  351.        system call supports saved setuid (the {_POSIX_SAVED_IDS}
  352.        behavior of Posix 1003.1-1990); this fails only if the
  353.        real or effective user is root.  If RCS detects any
  354.        failure in setuid, it quits immediately.
  355.  
  356.      + Choose a user A to serve as RCS administrator for the set
  357.        of users.  Only A will be able to invoke the rcs command
  358.        on the users' RCS files.  A should not be root or any
  359.        other user with special powers.  Mutually suspicious sets
  360.        of users should use different administrators.
  361.  
  362.      + Choose a path name B that will be a directory of files to
  363.        be executed by the users.
  364.  
  365.      + Have A set up B to contain copies of ci and co that are
  366.        setuid to A by copying the commands from their standard
  367.        installation directory D as follows:
  368.  
  369.           mkdir  B
  370.           cp  D/c[io]  B
  371.           chmod  go-w,u+s  B/c[io]
  372.  
  373.      + Have each user prepend B to their path as follows:
  374.  
  375.           PATH=B:$PATH;  export  PATH  # ordinary shell
  376.           set  path=(B  $path)  # C shell
  377.  
  378.      + Have A create each RCS directory R with write access only
  379.        to A as follows:
  380.  
  381.           mkdir  R
  382.           chmod  go-w  R
  383.  
  384.      + If you want to let only certain users read the RCS files,
  385.        put the users into a group G, and have A further protect
  386.        the RCS directory as follows:
  387.  
  388.           chgrp  G  R
  389.           chmod  g-w,o-rwx  R
  390.  
  391.      + Have A copy old RCS files (if any) into R, to ensure that
  392.        A owns them.
  393.  
  394.      + An RCS file's access list limits who can check in and lock
  395.        revisions.  The default access list is empty, which grants
  396.        checkin access to anyone who can read the RCS file.  If
  397.        you want limit checkin access, have A invoke rcs -a on the
  398.        file; see rcs(1).  In particular, rcs -e -aA limits access
  399.        to just A.
  400.  
  401.      + Have A initialize any new RCS files with rcs -i before
  402.        initial checkin, adding the -a option if you want to limit
  403.        checkin access.
  404.  
  405.      + Give setuid privileges only to ci, co, and rcsclean; do
  406.        not give them to rcs or to any other command.
  407.  
  408.      + Do not use other setuid commands to invoke RCS commands;
  409.        setuid is trickier than you think!
  410.  
  411. ENVIRONMENT
  412.      RCSINIT
  413.           options prepended to the argument list, separated by
  414.           spaces.  A backslash escapes spaces within an option.
  415.           The RCSINIT options are prepended to the argument lists
  416.           of most RCS commands.  Useful RCSINIT options include
  417.           -q, -V, and -x.
  418.  
  419.      TMPDIR
  420.           Name of the temporary directory.  If not set, the
  421.           environment variables TMP and TEMP are inspected
  422.           instead and the first value found is taken; if none of
  423.           them are set, a host-dependent default is used,
  424.           typically /tmp.
  425.  
  426. DIAGNOSTICS
  427.      For each revision, ci prints the RCS file, the working file,
  428.      and the number of both the deposited and the preceding
  429.      revision.  The exit status is zero if and only if all
  430.      operations were successful.
  431.  
  432. IDENTIFICATION
  433.      Author: Walter F. Tichy.
  434.      Revision Number: 5.11; Release Date: 1992/02/17.
  435.      Copyright 1982, 1988, 1989 by Walter F. Tichy.
  436.      Copyright 1990, 1991, 1992 by Paul Eggert.
  437.  
  438. SEE ALSO
  439.      co(1), ident(1), make(1), rcs(1), rcsclean(1), rcsdiff(1),
  440.      rcsintro(1), rcsmerge(1), rlog(1), rcsfile(5)
  441.      Walter F. Tichy, RCS--A System for Version Control,
  442.      Software--Practice & Experience 15, 7 (July 1985), 637-654.
  443.