1 .\" $NetBSD: ci.1,v 1.5 2002/02/08 01:26:50 ross Exp $
7 .\" Id: ci.1,v 5.17 1995/06/16 06:19:24 eggert Exp
15 ci \- check in RCS revisions
18 .RI [ options ] " file " .\|.\|.
21 stores new revisions into \*r files.
22 Each pathname matching an \*r suffix
23 is taken to be an \*r file.
25 are assumed to be working files containing new revisions.
27 deposits the contents of each working file
28 into the corresponding \*r file.
29 If only a working file is given,
31 tries to find the corresponding \*r file in an \*r subdirectory
32 and then in the working file's directory.
39 to work, the caller's login must be on the access list,
40 except if the access list is empty or the caller is the superuser or the
42 To append a new revision to an existing branch, the tip revision on
43 that branch must be locked by the caller. Otherwise, only a
44 new branch can be created. This restriction is not enforced
45 for the owner of the file if non-strict locking is used
48 A lock held by someone else can be broken with the
56 checks whether the revision to be deposited differs from the preceding one.
57 If not, instead of creating a new revision
59 reverts to the preceding one.
62 removes the working file and any lock;
66 removes any lock, and then they both generate a new working file much as if
70 had been applied to the preceding revision.
75 options apply to the preceding revision.
77 For each revision deposited,
79 prompts for a log message.
80 The log message should summarize the change and must be terminated by
81 end-of-file or by a line containing
84 If several files are checked in
86 asks whether to reuse the
88 If the standard input is not a terminal,
91 and uses the same log message for all files.
95 If the \*r file does not exist,
98 deposits the contents of the working file as the initial revision
101 The access list is initialized to empty.
102 Instead of the log message,
104 requests descriptive text (see
110 of the deposited revision can be given by any of the options
123 can be symbolic, numeric, or mixed.
126 must already be defined;
131 options for assigning names during checkin.
137 determines the revision number from keyword values in the working file.
141 begins with a period,
142 then the default branch (normally the trunk) is prepended to it.
145 is a branch number followed by a period,
146 then the latest revision on that branch is used.
150 is a revision number, it must be higher than the latest
151 one on the branch to which
153 belongs, or must start a new branch.
157 is a branch rather than a revision number,
158 the new revision is appended to that branch. The level number is obtained
159 by incrementing the tip revision number of that branch.
162 indicates a non-existing branch,
163 that branch is created with the initial revision numbered
172 tries to derive the new revision number from
173 the caller's last lock. If the caller has locked the tip revision of a branch,
174 the new revision is appended to that branch.
175 The new revision number is obtained
176 by incrementing the tip revision number.
177 If the caller locked a non-tip revision, a new branch is started at
178 that revision by incrementing the highest branch number at that revision.
179 The default initial branch and level numbers are
184 is omitted and the caller has no lock, but owns
188 then the revision is appended to the
189 default branch (normally the trunk; see the
194 Exception: On the trunk, revisions can be appended to the end, but
205 option (without any revision) has an unusual meaning in
207 With other \*r commands, a bare
209 option specifies the most recent revision on the default branch,
214 option reestablishes the default behavior of releasing a lock and
215 removing the working file, and is used to override any default
219 options established by shell aliases or scripts.
224 except it performs an additional
227 deposited revision. Thus, the deposited revision is immediately
228 checked out again and locked.
229 This is useful for saving a revision although one wants to continue
230 editing it after the checkin.
235 except that the deposited revision is not locked.
236 This lets one read the working file
237 immediately after checkin.
246 options are mutually exclusive and silently override each other.
258 forces a deposit; the new revision is deposited even it is not different
259 from the preceding one.
262 searches the working file for keyword values to determine its revision number,
263 creation date, state, and author (see
266 values to the deposited revision, rather than computing them locally.
267 It also generates a default login message noting the login of the caller
268 and the actual checkin date.
269 This option is useful for software distribution. A revision that is sent to
270 several sites should be checked in with the
272 option at these sites to
273 preserve the original number, date, author, and state.
274 The extracted keyword values and the default log message can be overridden
280 and any option that carries a revision number.
283 quiet mode; diagnostic output is not printed.
284 A revision that is not different from the preceding one is not deposited,
290 initial checkin; report an error if the \*r file already exists.
291 This avoids race conditions in certain applications.
294 just checkin and do not initialize;
295 report an error if the \*r file does not already exist.
299 the user is prompted and questioned
300 even if the standard input is not a terminal.
302 .BR \-d "[\f2date\fP]"
305 for the checkin date and time.
308 is specified in free format as explained in
310 This is useful for lying about the checkin date, and for
312 if no date is available.
315 is empty, the working file's time of last modification is used.
318 Set the modification time on any new working file
319 to be the date of the retrieved revision.
321 .BI "ci\ \-d\ \-M\ \-u" "\ f"
324 modification time, even if
326 contents change due to keyword substitution.
327 Use this option with care; it can confuse
333 as the log message for all revisions checked in.
334 By convention, log messages that start with
336 are comments and are ignored by programs like GNU Emacs's
339 Also, log messages that start with
341 (followed by white space) are meant to be clumped together if possible,
342 even if they are associated with different files; the
344 label is used only for clumping,
345 and is not considered to be part of the log message itself.
348 assigns the symbolic name
350 to the number of the checked-in revision.
352 prints an error message if
354 is already assigned to another
360 except that it overrides a previous assignment of
364 sets the state of the checked-in revision to the identifier
370 writes descriptive text from the contents of the named
373 deleting the existing text.
380 Write descriptive text from the
382 into the \*r file, deleting the existing text.
387 option, in both its forms, has effect only during an initial checkin;
388 it is silently ignored otherwise.
390 During the initial checkin, if
394 obtains the text from standard input,
395 terminated by end-of-file or by a line containing
398 The user is prompted for the text if interaction is possible; see
401 For backward compatibility with older versions of \*r, a bare
407 Set the \*r file's modification time to the new revision's time
408 if the former precedes the latter and there is a new revision;
409 preserve the \*r file's modification time otherwise.
410 If you have locked a revision,
412 usually updates the \*r file's modification time to the current time,
413 because the lock is stored in the \*r file
414 and removing the lock requires changing the \*r file.
415 This can create an \*r file newer than the working file in one of two ways:
418 can create a working file with a date before the current time;
419 second, when reverting to the previous revision
420 the \*r file can change while the working file remains unchanged.
421 These two cases can cause excessive recompilation caused by a
423 dependency of the working file on the \*r file.
426 option inhibits this recompilation by lying about the \*r file's date.
427 Use this option with care; it can suppress recompilation even when
428 a checkin of one working file should affect
429 another working file associated with the same \*r file.
430 For example, suppose the \*r file's time is 01:00,
431 the (changed) working file's time is 02:00,
432 some other copy of the working file has a time of 03:00,
433 and the current time is 04:00.
436 sets the \*r file's time to 02:00 instead of the usual 04:00;
439 to think (incorrectly) that the other copy is newer than the \*r file.
444 for the author field of the deposited revision.
445 Useful for lying about the author, and for
447 if no author is available.
450 Print \*r's version number.
460 specifies the suffixes for \*r files.
461 A nonempty suffix matches any pathname ending in the suffix.
462 An empty suffix matches any pathname of the form
465 .IB path1 /RCS/ path2.
468 option can specify a list of suffixes
473 specifies two suffixes:
475 and the empty suffix.
476 If two or more suffixes are specified,
477 they are tried in order when looking for an \*r file;
478 the first one that works is used for that file.
479 If no \*r file is found but an \*r file can be created,
480 the suffixes are tried in order
481 to determine the new \*r file's name.
484 is installation-dependent; normally it is
486 for hosts like UNIX that permit commas in filenames,
487 and is empty (i.e. just the empty suffix) for other hosts.
490 specifies the date output format in keyword substitution,
491 and specifies the default time zone for
498 should be empty, a numeric \*u offset, or the special string
501 The default is an empty
503 which uses the traditional \*r format of \*u without any time zone indication
504 and with slashes separating the parts of the date;
505 otherwise, times are output in \*i 8601 format with time zone indication.
506 For example, if local time is January 11, 1990, 8pm Pacific Standard Time,
507 eight hours west of \*u,
508 then the time is output as follows:
513 .ta \w'\f3\-z+05:30\fP 'u +\w'\f31990-01-11 09:30:00+05:30\fP 'u
515 \f2option\fP \f2time output\fP
516 \f3\-z\fP \f31990/01/12 04:00:00\fP \f2(default)\fP
517 \f3\-zLT\fP \f31990-01-11 20:00:00\-08\fP
518 \f3\-z+05:30\fP \f31990-01-12 09:30:00+05:30\fP
525 option does not affect dates stored in \*r files,
526 which are always \*u.
528 Pairs of \*r files and working files can be specified in three ways
532 1) Both the \*r file and the working file are given. The \*r pathname is of
534 .IB path1 / workfileX
535 and the working pathname is of the form
541 are (possibly different or empty) paths,
555 2) Only the \*r file is given. Then the working file is created in the current
556 directory and its name is derived from the name of the \*r file
562 3) Only the working file is given.
565 considers each \*r suffix
567 in turn, looking for an \*r file of the form
568 .IB path2 /RCS/ workfileX
569 or (if the former is not found and
572 .IB path2 / workfileX.
574 If the \*r file is specified without a path in 1) and 2),
576 looks for the \*r file first in the directory
578 and then in the current
582 reports an error if an attempt to open an \*r file fails for an unusual reason,
583 even if the \*r file's pathname is just one of several possibilities.
584 For example, to suppress use of \*r commands in a directory
586 create a regular file named
588 so that casual attempts to use \*r commands in
596 is an \*r suffix and the current directory contains a subdirectory
600 Then each of the following commands check in a copy of
604 as the latest revision, removing
610 ci io.c; ci RCS/io.c,v; ci io.c,v;
611 ci io.c RCS/io.c,v; ci io.c io.c,v;
612 ci RCS/io.c,v io.c; ci io.c,v io.c;
617 Suppose instead that the empty suffix
618 is an \*r suffix and the current directory contains a subdirectory
622 The each of the following commands checks in a new revision.
627 ci io.c; ci RCS/io.c;
634 An \*r file created by
636 inherits the read and execute permissions
637 from the working file. If the \*r file exists already,
639 preserves its read and execute permissions.
641 always turns off all write permissions of \*r files.
643 Temporary files are created in the directory containing
644 the working file, and also in the temporary directory (see
647 .BR \s-1ENVIRONMENT\s0 ).
648 A semaphore file or files are created in the directory containing the \*r file.
649 With a nonempty suffix, the semaphore names begin with
650 the first character of the suffix; therefore, do not specify an suffix
651 whose first character could be that of a working filename.
652 With an empty suffix, the semaphore names end with
654 so working filenames should not end in
658 never changes an \*r or working file.
661 unlinks the file and creates a new one;
662 but instead of breaking a chain of one or more symbolic links to an \*r file,
663 it unlinks the destination file instead.
666 breaks any hard or symbolic links to any working file it changes;
667 and hard links to \*r files are ineffective,
668 but symbolic links to \*r files are preserved.
670 The effective user must be able to
671 search and write the directory containing the \*r file.
672 Normally, the real user must be able to
673 read the \*r and working files
674 and to search and write the directory containing the working file;
675 however, some older hosts
676 cannot easily switch between real and effective users,
677 so on these hosts the effective user is used for all accesses.
678 The effective user is the same as the real user
679 unless your copies of
683 have setuid privileges.
684 As described in the next section,
685 these privileges yield extra security if
686 the effective user owns all \*r files and directories,
687 and if only the effective user can write \*r directories.
689 Users can control access to \*r files by setting the permissions
690 of the directory containing the files; only users with write access
691 to the directory can use \*r commands to change its \*r files.
692 For example, in hosts that allow a user to belong to several groups,
693 one can make a group's \*r directories writable to that group only.
694 This approach suffices for informal projects,
695 but it means that any group member can arbitrarily change the group's \*r files,
696 and can even remove them entirely.
697 Hence more formal projects sometimes distinguish between an \*r administrator,
698 who can change the \*r files at will, and other project members,
699 who can check in new revisions but cannot otherwise change the \*r files.
701 To prevent anybody but their \*r administrator from deleting revisions,
702 a set of users can employ setuid privileges as follows.
703 .nr n \w'\(bu'+2n-1/1n
705 .if \n(.g .if r an-tag-sep .ds n \w'\(bu'u+\n[an-tag-sep]u
707 Check that the host supports \*r setuid use.
708 Consult a trustworthy expert if there are any doubts.
711 system call works as described in POSIX 1003.1a Draft 5,
712 because \*r can switch back and forth easily
713 between real and effective users, even if the real user is
715 If not, the second best is if the
717 system call supports saved setuid
718 (the {\s-1_POSIX_SAVED_IDS\s0} behavior of POSIX 1003.1-1990);
719 this fails only if the real or effective user is
721 If \*r detects any failure in setuid, it quits immediately.
725 to serve as \*r administrator for the set of users.
730 command on the users' \*r files.
734 or any other user with special powers.
735 Mutually suspicious sets of users should use different administrators.
739 to be a directory of files to be executed by the users.
751 by copying the commands from their standard installation directory
759 \f3cp\fP \f2D\fP\^\f3/c[io]\fP \f2B\fP
760 \f3chmod go\-w,u+s\fP \f2B\fP\f3/c[io]\fP
764 Have each user prepend
766 to their path as follows:
771 \f3PATH=\fP\f2B\fP\f3:$PATH; export PATH\fP # ordinary shell
772 \f3set path=(\fP\f2B\fP \f3$path)\fP # C shell
778 create each \*r directory
780 with write access only to
788 \f3chmod go\-w\fP \f2R\fP
792 If you want to let only certain users read the \*r files,
793 put the users into a group
797 further protect the \*r directory as follows:
802 \f3chgrp\fP \f2G R\fP
803 \f3chmod g\-w,o\-rwx\fP \f2R\fP
809 copy old \*r files (if any) into
815 An \*r file's access list limits who can check in and lock revisions.
816 The default access list is empty,
817 which grants checkin access to anyone who can read the \*r file.
818 If you want limit checkin access,
826 .BI "rcs\ \-e\ \-a" A
827 limits access to just
832 initialize any new \*r files with
834 before initial checkin, adding the
836 option if you want to limit checkin access.
838 Give setuid privileges only to
845 or to any other command.
847 Do not use other setuid commands to invoke \*r commands;
848 setuid is trickier than you think!
852 options prepended to the argument list, separated by spaces.
853 A backslash escapes spaces within an option.
856 options are prepended to the argument lists of most \*r commands.
867 Name of the temporary directory.
868 If not set, the environment variables
872 are inspected instead and the first value found is taken;
873 if none of them are set,
874 a host-dependent default is used, typically
879 prints the \*r file, the working file, and the number
880 of both the deposited and the preceding revision.
881 The exit status is zero if and only if all operations were successful.
883 Author: Walter F. Tichy.
885 Manual Page Revision: \*(Rv; Release Date: \*(Dt.
887 Copyright \(co 1982, 1988, 1989 Walter F. Tichy.
889 Copyright \(co 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert.
893 ident(1), make(1), rcs(1), rcsclean(1), rcsdiff(1),
894 rcsintro(1), rcsmerge(1), rlog(1), setuid(2), rcsfile(5)
897 \*r\*-A System for Version Control,
898 .I "Software\*-Practice \*[Am] Experience"
900 7 (July 1985), 637-654.