.Id $Id: ci.1,v 5.9 1991/10/07 17:32:46 eggert Exp $
ci \- check in RCS revisions
.RI [ options ] " file " .\|.\|.
stores new revisions into \*r files.
Each pathname matching an \*r suffix
is taken to be an \*r file.
are assumed to be working files containing new revisions.
deposits the contents of each working file
into the corresponding \*r file.
If only a working file is given,
tries to find the corresponding \*r file in an \*r subdirectory
and then in the working file's directory.
to work, the caller's login must be on the access list,
except if the access list is empty or the caller is the superuser or the
To append a new revision to an existing branch, the tip revision on
that branch must be locked by the caller. Otherwise, only a
new branch can be created. This restriction is not enforced
for the owner of the file if non-strict locking is used
A lock held by someone else may be broken with the
checks whether the revision to be deposited differs from the preceding one.
If not, instead of creating a new revision
reverts to the preceding one.
removes the working file and any lock;
removes any lock, and then they both generate a new working file much as if
had been applied to the preceding revision.
options apply to the preceding revision.
For each revision deposited,
prompts for a log message.
The log message should summarize the change and must be terminated by
end-of-file or by a line containing
If several files are checked in
asks whether to reuse the
If the standard input is not a terminal,
and uses the same log message for all files.
If the \*r file does not exist,
deposits the contents of the working file as the initial revision
The access list is initialized to empty.
Instead of the log message,
requests descriptive text (see
of the deposited revision can be given by any of the options
may be symbolic, numeric, or mixed.
determines the revision number from keyword values in the working file.
is a revision number, it must be higher than the latest
one on the branch to which
belongs, or must start a new branch.
is a branch rather than a revision number,
the new revision is appended to that branch. The level number is obtained
by incrementing the tip revision number of that branch.
indicates a non-existing branch,
that branch is created with the initial revision numbered
tries to derive the new revision number from
the caller's last lock. If the caller has locked the tip revision of a branch,
the new revision is appended to that branch.
The new revision number is obtained
by incrementing the tip revision number.
If the caller locked a non-tip revision, a new branch is started at
that revision by incrementing the highest branch number at that revision.
The default initial branch and level numbers are
is omitted and the caller has no lock, but owns
then the revision is appended to the
default branch (normally the trunk; see the
Exception: On the trunk, revisions can be appended to the end, but
checks in a revision, releases the corresponding lock, and
removes the working file. This is the default.
option has an unusual meaning in
merely specifies a revision number,
it also releases a lock and removes the working file.
except it performs an additional
deposited revision. Thus, the deposited revision is immediately
checked out again and locked.
This is useful for saving a revision although one wants to continue
editing it after the checkin.
except that the deposited revision is not locked.
This lets one read the working file
immediately after checkin.
options are mutually exclusive and silently override each other.
forces a deposit; the new revision is deposited even it is not different
searches the working file for keyword values to determine its revision number,
creation date, state, and author (see
values to the deposited revision, rather than computing them locally.
It also generates a default login message noting the login of the caller
and the actual checkin date.
This option is useful for software distribution. A revision that is sent to
several sites should be checked in with the
preserve the original number, date, author, and state.
The extracted keyword values and the default log message may be overridden
and any option that carries a revision number.
quiet mode; diagnostic output is not printed.
A revision that is not different from the preceding one is not deposited,
the user is prompted and questioned
even if the standard input is not a terminal.
for the checkin date and time.
is specified in free format as explained in
This is useful for lying about the checkin date, and for
is empty, the working file's time of last modification is used.
Set the modification time on any new working file
to be the date of the retrieved revision.
.BI "ci\ \-d\ \-M\ \-u" "\ f"
modification time, even if
contents change due to keyword substitution.
Use this option with care; it can confuse
as the log message for all revisions checked in.
assigns the symbolic name
to the number of the checked-in revision.
prints an error message if
is already assigned to another
except that it overrides a previous assignment of
sets the state of the checked-in revision to the identifier
writes descriptive text from the contents of the named
deleting the existing text.
Write descriptive text from the
into the \*r file, deleting the existing text.
option, in both its forms, has effect only during an initial checkin;
it is silently ignored otherwise.
During the initial checkin, if
obtains the text from standard input,
terminated by end-of-file or by a line containing
The user is prompted for the text if interaction is possible; see
For backward compatibility with older versions of \*r, a bare
for the author field of the deposited revision.
Useful for lying about the author, and for
if no author is available.
specifies the suffixes for \*r files.
A nonempty suffix matches any pathname ending in the suffix.
An empty suffix matches any pathname of the form
option can specify a list of suffixes
If two or more suffixes are specified,
they are tried in order when looking for an \*r file;
the first one that works is used for that file.
If no \*r file is found but an \*r file can be created,
the suffixes are tried in order
to determine the new \*r file's name.
is installation-dependent; normally it is
for hosts like Unix that permit commas in file names,
and is empty (i.e. just the empty suffix) for other hosts.
Pairs of \*r files and working files may be specified in three ways
1) Both the \*r file and the working file are given. The \*r pathname is of
and the working pathname is of the form
are (possibly different or empty) paths,
2) Only the \*r file is given. Then the working file is created in the current
directory and its name is derived from the name of the \*r file
3) Only the working file is given.
considers each \*r suffix
in turn, looking for an \*r file of the form
.IB path2 /RCS/ workfileX
or (if the former is not found and
If the \*r file is specified without a path in 1) and 2),
looks for the \*r file first in the directory
reports an error if an attempt to open an \*r file fails for an unusual reason,
even if the \*r file's pathname is just one of several possibilities.
For example, to suppress use of \*r commands in a directory
create a regular file named
so that casual attempts to use \*r commands in
is an \*r suffix and the current directory contains a subdirectory
Then each of the following commands check in a copy of
as the latest revision, removing
ci io.c; ci RCS/io.c,v; ci io.c,v;
ci io.c RCS/io.c,v; ci io.c io.c,v;
ci RCS/io.c,v io.c; ci io.c,v io.c;
Suppose instead that the empty suffix
is an \*r suffix and the current directory contains a subdirectory
The each of the following commands checks in a new revision.
inherits the read and execute permissions
from the working file. If the \*r file exists already,
preserves its read and execute permissions.
always turns off all write permissions of \*r files.
Several temporary files may be created in the directory containing
the working file, and also in the temporary directory (see
.BR \s-1ENVIRONMENT\s0 ).
A semaphore file or files are created in the directory containing the \*r file.
With a nonempty suffix, the semaphore names begin with
the first character of the suffix; therefore, do not specify an suffix
whose first character could be that of a working filename.
With an empty suffix, the semaphore names end with
so working filenames should not end in
never changes an \*r or working file.
unlinks the file and creates a new one;
but instead of breaking a chain of one or more symbolic links to an \*r file,
it unlinks the destination file instead.
breaks any hard or symbolic links to any working file it changes;
and hard links to \*r files are ineffective,
but symbolic links to \*r files are preserved.
The effective user must be able to
search and write the directory containing the \*r file.
Normally, the real user must be able to
read the \*r and working files
and to search and write the directory containing the working file;
however, some older hosts
cannot easily switch between real and effective users,
so on these hosts the effective user is used for all accesses.
The effective user is the same as the real user
As described in the next section,
these privileges yield extra security if
the effective user owns all \*r files and directories,
and if only the effective user can write \*r directories.
Users can control access to \*r files by setting the permissions
of the directory containing the files; only users with write access
to the directory can use \*r commands to change its \*r files.
For example, in hosts that allow a user to belong to several groups,
one can make a group's \*r directories writable to that group only.
This approach suffices for informal projects,
but it means that any group member can arbitrarily change the group's \*r files,
and can even remove them entirely.
Hence more formal projects sometimes distinguish between an \*r administrator,
who can change the \*r files at will, and other project members,
who can check in new revisions but cannot otherwise change the \*r files.
To prevent anybody but their \*r administrator from deleting revisions,
a set of users can employ setuid privileges as follows.
Check that the host supports \*r setuid use.
Consult a trustworthy expert if there are any doubts.
system call works as described in Posix 1003.1a Draft 5,
because \*r can switch back and forth easily
between real and effective users, even if the real user is
If not, the second best is if the
system call supports saved setuid
(the {\s-1_POSIX_SAVED_IDS\s0} behavior of Posix 1003.1-1990);
this fails only if the real user is
If \*r detects any failure in setuid, it quits immediately.
to serve as \*r administrator for the set of users.
will be able to invoke the
command on the users' \*r files.
or any other user with special powers.
Mutually suspicious sets of users should use different administrators.
that will be a directory of files to be executed by the users.
by copying the commands from their standard installation directory
\f3cp\fP \f2D\fP\^\f3/c[io]\fP \f2B\fP
\f3chmod go\-w,u+s\fP \f2B\fP\f3/c[io]\fP
to their path as follows:
\f3PATH=\fP\f2B\fP\f3:$PATH; export PATH\fP # ordinary shell
\f3set path=(\fP\f2B\fP \f3$path)\fP # C shell
create each \*r directory
with write access only to
\f3chmod go\-w\fP \f2R\fP
If you want to let only certain users read the \*r files,
put the users into a group
further protect the \*r directory as follows:
\f3chmod g\-w,o\-rwx\fP \f2R\fP
copy old \*r files (if any) into
An \*r file's access list limits who can check in and lock revisions.
The default access list is empty,
which grants checkin access to anyone who can read the \*r file.
If you want limit checkin access,
initialize any new \*r files with
before initial checkin, adding the
option if you want to limit checkin access.
Give setuid privileges only to
Do not use other setuid commands to invoke \*r commands;
setuid is trickier than you think!
options prepended to the argument list, separated by spaces.
A backslash escapes spaces within an option.
options are prepended to the argument lists of most \*r commands.
Name of the temporary directory.
If not set, the environment variables
are inspected instead and the first value found is taken;
a host-dependent default is used, typically
prints the \*r file, the working file, and the number
of both the deposited and the preceding revision.
The exit status is zero if and only if all operations were successful.
Revision Number: \*(Rv; Release Date: \*(Dt.
Copyright \(co 1982, 1988, 1989 by Walter F. Tichy.
Copyright \(co 1990, 1991 by Paul Eggert.
co(1), ident(1), make(1), rcs(1), rcsclean(1), rcsdiff(1),
rcsintro(1), rcsmerge(1), rlog(1), rcsfile(5)
\*r\*-A System for Version Control,
.I "Software\*-Practice & Experience"