Check in RCS revisions (UNIX)
ci [options] file...
The ci utility does not follow the standard utility syntax conventions. Options and their arguments may not be separated by white space, and options may not be combined in single command line arguments (i.e. multiple options must be separated by spaces in the command line).
If you have locked a revision, ci usually updates the RCS file's modification time to the current time, because the lock is stored in the RCS file and removing the lock requires changing the RCS file. This can create an RCS file newer than the working file in one of two ways: first, ci -M can create a working file with a date before the current time; second, when reverting to the previous revision the RCS file can change while the working file remains unchanged. These two cases can cause excessive recompilation caused by a make dependency of the working file on the RCS file. The -T option inhibits this recompilation by lying about the RCS file's date. Use this option with care; it can suppress recompilation even when a checkin of one working file should affect another working file associated with the same RCS file. For example, suppose the RCS file's time is 01:00, the (changed) working file's time is 02:00, some other copy of the working file has a time of 03:00, and the current time is 04:00. Then ci -d -T sets the RCS file's time to 02:00 instead of the usual 04:00; this causes make to think (incorrectly) that the other copy is newer than the RCS file.
The -z option does not affect dates stored in RCS files, which are always UTC.
The ci utility stores new revisions into RCS files. Each filename ending in ,v is taken to be an RCS file. All others are assumed to be working files containing new revisions. The ci utility deposits the contents of each working file into the corresponding RCS file. If only a working file is given, ci tries to find the corresponding RCS file in an RCS subdirectory and then in the working file's directory.
If the RCS file doesn't exist, ci creates it and deposits the contents of the working file as the initial revision (default number: 1.1). The access list is initialized to empty. Instead of the log message, ci requests descriptive text (see "Descriptive text," below).
For each revision, ci prints the RCS file, the working file, and the number of both the deposited and the preceding revision.
You can specify pairs of RCS files and working files in three ways (see also the Example section of co):
If the RCS file is specified without a path in 1 and 2 (above), then ci looks for the RCS file first in the directory ./RCS and then in the current directory.
For ci to work, the caller's login must be on the access list, unless the access list is empty or the caller is the superuser or the owner of the file. 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 isn't enforced for the owner of the file if non-strict locking is used (see rcs). A lock held by someone else may be broken with the rcs command.
Normally, ci checks whether the revision to be deposited differs from the preceding one. If they're the same, ci reverts to the preceding revision instead of creating a new revision. To force a deposit, you use the -f option. The ci utility will deposit a revision that's the same as the preceding revision only if -f is specified.
For each revision deposited, ci prompts you for a log message. The log message you enter should summarize the change and must be terminated by EOF or by a line containing only a single dot (.). If several files are checked in, ci asks whether to reuse the previous log message. If the standard input isn't a terminal, ci suppresses the prompt and uses the same log message for all files. You can also use the -m option to specify the same log message for all revisions checked in.
The -t option, in both its forms, is effective only during an initial checkin; it's silently ignored otherwise. During the initial checkin, if -t isn't given, ci obtains the text from standard input, terminated by EOF or by a line containing only a dot (.). The user is prompted for the text if interaction is possible; see -I. For backward compatibility with older versions of RCS, a bare -t option is ignored.
The -k option generates a default checkin 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 -k option at these sites to preserve the original number, date, author, and state. The extracted keyword values and the default log message may be overridden with the options -d, -m, -s, -w, and any option that carries a revision number. For more information on keywords, see the co utility.
You can specify the number of the deposited revisions by any of the options -f, -I, -k, -l, -q, -r, or -u. The following rules apply using rev:
If rev: | Then: |
---|---|
is a revision number | it must be higher than the latest one on the branch to which rev 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 nonexisting branch | that branch is created with the initial revision numbered rev.1. |
is omitted | ci 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 1. |
is omitted and the caller has no lock, but owns the file and locking isn't set to strict | the revision is appended to the default branch (normally the trunk*; see the -b option of rcs). |
* Note that on the trunk, revisions can be appended to the end, but not inserted.
An RCS file created by ci inherits the read and execute permissions from the working file. If the RCS file already exists, ci preserves the RCS file's read and execute permissions. The ci utility always turns off all write permissions of RCS files.
Several temporary files may be created. A semaphore file is created in the directory containing the RCS file. The effective user and group must be able to read the RCS file and to search and write the directory containing the RCS file. Normally, the real user and group must be able to read the working file and to search and write the directory containing the working file. The effective user and group are the same as the real user and group unless your RCS executables have setuid or setgid privileges. These privileges yield extra security if RCS files are protected so that only the effective user and group can write RCS directories. Further protection can be achieved by granting access only to the effective user and group.
The ci utility never changes an RCS file or a working file; instead, it unlinks the file and creates a new one. This strategy breaks hard links to such files, but doesn't affect symbolic links.
The exit status is zero only if all operations were successful.
GNU
co, ident, rcs, rcsdiff, rcsmerge, rlog
Walter F. Tichy, "RCS -- A System for Version Control," Software -- Practice & Experience 15, 7, July 1985.
Don Bolinger & Tan Bronson, Applying RCS & SCCS, O'Reilly & Associates, 1995.