CI(1) CI(1) 名称 ci - RCS ファイルにリビジョンをチェックインする 書式 ci [options] file ... 解説 ci は RCS ファイルに新たなリビジョンを格納します。引数のうち、RCS ファ イルの拡張子形式に一致するファイル名を RCS ファイルとみなします。それ以 外 のファイル名は、新たなリビジョンを含んだワークファイルとみなします。 ci はワークファイルの内容を対応した RCS ファイルに格納します。もしワ ー ク ファイルのみが指定されたなら、 ci はサブディレクトリ RCS、次にワーク ファイルがあるディレクトリの順に対応する RCS ファイルを検索します。詳細 は後述の ファイル名規則の項を参照してください。 ci が動作するには、 ci を起動したユーザが RCS ファイルのアクセスリスト に登録されているか、アクセスリストが空であるか、ユーザが RCS ファイルの 持 ち主であるか、あるいはスーパユーザである必要があります。すでに存在す る枝 (branch) に新しいリビジョンを追加するには、枝の先端 (tip) リビジョ ン が、追加しようとするユーザによってロックされていなければなりません。 ロックされていない場合、新たな枝のみ作成可能です。非厳格モード ( rcs(1) 参 照) の場合、ファイルの所有者に対してはこの制限はありません。他人が行 っているロックは、 rcs コマンドによって解除できます。 -f オプションが指定されていなければ、 ci は追加しようとするリビジョンと 直 前のリビジョンとの比較を行います。違いがなかった場合、新たなリビジョ ンを作成するかわりに、ワークファイルを元のリビジョンのものに復元しま す 。復元するときには、ci はいったんワークファイルを削除し、ロックを解除し ます。 ci -l はロックし、 ci -u はロックを解除します。これらのオプシ ョ ン が 指 定 されていれば、あたかも直前のリビジョンに対して co -l または co -u を実行したかのようにして直前のリビジョンの内容を取り出します。 復 元 が行われる場合、 -n と -s オプションは復元されるリビジョンに対して作 用します。 リビジョンを格納するときに、 ci はログメッセージの入力を促すプロンプ ト を 表示します。ログメッセージは、そのリビジョンの変更点の要約です。ファ イル終端 (EOF) あるいは、ピリオド . のみからなる行によって入力を完了さ せ ます。複数のファイルが登録される場合、 ci は前に入力したログメッセー ジを再利用するかどうかを聞いてきます。もし標準入力が端末でなければ、 ci は 確認を行わず、登録されるすべてのファイルに対して同じログメッセージを 使用します。 -m オプションの項も参照してください。 もし RCS ファイルが存在しなければ、 ci は新規に RCS ファイルを作成し 、 ワ ークファイルの内容を初期リビジョン (デフォルトでは 1.1) として格納し ます。その場合、アクセスリストは空に初期化されます。初期リビジョンを 格 納 するときは、ログメッセージのかわりにファイルの内容を記述したテキスト を入力します (後述の -t オプションの項を参照してください)。 登録するリビジョン番号 ( rev ) は、 -f, -i, -I, -j, -k, -l, -M, -q, -r, -u のオプションのうちのいずれかで指定することができます。 rev はシンボ ル、数値、あるいは両者の組み合わせたものです。 rev で使用するシンボル名 は 定義済みでなければなりません; チェックイン時にシンボル名を割り当てる 方法については -n および -N を参照して下さい。もし rev が $ ならば、 ci はワークファイル中のキーワードからリビジョン番号を決定します。 もし rev がピリオドから始まる場合、デフォルトの枝 (通常は幹 (trunk)) に 格納されます。もし rev が枝番号に続いてピリオドである場合、当該枝の最新 のリビジョンが使用されます。 rev がリビジョン番号の場合、それは登録する枝のなかで最も大きな値である 必要があります。さもなければ、新しい枝を作成する必要があります。 rev がリビジョン番号ではなく枝番号の場合、その枝に対する新しいリビジ ョ ン が作成されます。新しいリビジョン番号は、その枝の先端リビジョン番号に 1 を加えたものとなります。もし rev が存在しない枝番号ならば、新たな枝が 作成され、初期リビジョンとして rev.1 が作成されます。 rev が省略された場合、 ci はユーザが行った最後のロックからリビジョン番 号を決定します。ユーザがある枝の先端リビジョンをロックしている場合は 、 新 たなリビジョンがその枝に追加されます。新しいリビジョン番号は先端リビ ジョン番号に 1 を加えたものになります。ユーザが先端ではないリビジョンを ロ ックしている場合は、新たな枝が作成されます。新たな枝番号は、ロック対 象のリビジョンの最も大きな枝番号に 1 を加えたものになります。デフォルト では、新たな枝やリビジョンの番号は 1 となります。 rev が省略され、ユーザがロックを行わず、そのファイルの所有者であり、か つロックが 非厳格モードであるなら、デフォルトの枝 (通常 は 幹 (trunk); rcs(1) の -b オプションの項を参照) に新たなリビジョンが作成されます。 例外: 幹 (trunk) においてリビジョンを追加することはできますが、途中に挿 入することはできません。 オプション -rrev リビジョン rev をチェックインします。 -r -r オプションをリビジョン抜きで使用した場合、 ci にとって特別 な 意 味が有ります。他の RCS コマンドでは -r オプションを単体で使用 するとデフォルト枝の最新のリビジョンを指定します。しかし、 ci で はロック解除、ワークファイル削除を行い、シェルのエイリアスやスク リプトによりデフォルトとされてしまった -l や -u オプションの効果 を打ち消します。 -l[rev] -r と同様の動作を行ったあと、 co -l と同様の動作も行います。すな わち、登録されたリビジョンは即座にロックされ、チェックアウトされ ます。これは、リビジョンをチェックインしてさらに編集を続けたい場 合に便利です。 -u[rev] -l とほぼ同様の動作をしますが、登録されたリビジョンはロックさ れ ません。これは、チェックインしたリビジョンの内容をすぐに参照した い場合に便利です。 -l 、リビジョン無し -r, -u オプションは、最後に指定したものの み が 効力を持ちます。たとえば、 ci -u -r は ci -r と等価です。リビ ジョン無し -r が -u に優先するからです。 -f[rev] 強制的に登録します。直前のリビジョンとの違いがない場合にも、新し いリビジョンとして登録します。 -k[rev] リビジョン番号などをローカルに算出せずに、ワークファイルからキー ワードを探し、リビジョン番号、作成日時、状態、作者 ( co(1) を 参 照) を検索し、登録されるリビジョンに割り当てます。さらに、 ci を 起動したユーザ名と実際にチェックインされた日付を含むデフォルトの ログメッセージを作成します。本オプションは、配布されたソフトウェ アを登録するのに便利です。複数のサイトに配布されたリビジョンは、 元のリビジョン番号、作成日付、状態、作者を保存するために、 -k オ プションを使って登録するべきです。ワークファイルのキーワードから 取り出した値とログメッセージは、 -d, -m, -s, -w や、他のリビジョ ン番号を生成するようなオプションにより変更することができます。 -q[rev] 沈黙モードです。診断メッセージを表示しません。直前のリビジョンか ら変更がない場合、 -f オプションを指定していなければ、登録を行い ません。 -i[rev] 最初のチェックイン; RCS ファイルが既に有る時にはエラー報告します 。特定のアプリケーションのレース状態を避けます。 -j[rev] 初期化を行わず、チェックインします; RCS ファイルが無いとエラー報 告します。 -I[rev] 対話モードで動作します。たとえ標準入力が端末でなくても、ユーザに 対して問い合わせを行います。 -d[date] チェックイン日付として指定された date を用います。 date は co(1) で記述された自由形式で指定することができます。これは、チェックイ ン日時をごまかしたい場合や、日付キーワードがワークファイルにない にもかかわらず -k オプションを使いたい場合に便利です。 date が指 定されなかった場合、ワークファイルの最終更新日付が用いられます。 -M[rev] 作成されるワークファイルの最終更新日付を、取り出されたリビジョン の日付にします。たとえば、 ci -d -M -u f は、 f の内容がキーワー ド置換により変更された場合も最終更新日時を変更しません。本オプシ ョ ンを指定すると make(1) に影響を与えるので、注意して使用する必 要があります。 -mmsg チェックインするすべてのリビジョンのログメッセージとして msg を 用います。慣習的に # で始まるログメッセージはコメントであり、GNU Emacs の vc パッケージのようなプログラムはこれを無視します。また 、 {clumpname} (の後に空白が続く) ログメッセージは可能であればま とめられることを意味します。それはたとえ別々のファイルに関連づけ られていてもです; {clumpname} ラベルは、まとめる目的でのみ使用さ れます。それ自身はログメッセージであるとは見なされません。 -nname チェックインしたリビジョンにシンボリック名 name をつけます。もし 同 じシンボリック名が別のリビジョンに割り当てられていた場合、 ci はエラーメッセージを出力します。 -Nname -n と同様の動作を行います。ただし、同じシンボリック名が他のリ ビ ジョンに割り当てられていた場合は、再割り当てを行います (こちらを 優先します)。 -sstate チェックインされるリビジョンの状態を state とします。デフォル ト は Exp (Experimental: 実験的) です。 -tfile RCS ファイル中の内容記述テキストをファイル file の内容で置き換え ます。すでに内容記述テキストがある場合はこれを削除します。ファイ ル名 file は - で始まってはいけません。 -t-string RCS ファイル中の内容記述テキストを文字列 string で置き換えます。 すでに内容記述テキストがある場合は削除されます。 -t オプションは、どちらの形式で使う場合も、最初のチェックイン 時 にしか意味を持ちません。それ以外の場合は単に無視されます。 最 初のチェックイン時に -t オプションが指定されなかった場合、 ci は標準入力から内容記述テキストを読み込みます。テキストは、ファイ ル 終端 (EOF) あるいはピリオド ( . ) のみの行で終了します。ユー ザへの問い合わせが可能な場合には、テキストの入力を促すプロンプト が表示されます ( -I オプション参照)。 旧バージョンとの互換性のため、引数のない -t オプションは無視され ます。 -T 新しいリビジョンが存在し、 RCS ファイルの修正時刻が新しいリビ ジ ョ ンの時刻よりも古ければ、 RCS ファイルの修正時刻に対して新しい リビジョンの時刻を代入します; そうでない場合は RCS ファイルの 修 正時刻は保たれます。リビジョンをロックした場合は、 ci は通常 RCS ファイルの修正時刻を現在の時刻に設定します。なぜならロックが RCS フ ァイルに格納され、ロックの削除は RCS ファイルの変更を要するか らです。 RCS ファイルがワークファイルよりも新しくなる方法とし て 2 通り有ります: まず、 ci -M は現在時刻以前の日付でワークファイ ルを作成します; 2 番目に、直前のバージョンを回復する時、ワークフ ァイルを変更しない場合にも RCS ファイルは変更され得ます。 RCS フ ァイルのワークファイルにおける make(1) 依存により、上記 2 ケース は過剰の再コンパイルという結果になり得ます。 -T オプションを使用 することで、RCS ファイルの日付をごまかし、再コンパイルを禁止しま す。このオプションは注意して使って下さい; あるワークファイルのチ ェックインが、同じ RCS ファイルに関連づけられている別のワーク フ ァイルに影響を及ぼすべき時でも、再コンパイルを抑制し得ます。例え ば、RCS ファイルの時刻を 01:00、 (変更された) ワークファイルの時 刻を 02:00、別のワークファイルのコピーの時刻を 03:00、現在の時刻 を 04:00 とします。ここで、 ci -d -T とすると、RCS ファイルの 時 刻 は 通常の 04:00 ではなく 02:00 になります; この結果、 make(1) は別のコピーが RCS ファイルよりも新しいと (誤って) 認識します。 -wlogin 指定された login をリビジョンの作者として登録します。作者名を ご まかしたい場合や、作者キーワードがワークファイルにないにもかかわ らず -k オプションを使いたい場合に便利です。 -V RCS のリビジョン 番号を表示します。 -Vn RCS システムのバージョン n のエミュレーションを行います。詳細は co(1) を参照してください。 -xsuffixes RCS ファイルの拡張子を指定します。拡張子が空ではない場合、拡張子 ま で含めたすべてのパス名を RCS ファイル名であるとみなします。拡 張子が空の場合は、 RCS/path または path1/RCS/path2 形式のもの を RCS ファイル名であるとみなします。本オプションの場合、 / で区切 ることにより、複数の拡張子を指定できます。たとえば、 -x,v/ は 、 ,v と空の拡張子の 2 つの拡張子を持つ RCS ファイルを指定します。 複数の拡張子が指定された場合、指定された順に RCS ファイルを検 索 し ます。最初に見つかったサフィックスが RCS ファイルに対して用い られます。 RCS ファイルを生成できるが、 RCS ファイルが見つからな いときは、これらのサフィックスを新しいファイル名に対して用います 。デフォルトの拡張子は、インストールされる環境により異なります。 UNIX のようなコンマをファイル名中に含めることの出来る計算機では 、通常 -x,v/ が、それ以外の計算機では空の拡張子が用いられます。 -zzone キーワード置換での日付の出力書式の指定を行い、また、 -ddate オプ シ ョ ン で の date のデフォルトのタイムゾーンの指定を行います。 zone は、省略する事も、UTC からの数値差で指定する事も、特別な 文 字列 LT を使ってローカル時間で指定する事もできます。デフォルトで は zone は空であり、この場合は伝統的な RCS フォーマット、すな わ ち タイムゾーン無しの UTC であり日付をスラッシュで区切ります; そ うでない場合は時刻はタイムゾーン付の ISO 8601 フォーマットです。 例 えば、ローカルタイムが 1990 年 1 月 11 日 太平洋標準時間 (UTC の 8 時間西) 午後 8 時の場合、時間の出力は次のようになります: オプション時刻の出力 -z 1990/01/12 04:00:00 (デフォルト) -zLT 1990-01-11 20:00:00-08 -z+05:30 1990-01-12 09:30:00+05:30 -z オプションは RCS ファイルに格納されている日付 (常に UTC です) には影響しません。 ファイル名規則 RCS ファイルとワークファイルの組み合わせは 3 通りの方法で指定することが できます (使用例の項目も参照してください)。 1) RCS ファイルとワークファイルの両方を指定する。 RCS ファイルのパス 名 は path1/workfileX 形式、ワークファイルのパス名は path2/workfile 形式を とります。この場合の path1/ と path2/ はパス (異なるパスや、空で も 可) を 示し、 workfile はファイル名、 X は RCS ファイルの拡張子です。もし X が空なら、 path1/ は RCS/ で始まるか、 /RCS/ を含まねばなりません。 2) RCS ファイルのみを指定する。ワークファイルがカレントディレクトリに作 成され、RCS ファイル名から path1/ と拡張子 X を取り除いたファイル名にな ります。 3) ワークファイルのみを指定する。 ci はまず、各 RCS 拡張子 X に対して、 path2/RCS/workfileX 形式の名前で検索を行います。さらに、(もしこれが見つ からず、 X が空でなければ、) path2/workfileX を検索します。 1) または 2) の方法で RCS ファイルが指定されていない場合、 ci はまず デ ィレクトリ ./RCS を検索し、次にカレントディレクトリを検索します。 異常により RCS ファイルのオープンに失敗すると、 ci はエラー報告します。 他に RCS ファイルのパス名の候補があってもです。たとえばディレクト リ d で RCS コマンドを利用できないようにするには、 d/RCS なる名前の通常ファ イルを作成しておきます。すると、RCS コマンドは d/RCS をディレクトリとし て オープンしようとしますが、ディレクトリではないのでオープンすることが できず失敗します。 使用例 RCS 拡張子が ,v 、カレントディレクトリには RCS ファイルを含む RCS と い う サブディレクトリがあり、 io.c,v があると仮定します。ここで、以下に示 したコマンドを実行すると、どれもカレントディレクトリに あ る io.c を RCS/io.c,v にチェックインし、 io.c を削除します。 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; RCS 拡張子が空、カレントディレクトリには RCS ファイルを含む RCS という サブディレクトリがあり、 io.c があると仮定します。ここで以下に示すコ マ ンドは、どれも新しいリビジョンのチェックインを行います。 ci io.c; ci RCS/io.c; ci io.c RCS/io.c; ci RCS/io.c io.c; ファイルモード ci が作成した RCS ファイルは、ワークファイルの読み込みと実行の許可属性 を受け継ぎます。すでに RCS ファイルが存在すれば、 ci はその読み込みと実 行の許可属性を保持します。 ci は、つねに RCS ファイルの書き込み許可属性 を不許可にします。 関連ファイル いくつかの一時ファイルが、ワークファイルの存在するディレクトリまたは 一 時 ディレクトリ (環境変数の項の TMPDIR 参照) に作成されます。セマフォフ ァイル等のファイルが RCS ファイルが存在するディレクトリに作成されます。 空 ではない拡張子を用いている場合、セマフォファイル名の先頭文字には、拡 張子の先頭文字と同じ文字が用いられます; よって、拡張子として、ワーク フ ァ イルの拡張子の先頭文字と同じ文字を指定しないように注意してください。 空の拡張子を指定している場合、セマフォファイル名の最後の文字がアンダ ス コア ( _ ) となります。 ci は、 RCS ファイルやワークファイルを変更しません。通常 ci はそれらの ファイルをアンリンクし、新しいファイルを作成します; ただし、RCS ファ イ ル へのシンボリックリンクの鎖を壊す代わりに、目的のファイルをアンリンク します。よって、 ci は変更されるワークファイルへのハードリンク、シン ボ リ ックリンクを全て壊します; さらに、RCS ファイルへのハードリンクは無効 となり、シンボリックリンクは保存されます。 実効ユーザは、RCS ファイルを含むディレクトリの検索および書き込み権を 持 っていなければなりません。通常実ユーザは、 RCS ファイルとワークファイル の読み込み許可と、それらを含むディレクトリの検索および書き込み権を持 っ て いなければなりません。しかし、古い計算機のなかには実ユーザと実効ユー ザの間を容易に行き来することができないものもあります。これらの計算機 で は 、実効ユーザのみが利用されます。 ci や co のコピーに setuid が設定さ れていなければ、実ユーザと実効ユーザは同一です。次節で説明するように 、 もし実効ユーザが全 RCS ファイルとそれを含むディレクトリを所有し、実効ユ ーザのみが RCS ディレクトリに書き込めるように設定できるなら、 RCS フ ァ イルのセキュリティを強化することが可能です。 ユーザは RCS ファイルを含むディレクトリの許可属性を変更することで、 RCS ファイルに対するアクセスを制限できます; そのディレクトリに書き込み権 の あ るユーザだけが、 RCS ファイルを変更する RCS コマンドを使用することが できます。たとえば、ユーザが複数のグループに属することが出来る計算機 で は、 RCS ディレクトリをあるグループのみが書き込み権を持つように設定しま す。これは、略式のプロジェクトでは十分ですが、グループに所属するユー ザ が 自由に RCS ファイルを変更することができ、 RCS ファイルすべてを削除す ることもできます。そのため、正式なプロジェクトでは、 RCS ファイルを自由 に操作きる RCS 管理者と、新たなリビジョンをチェックインすること以外の操 作はできない他のユーザとを、区別することがあります。 SETUID の使用 RCS 管理者以外のユーザがリビジョンを削除できないようにするには、以下 の ように setuid 特権を使用することができます。 · その計算機で RCS にて setuid が使用できるか確認します。疑問があるとき は、信頼できる専門家に意見を聞いてください。最も良いのは、 seteuid() システムコールが Posix 1003.1a Draft 5 に記述されているように動作する ことです。なぜなら、実ユーザが root であっても、RCS は実ユーザと実 効 ユ ー ザ を 簡 単に切り替えることができるからです。その次に良いのは、 setuid() システ ム コ ー ル が saved setuid (Posix 1003.1-1990 の {_POSIX_SAVED_IDS} の動作) をサポートしている場合です; この場合、実ユ ーザもしくは実効ユーザが root である時のみ失敗します。 RCS は setuid に失敗すると、ただちに終了します。 · ユ ー ザ グループの RCS 管理者として、ユーザ A を選びます。 A だけが 、RCS ファイルに対して rcs コマンドを実行することができます。 A は root や、特権を持ったユーザであってはいけません。相互に異なるユーザグ ループには、異なる管理者を使用するべきです。 · ユーザが実行するファイルのディレクトリに、パス名 B を選びます。 · 以下のように、通常のインストールディレクトリ D から、 ci と co を B にコピーし、 A へ setuid します: mkdir B cp D/c[io] B chmod go-w,u+s B/c[io] · 以下のように、各ユーザのパスに B を加えます: PATH=B:$PATH; export PATH # ordinary shell set path=(B $path) # C shell · 以下のように、 A だけが書き込み許可を持つ RCS ディレクトリ R を作成し ます: mkdir R chmod go-w R · 特定のユーザだけに RCS ファイルの読み込みを許可したい場合、そのユーザ を ユーザグループ G に入れて、さらに A が以下のように、RCS ディレクト リを保護します: chgrp G R chmod g-w,o-rwx R · (存在すれば) 古い RCS ファイルを R にコピーし、 A が所有であること を 保証します。 · RCS ファイルのアクセスリストは、リビジョンをチェックインおよびロック できるユーザを制限します。デフォルトのアクセスリストは空で、 RCS ファ イ ルを読むことのできる全てのユーザに、登録の権限を与えます。チェック インを制限したい場合は、 A がそのファイルに対して rcs -a を実行 し ま す; rcs(1) を参照してください。特に rcs -e -aA は、 A だけにアクセス を制限します。 · 初めてチェックインを行う前に、 A は rcs -i によって新しい RCS ファ イ ル を初期化します。チェックインを制限したい場合、 -a オプションを付け 加えます。 · setuid 特権は、 ci, co, rcsclean のみに与えます; rcs や他のコマンドに 、setuid 特権を与えてはなりません。 · RCS コ マンドに対して、他の setuid コマンドを実行しないでください。 setuid はあなたが考えるより扱いにくいものです。 環境変数 RCSINIT 本変数に空白で区切ったオプションを設定することで、コマンドライン 引数に先立って処理されます。空白はバックスラッシュによってエスケ ープすることができます。 RCSINIT はほとんどの RCS コマンドで参照 されます。特に -q, -V, -x, -z オプションを指定しておくと便利です 。 TMPDIR 一時ディレクトリ名を指定します。設定されていない場合は、環境変数 TMP と TEMP とを調べ、始めに見つかった値を用います; どれも設定さ れていない場合は、計算機依存のデフォルトのディレクトリ (たいてい は /tmp ) を使用します。 診断 各リビジョンに対して、 ci は RCS ファイル名、ワークファイル名、追加する リビジョン番号、直前のリビジョン番号を表示します。全ての処理が成功し た 場合のみ、終了ステータスが 0 になります。 作者 Author: Walter F. Tichy. Manual Page Revision: 1.6; Release Date: 1999/08/27. Copyright © 1982, 1988, 1989 Walter F. Tichy. Copyright © 1990, 1991, 1992, 1993, 1994, 1995 by Paul Eggert. 関連項目 co(1), ident(1), make(1), rcs(1), rcsclean(1), rcsdiff(1), rcsintro(1), rcsmerge(1), rlog(1), setuid(2), rcsfile(5) Walter F. Tichy, RCS--A System for Version Control, Software--Practice & Experience 15, 7 (July 1985), 637-654. GNU 1999/08/27 CI(1)
CI(1) CI(1) NAME ci - check in RCS revisions SYNOPSIS ci [options] file ... DESCRIPTION ci stores new revisions into RCS files. Each pathname matching an RCS suffix is taken to be an RCS file. All others are assumed to be work- ing files containing new revisions. ci 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 subdi- rectory and then in the working file’s directory. For more details, see FILE NAMING below. For ci 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 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 is not enforced for the owner of the file if non-strict locking is used (see rcs(1)). A lock held by someone else can be broken with the rcs command. Unless the -f option is given, ci checks whether the revision to be deposited differs from the preceding one. If not, instead of creating a new revision ci reverts to the preceding one. To revert, ordinary ci removes the working file and any lock; ci -l keeps and ci -u removes any lock, and then they both generate a new working file much as if co -l or co -u had been applied to the preceding revision. When reverting, any -n and -s options apply to the preceding revision. For each revision deposited, ci 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 . by itself. If several files are checked in ci asks whether to reuse the previous log message. If the standard input is not a terminal, ci suppresses the prompt and uses the same log message for all files. See also -m. If the RCS file does not 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 -t below). The number rev of the deposited revision can be given by any of the options -f, -i, -I, -j, -k, -l, -M, -q, -r, or -u. rev can be sym- bolic, numeric, or mixed. Symbolic names in rev must already be defined; see the -n and -N options for assigning names during checkin. If rev is $, ci determines the revision number from keyword values in the working file. If rev begins with a period, then the default branch (normally the trunk) is prepended to it. If rev is a branch number followed by a period, then the latest revision on that branch is used. If rev 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. If rev 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. If rev indicates a non-exist- ing branch, that branch is created with the initial revision numbered rev.1. If rev 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 revi- sion by incrementing the highest branch number at that revision. The default initial branch and level numbers are 1. If rev is omitted and the caller has no lock, but owns the file and locking is not set to strict, then the revision is appended to the default branch (normally the trunk; see the -b option of rcs(1)). Exception: On the trunk, revisions can be appended to the end, but not inserted. OPTIONS -rrev Check in revision rev. -r The bare -r option (without any revision) has an unusual meaning in ci. With other RCS commands, a bare -r option specifies the most recent revision on the default branch, but with ci, a bare -r option reestablishes the default behavior of releasing a lock and removing the working file, and is used to override any default -l or -u options established by shell aliases or scripts. -l[rev] works like -r, except it performs an additional co -l for the deposited revision. Thus, the deposited revision is immediately checked out again and locked. This is useful for saving a revi- sion although one wants to continue editing it after the checkin. -u[rev] works like -l, except that the deposited revision is not locked. This lets one read the working file immediately after checkin. The -l, bare -r, and -u options are mutually exclusive and silently override each other. For example, ci -u -r is equiva- lent to ci -r because bare -r overrides -u. -f[rev] forces a deposit; the new revision is deposited even it is not different from the preceding one. -k[rev] searches the working file for keyword values to determine its revision number, creation date, state, and author (see co(1)), and assigns these values to the deposited revision, rather than computing them locally. It also generates a default login mes- sage 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 can be overridden with the options -d, -m, -s, -w, and any option that carries a revision number. -q[rev] quiet mode; diagnostic output is not printed. A revision that is not different from the preceding one is not deposited, unless -f is given. -i[rev] initial checkin; report an error if the RCS file already exists. This avoids race conditions in certain applications. -j[rev] just checkin and do not initialize; report an error if the RCS file does not already exist. -I[rev] interactive mode; the user is prompted and questioned even if the standard input is not a terminal. -d[date] uses date for the checkin date and time. The date is specified in free format as explained in co(1). This is useful for lying about the checkin date, and for -k if no date is available. If date is empty, the working file’s time of last modification is used. -M[rev] Set the modification time on any new working file to be the date of the retrieved revision. For example, ci -d -M -u f does not alter f’s modification time, even if f’s contents change due to keyword substitution. Use this option with care; it can confuse make(1). -mmsg uses the string msg as the log message for all revisions checked in. By convention, log messages that start with # are comments and are ignored by programs like GNU Emacs’s vc package. Also, log messages that start with {clumpname} (followed by white space) are meant to be clumped together if possible, even if they are associated with different files; the {clumpname} label is used only for clumping, and is not considered to be part of the log message itself. -nname assigns the symbolic name name to the number of the checked-in revision. ci prints an error message if name is already assigned to another number. -Nname same as -n, except that it overrides a previous assignment of name. -sstate sets the state of the checked-in revision to the identifier state. The default state is Exp. -tfile writes descriptive text from the contents of the named file into the RCS file, deleting the existing text. The file cannot begin with -. -t-string Write descriptive text from the string into the RCS file, delet- ing the existing text. The -t option, in both its forms, has effect only during an ini- tial checkin; it is silently ignored otherwise. During the initial checkin, if -t is not given, ci obtains the text from standard input, terminated by end-of-file or by a line containing . by itself. 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. -T Set the RCS file’s modification time to the new revision’s time if the former precedes the latter and there is a new revision; preserve the RCS file’s modification time otherwise. If you have locked a revision, ci usually updates the RCS file’s modi- fication 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 recompi- lation caused by a make(1) 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(1) to think (incorrectly) that the other copy is newer than the RCS file. -wlogin uses login for the author field of the deposited revision. Use- ful for lying about the author, and for -k if no author is available. -V Print RCS’s version number. -Vn Emulate RCS version n. See co(1) for details. -xsuffixes specifies the suffixes for RCS files. A nonempty suffix matches any pathname ending in the suffix. An empty suffix matches any pathname of the form RCS/path or path1/RCS/path2. The -x option can specify a list of suffixes separated by /. For example, -x,v/ specifies two suffixes: ,v and the empty suffix. If two or more suffixes are specified, they are tried in order when looking for an RCS file; the first one that works is used for that file. If no RCS file is found but an RCS file can be cre- ated, the suffixes are tried in order to determine the new RCS file’s name. The default for suffixes is installation-depen- dent; normally it is ,v/ for hosts like Unix that permit commas in filenames, and is empty (i.e. just the empty suffix) for other hosts. -zzone specifies the date output format in keyword substitution, and specifies the default time zone for date in the -ddate option. The zone should be empty, a numeric UTC offset, or the special string LT for local time. The default is an empty zone, which uses the traditional RCS format of UTC without any time zone indication and with slashes separating the parts of the date; otherwise, times are output in ISO 8601 format with time zone indication. For example, if local time is January 11, 1990, 8pm Pacific Standard Time, eight hours west of UTC, then the time is output as follows: option time output -z 1990/01/12 04:00:00 (default) -zLT 1990-01-11 20:00:00-08 -z+05:30 1990-01-12 09:30:00+05:30 The -z option does not affect dates stored in RCS files, which are always UTC. FILE NAMING Pairs of RCS files and working files can be specified in three ways (see also the example section). 1) Both the RCS file and the working file are given. The RCS pathname is of the form path1/workfileX and the working pathname is of the form path2/workfile where path1/ and path2/ are (possibly different or empty) paths, workfile is a filename, and X is an RCS suffix. If X is empty, path1/ must start with RCS/ or must contain /RCS/. 2) Only the RCS file is given. Then the working file is created in the current directory and its name is derived from the name of the RCS file by removing path1/ and the suffix X. 3) Only the working file is given. Then ci considers each RCS suffix X in turn, looking for an RCS file of the form path2/RCS/workfileX or (if the former is not found and X is nonempty) path2/workfileX. If the RCS file is specified without a path in 1) and 2), ci looks for the RCS file first in the directory ./RCS and then in the current directory. ci reports an error if an attempt to open an RCS file fails for an unusual reason, even if the RCS file’s pathname is just one of several possibilities. For example, to suppress use of RCS commands in a directory d, create a regular file named d/RCS so that casual attempts to use RCS commands in d fail because d/RCS is not a directory. EXAMPLES Suppose ,v is an RCS suffix and the current directory contains a subdi- rectory RCS with an RCS file io.c,v. Then each of the following com- mands check in a copy of io.c into RCS/io.c,v as the latest revision, removing io.c. 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 RCS suffix and the current directory contains a subdirectory RCS with an RCS file io.c. The each of the following commands checks in a new revision. ci io.c; ci RCS/io.c; ci io.c RCS/io.c; ci RCS/io.c io.c; FILE MODES An RCS file created by ci inherits the read and execute permissions from the working file. If the RCS file exists already, ci preserves its read and execute permissions. ci always turns off all write per- missions of RCS files. FILES Temporary files are created in the directory containing the working file, and also in the temporary directory (see TMPDIR under ENVIRON- MENT). A semaphore file or files are created in the directory contain- ing the RCS 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 _. ci never changes an RCS or working file. Normally, ci unlinks the file and creates a new one; but instead of breaking a chain of one or more symbolic links to an RCS file, it unlinks the destination file instead. Therefore, ci breaks any hard or symbolic links to any working file it changes; and hard links to RCS files are ineffective, but symbolic links to RCS files are preserved. The effective user must be able to search and write the directory con- taining the RCS file. Normally, the real user must be able to read the RCS 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 unless your copies of ci and co have setuid privileges. As described in the next section, these privileges yield extra security if the effective user owns all RCS files and directories, and if only the effective user can write RCS directories. Users can control access to RCS files by setting the permissions of the directory containing the files; only users with write access to the directory can use RCS commands to change its RCS files. For example, in hosts that allow a user to belong to several groups, one can make a group’s RCS 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 RCS files, and can even remove them entirely. Hence more formal projects sometimes distinguish between an RCS administrator, who can change the RCS files at will, and other project members, who can check in new revisions but cannot otherwise change the RCS files. SETUID USE To prevent anybody but their RCS administrator from deleting revisions, a set of users can employ setuid privileges as follows. · Check that the host supports RCS setuid use. Consult a trustworthy expert if there are any doubts. It is best if the seteuid system call works as described in Posix 1003.1a Draft 5, because RCS can switch back and forth easily between real and effective users, even if the real user is root. If not, the second best is if the setuid system call supports saved setuid (the {_POSIX_SAVED_IDS} behavior of Posix 1003.1-1990); this fails only if the real or effective user is root. If RCS detects any failure in setuid, it quits immediately. · Choose a user A to serve as RCS administrator for the set of users. Only A can invoke the rcs command on the users’ RCS files. A should not be root or any other user with special powers. Mutually suspi- cious sets of users should use different administrators. · Choose a pathname B to be a directory of files to be executed by the users. · Have A set up B to contain copies of ci and co that are setuid to A by copying the commands from their standard installation directory D as follows: mkdir B cp D/c[io] B chmod go-w,u+s B/c[io] · Have each user prepend B to their path as follows: PATH=B:$PATH; export PATH # ordinary shell set path=(B $path) # C shell · Have A create each RCS directory R with write access only to A as follows: mkdir R chmod go-w R · If you want to let only certain users read the RCS files, put the users into a group G, and have A further protect the RCS directory as follows: chgrp G R chmod g-w,o-rwx R · Have A copy old RCS files (if any) into R, to ensure that A owns them. · An RCS file’s access list limits who can check in and lock revisions. The default access list is empty, which grants checkin access to any- one who can read the RCS file. If you want limit checkin access, have A invoke rcs -a on the file; see rcs(1). In particular, rcs -e -aA limits access to just A. · Have A initialize any new RCS files with rcs -i before initial checkin, adding the -a option if you want to limit checkin access. · Give setuid privileges only to ci, co, and rcsclean; do not give them to rcs or to any other command. · Do not use other setuid commands to invoke RCS commands; setuid is trickier than you think! ENVIRONMENT RCSINIT options prepended to the argument list, separated by spaces. A backslash escapes spaces within an option. The RCSINIT options are prepended to the argument lists of most RCS commands. Use- ful RCSINIT options include -q, -V, -x, and -z. TMPDIR Name of the temporary directory. If not set, the environment variables TMP and TEMP are inspected instead and the first value found is taken; if none of them are set, a host-dependent default is used, typically /tmp. DIAGNOSTICS For each revision, ci prints the RCS file, the working file, and the number of both the deposited and the preceding revision. The exit sta- tus is zero if and only if all operations were successful. IDENTIFICATION Author: Walter F. Tichy. Manual Page Revision: 5.17; Release Date: 1995/06/16. Copyright © 1982, 1988, 1989 Walter F. Tichy. Copyright © 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert. SEE ALSO co(1), emacs(1), ident(1), make(1), rcs(1), rcsclean(1), rcsdiff(1), rcsintro(1), rcsmerge(1), rlog(1), setuid(2), rcsfile(5) Walter F. Tichy, RCS--A System for Version Control, Software--Practice & Experience 15, 7 (July 1985), 637-654. GNU 1995/06/16 CI(1)
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa