xref: /openbsd-src/gnu/usr.bin/cvs/FAQ (revision e77048c1007676349fedef3cd7d0b6b93f74c675)
12286d8edStholoThis file contains a CVS FAQ.  Until 1995 it was maintained by David
22286d8edStholoGrubbs.  It was out of date and not being maintained, but it had a
32286d8edStholocertain following and in 1997 Pascal Molli decided to start
42286d8edStholomaintaining it with the FAQ-O-Matic package which allows any
52286d8edStholocontributor with a web browser to help maintain it.  The following
62286d8edStholotext is (mostly automatically) extracted from the FAQ-O-Matic.  The
72286d8edStholoodds are good that the file that you are currently reading is out of
82286d8edStholodate with respect to the online FAQ-O-Matic, which is part of Pascal
92286d8edStholoMolli's CVS web site at http://www.loria.fr/~molli/cvs-index.html
102286d8edStholo(currently under "Documentation").  The online version is also
112286d8edStholosomewhat better in terms of things like tables of contents (at least
122286d8edStholountil someone can write some code to extract data from a FAQ-O-Matic
132286d8edStholoand insert things like tables of contents).
142286d8edStholo
152286d8edStholoThe answers which are dated "6/13/1997" below are really from the 1995
162286d8edStholoFAQ, for the most part.  Many of them are out of date.  If you have
172286d8edStholosome time, you are encouraged to double-check them against other
182286d8edStholosources like the Cederqvist manual and update the FAQ.  If you don't
192286d8edStholohave such time, take them with a grain of salt or a few.
202286d8edStholo
21*e77048c1StholoSince Feb. 2000 CVS is being maintained by OpenAvenue, Inc. and many of
22*e77048c1Stholothe existing resources have been centeralized on http://www.cvshome.org.
23*e77048c1Stholo
242286d8edStholo  Category: /, all questions
252286d8edStholo
262286d8edStholo  Category: /
272286d8edStholo
282286d8edStholo          " [INLINE] "
292286d8edStholo
302286d8edStholo    1. About FAQ-O-Matic
312286d8edStholo
322286d8edStholoThis is FAQ-O-Matic, a quick-and-dirty Perl hack (aren't they all?) by
332286d8edStholoJon Howell.
342286d8edStholo
352286d8edStholoIt seems like most FAQ maintainers make a valiant initial effort, then get
362286d8edStholoa life and don't have time to keep their FAQs up to date. Also, I often
372286d8edStholofind out a solution to a problem, and feel like I could write a single
382286d8edStholoFAQ answer on it in a few minutes, but where to post it?
392286d8edStholo
402286d8edStholoThus the FAQ-O-Matic was born. FAQ-O-Matic is a couple sleazy Perl scripts
412286d8edStholothat allow people to submit FAQ answers to this database, so it can stay
422286d8edStholocurrent, with just a tiny bit of work on any one person's part.
432286d8edStholo
442286d8edStholoYes, a bad guy could come along and wipe out all the FAQ entries. Please don't.
452286d8edStholoBut to give the good guys some measure of comfort, each submission is stored
462286d8edStholoin an RCS file, so if someone does tamper, we can recover the database.
472286d8edStholo
482286d8edStholoGuidelines for submissions:
492286d8edStholo
502286d8edStholo1. Please _try to be fairly unbiased in matters of opinion._ Mailing lists are
512286d8edStholothe place to start flame wars (just kidding :v), but definitely not here.
522286d8edStholo
532286d8edStholo2. Please _use HTML only conservatively_ in your entries. Links are appropriate
542286d8edStholo,
552286d8edStholobut put the URL in the plaintext also so it's useable on printed versions of
562286d8edStholothe FAQ. Inline images pointing off this site are inappropriate, as is much
572286d8edStholofancy formatting. This is meant to be bandwidth-light and dumb-browser-friendly
582286d8edStholo.
592286d8edStholo
602286d8edStholo3. If you feel there's a place for a _new category, or a reorganization of
612286d8edStholoexisting questions_, don't hesitate to mail me (molli@loria.fr).
622286d8edStholoCategory changes need to be done from my end.
632286d8edStholo
642286d8edStholo4. Please _leave an email address_ at the bottom of your submission so that oth
652286d8edStholoers
662286d8edStholocan drop you a note.
672286d8edStholo
682286d8edStholo5. _If you only have a question_, not an answer, you should probably post
692286d8edStholoit to a mailing list, not here. If there are frequently asked questions to whic
702286d8edStholoh
712286d8edStholothe answer is not forthcoming on mailing lists (or perhaps there's no
722286d8edStholouseful answer yet other than "no one knows"), then it's appropriate to
732286d8edStholopost here, in hopes that someone will see it and know the answer.
742286d8edStholo
752286d8edStholo6. Please refrain from crude or inconsiderate language. Please don't use
762286d8edStholothis as a forum for advertising. However, mention of worthy commercial
772286d8edStholoproducts is certainly appropriate (even if you sell said product). Just
782286d8edStholodon't overdo it. :v)
792286d8edStholo
802286d8edStholo          Last modified: _6/13/1997_
812286d8edStholo
822286d8edStholo    2. Adding a new category ?
832286d8edStholo
842286d8edStholojust send me a mail at
852286d8edStholomolli@loria.fr
862286d8edStholo
872286d8edStholo          Last modified: _6/13/1997_
882286d8edStholo
892286d8edStholo  Category: /Advanced_Topics_/
902286d8edStholo
912286d8edStholo          " Advanced Topics "
922286d8edStholo
932286d8edStholo  Category: /Advanced_Topics_/Branching_and_Mergin/
942286d8edStholo
952286d8edStholo          " + Branching and Merging"
962286d8edStholo
972286d8edStholo    1. What is a branch?
982286d8edStholo
992286d8edStholo          Unfortunately, the word "branch" is an overloaded technical
1002286d8edStholo          term. It is used in too many different ways in three
1012286d8edStholo          categories. It might help to understand some of the issues by
1022286d8edStholo          going through the categories:
1032286d8edStholo
1042286d8edStholo     How Humans use the word "branch":
1052286d8edStholo
1062286d8edStholo          Most development starts with everyone working on the same
1072286d8edStholo          software, making changes and heading toward a single goal. This
1082286d8edStholo          is called something like "Main Line Development". Note that
1092286d8edStholo          though many people do main line development on CVS's "Main
1102286d8edStholo          Branch", that is a choice, not a requirement.
1112286d8edStholo
1122286d8edStholo          After a release or when one or more developers want to go off
1132286d8edStholo          and work on some project for a while, the Software Engineers
1142286d8edStholo          assigned to deal with large software issues generate a "Branch
1152286d8edStholo          in Development" to support the release or project. (Keep in
1162286d8edStholo          mind that a programmer is no more a Software Engineer than a
1172286d8edStholo          carpenter is a Civil Engineer.)
1182286d8edStholo
1192286d8edStholo          Essentially, the word "branch" implies a way to allow
1202286d8edStholo          simultaneous development on the same files by multiple people.
1212286d8edStholo
1222286d8edStholo          The above terms are human-oriented. They refer to actions that
1232286d8edStholo          people would like to take. They do *not* imply any particular
1242286d8edStholo          implementation or set of procedures. Branches in development
1252286d8edStholo          can be supported in many different ways.
1262286d8edStholo
1272286d8edStholo     How CVS uses the word "branch":
1282286d8edStholo
1292286d8edStholo          CVS uses the word "branch" in a number of ways. The two most
1302286d8edStholo          important are:
1312286d8edStholo
1322286d8edStholo          - The vendor branch holds releases from (normally) an outside
1332286d8edStholo          software vendor. It is implemented using a specific RCS branch
1342286d8edStholo          (i.e. 1.1.1).
1352286d8edStholo
1362286d8edStholo          - The "Main Branch", which normally holds your "Main Line
1372286d8edStholo          Development", but is defined as the collection of revisions you
1382286d8edStholo          get when you "checkout" something fresh, or when you use the
1392286d8edStholo          '-A' option to "update".
1402286d8edStholo
1412286d8edStholo          Important Note: The CVS "Main Branch" is *not* the same as the
1422286d8edStholo          RCS concept with the same name. If you are using Vendor
1432286d8edStholo          Branches, files you have never changed are on three branches at
1442286d8edStholo          the same time:
1452286d8edStholo
1462286d8edStholo          - The RCS 1.1.1 branch.
1472286d8edStholo          - The CVS Vendor branch.
1482286d8edStholo          - The CVS "Main Branch".
1492286d8edStholo
1502286d8edStholo          The concepts overlap, but they are not equivalent.
1512286d8edStholo
1522286d8edStholo          In referring to CVS, "branch" can be used in four other ways:
1532286d8edStholo
1542286d8edStholo          - A CVS working directory satisfies the definition of "branch"
1552286d8edStholo          for a single developer -- you are on a private "virtual branch"
1562286d8edStholo          that does not appear in any of the RCS files or the CVS control
1572286d8edStholo          files.
1582286d8edStholo
1592286d8edStholo          - The CVS "default branch" is the Repository source for the
1602286d8edStholo          collection of files in your working directory. It is *not* the
1612286d8edStholo          same as the RCS "default branch". Normally the CVS default
1622286d8edStholo          branch is the same as the CVS Main branch. If you use the "-r
1632286d8edStholo          <branch_tag>" option to the "checkout" command, you will record
1642286d8edStholo          a "sticky" tag that changes your default branch to the one you
1652286d8edStholo          checked out.
1662286d8edStholo
1672286d8edStholo          - A "magic" branch can be a branch that hasn't happened yet. It
1682286d8edStholo          is implemented by a special tag you can check out that is not
1692286d8edStholo          attached to a real RCS branch. When you commit a file to a
1702286d8edStholo          magic branch, the branch becomes real (i.e. a physical RCS
1712286d8edStholo          branch).
1722286d8edStholo
1732286d8edStholo          - And, of course, CVS uses "branch" to indicate a
1742286d8edStholo          human-oriented "branch in development".
1752286d8edStholo
1762286d8edStholo     How RCS uses the word "branch":
1772286d8edStholo
1782286d8edStholo          - The RCS "Main Branch" (Synonym: "The Trunk") contains a
1792286d8edStholo          series of two-part revision numbers separated by a single '.'
1802286d8edStholo          (e.g. 1.2). It is treated specially and is the initial default
1812286d8edStholo          branch. (The default default?)
1822286d8edStholo
1832286d8edStholo          - The RCS "Default" branch starts out attached to the RCS "Main
1842286d8edStholo          Branch". For RCS purposes, it can be changed to point to any
1852286d8edStholo          branch. Within CVS, you *must*not* alter the RCS default
1862286d8edStholo          branch. It is used to support the CVS idea of a "Main Branch"
1872286d8edStholo          and it must either point to the RCS Main Branch, or the Vendor
1882286d8edStholo          Branch (1.1.1) if you haven't made any changes to the file
1892286d8edStholo          since you executed "import".
1902286d8edStholo
1912286d8edStholo   Last modified: _6/13/1997_
1922286d8edStholo
1932286d8edStholo    2. Why (or when) would I want to create a branch?
1942286d8edStholo
1952286d8edStholo   Remember that you can think of your working directory as a "branch for
1962286d8edStholo   one". You can consider yourself to be on a branch all the time because
1972286d8edStholo   you can work without interfering with others until your project (big
1982286d8edStholo   or small) is done.
1992286d8edStholo
2002286d8edStholo   The four major situations when you should create a branch:
2012286d8edStholo
2022286d8edStholo     When you expect to take a long time or make a large set of changes
2032286d8edStholo   that the merging process will be difficult. Both "long" and "large"
2042286d8edStholo   are defined in your own environment.
2052286d8edStholo
2062286d8edStholo     When you want to be able to "commit" and "tag" your work repeatedly
2072286d8edStholo   without affecting others.
2082286d8edStholo
2092286d8edStholo   If you ever think you need Source Control for your own work, but don't
2102286d8edStholo   want your changes to affect others, create a private branch. (Put your
2112286d8edStholo   username in the branch tag, to make it obvious that it is private.)
2122286d8edStholo
2132286d8edStholo     When you need to share code among a group of developers, but not the
2142286d8edStholo   whole development organization working on the files.
2152286d8edStholo
2162286d8edStholo   Rather than trying to share a working directory, you can move onto a
2172286d8edStholo   branch and share your work with others by "committing" your work onto
2182286d8edStholo   the branch. Developers not working on the branch won't see your work
2192286d8edStholo   unless they switch to your branch or explicitly merge your branch into
2202286d8edStholo   theirs.
2212286d8edStholo
2222286d8edStholo     When you need to make minor changes to a released system.
2232286d8edStholo
2242286d8edStholo   Normally a "release" is labeled by a branch tag, allowing later work
2252286d8edStholo   on the released files. If the release is labeled by a non-branch tag,
2262286d8edStholo   it is easy to add a branch tag to a previously tagged module with the
2272286d8edStholo   "rtag" command. If the release is not tagged, you made a mistake.
2282286d8edStholo   Recovery requires identifying all revisions involved in the release
2292286d8edStholo   and adding a tag to them.
2302286d8edStholo
2312286d8edStholo   Last modified: _6/13/1997_
2322286d8edStholo
2332286d8edStholo    3. How do I create and checkout a branch?
2342286d8edStholo
2352286d8edStholo   Suggested technique:
2362286d8edStholo
2372286d8edStholo     Attach a non-branch tag to all the revisions you want to branch
2382286d8edStholo   from. (i.e. the branch point revisions)
2392286d8edStholo
2402286d8edStholo     When you decide you really need a branch, attach a branch tag to the
2412286d8edStholo   same revisions marked by the non-branch tag.
2422286d8edStholo
2432286d8edStholo     "Checkout" or "update" your working directory onto the branch.
2442286d8edStholo
2452286d8edStholo     Suggested procedure when using modules:
2462286d8edStholo
2472286d8edStholo     cvs rtag <branch_point_tag> module
2482286d8edStholo
2492286d8edStholo     cvs rtag -b -r <branch_point_tag> <branch_tag> <module>
2502286d8edStholo
2512286d8edStholo     cvs checkout -r <branch_tag> module
2522286d8edStholo
2532286d8edStholo     Suggested procedure when using your working directory, which
2542286d8edStholo   contains the revisions of your working files you want to branch from:
2552286d8edStholo
2562286d8edStholo     cvs tag <branch_point_tag>
2572286d8edStholo
2582286d8edStholo     cvs rtag -b -r <branch_point_tag> <branch_tag> <module>
2592286d8edStholo
2602286d8edStholo     cvs update -r <branch_tag>
2612286d8edStholo
2622286d8edStholo   In each procedure above, Step #1 applies a non-branch tag to all the
2632286d8edStholo   branch point revisions in the module/directory. Though this is not
2642286d8edStholo   strictly necessary, if you don't add a non-branch tag to the revisions
2652286d8edStholo   you branch from, you won't be able to refer to the branch point in the
2662286d8edStholo   future.
2672286d8edStholo
2682286d8edStholo   Between steps 1 & 2 you may commit changes. The result would be same
2692286d8edStholo   because "rtag -r <oldtag> <newtag>" applies <newtag> to the same
2702286d8edStholo   revision that <oldtag> is attached to. You can use this technique to
2712286d8edStholo   avoid attaching *any* branch tags until you need them.
2722286d8edStholo
2732286d8edStholo   Step B.2 has two corollaries:
2742286d8edStholo
2752286d8edStholo     If you plan to create the branch tag before committing anything in
2762286d8edStholo   your working directory, you can use "cvs tag -b <branch_tag>" instead
2772286d8edStholo   of the "rtag" command.
2782286d8edStholo
2792286d8edStholo     The <module> can be a relative path to a directory from which your
2802286d8edStholo   working directory was checked out.
2812286d8edStholo
2822286d8edStholo   If you have trouble figuring out what <module> to use (or pathname to
2832286d8edStholo   use in its place), you can aim it at whatever parent directories you
2842286d8edStholo   believe will cover all your work.
2852286d8edStholo
2862286d8edStholo   If you are sure the <branch_tag> is not being used anywhere else, you
2872286d8edStholo   can even aim it at the whole Repository ($CVSROOT), if you have to. It
2882286d8edStholo   might take some extra time, but assuming that your <tag> is a unique
2892286d8edStholo   string and you don't use the '-f' option to "rtag -r", "rtag" will
2902286d8edStholo   only add a <tag> to files in which it actually *finds* the earlier
2912286d8edStholo   <tag>.
2922286d8edStholo
2932286d8edStholo   In each procedure above, Step #3 may occur any time after step 2.
2942286d8edStholo   Unless you explicitly remove them with "tag -d", a <tag> is permanent.
2952286d8edStholo
2962286d8edStholo   The <branch_tag> is an unusual creature. It labels a branch in a way
2972286d8edStholo   that allows you to "checkout" the branch, to "commit" files to the end
2982286d8edStholo   of the branch and to refer to the end of the branch. It does not label
2992286d8edStholo   the base of the branch (the branch point).
3002286d8edStholo
3012286d8edStholo   There are two obvious ways to choose the <branch_point_tag> and
3022286d8edStholo   <branch_tag> names. But keep in mind that the <branch_tag> is typed by
3032286d8edStholo   any developer who wants to work on the branch -- you should make it
3042286d8edStholo   mean something to them.
3052286d8edStholo
3062286d8edStholo   Style #1 presumes that the simple version string refers to a set of
3072286d8edStholo   designed, documented or promised features, not to a specific set of
3082286d8edStholo   files. In this case, you tag the branch with the generic Version
3092286d8edStholo   string and assume that whenever you refer to "Version", you want the
3102286d8edStholo   "latest" set of files associated with that Version, including all
3112286d8edStholo   patches. (You can substitute whatever you like for "bp_", as long as
3122286d8edStholo   your <branch_point_tag> is some modification of the <branch_tag>.)
3132286d8edStholo
3142286d8edStholo                <branch_point_tag>      Matching <branch_tag>
3152286d8edStholo
3162286d8edStholo                bp_V1_3                 V1_3
3172286d8edStholo                bp_Release2-3-5         Release2-3-5
3182286d8edStholo                bp_Production4_5        Release4_5
3192286d8edStholo
3202286d8edStholo   Style #2 presumes that the simple version string refers to the
3212286d8edStholo   specific set of files used to construct the first release of
3222286d8edStholo   "version". In this case, you tag the branch-point revisions with the
3232286d8edStholo   generic Version string and assume that whenever you refer to this
3242286d8edStholo   Version, you want the original set of released revisions. To get the
3252286d8edStholo   latest patched revisions of the release, you refer to the branch tag
3262286d8edStholo   "latest_<branch_point_tag>". (You can substitute what ever you like
3272286d8edStholo   for "latest_", as long as your <branch_tag> is some modification of
3282286d8edStholo   the <branch_point_tag>.)
3292286d8edStholo
3302286d8edStholo                <branch_point_tag>      Matching <branch_tag>
3312286d8edStholo
3322286d8edStholo                V1_3                    latest_V1_3
3332286d8edStholo                Release2-3-5            latest_Release2-3-5
3342286d8edStholo                Release4_5              latest_Production4_5
3352286d8edStholo
3362286d8edStholo   In both styles you can find out what you had to change since the
3372286d8edStholo   original release of this Version by typing:
3382286d8edStholo
3392286d8edStholo            cvs diff -r <branch_point_tag> -r <branch_tag>
3402286d8edStholo
3412286d8edStholo   For Style 1, this is:
3422286d8edStholo
3432286d8edStholo            cvs diff -r bp_<branch_tag> -r <branch_tag>
3442286d8edStholo
3452286d8edStholo   For Style 2, this is:
3462286d8edStholo
3472286d8edStholo            cvs diff -r <branch_point_tag> -r latest_<branch_point_tag>
3482286d8edStholo
3492286d8edStholo   Notes on "being on a branch":
3502286d8edStholo
3512286d8edStholo   - "update -r <tag>" tells CVS to attach a "sticky tag" to working
3522286d8edStholo   directory (in ./CVS/Tag) and the checked-out files (on each line of
3532286d8edStholo   ./CVS/Entries).
3542286d8edStholo
3552286d8edStholo   - A "sticky" <tag> (including a <branch_tag>) causes most CVS commands
3562286d8edStholo   to act as if "-r <tag>" were on the command line.
3572286d8edStholo
3582286d8edStholo   - A "sticky" <branch_tag> indicates that the working directory (and
3592286d8edStholo   working files) are "on the branch".
3602286d8edStholo
3612286d8edStholo   Last modified: _6/13/1997_
3622286d8edStholo
3632286d8edStholo    4. Once created, how do I manage a branch?
3642286d8edStholo
3652286d8edStholo   The most important thing you should know about managing a branch is
3662286d8edStholo   that the creation of a branch is not a lightweight act. When you
3672286d8edStholo   create a branch, you must also create a set of procedures to keep
3682286d8edStholo   track of it.
3692286d8edStholo
3702286d8edStholo   Specifically, you must:
3712286d8edStholo
3722286d8edStholo   - Remember that the branch exists. (This is non-trivial if you create
3732286d8edStholo   a lot of them.)
3742286d8edStholo
3752286d8edStholo   - Plan when to merge it back into the main line of development.
3762286d8edStholo
3772286d8edStholo   - Schedule the order that multiple branch merges are to be done.
3782286d8edStholo
3792286d8edStholo   - If you ever intend to merge branches into each other, instead of
3802286d8edStholo   limiting merges of branch work back into the "main line", you must
3812286d8edStholo   keep careful track of which parts of which branches have merged into
3822286d8edStholo   which other branches.
3832286d8edStholo
3842286d8edStholo   The simplest way to deal with branches is to limit their number,
3852286d8edStholo   "collapse" them back into the main line as quickly as is reasonable
3862286d8edStholo   and forget them. If a group wants to continue working, tell them to
3872286d8edStholo   create another branch off the fully merged main line.
3882286d8edStholo
3892286d8edStholo   Remember that CVS is just a tool. Over time, it will probably handle
3902286d8edStholo   branching better, requiring less careful attendance. But no matter how
3912286d8edStholo   good it becomes, the whole idea of "branching" is a complicated
3922286d8edStholo   management problem. Don't take it lightly.
3932286d8edStholo
3942286d8edStholo   Last modified: _6/13/1997_
3952286d8edStholo
3962286d8edStholo    5. Are there any extra issues in managing multiple branches?
3972286d8edStholo
3982286d8edStholo   If you plan to split from the "main line" and merge back after a time,
3992286d8edStholo   the only problem will be scheduling the order of branch merges. As
4002286d8edStholo   each branch is merged, the main line must be rebuilt and tested.
4012286d8edStholo   Merging multiple branches (i.e. "lines of development") before
4022286d8edStholo   building and testing creates more problems than you are ready for.
4032286d8edStholo
4042286d8edStholo   If you plan to collapse some branches into others, then move the
4052286d8edStholo   combined branches back into the main line, you have to be careful with
4062286d8edStholo   the revisions and tags you hand to your "update -j" command, but it
4072286d8edStholo   shouldn't be much trouble.
4082286d8edStholo
4092286d8edStholo   If you plan to allow every branch to incrementally take the work done
4102286d8edStholo   on other branches, you are creating an almost insurmountable
4112286d8edStholo   bookkeeping problem. Every developer will say "Hey, I can handle
4122286d8edStholo   taking just this little bit," but for the system as a whole it is
4132286d8edStholo   disaster. Try it once and see. If you are forced into this situation,
4142286d8edStholo   you will need to keep track of the beginning and end points of every
4152286d8edStholo   merge ever done. Good Luck.
4162286d8edStholo
4172286d8edStholo   Last modified: _6/13/1997_
4182286d8edStholo
4192286d8edStholo    6. How do I merge a whole branch back into the trunk?
4202286d8edStholo
4212286d8edStholo   If you don't have a working directory, you can checkout and merge in
4222286d8edStholo   one command:
4232286d8edStholo
4242286d8edStholo                cvs checkout -j <branch_tag> <module>
4252286d8edStholo                cd <module>
4262286d8edStholo
4272286d8edStholo   If you already have a working directory:
4282286d8edStholo
4292286d8edStholo                cd <working_directory>
4302286d8edStholo                cvs update      <== Optional, to bring it up to date.
4312286d8edStholo                cvs update -j <branch_tag>
4322286d8edStholo
4332286d8edStholo   CVS will print lines beginning with
4342286d8edStholo
4352286d8edStholo   'U' for files that you hadn't changed, but the branch did.
4362286d8edStholo
4372286d8edStholo   'M' for files that you changed and the branch didn't
4382286d8edStholo                *and* for files that you both changed that were merged
4392286d8edStholo                without overlaps.  (This overload is unfortunate.)
4402286d8edStholo
4412286d8edStholo   'C' for files that you both changed in a way that conflicts
4422286d8edStholo                with each other.
4432286d8edStholo
4442286d8edStholo   You need to go edit all the 'C' files and clean up the conflicts. Then
4452286d8edStholo   you must commit them.
4462286d8edStholo
4472286d8edStholo   Last modified: _6/13/1997_
4482286d8edStholo
4492286d8edStholo    7. How do I merge changes from the trunk into my branch or between
4502286d8edStholo    branches?
4512286d8edStholo
4522286d8edStholo   The idea is similar to the above, but since CVS doesn't treat the main
4532286d8edStholo   branch like other branches, you'll have to be more careful. There are
4542286d8edStholo   5 different ways to look at the problem.
4552286d8edStholo
4562286d8edStholo     The way to merge *all* changes made on the trunk into a working
4572286d8edStholo   branch is to move to the branch you want via "checkout -r" or "update
4582286d8edStholo   -r":
4592286d8edStholo
4602286d8edStholo                cvs update -r <branch_tag> {optional files}
4612286d8edStholo
4622286d8edStholo   Then merge the changes from the trunk into your working branch using
4632286d8edStholo   the pseudo-tag named "HEAD":
4642286d8edStholo
4652286d8edStholo                cvs up -j HEAD {optional files}
4662286d8edStholo
4672286d8edStholo   You will get everything from the branch point of the branch named
4682286d8edStholo   <branch_tag> up to the HEAD of the main branch. This is still kind of
4692286d8edStholo   strange. If the file is on a branch, HEAD should be the latest thing
4702286d8edStholo   on the branch, not the HEAD of MAIN. But that's not the way CVS
4712286d8edStholo   (currently) works.
4722286d8edStholo
4732286d8edStholo   If you run "cvs up -j HEAD" again after adding more revisions to the
4742286d8edStholo   trunk, you may get overlaps for the text you have already merged. It
4752286d8edStholo   depends on your version of your RCS "merge" command (actually the "co
4762286d8edStholo   -j" option, which depends on the version of "diff3" you configured RCS
4772286d8edStholo   to use).
4782286d8edStholo
4792286d8edStholo     You can merge the difference between any two <tags> using two "-j"
4802286d8edStholo   options on "update" or "checkout".
4812286d8edStholo
4822286d8edStholo   Identify the two tags on the branch you want to merge from.
4832286d8edStholo
4842286d8edStholo                cvs update -j <tag1> -j <tag2> {optional files}
4852286d8edStholo
4862286d8edStholo   This step assumes you were careful about tagging milestones. You can
4872286d8edStholo   use this technique for any two <tags> on the same branch, even the
4882286d8edStholo   trunk. It is also possible to use tags on different branches, but
4892286d8edStholo   you'll have to ponder the meaning of the difference between those two
4902286d8edStholo   tags.
4912286d8edStholo
4922286d8edStholo   In place of one of the <tags>, you can use a <branch_tag> to refer to
4932286d8edStholo   the latest revision on that branch. See 4C.11 and 4C.3 for info on
4942286d8edStholo   branch points.
4952286d8edStholo
4962286d8edStholo   Merges can also be performed by handing RCS revisions to the '-j'
4972286d8edStholo   options, but since revision numbers aren't the same in all files,
4982286d8edStholo   merging by number is normally limited to one file. Sets of files with
4992286d8edStholo   the exact same trees of branches and revision numbers would work too,
5002286d8edStholo   but that's a rare situation.
5012286d8edStholo
5022286d8edStholo     To "take" revisions from other branches instead of merging them, see
5032286d8edStholo   4C.19 for an idea.
5042286d8edStholo
5052286d8edStholo     A way to gain the effect of merging the main to the branch is to
5062286d8edStholo   merge the branch into the main using the normal
5072286d8edStholo
5082286d8edStholo                cvs update -A {optional files}
5092286d8edStholo                cvs update -j <branch_tag> {optional files}
5102286d8edStholo                cvs commit
5112286d8edStholo                cvs tag -F  -b <same_branch_tag> {optional files}
5122286d8edStholo
5132286d8edStholo   See part B of 4D.5
5142286d8edStholo
5152286d8edStholo     Other oddities.
5162286d8edStholo
5172286d8edStholo   This also works, but is probably not officially supported:
5182286d8edStholo
5192286d8edStholo                   cvs update -j N {optional files}
5202286d8edStholo
5212286d8edStholo   where N is a number. This will merge all the changes from the branch
5222286d8edStholo   point up to the highest revision on the main branch starting with N.
5232286d8edStholo   For example, if your highest trunk revision is 1.52, you can use this
5242286d8edStholo   to grab revisions from the trunk:
5252286d8edStholo
5262286d8edStholo                   cvs update -j 1 {optional files}
5272286d8edStholo
5282286d8edStholo   Another example: Say you have a branch point at rev 1.2 for a branch
5292286d8edStholo   named "BR1" and trunk revisions 1.3, 1.4, 2.1, 2.2, 2.3, 3.1, 3.2.
5302286d8edStholo   Then:
5312286d8edStholo
5322286d8edStholo                   cvs update -j 1 {optional files}
5332286d8edStholo
5342286d8edStholo   will merge the changes from 1.2 to 1.4
5352286d8edStholo
5362286d8edStholo                   cvs update -j 2 {optional files}
5372286d8edStholo
5382286d8edStholo   will merge the changes from 1.2 to 2.3
5392286d8edStholo
5402286d8edStholo                   cvs update -j 3 {optional files}
5412286d8edStholo
5422286d8edStholo   will merge the changes from 1.2 to 3.2, which in this example, is
5432286d8edStholo   equivalent to the use of "-j HEAD" in part A above.
5442286d8edStholo
5452286d8edStholo   The intuitive (at least to me):
5462286d8edStholo
5472286d8edStholo                   cvs up -j MAIN (or TRUNK) {optional files}
5482286d8edStholo
5492286d8edStholo   doesn't work. If the trunk (i.e. "main branch") had an implicit branch
5502286d8edStholo   named "MAIN", you could use:
5512286d8edStholo
5522286d8edStholo                   cvs up -j MAIN:10/26 -j MAIN:now {optional files}
5532286d8edStholo
5542286d8edStholo   and refer to date-stamped revisions on the trunk using the
5552286d8edStholo   <branch_tag>:<date> support that works on other branches.
5562286d8edStholo
5572286d8edStholo   You might also think you could place an explicit tag on branch 1 (or
5582286d8edStholo   higher) (e.g. MAINHACK:1) and use it in place of the implicit "MAIN",
5592286d8edStholo   but I haven't found the right combination.
5602286d8edStholo
5612286d8edStholo   [[If you find working techniques, I'll add them here.]]
5622286d8edStholo
5632286d8edStholo   Last modified: _6/13/1997_
5642286d8edStholo
5652286d8edStholo    8. How do I merge onto the Main Branch a file that exists only on a branch
5662286d8edStholo    other than the Main Branch? (i.e. it is in the Attic)
5672286d8edStholo
5682286d8edStholo   For how such a file can exist, see 3A.2 and 3A.3.
5692286d8edStholo
5702286d8edStholo   For how to avoid creating such a file, see 3A.5.
5712286d8edStholo
5722286d8edStholo   Though you might think that the "update -j" command could perform the
5732286d8edStholo   "merge" of a file from the side branch to the Main Branch, it isn't
5742286d8edStholo   (yet) smart enough. Unfortunately, there is no single CVS command to
5752286d8edStholo   do this -- it takes three steps:
5762286d8edStholo
5772286d8edStholo     To move something onto the Main Branch from the Attic, you have to
5782286d8edStholo   physically move the file from the Attic to the main Repository
5792286d8edStholo   directory associated with your working directory.
5802286d8edStholo
5812286d8edStholo   It is exactly like resurrecting a removed file. See 3L.4
5822286d8edStholo
5832286d8edStholo   I use something like this: (csh-like syntax)
5842286d8edStholo
5852286d8edStholo   set repos = `cat ./CVS/Repository` mv $repos/Attic/filename,v
5862286d8edStholo   $repos/filename,v
5872286d8edStholo
5882286d8edStholo   (If you use relative paths in your Repository files, that first line
5892286d8edStholo   becomes: set repos = $CVSROOT/`cat ./CVS/Repository`)
5902286d8edStholo
5912286d8edStholo     Now that the file is physically in the right place within the
5922286d8edStholo   Repository, "update -A" will make it appear in your working directory
5932286d8edStholo   on the Main Branch. Do that now.
5942286d8edStholo
5952286d8edStholo     You now have a choice. The act of physically moving the file has
5962286d8edStholo   fused together the <branch_tag> branch and the Main Branch for this
5972286d8edStholo   file. You can continue that way, making changes along the RCS Main
5982286d8edStholo   Branch which CVS will (for this type of file only) treat as both the
5992286d8edStholo   Main Branch and the <branch_tag> branch.
6002286d8edStholo
6012286d8edStholo   The other choice, which I would suggest, is to re-tag the file with
6022286d8edStholo   <branch_tag>, restoring a normal-looking magic branch tag to the file:
6032286d8edStholo
6042286d8edStholo                cvs tag -F -b <branch_tag> <file>
6052286d8edStholo
6062286d8edStholo   After you have done the above, you can run "update -A" or "update -r
6072286d8edStholo   <branch_tag>" to resume whatever you were doing before you started
6082286d8edStholo   this procedure.
6092286d8edStholo
6102286d8edStholo   Caveat: The final result is a file whose revision tree doesn't look
6112286d8edStholo   like it was ever on any branch but the Main Branch until the above
6122286d8edStholo   "tag -F -b" command was executed. CVS and RCS have no way of saving
6132286d8edStholo   the history of the actions you have just performed.
6142286d8edStholo
6152286d8edStholo   Last modified: _6/13/1997_
6162286d8edStholo
6172286d8edStholo    9. How do I know what branch I'm (working) on?
6182286d8edStholo
6192286d8edStholo   Type:
6202286d8edStholo                cvs status
6212286d8edStholo
6222286d8edStholo   and look at the "Sticky Tag" field for each file. If:
6232286d8edStholo
6242286d8edStholo     The *same* tag is on *every* file in your working tree, *and*
6252286d8edStholo
6262286d8edStholo     That tag matches the contents of the ./CVS/Tag file, *and*
6272286d8edStholo
6282286d8edStholo     That tag is a branch tag,
6292286d8edStholo
6302286d8edStholo   then you know what branch you are working on. You can get sticky Tag
6312286d8edStholo   information directly from the ./CVS/Entries file instead of "cvs
6322286d8edStholo   status".
6332286d8edStholo
6342286d8edStholo   If all the sticky Tags don't agree, then your directory is temporarily
6352286d8edStholo   inconsistent. This is a feature allowing you to make changes (or
6362286d8edStholo   perform merges) to individual files on multiple branches without
6372286d8edStholo   checking out the whole directory.
6382286d8edStholo
6392286d8edStholo   The sticky Tag on each file in the ./CVS/Entries file (as displayed by
6402286d8edStholo   the "status" command) indicates what branch the working file is on.
6412286d8edStholo   New files are added to the Tag stored in ./CVS/Tag.
6422286d8edStholo
6432286d8edStholo   To force your entire working directory onto the same branch, type:
6442286d8edStholo
6452286d8edStholo                cvs update -r <branch_tag>
6462286d8edStholo
6472286d8edStholo   Last modified: _6/13/1997_
6482286d8edStholo
6492286d8edStholo    10. Do I really have to know the name of the branch I'm working on?
6502286d8edStholo
6512286d8edStholo   If a developer can't be relied on to know what branch of development
6522286d8edStholo   to work on, then either the developer's manager isn't planning
6532286d8edStholo   branches properly or the developer has serious problems.
6542286d8edStholo
6552286d8edStholo   I have found that one of the hardest concepts to get across to
6562286d8edStholo   developers (and some managers) is that "a branch in development" (as
6572286d8edStholo   opposed to the use of RCS branches to support some other scheme) is a
6582286d8edStholo   heavyweight act. Every time you create a real branch in development,
6592286d8edStholo   you must spawn a set of managerial procedures and a schedule by which
6602286d8edStholo   you plan to merge each branch into each other branch. Unless you plan
6612286d8edStholo   to keep it simple and collapse (by merging and forgetting) branches
6622286d8edStholo   quickly, they are not to be created lightly.
6632286d8edStholo
6642286d8edStholo   In other words, if you don't regularly attend group meetings in which
6652286d8edStholo   the branch to be worked on is a major topic of discussion, then the
6662286d8edStholo   group is not managing branches properly.
6672286d8edStholo
6682286d8edStholo   We created a couple major branches a few months ago and even the
6692286d8edStholo   customer service people refer to the "XYZ branch" as a shorthand for
6702286d8edStholo   "continuing development on the XYZ project".
6712286d8edStholo
6722286d8edStholo   Last modified: _6/13/1997_
6732286d8edStholo
6742286d8edStholo    11. How do I refer to the revision where I branched so I can see what
6752286d8edStholo    changed since the Branch Point on another branch?
6762286d8edStholo
6772286d8edStholo   Given the current <branch_tag> format, there is no direct way to refer
6782286d8edStholo   to the branch point, which is more useful in many ways than referring
6792286d8edStholo   to the branch, which always refers to the latest revision on the
6802286d8edStholo   branch.
6812286d8edStholo
6822286d8edStholo   When CVS adds a branch tag, it attaches an RCS symbol to a
6832286d8edStholo   non-existent revision number containing the revision number of the
6842286d8edStholo   branch point as a prefix. (See Section 3O, on the "tag" command.) RCS
6852286d8edStholo   can't use the CVS magic branch tag and many of the CVS commands can't
6862286d8edStholo   refer to it.
6872286d8edStholo
6882286d8edStholo   To be certain of your ability to refer to a branch point, you must
6892286d8edStholo   create a "branch point" tag at the same time as the Branch tag. See
6902286d8edStholo   4C.3.
6912286d8edStholo
6922286d8edStholo   Last modified: _6/13/1997_
6932286d8edStholo
6942286d8edStholo    12. Why didn't the command "cvs admin -bBRANCH1 *" create a branch?
6952286d8edStholo
6962286d8edStholo   Because your command creates an RCS branch, not a CVS branch. See the
6972286d8edStholo   above discussion on branches. RCS branches are used to support CVS
6982286d8edStholo   branches, but they are not the same. You can't act as if you have
6992286d8edStholo   direct control over the RCS files.
7002286d8edStholo
7012286d8edStholo   The "admin" command was placed there as a convenience to allow you to
7022286d8edStholo   execute raw "rcs" commands on the Repository, taking advantage of
7032286d8edStholo   CVS's ability to find the files in the Repository.
7042286d8edStholo
7052286d8edStholo   But you have to remember that you are using RCS commands on a CVS
7062286d8edStholo   Repository, which is not generally safe unless you know exactly what
7072286d8edStholo   CVS depends on.
7082286d8edStholo
7092286d8edStholo   For one thing, CVS insists on control of the default branch. It is set
7102286d8edStholo   either to the Main branch or the Vendor branch depending on whether
7112286d8edStholo   you have changed the Vendor's code. If you change the default branch,
7122286d8edStholo   you are monkeying with the internals and you will get unexpected
7132286d8edStholo   results.
7142286d8edStholo
7152286d8edStholo   To set your "default CVS branch" to BRANCH1, you must use "checkout"
7162286d8edStholo   or "update" with the "-r BRANCH1" option. Then you have changed CVS's
7172286d8edStholo   idea of your "default branch", which has little to do with RCS's
7182286d8edStholo   default branch.
7192286d8edStholo
7202286d8edStholo   Last modified: _6/13/1997_
7212286d8edStholo
7222286d8edStholo    13. Is it possible to set the "default CVS branch" for everyone?
7232286d8edStholo
7242286d8edStholo   No. It doesn't work that way.
7252286d8edStholo
7262286d8edStholo   When using CVS, all administrative information (such as what branch
7272286d8edStholo   you checked out) is stored in CVS sub-directories, local to the user.
7282286d8edStholo   There is no global state, other than the description and logging files
7292286d8edStholo   in the $CVSROOT/CVSROOT directory.
7302286d8edStholo
7312286d8edStholo   You tell "checkout" or "update" what branch you want to check out via
7322286d8edStholo   the "-r <tag>" option. The default is CVS's "Main Branch".
7332286d8edStholo
7342286d8edStholo   I don't see a problem in *designing* a new way to indicate what branch
7352286d8edStholo   you get by default, instead of the main one, but that's not how it
7362286d8edStholo   currently works.
7372286d8edStholo
7382286d8edStholo   Last modified: _6/13/1997_
7392286d8edStholo
7402286d8edStholo    14. How do I perform a large merge?
7412286d8edStholo
7422286d8edStholo   Large merges require a bit more planning to be able to track what has
7432286d8edStholo   happened in the inevitable cases where something goes wrong. No tool
7442286d8edStholo   can force a "merge" to make perfect sense.
7452286d8edStholo
7462286d8edStholo   Though you can handle the details in many different ways, the two ends
7472286d8edStholo   of the spectrum of merge techniques are: gonzo and paranoid.
7482286d8edStholo
7492286d8edStholo     The gonzo method assumes that you know everything about your sources
7502286d8edStholo   so that recovery from failures is "just a matter of typing." You
7512286d8edStholo   created the branch this way:
7522286d8edStholo
7532286d8edStholo                cvs checkout <module>
7542286d8edStholo                cd <module>
7552286d8edStholo                cvs tag -b <branch_tag>
7562286d8edStholo                cvs update -r <branch_tag>
7572286d8edStholo                >>> Edit away.
7582286d8edStholo                cvs commit              <<== Onto branch
7592286d8edStholo
7602286d8edStholo   Now you want to merge your branch back into the Main branch, you are
7612286d8edStholo   certain you can make it work, or at least detect all the failures, so
7622286d8edStholo   you dive in and hack away: (For simplicity, we will assume you are
7632286d8edStholo   collapsing (i.e. merging and forgetting) a side-branch into the Main
7642286d8edStholo   branch from your single working directory.)
7652286d8edStholo
7662286d8edStholo                cvs update -A
7672286d8edStholo                cvs update -j <branch_tag>
7682286d8edStholo                >>> Edit the 'C' files and remove the overlaps.
7692286d8edStholo                >>> Edit some more to make it all compile and work.
7702286d8edStholo                cvs commit
7712286d8edStholo
7722286d8edStholo   Looks simple. For more details on the output from the "update -j"
7732286d8edStholo   command, see 3P.2 and 4C.6.
7742286d8edStholo
7752286d8edStholo   Note: You could also checkout a whole new working directory and
7762286d8edStholo                 perform the merge at the same time by replacing the two
7772286d8edStholo                 update commands with these two commands:
7782286d8edStholo
7792286d8edStholo                        cvs checkout -j <branch_tag> <module>
7802286d8edStholo                        cd <module>
7812286d8edStholo
7822286d8edStholo     The paranoid way is more difficult, but it can catch all sorts of
7832286d8edStholo   problems. You created the branch this way:
7842286d8edStholo
7852286d8edStholo                cvs checkout <module>
7862286d8edStholo                cd <module>
7872286d8edStholo                cvs tag <branch_point_tag>
7882286d8edStholo                cvs tag -b <branch_tag>
7892286d8edStholo                cvs update -r <branch_tag>
7902286d8edStholo                >>> Edit away.
7912286d8edStholo                cvs commit              <<== Onto branch
7922286d8edStholo
7932286d8edStholo   The extra tag command places a non-branch tag on the Branch Point, an
7942286d8edStholo   act that makes it easier to do "diffs" later. Now we decide to perform
7952286d8edStholo   the merge:
7962286d8edStholo
7972286d8edStholo                cvs tag <latest_on_branch_tag>
7982286d8edStholo                cvs update -A
7992286d8edStholo           *1*  cvs diff -r <branch_point_tag> -r <latest_on_branch_tag>
8002286d8edStholo                >>> *1* shows all the changes on the branch.
8012286d8edStholo           *2*  cvs diff -r <branch_point_tag> -r HEAD
8022286d8edStholo                >>> *2* shows the changes on the trunk since branching.
8032286d8edStholo                cvs tag <premerge_tag>
8042286d8edStholo                cvs update -j <branch_tag>
8052286d8edStholo                >>> Edit the 'C' files and remove the overlaps.
8062286d8edStholo           *3*  cvs diff
8072286d8edStholo                >>> Verify that *3* matches *1*, except for line numbers.
8082286d8edStholo                cvs commit
8092286d8edStholo                cvs tag <just_merge_changes_tag>
8102286d8edStholo                >>> Edit some more to make it all compile and work.
8112286d8edStholo                cvs commit
8122286d8edStholo                cvs tag <after_merge_cleanup_tag>
8132286d8edStholo
8142286d8edStholo   The reason *3* and *1* match so closely is that they are the
8152286d8edStholo   differences between two pairs of starting points and ending points
8162286d8edStholo   after the same data was inserted. If they are significantly different,
8172286d8edStholo   you will want to figure out why.
8182286d8edStholo
8192286d8edStholo   NOTE: You will have to tell everyone to stay the hell out of the
8202286d8edStholo   Repository while you do this. If they commit something while you are
8212286d8edStholo   in the middle of a merge, your job will be much more difficult. If
8222286d8edStholo   they "update" at the wrong time, their work will be randomized until
8232286d8edStholo   you finish. It's better to call a halt.
8242286d8edStholo
8252286d8edStholo   See 3H.13 for some more information about dealing with merges after
8262286d8edStholo   import. The last part of the procedure is applicable to any large
8272286d8edStholo   merge.
8282286d8edStholo
8292286d8edStholo   Last modified: _6/13/1997_
8302286d8edStholo
8312286d8edStholo    15. Is a Vendor merge any different from a branch merge?
8322286d8edStholo
8332286d8edStholo   No. In most ways, a Vendor branch is exactly the same as any other
8342286d8edStholo   branch. In a Vendor merge, the data is append to the branch by the
8352286d8edStholo   "import" command, rather than by hand-editing, but the merge process
8362286d8edStholo   is the same.
8372286d8edStholo
8382286d8edStholo   See the "import" command in section 3H.
8392286d8edStholo
8402286d8edStholo   Last modified: _6/13/1997_
8412286d8edStholo
8422286d8edStholo    16. How do I go back to a previous version of the code on a branch?
8432286d8edStholo
8442286d8edStholo
8452286d8edStholo
8462286d8edStholo
8472286d8edStholo        You can avoid digging into RCS revision numbers (executing "update
8482286d8edStholo        -r (rev)" on each file) by trying one of these:
8492286d8edStholo
8502286d8edStholoUse non-branch tags as you normally would.  Non-branch tags
8512286d8edStholo           attach to specific revisions, so a "tag (tag)" command would
8522286d8edStholo           mark the revisions you have in your working directory, which
8532286d8edStholo           are on your branch.  If you need to retrieve them, use "update
8542286d8edStholo           -r (non-branch-tag)"
8552286d8edStholo
8562286d8edStholo           Doing this overrides the sticky (branch-tag) attached to your
8572286d8edStholo           working directory with a non-branch tag, which means you won't
8582286d8edStholo           be able to commit until you again move forward to the end of
8592286d8edStholo           the branch with "update -r (branch-tag)".
8602286d8edStholo
8612286d8edStholoUse the "update -r (branch-tag):(date)" trick.
8622286d8edStholo
8632286d8edStholo           This is almost like using the '-D' option, but it looks for
8642286d8edStholo           revisions extant on (date) only along the given branch.
8652286d8edStholo
8662286d8edStholo           As in #1, you can't commit to this kind of working area,
8672286d8edStholo           because it has a sticky date referring to revisions in the
8682286d8edStholo           middle of a branch.
8692286d8edStholo
8702286d8edStholo[comment from the audience:  You are dreaming..
8712286d8edStholothis does not work.. try it, you get
8722286d8edStholoNo such tag: "MYTAG:May 1"
8732286d8edStholoor similar. I wish it did because I need it. julian@whistle.com]
8742286d8edStholo
8752286d8edStholo
8762286d8edStholoYou can branch a branch.
8772286d8edStholo
8782286d8edStholo           If you add a branch tag to file in a working directory that was
8792286d8edStholo           checked out on a branch, you will branch the branch.  This
8802286d8edStholo           works just fine, though you'll have to play some games to merge
8812286d8edStholo           everything back together again.  You'll also create 6-part
8822286d8edStholo           revision numbers.  (They'll be 8-part revision numbers if you
8832286d8edStholo           branch a branch that started out with some unmodified files on
8842286d8edStholo           the Vendor branch.  Think about it.  How does revision
8852286d8edStholo           1.2.4.2.4.2.2.1 grab you?)
8862286d8edStholo
8872286d8edStholo
8882286d8edStholo(fixed formatting, kingdon@cyclic.com)
8892286d8edStholo
8902286d8edStholo   Last modified: _9/8/1997_
8912286d8edStholo
8922286d8edStholo    17. Once I've found the files I want, how do I start changing them? I keep
8932286d8edStholo    getting warnings about sticky tags.
8942286d8edStholo
8952286d8edStholo   What you probably did was type "cvs update -r <tag>" where <tag> is a
8962286d8edStholo   non-branch tag. "update" created a sticky tag for a specific revision,
8972286d8edStholo   not a branch. To start working right there, you have to create a
8982286d8edStholo   branch to work on.
8992286d8edStholo
9002286d8edStholo   You have two choices.
9012286d8edStholo
9022286d8edStholo     You can do it in place and keep working:
9032286d8edStholo
9042286d8edStholo           cvs tag -b <branch_tag>      <<== To tag the current files.
9052286d8edStholo           cvs update -r <branch_tab>   <<== To move onto the branch.
9062286d8edStholo
9072286d8edStholo     You can do it "externally" and create a new working directory:
9082286d8edStholo
9092286d8edStholo           cvs rtag -b -r <tag> <branch_tag> <module>
9102286d8edStholo           cvs checkout -r <branch_tag> <module>
9112286d8edStholo
9122286d8edStholo   <module> can be a relative path within the Repository.
9132286d8edStholo
9142286d8edStholo   <tag> in the above is the non-branch tag you placed earlier
9152286d8edStholo                 that caused the error in your question.  Be warned that
9162286d8edStholo                 if <tag> is not set on all the files (or all the right
9172286d8edStholo                 revisions) you won't get exactly what you wanted.
9182286d8edStholo
9192286d8edStholo   Last modified: _6/13/1997_
9202286d8edStholo
9212286d8edStholo    18. Why do I get the latest files on the branch when I tried to "update -r
9222286d8edStholo    <tag>"?
9232286d8edStholo
9242286d8edStholo   If "update -r <tag>" always retrieves the latest files on a branch,
9252286d8edStholo   then <tag> is really a <branch_tag>. A branch tag is supposed to be
9262286d8edStholo   used to grab a branch to work on. Since you can't modify a file in the
9272286d8edStholo   middle of a branch, checking out a <branch_tag> will give you the
9282286d8edStholo   latest revision on the branch.
9292286d8edStholo
9302286d8edStholo   If you want to "checkout" a specific collection of revisions, you must
9312286d8edStholo   use a "non-branch" tag. See the first part of 4C.16.
9322286d8edStholo
9332286d8edStholo   Last modified: _6/13/1997_
9342286d8edStholo
9352286d8edStholo    19. How can I avoid a merge? I just want to move the latest revision on my
9362286d8edStholo    working branch directly onto the trunk.
9372286d8edStholo
9382286d8edStholo   There is no direct way to do this using CVS, though the technique is
9392286d8edStholo   not difficult using shell commands. Here's one way:
9402286d8edStholo
9412286d8edStholo     Move your working directory to the Main Branch.
9422286d8edStholo
9432286d8edStholo                cvs update -A
9442286d8edStholo
9452286d8edStholo     Use "update -p" to grab the latest revision on the branch and write
9462286d8edStholo   it over your working files. Make sure you don't have an modified files
9472286d8edStholo   -- you will lose them. The following is in "csh" syntax. Change the
9482286d8edStholo   wildcard to grab the files you want
9492286d8edStholo
9502286d8edStholo   foreach i (Makefile *.cc *.hh)
9512286d8edStholo                    cvs update -p -r <branch_tag> $i > $i
9522286d8edStholo                end
9532286d8edStholo
9542286d8edStholo     Commit all the working files onto the Main Branch.
9552286d8edStholo
9562286d8edStholo                cvs commit -m 'Moved branch <branch_tag> onto MAIN'
9572286d8edStholo
9582286d8edStholo   You should experiment with the above before blasting everything.
9592286d8edStholo
9602286d8edStholo   Last modified: _6/13/1997_
9612286d8edStholo
9622286d8edStholo    20. How to I avoid merge collisions in the RCS $\Log$ data?
9632286d8edStholo
9642286d8edStholo   In short, you can't. The RCS $\Log$ keyword is handled differently
9652286d8edStholo   from all other RCS keywords.
9662286d8edStholo
9672286d8edStholo   On the info-cvs mailing list, there is a periodic discussion that goes
9682286d8edStholo   something like this:
9692286d8edStholo
9702286d8edStholo   Question: How do I deal with $\Log$? Answer1: You can't do much with
9712286d8edStholo   it. Here's how it works. . . Answer2: I've found a limited way to use
9722286d8edStholo   it. . . Answer3: Get rid of it. $\Log$ is an abomination.
9732286d8edStholo
9742286d8edStholo   I tend to lean toward answer #3. There are only two sets of people who
9752286d8edStholo   would ever have access to logs stored within sources files, developers
9762286d8edStholo   and source customers.
9772286d8edStholo
9782286d8edStholo   For developers:
9792286d8edStholo
9802286d8edStholo     Log entries within sources files are notoriously incomplete, rushed,
9812286d8edStholo   poorly phrased and in many cases incorrect, making them useless for
9822286d8edStholo   debugging or file maintenance. I remember a maxim from "Software
9832286d8edStholo   Tools" (I believe): "Read the code, not the comments." No managerial
9842286d8edStholo   order or plan for programmer discipline will affect this in the real
9852286d8edStholo   world.
9862286d8edStholo
9872286d8edStholo     Log entries are usually in an unreadable mixture of styles. Many log
9882286d8edStholo   entries are just plain meaningless. Some are foolish. Some are even
9892286d8edStholo   insulting. Examples:
9902286d8edStholo
9912286d8edStholo   "Corrected spelling of misspelling." "Bug fix." "Reversed stupid
9922286d8edStholo   change in previous revisions." "If Joe could do his job, this would
9932286d8edStholo   already have worked."
9942286d8edStholo
9952286d8edStholo     Log entries are not managed well by the tools. Any merge can cause
9962286d8edStholo   conflicts in the $\Log$ data. Branch merges produce incomplete logs.
9972286d8edStholo   They can be edited into chaos and they are not regenerated. They waste
9982286d8edStholo   space duplicating information available to the developer with a single
9992286d8edStholo   command.
10002286d8edStholo
10012286d8edStholo     Even if correct when originally entered, as changes are made to the
10022286d8edStholo   file, log entries become false over time. Humans are not good at
10032286d8edStholo   reading down through a list and remembering only the last change
10042286d8edStholo   affecting something. Over time *most* of the log is wrong.
10052286d8edStholo
10062286d8edStholo     Even if still correct, the log data is almost useless to developers
10072286d8edStholo   without the code diffs. If you can get code diffs, you can display the
10082286d8edStholo   log.
10092286d8edStholo
10102286d8edStholo   For source customers the problem is even worse. The last thing you
10112286d8edStholo   want to show customers is a hodge-podge of tiny comments about large
10122286d8edStholo   changes followed by a series of emergency fixes before delivery. If
10132286d8edStholo   you distribute sources, then you should provide documentation, or
10142286d8edStholo   changelogs reviewed by people who won't let comments like "Fixed for
10152286d8edStholo   stupid customer." out the door.
10162286d8edStholo
10172286d8edStholo   Conclusion: Though some people would prefer to see in this FAQ
10182286d8edStholo   techniques for making the $\Log$ entries the best they can be, I
10192286d8edStholo   believe them to be a lost cause. My suggestion is to hunt down, root
10202286d8edStholo   out and destroy all occurrences of $\Log$ and the unusable data
10212286d8edStholo   attached to it wherever you may find it.
10222286d8edStholo
10232286d8edStholo   Last modified: _6/13/1997_
10242286d8edStholo
10252286d8edStholo    21. Why should I trust automatic merges?
10262286d8edStholo
10272286d8edStholo   Some developers have the feeling that three-way merging doesn't work.
10282286d8edStholo   They fear and distrust the way the "update" command automatically
10292286d8edStholo   merges committed changes from the Repository into the working file.
10302286d8edStholo
10312286d8edStholo   Experience has shown that most merges are utterly painless and most of
10322286d8edStholo   the rest are easily resolved. The few conflicts that cause headaches
10332286d8edStholo   are nearly all due to poor communication between developers, a problem
10342286d8edStholo   no source control system can obviate.
10352286d8edStholo
10362286d8edStholo   Some developers were troubled in the past by flaky Unix software. I
10372286d8edStholo   can't say that everything is perfect, but the tools CVS depends on
10382286d8edStholo   (RCS and diff, mainly) are fairly solid nowadays. They work.
10392286d8edStholo
10402286d8edStholo   Since it does seem to work for most of us, the algorithm is unlikely
10412286d8edStholo   to change soon. Why not test it on a couple trouble spots and if it
10422286d8edStholo   works for you, use it for a while? Then you can make an informed
10432286d8edStholo   decision.
10442286d8edStholo
10452286d8edStholo   Last modified: _6/13/1997_
10462286d8edStholo
10472286d8edStholo    22. How does CVS decide if it can safely perform a merge?
10482286d8edStholo
10492286d8edStholo   CVS can merge any text file, possibly discovering a conflict and
10502286d8edStholo   leaving overlaps for you to edit. Editing the conflict markers out of
10512286d8edStholo   the file is a moment's work, but resolving the conflict could take an
10522286d8edStholo   arbitrary amount of time. CVS works to determine if it *should* merge,
10532286d8edStholo   not if it *can*.
10542286d8edStholo
10552286d8edStholo   See 2B.6 for how the merge proceeds.
10562286d8edStholo
10572286d8edStholo   Last modified: _6/13/1997_
10582286d8edStholo
10592286d8edStholo    23. After resolving merge conflicts in a file, what if I want to keep my
10602286d8edStholo    previous version, and not take any of the branch changes?
10612286d8edStholo
10622286d8edStholo   If you want to retain your previous version, a version on the MAIN
10632286d8edStholo   branch greater than 1.1 (one you committed there), just throw the
10642286d8edStholo   merged file away and "cvs update" the file.
10652286d8edStholo
10662286d8edStholo   You don't need to commit something to remember it. The tags you place
10672286d8edStholo   before and after the merge should give all the handles you need to
10682286d8edStholo   find various versions. You don't have to create a new version of the
10692286d8edStholo   file.
10702286d8edStholo
10712286d8edStholo   If you want to retain the previous Vendor revision, you can grab a
10722286d8edStholo   copy of it using "cvs update -p" and commit it or use the technique
10732286d8edStholo   described in 3B.3 to revert back to the Vendor branch.
10742286d8edStholo
10752286d8edStholo   Last modified: _6/13/1997_
10762286d8edStholo
10772286d8edStholo  Category: /Advanced_Topics_/Engineering/
10782286d8edStholo
10792286d8edStholo   " + Engineering"
10802286d8edStholo
10812286d8edStholo    1. Where can I find out about Software Engineering?
10822286d8edStholo
10832286d8edStholo   A couple different people suggested this book:
10842286d8edStholo
10852286d8edStholo   Software Configuration Management: Coordination for Team Productivity;
10862286d8edStholo   Wayne A. Babich; Addison Wesley; 1986; ISBN 0-201-10161-0
10872286d8edStholo
10882286d8edStholo   A number of others suggested Appendix B of the book "Decline and Fall
10892286d8edStholo   of the American Programmer" by Ed Yourdon, called "The Programmer's
10902286d8edStholo   Bookshelf". It list 87 books you are expected to have read. Since they
10912286d8edStholo   publish many of the books, Prentice-Hall distributes this list as
10922286d8edStholo   "Prentice Hall Professional Technical reference PTR-125-AA3.
10932286d8edStholo
10942286d8edStholo   One interesting item from the Yourdon book: The total number of
10952286d8edStholo   professional computer books sold is less than the number of
10962286d8edStholo   programmers currently in the United States. It wasn't clear from the
10972286d8edStholo   book whether this meant "per year" or not, but it is still
10982286d8edStholo   frightening.
10992286d8edStholo
11002286d8edStholo   Last modified: _6/13/1997_
11012286d8edStholo
11022286d8edStholo    2. How do I flexibly arrange the modules file to describe my sources?
11032286d8edStholo
11042286d8edStholo   An equivalent question might be, "How do I structure my sources?" This
11052286d8edStholo   can be a difficult question especially in the areas that are more
11062286d8edStholo   political than technical.
11072286d8edStholo
11082286d8edStholo   Generally you want to think about which pieces of your system need to
11092286d8edStholo   be checked out together, built as one system or tagged as a consistent
11102286d8edStholo   whole. You should certainly create module names that correspond to
11112286d8edStholo   complete, buildable collections that you would tag and release as one
11122286d8edStholo   "product". It is also convenient to create module names for small
11132286d8edStholo   sections of the Repository containing files that will all be worked on
11142286d8edStholo   at the same time by the same person or group.
11152286d8edStholo
11162286d8edStholo   Once you have defined the structure of your work, you can usually see
11172286d8edStholo   how to lay it out in a Repository. After that the modules file is
11182286d8edStholo   easy. You set up module names and aliases to match what you need to
11192286d8edStholo   check out by name. If you like relative directories, it is possible,
11202286d8edStholo   but not recommended, to work completely without a modules file. See
11212286d8edStholo   1D.11 and 2C.7 for some info about the modules file.
11222286d8edStholo
11232286d8edStholo   Here are a few types of modules. You should experiment to see what
11242286d8edStholo   kind of structure each of these produces. They all have different
11252286d8edStholo   uses.
11262286d8edStholo
11272286d8edStholo     Connected projects in one group with two separate helper
11282286d8edStholo   directories. The helper directories can contain build tools, header
11292286d8edStholo   files, libraries, or whatever you like.
11302286d8edStholo
11312286d8edStholo   These are all aliases that checkout relative pathnames. The equivalent
11322286d8edStholo   results could be produced by placing the selected relative pathnames
11332286d8edStholo   on the "cvs checkout" command line.
11342286d8edStholo
11352286d8edStholo           pr1  -a P1 HELPERS
11362286d8edStholo           pr2  -a P2 HELPERS
11372286d8edStholo           pr3  -a P3 HELPERS
11382286d8edStholo           pr12 -a P1 P2 HELPERS
11392286d8edStholo           pr13 -a P1 P3 HELPERS
11402286d8edStholo           pr23 -a P2 P3 HELPERS
11412286d8edStholo
11422286d8edStholo           P1           -a group1/proj1
11432286d8edStholo           P2           -a group1/proj2
11442286d8edStholo           P3           -a group1/proj3
11452286d8edStholo           HELPERS      -a group1/helper1 group1/helper2 MAKEFILE
11462286d8edStholo           MAKEFILE     -a group1/Makefile
11472286d8edStholo
11482286d8edStholo   Actual Repository directory structure: (from $CVSROOT down)
11492286d8edStholo
11502286d8edStholo   group1/ Makefile The top level Makefile. helper1/ helper2/ Helper
11512286d8edStholo   files and dirs proj1/ Files and dirs proj2/ Files and dirs proj3/
11522286d8edStholo   Files and dirs
11532286d8edStholo
11542286d8edStholo   "checkout group1" produces a duplicate of the above. "checkout projX"
11552286d8edStholo   produces all but "projY" and "projZ". "checkout projXY" produces all
11562286d8edStholo   but "projZ".
11572286d8edStholo
11582286d8edStholo     Here is the exact same set of module names describing the same
11592286d8edStholo   Repository layout using module names (and aliases containing module
11602286d8edStholo   names) instead of merely aliases for relative pathnames.
11612286d8edStholo
11622286d8edStholo   There is one difference in the result. The name of the top level
11632286d8edStholo   directory in the checked out working tree will match the "module" name
11642286d8edStholo   (e.g. pr1) instead of always being "group1" as it was in the first
11652286d8edStholo   example above.
11662286d8edStholo
11672286d8edStholo           pr1  group1 proj1 &HELPERS
11682286d8edStholo           pr2  group1 proj2 &HELPERS
11692286d8edStholo           pr3  group1 proj3 &HELPERS
11702286d8edStholo           pr12 group1 proj1 proj2 &HELPERS
11712286d8edStholo           pr13 group1 proj1 proj3 &HELPERS
11722286d8edStholo           pr23 group1 proj2 proj3 &HELPERS
11732286d8edStholo
11742286d8edStholo           HELPERS      -a helper1 helper2 group1-Makefile
11752286d8edStholo           helper1      group1/helper1
11762286d8edStholo           helper2      group1/helper2
11772286d8edStholo           group1-Makefile -d . group1 Makefile
11782286d8edStholo
11792286d8edStholo   The above line (with the -d in it) says that when the module named
11802286d8edStholo   "group1-Makefile" is checked out, the file named Makefile file will be
11812286d8edStholo   found in a directory named $CVSROOT/group1 and will be checked out
11822286d8edStholo   into a directory named '.', which obviously already exists.
11832286d8edStholo
11842286d8edStholo   The & references say to interpret those pathnames relative to the
11852286d8edStholo   directory where the whole module is stored. For the "pr1" module, that
11862286d8edStholo   directory is "group1", so the &HELPERS reference winds up placing
11872286d8edStholo   Makefile in '.' relative to "group1".
11882286d8edStholo
11892286d8edStholo     A short one containing the basic "module" actions:
11902286d8edStholo
11912286d8edStholo           m1           head/path file1 dir2 file3 dir4 file5
11922286d8edStholo
11932286d8edStholo   When checked out, a directory named "m1" appears in your current
11942286d8edStholo   directory. Elements named file1, dir2, file3, dir4, and file5 appear
11952286d8edStholo   in it. They were originally taken as relative paths from
11962286d8edStholo   $CVSROOT/head/path.
11972286d8edStholo
11982286d8edStholo     Here's another way to construct a working directory out of pieces of
11992286d8edStholo   the Repository:
12002286d8edStholo
12012286d8edStholo                projX   projX Makefile &projX_inc &projX_src &projX_doc
12022286d8edStholo
12032286d8edStholo                # The first line selects a single file within projX, plus
12042286d8edStholo                # the contents of three other modules.  Those three other
12052286d8edStholo                # modules rename their directories.
12062286d8edStholo
12072286d8edStholo   projX_inc -d include projX/inc projX_src -d source projX/src projX_doc
12082286d8edStholo   -d documentation projX/doc
12092286d8edStholo
12102286d8edStholo     A Unix tree. This is similar to what CVS was developed for and the
12112286d8edStholo   way I have used it for years.
12122286d8edStholo
12132286d8edStholo                # Top level
12142286d8edStholo                unix            unix
12152286d8edStholo                u_bin           unix/bin
12162286d8edStholo                u_etc           unix/etc
12172286d8edStholo                u_man           unix/man
12182286d8edStholo                usr-bin         unix/usr.bin
12192286d8edStholo
12202286d8edStholo                # Subdirs of top level dirs.  (tiny subset)
12212286d8edStholo                ls              unix/bin/ls
12222286d8edStholo                fsck            unix/etc/fsck
12232286d8edStholo                man8            unix/man/man8
12242286d8edStholo
12252286d8edStholo                # Programs without subdirs. (tiny subset)
12262286d8edStholo                cat             unix/bin Makefile cat.c
12272286d8edStholo                uniq            unix/usr.bin Makefile uniq.c
12282286d8edStholo
12292286d8edStholo                # /usr/local/src
12302286d8edStholo                localsrc        localsrc
12312286d8edStholo                gnu             localsrc/gnu
12322286d8edStholo                public          localsrc/public
12332286d8edStholo                X11             localsrc/X11
12342286d8edStholo
12352286d8edStholo                # GNU and PD tools
12362286d8edStholo                cvs             localsrc/gnu/cvs
12372286d8edStholo                emacs           localsrc/gnu/emacs
12382286d8edStholo                rcs             localsrc/gnu/rcs
12392286d8edStholo                btoa            localsrc/public/btoa
12402286d8edStholo                tcsh            localsrc/public/tcsh
12412286d8edStholo
12422286d8edStholo                # X11 related items.
12432286d8edStholo                tvtwm           localsrc/X11/contrib/tvtwm
12442286d8edStholo
12452286d8edStholo   "unix" was checked out and built from the top down, using a set of
12462286d8edStholo   Makefiles that knew about the whole structure. "localsrc" was kept
12472286d8edStholo   checked out in /usr/local/src.
12482286d8edStholo
12492286d8edStholo   At any time I could run "checkout ls" or "checkout cat" and get a
12502286d8edStholo   simple directory with only that tool in it, plus a subset Makefile
12512286d8edStholo   that knew how to build that tool against the installed (or alternate,
12522286d8edStholo   via environment variables) headers and libraries.
12532286d8edStholo
12542286d8edStholo   I found it very handy to be able to run "ls" and see the three tools I
12552286d8edStholo   was porting that week.
12562286d8edStholo
12572286d8edStholo   Last modified: _6/13/1997_
12582286d8edStholo
12592286d8edStholo    3. Can I have multiple source repositories, one for each project?
12602286d8edStholo
12612286d8edStholo   Yes, you can have as many Repositories as you like. But each
12622286d8edStholo   Repository must be managed separately, creating additional work.
12632286d8edStholo
12642286d8edStholo   Question 4A.1 provides a short description of setting up a single
12652286d8edStholo   Repository. A few additional considerations:
12662286d8edStholo
12672286d8edStholo     It is a good idea to start by creating a single Repository and split
12682286d8edStholo   it up (or create additional Repositories) only if you believe it is
12692286d8edStholo   really necessary. I would only create a new Repository if the data is
12702286d8edStholo   completely disconnected from the rest of the main Repository.
12712286d8edStholo
12722286d8edStholo     If there is a lot of overlap among the developers working on the
12732286d8edStholo   collections of files you want to place in different Repositories, or
12742286d8edStholo   if there is any connection between those collections, I would go out
12752286d8edStholo   of my way to create a single Repository. It is much easier to manage.
12762286d8edStholo
12772286d8edStholo     Disk space should not be a factor since you can build up a
12782286d8edStholo   Repository using symbolic links and/or remote mounts.
12792286d8edStholo
12802286d8edStholo     Each Repository is completely distinct. You can't check out modules
12812286d8edStholo   from different Repositories at the same time. A better way of looking
12822286d8edStholo   at it is that if you *can* check out two modules or directories with a
12832286d8edStholo   single "checkout" command (without contortions or explicit absolute
12842286d8edStholo   pathnames), then they are in the same Repository.
12852286d8edStholo
12862286d8edStholo     To "checkout" modules from multiple Repositories, you must use the
12872286d8edStholo   "cvs -d" option on all CVS commands or alter your $CVSROOT variable
12882286d8edStholo   when you change focus to another Repository. If you work with multiple
12892286d8edStholo   Repositories, it is a good idea to configure CVS to use absolute
12902286d8edStholo   pathnames in the ./CVS/Repository file, since most commands (other
12912286d8edStholo   than "checkout") will use that file rather than $CVSROOT.
12922286d8edStholo
12932286d8edStholo     If you configure CVS to use relative pathnames in your
12942286d8edStholo   ./CVS/Repository files, you must always be careful to set your
12952286d8edStholo   $CVSROOT properly or you will get unexpected results.
12962286d8edStholo
12972286d8edStholo   If you have two modules or directories by the same name at the same
12982286d8edStholo   relative path inside two different Repositories, you are asking for
12992286d8edStholo   disaster. You could unexpectedly update a directory with completely
13002286d8edStholo   unrelated files. This is not a fanciful example -- a Repository is
13012286d8edStholo   occasionally duplicated for release purposes in which case *all* the
13022286d8edStholo   paths in the two Repositories are the same.
13032286d8edStholo
13042286d8edStholo   Last modified: _6/13/1997_
13052286d8edStholo
13062286d8edStholo    4. Who should administer the Repository and manage the modules file?
13072286d8edStholo
13082286d8edStholo   This is a "management style" question. In large or traditional groups,
13092286d8edStholo   the CVS procedures are warped to conform to local conventions. In
13102286d8edStholo   small groups, in groups with strong personalities or on new projects
13112286d8edStholo   the choice of source control procedures can help create some of the
13122286d8edStholo   working environment. Here is a taxonomy of environments I have worked
13132286d8edStholo   in or helped set up:
13142286d8edStholo
13152286d8edStholo   Situation 1.
13162286d8edStholo
13172286d8edStholo   A small number of competent developers working on a medium size
13182286d8edStholo   project. We all got along and we all respected each other (at least
13192286d8edStholo   technically). Anyone edited anything.
13202286d8edStholo
13212286d8edStholo   Modules and Repository admin was mostly left to me. I never found a
13222286d8edStholo   problem in minor changes made by anyone else.
13232286d8edStholo
13242286d8edStholo   Situation 2.
13252286d8edStholo
13262286d8edStholo   A large number of experienced developers sprinkled with wackos. Many
13272286d8edStholo   of the developers didn't want to deal with any kind of source control.
13282286d8edStholo   They wanted a full-service source control system that caused them zero
13292286d8edStholo   thought.
13302286d8edStholo
13312286d8edStholo   I learned "big stick" diplomacy here. There was a small number of
13322286d8edStholo   "designated" (by me) people who were allowed to do *anything* other
13332286d8edStholo   than "update" and "commit". Even "checkouts" were controlled. This is
13342286d8edStholo   where I found "history" and "release" the most useful.
13352286d8edStholo
13362286d8edStholo   Situation 3.
13372286d8edStholo
13382286d8edStholo   A small number of developers who wanted me to "help", but who didn't
13392286d8edStholo   want to deal with anything other than their favorite algorithms.
13402286d8edStholo
13412286d8edStholo   I didn't have the time to baby-sit this group, so I designated one of
13422286d8edStholo   them to be my official contact and made him do it all. He felt sullied
13432286d8edStholo   by the requirement to pay attention to anything other than his pet
13442286d8edStholo   coding projects, but enjoyed the "status" of being the only one who
13452286d8edStholo   could touch the control files without my kicking the chair out from
13462286d8edStholo   under him.
13472286d8edStholo
13482286d8edStholo   Situation 4.
13492286d8edStholo
13502286d8edStholo   A huge number of developers of covering the whole spectrum of
13512286d8edStholo   competence and experience split into 20 groups, none of which
13522286d8edStholo   cooperated with the others, working on 57 different projects, most of
13532286d8edStholo   which didn't inter-operate.
13542286d8edStholo
13552286d8edStholo   Managing it in any coherent way was not my responsibility (and beyond
13562286d8edStholo   my tolerance for chaos). Too many people. So I privately designated a
13572286d8edStholo   person in each group to be the contact and kept watch on the
13582286d8edStholo   Repository activity. When something went wrong, I notified the contact
13592286d8edStholo   for the group and told him what was happening and *he* kept his troops
13602286d8edStholo   in line. They were tougher with their own group that I would have
13612286d8edStholo   been.
13622286d8edStholo
13632286d8edStholo   Eventually only a few people were willing to touch the control files,
13642286d8edStholo   since they were flamed from all directions if they screwed up.
13652286d8edStholo
13662286d8edStholo   Situation 5.
13672286d8edStholo
13682286d8edStholo   In a medium group of really *serious*, and seriously overworked,
13692286d8edStholo   people, someone else was designated the "master". I convinced the
13702286d8edStholo   master I knew what I was doing and went on my way.
13712286d8edStholo
13722286d8edStholo   No one else in the world was allowed to touch anything.
13732286d8edStholo
13742286d8edStholo   Situation 6.
13752286d8edStholo
13762286d8edStholo   In a large amorphous group of beginners, experts and clowns, over whom
13772286d8edStholo   no one had official control, I was forced to employ a group of
13782286d8edStholo   relative beginners (who became experts rather quickly) to police the
13792286d8edStholo   world. The ultimate in locking the barn after the horse was stolen, we
13802286d8edStholo   kept Chaos from destroying us only by use of superior firepower.
13812286d8edStholo
13822286d8edStholo   My choice, if allowed, is to let anyone touch anything. I keep backups
13832286d8edStholo   of important items and let people know individually whether I want
13842286d8edStholo   them to touch things or not. If someone on my "no touch" list touches
13852286d8edStholo   and succeeds, they are allowed more slack. If they screw up after
13862286d8edStholo   being warned, their screwup becomes public. After a few months, I
13872286d8edStholo   usually have no trouble keeping the world running smoothly, at least
13882286d8edStholo   from my (and CVS's) perspective.
13892286d8edStholo
13902286d8edStholo   Last modified: _6/13/1997_
13912286d8edStholo
13922286d8edStholo    5. Isn't disk space a big factor? CVS copies files out of the Repository,
13932286d8edStholo    duplicating everything.
13942286d8edStholo
13952286d8edStholo   Everyone knows that disk space is getting cheaper. How do we reconcile
13962286d8edStholo   this with the equally well-known problem that *all* disk is *always*
13972286d8edStholo   filled up?
13982286d8edStholo
13992286d8edStholo   In my opinion, the main reason disk space will never be an unlimited
14002286d8edStholo   resource is that it is the major variable in organizational time/space
14012286d8edStholo   tradeoffs. It isn't a problem of waste or an aspect of Murphy's law,
14022286d8edStholo   as some claim it is, but rather a direct consequence of good
14032286d8edStholo   management. Disk space is, and will always be, a limited resource.
14042286d8edStholo
14052286d8edStholo   First, the cost of *deploying* that disk is not dropping as fast as
14062286d8edStholo   the cost of the storage medium. The cost of machines to hold the disks
14072286d8edStholo   and the networks to connect them are dropping more slowly than disk
14082286d8edStholo   media. And the cost of the human time necessary to manage the
14092286d8edStholo   machines, networks, disks, and the developers using them, is not
14102286d8edStholo   dropping at all. The cost of human time continues to rise.
14112286d8edStholo
14122286d8edStholo   If management decides that expensive human time can be saved by using
14132286d8edStholo   all that new disk space to keep the last three releases online, then
14142286d8edStholo   that's what it will be used for. If each release takes up a Gigabyte
14152286d8edStholo   and you support 30 platforms, a simple time-saving suggestion has just
14162286d8edStholo   grabbed 100 Gigabytes of disk space. And we've ignored the potential
14172286d8edStholo   disk storage needed to support "better Customer Service", another
14182286d8edStholo   management refrain.
14192286d8edStholo
14202286d8edStholo   Even at 30 cents per Megabyte (next year's price), you've just used up
14212286d8edStholo   $30,000 of disk space. And that doesn't count the computers, tape
14222286d8edStholo   drives and humans necessary to maintain and deploy all of it. Spending
14232286d8edStholo   money to save time has its own overhead, too.
14242286d8edStholo
14252286d8edStholo   Binaries are getting bigger. Graphics and data collection devices can
14262286d8edStholo   eat up any amount of disk. There are more tools available, more
14272286d8edStholo   libraries, more raw data than you can ever store. My home computer has
14282286d8edStholo   a Gigabyte of disk on it. It could easily handle 30.
14292286d8edStholo
14302286d8edStholo   The "economy" of disk storage media will never remove the need to
14312286d8edStholo   manage disk space.
14322286d8edStholo
14332286d8edStholo   So, here's an un-reviewed suggestion originally from Graydon Dodson
14342286d8edStholo   <grdodson@lexmark.com>, which I've altered and edited heavily.
14352286d8edStholo
14362286d8edStholo   - Keep a directory where the whole tree is checked out. (It might be
14372286d8edStholo   built and tested once in a while to make sure it is worth linking to,
14382286d8edStholo   but that doesn't affect the source control aspect of this procedure).
14392286d8edStholo   Let's call it /master/build.
14402286d8edStholo
14412286d8edStholo   - Write a tool that creates a tree of directories (like the X11
14422286d8edStholo   "lndir" command) filled with links to the checked out files in the
14432286d8edStholo   /master/build tree.
14442286d8edStholo
14452286d8edStholo   This tool should also provide real copies of, not symlinks to, all the
14462286d8edStholo   files within the CVS administrative directories.
14472286d8edStholo
14482286d8edStholo   - You could also provide a way for the tool to take a list of whole
14492286d8edStholo   directories that you will never change, for which it would create a
14502286d8edStholo   single symlink to the directory and not a subtree of symlinks to
14512286d8edStholo   files. Or you could rm -r pieces of the resulting working directory
14522286d8edStholo   yourself and replace it with links.
14532286d8edStholo
14542286d8edStholo   - If you want to edit a file, you have to grab a real copy and keep it
14552286d8edStholo   until your revision shows up in the /master/build tree. I'd create a
14562286d8edStholo   script to do this: cvsgrab <file>
14572286d8edStholo
14582286d8edStholo                #!/bin/csh -f
14592286d8edStholo                set f = $1
14602286d8edStholo                if (! -l $f) then
14612286d8edStholo                   echo "file $f is not a symlink"
14622286d8edStholo                   exit 1
14632286d8edStholo                endif
14642286d8edStholo                rm $f
14652286d8edStholo                set rev = `grep "^/$f/" CVS/Entries | awk -F/ '{print $3}'`
14662286d8edStholo                cvs update -p -r $rev $f > $f
14672286d8edStholo
14682286d8edStholo   You can't do a plain "cvs update" since that would grab newer
14692286d8edStholo   revisions from the Repository, not the revision you wanted to start
14702286d8edStholo   with. After the file is no longer a symlink, you can work normally.
14712286d8edStholo   You'll have to run "update" before "commit" anyway if there are newer
14722286d8edStholo   revisions.
14732286d8edStholo
14742286d8edStholo   - Presumably there would also be a tool to traverse the link tree and
14752286d8edStholo   revert it to links if there are no modified files and/or if all the
14762286d8edStholo   real files match the revision of the /master/build tree.
14772286d8edStholo
14782286d8edStholo   - To avoid confusing CVS when the /master/build revisions are updated
14792286d8edStholo   but your CVS/Entries files is not, CVS would have to change to handle
14802286d8edStholo   symlinks. It currently causes problems with this scenario:
14812286d8edStholo
14822286d8edStholo     ./<file> is a symlink.
14832286d8edStholo
14842286d8edStholo     ./CVS/Entries says you are revision 1.2.
14852286d8edStholo
14862286d8edStholo     The corresponding CVS/Entries file in /master/build says the latest
14872286d8edStholo   revision is 1.3.
14882286d8edStholo
14892286d8edStholo     cvs update <file> shows a 'C' conflict flag.
14902286d8edStholo
14912286d8edStholo   Last modified: _6/13/1997_
14922286d8edStholo
14932286d8edStholo  Category: /Advanced_Topics_/Installing_CVS/
14942286d8edStholo
14952286d8edStholo   " + Installing CVS"
14962286d8edStholo
14972286d8edStholo    1. What do I have to do before I install CVS?
14982286d8edStholo
14992286d8edStholo     You must decide where to set up a Repository.
15002286d8edStholo
15012286d8edStholo   Though you can construct a Repository tree structure using links and
15022286d8edStholo   mount points, there must be a single copy of each real file across
15032286d8edStholo   your entire organization. You may not "rdist" files and expect to edit
15042286d8edStholo   both copies.
15052286d8edStholo
15062286d8edStholo   CVS does not support a truly distributed Repository. You can have
15072286d8edStholo   multiple Repositories, but each one must be mounted (not copied or
15082286d8edStholo   "rdist"ed) from a single place onto all machines where it will be
15092286d8edStholo   used.
15102286d8edStholo
15112286d8edStholo   Initially, a Repository takes about same amount of disk space as the
15122286d8edStholo   sources you want to put into it, plus a bit of overhead for the RCS
15132286d8edStholo   files.
15142286d8edStholo
15152286d8edStholo   See Section 4B. For multiple Repositories, see 4G.3
15162286d8edStholo
15172286d8edStholo     You need a directory in everyone's $PATH variable where you can
15182286d8edStholo   install all the executables. /usr/local/bin is a common place.
15192286d8edStholo
15202286d8edStholo     You need some helper tools besides CVS such as "RCS" and a good set
15212286d8edStholo   of "diff" and "diff3" programs. See 1B.4 for suggestions.
15222286d8edStholo
15232286d8edStholo     Read the README, INSTALL and ChangeLog files to see what you are
15242286d8edStholo   getting into.
15252286d8edStholo
15262286d8edStholo     Make sure you have versions of all the programs mentioned in the
15272286d8edStholo   "cvs/src/options.h" and "cvs/src/rcs.h" files.
15282286d8edStholo
15292286d8edStholo     Though you can probably muddle along without it, you should appoint
15302286d8edStholo   one or more "Repository Administrators" who will be responsible for
15312286d8edStholo   maintaining the Repository structure, administrative files and the
15322286d8edStholo   "modules" interface.
15332286d8edStholo
15342286d8edStholo   Someone at your site should probably be on the info-cvs mailing list.
15352286d8edStholo   See 1B.5.
15362286d8edStholo
15372286d8edStholo   Last modified: _6/13/1997_
15382286d8edStholo
15392286d8edStholo    2. How do I configure the CVS programs?
15402286d8edStholo
15412286d8edStholo     You should certainly start by reading the README file, the INSTALL
15422286d8edStholo   files and possibly the ChangeLogs in each directory, the Makefile.in
15432286d8edStholo   files and the "cvsinit.sh" program.
15442286d8edStholo
15452286d8edStholo     Edit the "options.h" file in the "src" directory.
15462286d8edStholo
15472286d8edStholo   You might need to specify a few site-specific pieces of information
15482286d8edStholo   including the names of a number of functions.
15492286d8edStholo
15502286d8edStholo   Hint1: You probably want to set the DIFF macro to use your version of
15512286d8edStholo   the GNU diff program with the '-a' option. Ours is set to "gdiff -a".
15522286d8edStholo
15532286d8edStholo   Hint2: You want to use RCS 5.6.0.1 or greater and set the "HAVE_RCS5"
15542286d8edStholo   macro.
15552286d8edStholo
15562286d8edStholo     Execute the ./configure command.
15572286d8edStholo
15582286d8edStholo     Type "make".
15592286d8edStholo
15602286d8edStholo     After running "make" you might try running the "sanity.sh" script:
15612286d8edStholo   ./src/sanity.sh `pwd`/src/cvs
15622286d8edStholo
15632286d8edStholo   It writes into /tmp/cvs-sanity by default.
15642286d8edStholo
15652286d8edStholo     Finish reading the INSTALL file and test out the system.
15662286d8edStholo
15672286d8edStholo   Last modified: _6/13/1997_
15682286d8edStholo
15692286d8edStholo    3. What do I have to install?
15702286d8edStholo
15712286d8edStholo     Install the "cvs" executable and "mkmodules" from the CVS sources.
15722286d8edStholo   The man page is useful too. If you plan to report bugs, you should
15732286d8edStholo   also install "cvsbug".
15742286d8edStholo
15752286d8edStholo     Make sure you have versions of all the programs mentioned in the
15762286d8edStholo   options.h file, most of which are included in a standard Unix system.
15772286d8edStholo
15782286d8edStholo     Unless you plan to reimplement RCS [:-)], you must install RCS.
15792286d8edStholo
15802286d8edStholo   It is a very good idea to examine the RCS installation instructions
15812286d8edStholo   and make sure you are using the GNU versions of "diff" and "diff3" or
15822286d8edStholo   merges (an important part of CVS) will not work as well as you'd like.
15832286d8edStholo
15842286d8edStholo     Set your $CVSROOT environment variable and create the Repository
15852286d8edStholo   (which you planned out in 4A.1) with the "cvsinit" command at the top
15862286d8edStholo   of the CVS sources.
15872286d8edStholo
15882286d8edStholo     You'll need to edit the Repository control files created by
15892286d8edStholo   "cvsinit".
15902286d8edStholo
15912286d8edStholo     Install any helper programs mentioned in the modules file.
15922286d8edStholo
15932286d8edStholo   Last modified: _6/13/1997_
15942286d8edStholo
15952286d8edStholo    4. How do I work around the merge problems in GNU diff version 2.1 or
15962286d8edStholo    later?
15972286d8edStholo
15982286d8edStholo   See 1B.4 If you use recent versions of RCS and "diff", you won't run
15992286d8edStholo   into the above. If you do, see 5B.8
16002286d8edStholo
16012286d8edStholo   Last modified: _6/13/1997_
16022286d8edStholo
16032286d8edStholo  Category: /Advanced_Topics_/Internal_errors/
16042286d8edStholo
16052286d8edStholo   " + Internal errors"
16062286d8edStholo
16072286d8edStholo    1. Explain: "ci error: unexpected EOF in diff output"
16082286d8edStholo
16092286d8edStholo   RCS versions earlier than 5.5 print the above error when a file does
16102286d8edStholo   not end in a newline character. It can be caused by:
16112286d8edStholo
16122286d8edStholo   - Editing with Emacs and not using "require-final-newline".
16132286d8edStholo   - Committing a binary file.
16142286d8edStholo   - Filesystem failures (NFS!) that put nulls in your file.
16152286d8edStholo
16162286d8edStholo   The solution is to upgrade to RCS 5.5 or later. (Of course, this won't
16172286d8edStholo   fix filesystem failures. It will merely allow RCS (and therefore CVS)
16182286d8edStholo   to handle the file without error.)
16192286d8edStholo
16202286d8edStholo   Last modified: _6/13/1997_
16212286d8edStholo
16222286d8edStholo    2. Explain: "RCS file /Repository/module/file.c,v is in use"
16232286d8edStholo
16242286d8edStholo   This is an RCS error that occurs when its internal lock file has been
16252286d8edStholo   left around by an RCS command interrupted by some sort of system
16262286d8edStholo   crash, disk failure or SIGKILL signal.
16272286d8edStholo
16282286d8edStholo   Go into the Repository and look for files with names similar to
16292286d8edStholo   "file.c,v", usually starting with ',', '_' or '#'. Make sure they are
16302286d8edStholo   really crash remnants and do not belong to transactions in progress --
16312286d8edStholo   a recent last-modified timestamp is a good indicator of a live
16322286d8edStholo   transaction. Delete them if they are old.
16332286d8edStholo
16342286d8edStholo   Last modified: _6/13/1997_
16352286d8edStholo
16362286d8edStholo    3. Explain: "co error, line 2: Missing access list"
16372286d8edStholo
16382286d8edStholo   This is an error message from RCS Version 3 when it tries to read a
16392286d8edStholo   file created by a later version of RCS.
16402286d8edStholo
16412286d8edStholo   HP decided to "standardize" on an ancient version of RCS some time
16422286d8edStholo   ago. You can't use it for CVS. See 4H.6.
16432286d8edStholo
16442286d8edStholo   Since the error comes from having a later version of RCS than HP
16452286d8edStholo   supports, you probably did install the later version but must have
16462286d8edStholo   recently changed your $PATH or installed the HP package that has RCS
16472286d8edStholo   in it.
16482286d8edStholo
16492286d8edStholo   You should either reconfigure CVS to use absolute pathnames to the
16502286d8edStholo   proper versions of the RCS programs that CVS uses, or change your PATH
16512286d8edStholo   to look there first. If you haven't installed the latest version of
16522286d8edStholo   RCS, you should upgrade. See 1B.4
16532286d8edStholo
16542286d8edStholo   Last modified: _6/13/1997_
16552286d8edStholo
16562286d8edStholo    4. Explain: "error: RCS file name `xyz .c' contains white space"
16572286d8edStholo
16582286d8edStholo   RCS 5.6 doesn't allow white space in filenames. Apparently this
16592286d8edStholo   restriction will be removed in RCS 5.7, but CVS may still require that
16602286d8edStholo   filenames have no white space in them.
16612286d8edStholo
16622286d8edStholo   Last modified: _6/13/1997_
16632286d8edStholo
16642286d8edStholo    5. Explain: cvs checkout: warning: <X> is not (any longer) pertinent
16652286d8edStholo
16662286d8edStholo   This message occurs in three instances:
16672286d8edStholo
16682286d8edStholo     When there is an entry in the ./CVS/Entries for file <X> and there
16692286d8edStholo   is no RCS file in the Repository to back it up.
16702286d8edStholo
16712286d8edStholo   If the working file exists, and hasn't changed (determined from the
16722286d8edStholo   timestamp) it is removed.
16732286d8edStholo
16742286d8edStholo     When you try to check out a piece of the Repository with:
16752286d8edStholo
16762286d8edStholo   cvs checkout some/place/in/repository/tree
16772286d8edStholo
16782286d8edStholo   and at least the first element of the path (i.e. "some" in the above)
16792286d8edStholo   exists, but some part of the rest of it does not.
16802286d8edStholo
16812286d8edStholo   The checkout command checks the modules file first for the whole path,
16822286d8edStholo   then for a prefix of the path as a module name. If it doesn't find
16832286d8edStholo   *any* portion of your path in the modules file, it says:
16842286d8edStholo
16852286d8edStholo                cvs checkout: cannot find module `<module/path>' - ignored
16862286d8edStholo
16872286d8edStholo   If it finds some set of prefix directories, it prints the message you
16882286d8edStholo   see.
16892286d8edStholo
16902286d8edStholo   In practice this is usually a spelling error.
16912286d8edStholo
16922286d8edStholo     If the Repository files you are trying to check out or update are
16932286d8edStholo   not readable by you, the same problems can occur. Check the
16942286d8edStholo   permissions on the files involved.
16952286d8edStholo
16962286d8edStholo   Last modified: _6/13/1997_
16972286d8edStholo
16982286d8edStholo    6. Why did a Repository file change from <file>,v to ,<file>,?
16992286d8edStholo
17002286d8edStholo   This is an RCS problem, since the ,<file>, syntax for file names is
17012286d8edStholo   used by RCS and not CVS.
17022286d8edStholo
17032286d8edStholo   RCS constructs a new <file>,v in a temporary file named ,<file>,
17042286d8edStholo   (which doubles as a lock file) then renames it to <file>,v when it is
17052286d8edStholo   done. The only way this is reliable is if your system's version of
17062286d8edStholo   rename(2) is an atomic, as required by POSIX.
17072286d8edStholo
17082286d8edStholo   If your system has a non-atomic (and therefore non-POSIX) rename(2)
17092286d8edStholo   system call, RCS runs uses an internal version of this algorithm to
17102286d8edStholo   approximate the atomic rename:
17112286d8edStholo
17122286d8edStholo   rm <file>,v; ln ,<file>, <file>,v; rm ,<file>,
17132286d8edStholo
17142286d8edStholo   If the system crashes, or you lose your NFS connection between the
17152286d8edStholo   first "rm", but before the "ln", you can be left only with the
17162286d8edStholo   ,<file>, file. If the crash or network failure occurs between the "ln"
17172286d8edStholo   and the final "rm", you could be left with a pair of linked names.
17182286d8edStholo
17192286d8edStholo   Recovery:
17202286d8edStholo   - If only the ,<file>, exists, rename it to <file>,v.
17212286d8edStholo
17222286d8edStholo   - If both ,<file>, and <file>,v exist and are linked, remove the
17232286d8edStholo   ,<file>, file.
17242286d8edStholo
17252286d8edStholo   - If both ,<file>, and <file>,v exist and are separate files, look at
17262286d8edStholo   the dates, "diff" them and make your best guess. This sounds like the
17272286d8edStholo   remnants of two separate events.
17282286d8edStholo
17292286d8edStholo   Last modified: _6/13/1997_
17302286d8edStholo
17312286d8edStholo  Category: /Advanced_Topics_/Other_Systems/
17322286d8edStholo
17332286d8edStholo   " + Other Systems"
17342286d8edStholo
17352286d8edStholo    1. I use a NeXT. Is there anything I need to know?
17362286d8edStholo
17372286d8edStholo   NeXTSTEP 3.0's Interface Builder uses "nib" directories, rather than
17382286d8edStholo   the files used in previous revisions. It removes files it doesn't
17392286d8edStholo   recognize, making it impossible to place such a directory under CVS --
17402286d8edStholo   the CVS admin directory will be removed.
17412286d8edStholo
17422286d8edStholo   Some time ago, <Bob_Vadnais@pdh.com> posted a palette named CVSPalette
17432286d8edStholo   that claimed to resolve this problem. It was intended to preserve the
17442286d8edStholo   CVS administrative directories within nib documents (directories) that
17452286d8edStholo   Interface Builder usually removes.
17462286d8edStholo
17472286d8edStholo   CVSPalette is no longer in its announced place:
17482286d8edStholo
17492286d8edStholo                ftp.cs.orst.edu:/pub/next/submissions
17502286d8edStholo
17512286d8edStholo   though I did find two other interesting files on ftp.cs.orst.edu:
17522286d8edStholo
17532286d8edStholo                /software/NeXT/sources/tools/cvs-next-2_1_1.tar.Z
17542286d8edStholo
17552286d8edStholo   which is a port of CVS 1.3 (along with RCS and diff) and:
17562286d8edStholo
17572286d8edStholo                /software/NeXT/sources/programming/cvs.postamble-2.4.gz
17582286d8edStholo
17592286d8edStholo   which appears to be a set of wrappers for CVS commands that claim to
17602286d8edStholo   allow you to use CVS effectively (and without need for the "command
17612286d8edStholo   line") on a NeXT machine.
17622286d8edStholo
17632286d8edStholo   [[Anyone know the truth about CVS and NeXT?]]
17642286d8edStholo
17652286d8edStholo   Last modified: _6/13/1997_
17662286d8edStholo
17672286d8edStholo    2. I use OS/2 and/or DOS and/or Windows. Is there anything I need to know?
17682286d8edStholo
17692286d8edStholo   When using a local repository, be sure to specify the local access
17702286d8edStholo   method or CVS will interpret the drive letter as a remote host name
17712286d8edStholo   due to the : following it:
17722286d8edStholo
17732286d8edStholo        WRONG:  CVSROOT=C:\SRC\CVSROOT
17742286d8edStholo
17752286d8edStholo        RIGHT:  CVSROOT=:local:C:\SRC\CVSROOT
17762286d8edStholo
17772286d8edStholo   (larry.jones@sdrc.com)
17782286d8edStholo
17792286d8edStholo   You can share RCS files between Unix and DOS while avoiding the MS-DOS
17802286d8edStholo   file name limits by setting your RCSINIT environment variable to
17812286d8edStholo   '-x/,v'. New RCS files will be created without the standard ",v"
17822286d8edStholo   suffix, though files ending in ",v" will still be found if there is no
17832286d8edStholo   matching file in the same directory without the ",v".
17842286d8edStholo
17852286d8edStholo   Erik van Linstee offers an OS/2 and a DOS port of CVS 1.3 in:
17862286d8edStholo
17872286d8edStholo   ftp.informatik.tu-muenchen.de:/pub/comp/os/os2/gnu/devtools or
17882286d8edStholo   ftp.rrzn.uni-hannover.de:/pub/os2-local
17892286d8edStholo
17902286d8edStholo   The files are named:
17912286d8edStholo
17922286d8edStholo                cvs13p?[bs].zip
17932286d8edStholo
17942286d8edStholo   Where the ? stands for the patch level (currently 8) and the b is for
17952286d8edStholo   the binaries, the s for the sources.
17962286d8edStholo
17972286d8edStholo   There are three binaries. An OS/2 only one (32-bit), a DOS only one
17982286d8edStholo   (16-bit) and an EMX one that runs on both (32-bit).
17992286d8edStholo
18002286d8edStholo   There are many differences between the Unix and the DOS versions of
18012286d8edStholo   CVS. Read the material that comes with the DOS version before using
18022286d8edStholo   it.
18032286d8edStholo
18042286d8edStholo   [[Updates?]].
18052286d8edStholo
18062286d8edStholo   Last modified: _9/22/1997_
18072286d8edStholo
18082286d8edStholo    3. I use SCO Unix. Is there anything I need to know?
18092286d8edStholo
18102286d8edStholo   On SCO/UNIX 3.2 V2.0 POSIX signals don't work. Unfortunately the
18112286d8edStholo   configure program detects POSIXness and configures in the use of POSIX
18122286d8edStholo   signals. Workaround : Edit out the check for POSIXness in the
18132286d8edStholo   configure script. [[You could also remove all occurrences of
18142286d8edStholo   "-DPOSIX=1" from the Makefiles after configure is run. -dgg-]]
18152286d8edStholo
18162286d8edStholo   SCO/UNIX doesn't understand #!/<some shell> syntax. This breaks the
18172286d8edStholo   use of log.pl as it gets invoked by /bin/sh instead of
18182286d8edStholo   !#/usr/local/bin/perl. WorkAround : edit log.pl and change it into a
18192286d8edStholo   shell script which invokes perl with log.perl (renamed from log.pl) as
18202286d8edStholo   input.
18212286d8edStholo                                Contributed by Joe Drumgoole
18222286d8edStholo
18232286d8edStholo   Last modified: _6/13/1997_
18242286d8edStholo
18252286d8edStholo    4. I use AIX. Is there anything I need to know?
18262286d8edStholo
18272286d8edStholo   The only report on AIX claims to have no trouble using it in concert
18282286d8edStholo   with SunOS and IRIX platforms.
18292286d8edStholo
18302286d8edStholo   Last modified: _6/13/1997_
18312286d8edStholo
18322286d8edStholo    5. I use IRIX. Is there anything I need to know?
18332286d8edStholo
18342286d8edStholo   If you see "uid" numbers where you would expect user names, try adding
18352286d8edStholo   -lsun to the link line. Without it CVS is unable to retrieve "passwd"
18362286d8edStholo   data through NIS.
18372286d8edStholo
18382286d8edStholo   Last modified: _6/13/1997_
18392286d8edStholo
18402286d8edStholo    6. I use an HP system. Is there anything I need to know?
18412286d8edStholo
18422286d8edStholo   HP distributes RCS version 3 (a circa 1983 release!) with HP-UX. CVS
18432286d8edStholo   does not work with RCS version 3; it requires RCS version 4 or later.
18442286d8edStholo   Your best bet is to find the latest version of RCS and install it
18452286d8edStholo   somewhere.
18462286d8edStholo
18472286d8edStholo   HP-UX 8.07 has a serious bug with the mmap system call and NFS files;
18482286d8edStholo   the bug can crash the operating system. Make sure that you configure
18492286d8edStholo   RCS to avoid mmap by setting has_mmap to 0 in RCS's conf.h. This bug
18502286d8edStholo   is fixed in HP-UX 9.
18512286d8edStholo
18522286d8edStholo                                Contributed by Paul Eggert
18532286d8edStholo
18542286d8edStholo   If using the setgid() trick described in 4D.13, you will have to
18552286d8edStholo   create an entry in the /etc/privgroup file to give the group assigned
18562286d8edStholo   to the cvs executable setgid permission (see setprivgrp(1m)).
18572286d8edStholo   Additionally, if you are restricting "read" access to the Repository
18582286d8edStholo   by limiting access to the executable (this requires yet another
18592286d8edStholo   group), then you will require that /etc/logingroup exists and is
18602286d8edStholo   configured correctly (usually it's just alink to /etc/group).
18612286d8edStholo
18622286d8edStholo                                Contributed by Dale Woolridge
18632286d8edStholo
18642286d8edStholo   Last modified: _6/13/1997_
18652286d8edStholo
18662286d8edStholo    7. I use AFS. Is there anything I need to know?
18672286d8edStholo
18682286d8edStholo   There is a problem with the way CVS performs its locking when the
18692286d8edStholo   files are within AFS. When your current PTS id != your uid, the locks
18702286d8edStholo   are not deleted. The stat() system call returns the PTS id of the
18712286d8edStholo   owner. If that id != your uid, CVS assumes you did not lock it, and
18722286d8edStholo   leaves the lock files alone. The next time you try to use it, it
18732286d8edStholo   complains that someone has the repository locked.
18742286d8edStholo
18752286d8edStholo                                Contributed by Michael Ganzberger
18762286d8edStholo
18772286d8edStholo   [[This was against CVS 1.3. Is it still in CVS 1.4?]]
18782286d8edStholo
18792286d8edStholo   Last modified: _6/13/1997_
18802286d8edStholo
18812286d8edStholo    8. I use A/UX. Is there anything I need to know?
18822286d8edStholo
18832286d8edStholo   [[??]]
18842286d8edStholo
18852286d8edStholo   Last modified: _6/13/1997_
18862286d8edStholo
18872286d8edStholo  Category: /Advanced_Topics_/Related_Software/
18882286d8edStholo
18892286d8edStholo   " + Related Software"
18902286d8edStholo
18912286d8edStholo    1. How do I use CVS under Emacs? Is there an Emacs cvs-mode?
18922286d8edStholo
18932286d8edStholo   The pcl-cvs package distributed with CVS is an emacs package that
18942286d8edStholo   helps with the update/commit process. When you are ready to update,
18952286d8edStholo   you use the 'cvs-update' command within emacs. This executes "update"
18962286d8edStholo   and fills a cvs-mode buffer with a line for each file that changed.
18972286d8edStholo   The most helpful features are: descriptive words for what happened
18982286d8edStholo   (i.e. Merged or Conflict rather than 'U' or 'C'), single keys bound to
18992286d8edStholo   diffs and commits, and the ability to mark arbitrary groups of files,
19002286d8edStholo   possibly from different directories, for commit as a whole.
19012286d8edStholo
19022286d8edStholo   All the developers in my group that use emacs find pcl-cvs a much
19032286d8edStholo   friendlier and more helpful way to update/commit than raw cvs. One vi
19042286d8edStholo   user even converted to emacs just to use pcl-cvs.
19052286d8edStholo
19062286d8edStholo                                Contributed by Jeffrey M Loomis
19072286d8edStholo
19082286d8edStholo   Last modified: _6/13/1997_
19092286d8edStholo
19102286d8edStholo    2. What is GIC (Graphical Interface to CVS)?
19112286d8edStholo
19122286d8edStholo
19132286d8edStholo
19142286d8edStholo
19152286d8edStholo        GIC provides a graphical user interface to the Concurrent Version
19162286d8edStholo        System (CVS), a powerful revision control system.  GIC is
19172286d8edStholo        implemented in the Tcl/Tk programming language and is intended to
19182286d8edStholo        augment the sometimes cumbersome CVS command line interface.
19192286d8edStholo
19202286d8edStholo        Note that according to the official GIC page at
19212286d8edStholo        http://www.cpsc.ucalgary.ca/redirect/grouplab/projects/gic/
19222286d8edStholo        GIC is no longer being maintained and tkCVS is recommended
19232286d8edStholo        instead.  For more on tkCVS, see http://www.cyclic.com/tkcvs/
19242286d8edStholo
19252286d8edStholo        kingdon@cyclic.com
19262286d8edStholo
19272286d8edStholo   Last modified: _9/6/1997_
19282286d8edStholo
19292286d8edStholo    3. What is CAVEMAN?
19302286d8edStholo
19312286d8edStholo   CAVEMAN is a front end to CVS written in PERL providing a collection
19322286d8edStholo   of features desired by the site where it was developed.
19332286d8edStholo
19342286d8edStholo   - The ability to spread a "project" over multiple Repositories.
19352286d8edStholo   - Optional automatic tagging after each commit.
19362286d8edStholo   - Additional locking of files.
19372286d8edStholo   - Extra before and after program hooks.
19382286d8edStholo   - A layer of event logging.
19392286d8edStholo   - All sorts of error messages.
19402286d8edStholo   - Many changes to the semantics of commands.
19412286d8edStholo
19422286d8edStholo   It is available via anonymous ftp on ftp.llnl.gov [128.115.54.18] in
19432286d8edStholo   gnu/caveman_vX.Y.Z.tar.gz (The numbers X, Y, & Z vary.)
19442286d8edStholo
19452286d8edStholo   contact Kathleen Dyer kdyer@llnl.gov
19462286d8edStholo                                (510)423-6803
19472286d8edStholo                                (510)423-5112 FAX
19482286d8edStholo
19492286d8edStholo   [[Does someone want to elaborate?]]
19502286d8edStholo
19512286d8edStholo   Last modified: _6/13/1997_
19522286d8edStholo
19532286d8edStholo  Category: /Advanced_Topics_/Setting_up_and_Manag/
19542286d8edStholo
19552286d8edStholo   " + Setting up and Managing the Repository"
19562286d8edStholo
19572286d8edStholo    1. What do I do first? How do I create a Repository?
19582286d8edStholo
19592286d8edStholo   First, install all the programs. (See Section 4A.)
19602286d8edStholo
1961c71bc7e2Stholo   Then create a Repository by executing "cvs -d init". (This works with
1962c71bc7e2Stholo   CVS 1.9.)
19632286d8edStholo
1964c71bc7e2Stholo   Now you can configure your repository by checking out CVSROOT: "cvs -d
1965c71bc7e2Stholo   checkout CVSROOT". Change into the created directory CVSROOT. Edit the
1966c71bc7e2Stholo   files you want to edit, and afterwards, commit the changes by typing
1967c71bc7e2Stholo   "cvs commit".
19682286d8edStholo
19692286d8edStholo   You will certainly want to add modules of your own. Edit the "modules"
19702286d8edStholo   file and add lines to describe the items you want to "checkout" by
19712286d8edStholo   module name. Here's a short list that could be used for storing a
19722286d8edStholo   small number of GNU and PD sources:
19732286d8edStholo
19742286d8edStholo                local   local
19752286d8edStholo
19762286d8edStholo                gnu     local/gnu
19772286d8edStholo                emacs   local/gnu/emacs
19782286d8edStholo                cvs     local/gnu/cvs
19792286d8edStholo
19802286d8edStholo                public  local/public
19812286d8edStholo                pdprog1 local/public/pdprog1
19822286d8edStholo                pdprog2 local/public/pdprog2
19832286d8edStholo
19842286d8edStholo                test    test
19852286d8edStholo                junk    test/junk
19862286d8edStholo
1987c71bc7e2Stholo   Andreas Kostyrka
19882286d8edStholo
1989c71bc7e2Stholo   Last modified: _4/21/1998_
19902286d8edStholo
19912286d8edStholo    2. What are those files in $CVSROOT/CVSROOT?
19922286d8edStholo
19932286d8edStholo   There are eight Repository control (or "database") files of interest
19942286d8edStholo   in the CVSROOT directory:
19952286d8edStholo
19962286d8edStholo     modules contains the "modules" database. See 1D.11, 2C.7, 4B.6 and
19972286d8edStholo   4B.7 for more details.
19982286d8edStholo
19992286d8edStholo     commitinfo contains two columns: 1. a regular expression to match
20002286d8edStholo   against pathnames within the Repository and
20012286d8edStholo
20022286d8edStholo     a <command> to execute for matching pathnames.
20032286d8edStholo
20042286d8edStholo   When you execute "commit", CVS passes the Repository pathname for each
20052286d8edStholo   directory (and the files to commit within that directory) to
20062286d8edStholo   <command>. If <command> exits with a non-zero status, the commit is
20072286d8edStholo   blocked.
20082286d8edStholo
20092286d8edStholo   A <command> associated with a pathname of "DEFAULT" is executed if
20102286d8edStholo   nothing else matches. Every <command> associated with a pathname of
20112286d8edStholo   "ALL" is executed separately.
20122286d8edStholo
20132286d8edStholo     rcsinfo contains the same first column as commitinfo, but the second
20142286d8edStholo   column is a template file for specifying the log entry you are
20152286d8edStholo   required to enter for each commit.
20162286d8edStholo
20172286d8edStholo   "DEFAULT" and "ALL" work the same as in the commitinfo file.
20182286d8edStholo
20192286d8edStholo     editinfo contains the same two columns as commitinfo, but the
20202286d8edStholo   <command> in the second column is intended to do some consistency
20212286d8edStholo   checking on the commit log.
20222286d8edStholo
20232286d8edStholo   "DEFAULT" works as in commitinfo.
20242286d8edStholo
20252286d8edStholo     loginfo contains the same two columns as commitinfo, but the
20262286d8edStholo   <command> is expected to read a log message from its standard input.
20272286d8edStholo   The <command> can do anything it wants with the log information, but
20282286d8edStholo   normally it is appended to a log file or sent to mailing lists.
20292286d8edStholo
20302286d8edStholo   "DEFAULT" & "ALL" work the same as in commitinfo.
20312286d8edStholo
20322286d8edStholo     cvsignore contains "ignore" patterns that are added to the built-in
20332286d8edStholo   ignore list. See 2D.10.
20342286d8edStholo
20352286d8edStholo     checkoutlist contains a list of other files kept under RCS in
20362286d8edStholo   $CVSROOT/CVSROOT that should be checked out by mkmodules to provide a
20372286d8edStholo   readable copy.
20382286d8edStholo
20392286d8edStholo     history contains a stream of text records, one for each event that
20402286d8edStholo   the "history" command is interested in. Though the contents of the
20412286d8edStholo   history file can be read, it is intended to be read and displayed by
20422286d8edStholo   the "history" command. This file is the only one in the above list
20432286d8edStholo   that is not under RCS.
20442286d8edStholo
20452286d8edStholo   Last modified: _6/13/1997_
20462286d8edStholo
20472286d8edStholo    3. Is there any other state stored in the Repository besides in the
20482286d8edStholo    $CVSROOT/CVSROOT directory?
20492286d8edStholo
20502286d8edStholo   Only in the RCS files. The Repository holds exactly two things: the
20512286d8edStholo   tree of RCS files (each usually ending in ",v") and the CVSROOT
20522286d8edStholo   directory described above.
20532286d8edStholo
20542286d8edStholo   Last modified: _6/13/1997_
20552286d8edStholo
20562286d8edStholo    4. How do I put sources into the Repository?
20572286d8edStholo
20582286d8edStholo   There are three main ways to put files in the Repository:
20592286d8edStholo
20602286d8edStholo     Use the "import" command described in Section 3H.
20612286d8edStholo
20622286d8edStholo   This method is the fastest way to put trees of new code into the
20632286d8edStholo   Repository and the *only* way to handle source releases from a 3rd
20642286d8edStholo   party software vendor.
20652286d8edStholo
20662286d8edStholo     Use "add" followed by "commit".
20672286d8edStholo
20682286d8edStholo   This is how to add new files and directories to the Repository, a few
20692286d8edStholo   at a time. Directories don't need to be committed.
20702286d8edStholo
20712286d8edStholo     You can move RCS files directly into the Repository.
20722286d8edStholo
20732286d8edStholo   You should create a directory hierarchy to hold them, but you can just
20742286d8edStholo   move arbitrary ",v" files into the Repository. The only "state" in the
20752286d8edStholo   Repository other than within ",v" files is in the required CVSROOT
20762286d8edStholo   directory at the top of the Repository.
20772286d8edStholo
20782286d8edStholo   Last modified: _6/13/1997_
20792286d8edStholo
20802286d8edStholo    5. What file permissions should I use on (and in) the Repository?
20812286d8edStholo
2082c71bc7e2Stholo   If you are using pserver (password-authenticated access), see below.
2083c71bc7e2Stholo
20842286d8edStholo   If you run a completely open environment (which usually means that you
20852286d8edStholo   don't have, or don't want to waste, the time to deal with it):
20862286d8edStholo
20872286d8edStholo   - Set all directory permissions to 777.
20882286d8edStholo
20892286d8edStholo   - Have everyone set their umasks to 0.
20902286d8edStholo
20912286d8edStholo   (BTW, I don't suggest this. I am merely reporting it.)
20922286d8edStholo
20932286d8edStholo   If you are a normal Unix shop and want to use groups effectively:
20942286d8edStholo
20952286d8edStholo   - Set all the directory permissions in the Repository to 775.
20962286d8edStholo
20972286d8edStholo   If you are using a system that handles both System V and BSD
20982286d8edStholo   filesystems, you might have to set the permissions to 2775.)
20992286d8edStholo
21002286d8edStholo   If you are using one of the many recent versions of Unix that don't
21012286d8edStholo   allow you to use the full octal mode, then you'll have to type: chmod
2102c71bc7e2Stholo   u=rwx,g=rwx,o=rx,g+s dir&gt;
21032286d8edStholo
21042286d8edStholo   - Change all the groups on the directories to match the groups you
21052286d8edStholo   want to write to various directories.
21062286d8edStholo
21072286d8edStholo   - Make sure every user is in the appropriate groups.
21082286d8edStholo
21092286d8edStholo   - Have everyone set their umask to 002, including root.
21102286d8edStholo
21112286d8edStholo   If you don't want non-group members to even read the files, do the
21122286d8edStholo   above, but change:
21132286d8edStholo
21142286d8edStholo   - Repository directory permissions to 770. (or 2770)
21152286d8edStholo
21162286d8edStholo   - umasks to 007.
21172286d8edStholo
21182286d8edStholo   If you work in an environment where people can't be trusted to set
21192286d8edStholo   their "umask" to something reasonable, you might want to set the umask
21202286d8edStholo   for them:
21212286d8edStholo
21222286d8edStholo                mv /usr/local/bin/cvs /usr/local/bin/cvs.real
21232286d8edStholo                cat > /usr/local/bin/cvs
21242286d8edStholo                #!/bin/sh
21252286d8edStholo                umask 2         # Or whatever your site standard is.
21262286d8edStholo                exec /usr/local/bin/cvs.real ${1+"$@"}
21272286d8edStholo                ^D
21282286d8edStholo
2129c71bc7e2Stholo   Pserver (Password-Authenticated Access) &lt;blome@de.ibm.com&gt;
2130c71bc7e2Stholo
2131c71bc7e2Stholo   The above suggestions are not valid when you use the pserver facility.
2132c71bc7e2Stholo   Be sure to read and understand the manual section about this (should
2133c71bc7e2Stholo   be 4.6.something). Above all: do /not/ make the repository and CVSROOT
2134c71bc7e2Stholo   group writeable. In CVSROOT, make `history� group or world writeable
2135c71bc7e2Stholo   instead.
2136c71bc7e2Stholo
2137c71bc7e2Stholo   I suggest creating one unix group per project group. In the
2138c71bc7e2Stholo   repository, you would then create one directory for each group, group
2139c71bc7e2Stholo   writeable. New projects must then be created in these group
2140c71bc7e2Stholo   directories. If you don't want to say &lt;group&gt;/&lt;project&gt; on
2141c71bc7e2Stholo   checkout, create a &lt;project&gt; module and point it there.
2142c71bc7e2Stholo
2143c71bc7e2Stholo   Last modified: _9/24/1998_
21442286d8edStholo
21452286d8edStholo    6. How do I structure my Repository?
21462286d8edStholo
21472286d8edStholo   The Repository holds your software. It can be all interrelated or it
21482286d8edStholo   can be a bunch of separately managed directories.
21492286d8edStholo
21502286d8edStholo   How you break a whole system down into its component parts, while
21512286d8edStholo   defining interfaces between them, is one aspect of "Software
21522286d8edStholo   Engineering", a discipline that requires the study of dozens of
21532286d8edStholo   strange and wonderful areas of the computer and management worlds.
21542286d8edStholo
21552286d8edStholo   CVS provides a way to keep track of changes to individual files, a way
21562286d8edStholo   to "tag" collections of files, and a way to "name" collections of
21572286d8edStholo   files and directories. That's all. Everything else is in the way you
21582286d8edStholo   apply it.
21592286d8edStholo
21602286d8edStholo   In other words, you should structure your Repository to match your
21612286d8edStholo   needs, usually tied in with the other tools you use to build, install
21622286d8edStholo   and distribute your work. Common needs include the ability to:
21632286d8edStholo
21642286d8edStholo   - mount (or automount) directories from many places in your
21652286d8edStholo   organization.
21662286d8edStholo   - check out just what you need and no more.
21672286d8edStholo   - check out multiple sections in a fixed relation to each other.
21682286d8edStholo   - check out large sections to match the assumptions built into your
21692286d8edStholo   build system. (Makefiles?)
21702286d8edStholo
21712286d8edStholo   In my opinion, you should start small and keep everything in one tree,
21722286d8edStholo   placing each major sub-system into a separate directory. Later, when
21732286d8edStholo   you know what you are doing, you can make it more sophisticated.
21742286d8edStholo
21752286d8edStholo   Last modified: _6/13/1997_
21762286d8edStholo
21772286d8edStholo    7. Why would anyone use "modules"? They are too restrictive. I want to be
21782286d8edStholo    able to select just the files I want to edit.
21792286d8edStholo
21802286d8edStholo   Any form of structure is restrictive. If you believe that total chaos
21812286d8edStholo   is a viable working paradigm, or if you believe you can keep track of
21822286d8edStholo   the interrelations between all portions of your Repository in your
21832286d8edStholo   head, then you can do what you please.
21842286d8edStholo
21852286d8edStholo   If you believe that systems of files require management and structure,
21862286d8edStholo   then the "modules" idea is very useful. It is a way to impose a naming
21872286d8edStholo   scheme on a tree of files, a naming scheme that can be simpler than a
21882286d8edStholo   large list of relative pathnames.
21892286d8edStholo
21902286d8edStholo   The "modules" file represents a published interface to the Repository
21912286d8edStholo   set up by your Repository Administrator. If s/he did a creditable job,
21922286d8edStholo   the modules offered will be internally consistent and will smoothly
21932286d8edStholo   interact with the rest of your environment.
21942286d8edStholo
21952286d8edStholo   Last modified: _6/13/1997_
21962286d8edStholo
21972286d8edStholo    8. How do I rename a file or directory? What are the consequences?
21982286d8edStholo
21992286d8edStholo   In CVS there is no single "rename" command.
22002286d8edStholo
22012286d8edStholo   See 2C.4 for the suggested way to rename a file or directory.
22022286d8edStholo
22032286d8edStholo   The rest of this section covers some of the consequences of renaming.
22042286d8edStholo
22052286d8edStholo   A "renaming database" has been proposed that would keep track of name
22062286d8edStholo   changes so that "update -r <tag>" would continue to work across the
22072286d8edStholo   renaming. But as it stands, you have to pick one of the following
22082286d8edStholo   options:
22092286d8edStholo
22102286d8edStholo     Use the technique described in 2C.4. (For each file, duplicate the
22112286d8edStholo   file in the Repository, "remove" the old version so it winds up in the
22122286d8edStholo   Attic and strip all Tags off the new version.)
22132286d8edStholo
22142286d8edStholo   - "update -r <tag>" produces the correct files.
22152286d8edStholo
22162286d8edStholo   - The duplicated revision history can be slightly misleading.
22172286d8edStholo
22182286d8edStholo   - A plain (i.e. without the "-r <tag>") "checkout" or "update -d" will
22192286d8edStholo   create directories "renamed" this way, but you can delete it and a
22202286d8edStholo   plain "update" won't bring it back.
22212286d8edStholo
22222286d8edStholo     Move the files and directories in the Repository to the new names.
22232286d8edStholo
22242286d8edStholo   - You save the revision history under a different file name.
22252286d8edStholo
22262286d8edStholo   - You save a little space.
22272286d8edStholo
22282286d8edStholo   - "update -r <tag>" produces the wrong files or directories.
22292286d8edStholo
22302286d8edStholo   This is not a good general solution, but if you plan never to look
22312286d8edStholo   back (someone may be gaining on you!), it is sometimes a useful
22322286d8edStholo   notion.
22332286d8edStholo
22342286d8edStholo   If you are clever with Makefiles, you might be able to rework them to
22352286d8edStholo   handle either the new or old names, depending on which ones exist at
22362286d8edStholo   the time. Then you can move an old <tag> onto the new, more
22372286d8edStholo   sophisticated, revision of the Makefile. (Yes, this changes the
22382286d8edStholo   "released" file if <tag> indicates a release. But it is an option.)
22392286d8edStholo
22402286d8edStholo   - Important Note: If you rename a directory, you must rename the
22412286d8edStholo   corresponding directory in every checked-out working directory. At the
22422286d8edStholo   same time, you must edit the pathname stored in the ./CVS/Repository
22432286d8edStholo   file within each of the moved directories.
22442286d8edStholo
22452286d8edStholo   The easiest way to move a lot of directories around is to tell
22462286d8edStholo   everyone to remove their working directories and check them out again
22472286d8edStholo   from scratch.
22482286d8edStholo
22492286d8edStholo   - The file exists in the working directory and in the ./CVS/Entries
22502286d8edStholo   file, but not in the Repository. For the old file, "update" prints:
22512286d8edStholo
22522286d8edStholo   cvs update: xyz.c is no longer in the repository
22532286d8edStholo
22542286d8edStholo   and deletes the file. If the file was modified, "update" prints:
22552286d8edStholo
22562286d8edStholo   cvs update: conflict: xyz.c is modified but no longer in the
22572286d8edStholo   repository C xyz.c
22582286d8edStholo
22592286d8edStholo   and leaves the file alone. In the new directory, you see:
22602286d8edStholo
22612286d8edStholo   U xyz.c
22622286d8edStholo
22632286d8edStholo   as you would if someone else executed "add" and "commit".
22642286d8edStholo
22652286d8edStholo     For each file, copy the working file to a new name in the working
22662286d8edStholo   directory and use the "cvs remove" to get rid of the old old file and
22672286d8edStholo   "cvs add" to add the new one. Since there is no way for CVS to remove
22682286d8edStholo   a directory, this only works for files.
22692286d8edStholo
22702286d8edStholo   - This is what most people think of first. Without a "rename" command,
22712286d8edStholo   the remove/add technique seems obvious.
22722286d8edStholo
22732286d8edStholo   - You lose the connection of your new working file to its past
22742286d8edStholo   revision history.
22752286d8edStholo
22762286d8edStholo   Last modified: _6/13/1997_
22772286d8edStholo
22782286d8edStholo    9. What are "Attic" directories?
22792286d8edStholo
22802286d8edStholo   When you use the "remove" command on a file, CVS doesn't delete the
22812286d8edStholo   file, it only registers your desire to delete it.
22822286d8edStholo
22832286d8edStholo   When you "commit" a removed file, CVS moves the Repository's matching
22842286d8edStholo   RCS file into a sub-directory named "Attic" within the Repository.
22852286d8edStholo
22862286d8edStholo   Attic files are examined when the '-r' or '-D' option is used on
22872286d8edStholo   "checkout" or "update". If the specified revision, tag or date matches
22882286d8edStholo   one on a file in the Attic, that file is checked out with the others.
22892286d8edStholo
22902286d8edStholo   You can think of the Attic as a sort of dead branch, which is only
22912286d8edStholo   looked at when you refer to a <tag> or <date>.
22922286d8edStholo
22932286d8edStholo   Last modified: _6/13/1997_
22942286d8edStholo
22952286d8edStholo    10. Is it OK to remove anything from the Repository?
22962286d8edStholo
22972286d8edStholo   In general, removing anything from the Repository is a bad idea. The
22982286d8edStholo   information in a deleted object is lost forever. There are many ways
22992286d8edStholo   to skip over files, directories and revisions without deleting them.
23002286d8edStholo
23012286d8edStholo   Here are some of the consequences of removing the following things
23022286d8edStholo   stored in the Repository:
23032286d8edStholo
23042286d8edStholo     CVSROOT files (Repository control files)
23052286d8edStholo
23062286d8edStholo   The Repository will work without any of them, but you should
23072286d8edStholo   understand what you are losing by deleting them. See 4B.2.
23082286d8edStholo
23092286d8edStholo     Revisions
23102286d8edStholo
23112286d8edStholo   The only way to remove revisions is to use the "admin -o" command (or
23122286d8edStholo   the equivalent RCS command "rcs -o").
23132286d8edStholo
23142286d8edStholo   They are lost forever. Any tags formerly attached to deleted revisions
23152286d8edStholo   are now pointing into the Phantom Zone. You'll need to contact Jor-el
23162286d8edStholo   to get them back.
23172286d8edStholo
23182286d8edStholo     Files
23192286d8edStholo
23202286d8edStholo   You should not remove a file unless you truly never want to see it
23212286d8edStholo   again. If you want to be able to check out an old revision of this
23222286d8edStholo   file, use "cvs remove" instead.
23232286d8edStholo
23242286d8edStholo     Tags
23252286d8edStholo
23262286d8edStholo   Tags take up little space and you can't recover from deleting them. If
23272286d8edStholo   you depend on tags for releases you will lose vital information.
23282286d8edStholo
23292286d8edStholo     Directories
23302286d8edStholo
23312286d8edStholo   There is no Attic for directories, so the only way to remove them is
23322286d8edStholo   to use "rm -r". They are gone forever.
23332286d8edStholo
23342286d8edStholo   If you delete (or move) a directory, all checked-out versions of that
23352286d8edStholo   directory will cause CVS to halt. You'll have to visit each
23362286d8edStholo   checked-out directory and remove the matching working directory by
23372286d8edStholo   hand.
23382286d8edStholo
23392286d8edStholo     Attic files
23402286d8edStholo
23412286d8edStholo   The "remove" command sends files to the Attic. To really delete them,
23422286d8edStholo   you have to go into the Attic and use "rm".
23432286d8edStholo
23442286d8edStholo   If a file in the Attic has a Tag on it that you might ever want to
23452286d8edStholo   check out again, you probably don't want to delete it.
23462286d8edStholo
23472286d8edStholo     Lock files (named: "#cvs.[wr]fl.<pid>")
23482286d8edStholo
23492286d8edStholo   These are lock files. If you are getting "lock" errors and the dates
23502286d8edStholo   on the lock files indicate that they are old, you can delete them.
23512286d8edStholo
23522286d8edStholo   Deleting lock files still in use by a CVS process might produce
23532286d8edStholo   unusual errors.
23542286d8edStholo
23552286d8edStholo   Last modified: _6/13/1997_
23562286d8edStholo
23572286d8edStholo    11. Can I convert to CVS from RCS without losing my revision history?
23582286d8edStholo
23592286d8edStholo   Yes, you can simply move (or copy) your RCS files into a directory
23602286d8edStholo   within the Repository, check out that directory and start working.
23612286d8edStholo
23622286d8edStholo   Last modified: _6/13/1997_
23632286d8edStholo
23642286d8edStholo    12. Can I move RCS files with branches in them into the Repository?
23652286d8edStholo
23662286d8edStholo   Yes, but they may not work if you created branches in a way that
23672286d8edStholo   conflicts with CVS's assumptions:
23682286d8edStholo
23692286d8edStholo     You can't use .0. branches. (They are reserved for "Magic" branch
23702286d8edStholo   tags.)
23712286d8edStholo
23722286d8edStholo     If you use branch 1.1.1, you can't use the Vendor branch.
23732286d8edStholo
23742286d8edStholo   You can use other RCS branches under CVS. There is no need to create
23752286d8edStholo   "magic" branch tags because the physical branch already exists.
23762286d8edStholo
23772286d8edStholo   Last modified: _6/13/1997_
23782286d8edStholo
23792286d8edStholo    13. Can I use raw RCS commands on the Repository?
23802286d8edStholo
23812286d8edStholo   You can use raw rcs commands directly on the Repository if you take a
23822286d8edStholo   little care. The Repository itself contains no "CVS state" (as opposed
23832286d8edStholo   to RCS revision histories) outside the CVSROOT directory.
23842286d8edStholo
23852286d8edStholo   But using raw RCS commands to change branches, tags or other things
23862286d8edStholo   that CVS depends on may render the files unusable.
23872286d8edStholo
23882286d8edStholo   See 4D.7 on RCS/CVS sharing of the Repository and Section 3B on the
23892286d8edStholo   "admin" command.
23902286d8edStholo
23912286d8edStholo   Last modified: _6/13/1997_
23922286d8edStholo
23932286d8edStholo    14. How do I convert from SCCS to RCS?
23942286d8edStholo
23952286d8edStholo   You'll have to execute something like "sccs2rcs" (in the CVS contrib
23962286d8edStholo   directory) on every file. Then you can move the resulting RCS files
23972286d8edStholo   into the Repository as described above.
23982286d8edStholo
23992286d8edStholo   Last modified: _6/13/1997_
24002286d8edStholo
24012286d8edStholo    15. How do I limit access to the Repository?
24022286d8edStholo
24032286d8edStholo   There are all sorts of ways to restrict access to Repository files,
24042286d8edStholo   none of which are hooked directly into CVS.
24052286d8edStholo
24062286d8edStholo   Techniques for limiting access include:
24072286d8edStholo
24082286d8edStholo     Training, management and good backups.
24092286d8edStholo
24102286d8edStholo   The best form of Repository control is a combination of:
24112286d8edStholo
24122286d8edStholo   - A reliable backup scheme (verify it!)
24132286d8edStholo   - Enough training to ensure your developers are competent and
24142286d8edStholo   knowledgeable about all areas of your sources.
24152286d8edStholo   - Effective management of the boundaries and grey areas.
24162286d8edStholo
24172286d8edStholo   In many cases, technical solutions to "security" problems are
24182286d8edStholo   inadequate. You should first try to avoid them.
24192286d8edStholo
24202286d8edStholo   Personal Opinion: In an environment where "unknowns" are allowed to
24212286d8edStholo   touch important sources the "owner" of the CVS Repository must be a
24222286d8edStholo   large, loud, vigorous lout with a well-balanced truncheon and the
24232286d8edStholo   right to use it. Don't underestimate the effectiveness of letting
24242286d8edStholo   everyone know they will be strapped into the stocks on the Town Common
24252286d8edStholo   and pelted with vegetables if they break something they don't
24262286d8edStholo   understand without first asking the experts.
24272286d8edStholo
24282286d8edStholo     Set Unix groups and permissions. See 4B.5. You can set different
24292286d8edStholo   owners, groups and permissions for each sub-directory within the
24302286d8edStholo   Repository if that helps.
24312286d8edStholo
24322286d8edStholo     Catch invocations of "commit" by defining pre-commit programs in the
24332286d8edStholo   "commitinfo" file. This is fairly powerful, since it can block commits
24342286d8edStholo   based on anything you can program. Take a look at the programs in the
24352286d8edStholo   "contrib" directory of the CVS source tree.
24362286d8edStholo
24372286d8edStholo     Use multiple Repositories, each with its own protection scheme. If
24382286d8edStholo   you use NFS (or AFS) you can even use "export" restrictions to various
24392286d8edStholo   groups of machines to keep (for example) the Engineering Repository
24402286d8edStholo   off the Customer Service machines.
24412286d8edStholo
24422286d8edStholo     Try the "setgid" trick described in 4D.13.
24432286d8edStholo
24442286d8edStholo     Try to use the RCS access control lists, though I don't think CVS
24452286d8edStholo   will handle them cleanly.
24462286d8edStholo
24472286d8edStholo     Edit the source code to CVS to add your own access control.
24482286d8edStholo
24492286d8edStholo   Last modified: _6/13/1997_
24502286d8edStholo
24512286d8edStholo    16. What are the Repository Administrator's responsibilities?
24522286d8edStholo
24532286d8edStholo   Generally, the Administrator should set "policy", create the
24542286d8edStholo   Repository and monitor its size and control files.
24552286d8edStholo
24562286d8edStholo   Some specific responsibilities include:
24572286d8edStholo
24582286d8edStholo     Examining the Repository once in a while to clean up:
24592286d8edStholo
24602286d8edStholo     Trash files left by misguided developers who mistake the Repository
24612286d8edStholo   for a working directory.
24622286d8edStholo
24632286d8edStholo     Non-RCS files. Other than the files CVS needs in the
24642286d8edStholo   $CVSROOT/CVSROOT directory, every file in the Repository should be an
24652286d8edStholo   RCS file.
24662286d8edStholo
24672286d8edStholo     Lock files (both CVS '#*' and RCS ',*' files) left around after
24682286d8edStholo   crashes.
24692286d8edStholo
24702286d8edStholo     Wrong permissions, groups and ownerships.
24712286d8edStholo
24722286d8edStholo     Locked files. (RCS locks, that is.)
24732286d8edStholo
24742286d8edStholo     Attic files that should never have been under CVS at all. Don't
24752286d8edStholo   blindly delete files from Attic directories -- they were mostly put
24762286d8edStholo   there (via the "cvs remove") for a reason. Files that should be
24772286d8edStholo   deleted are binary files (e.g. '*.o', 'core', executables) that were
24782286d8edStholo   mistakenly inserted by "import -I !".
24792286d8edStholo
24802286d8edStholo     Maintaining the modules file.
24812286d8edStholo
24822286d8edStholo     Storing site-specific ignore patterns in the
24832286d8edStholo   $CVSROOT/CVSROOT/cvsignore file.
24842286d8edStholo
24852286d8edStholo     Storing the names of non-standard CVSROOT files (See 4B.2) in the
24862286d8edStholo   $CVSROOT/CVSROOT/checkoutlist
24872286d8edStholo
24882286d8edStholo     Maintaining the other Repository control files: commitinfo, loginfo,
24892286d8edStholo   rcsinfo and editinfo.
24902286d8edStholo
24912286d8edStholo     Pruning the history file every once in a while. (Try the
24922286d8edStholo   "cln_hist.pl" script in the "contrib" directory.)
24932286d8edStholo
24942286d8edStholo     Staying aware of developments on the info-cvs mailing list and what
24952286d8edStholo   is available in the FTP and WWW archives.
24962286d8edStholo
24972286d8edStholo     Running "ps ax" once in a while and kill off any "update" programs
24982286d8edStholo   not running as "root". It is too easy to leave the "cvs" off the front
24992286d8edStholo   of the "cvs update" command.
25002286d8edStholo
25012286d8edStholo     Executing monitor programs to check the internal consistency of the
25022286d8edStholo   Repository files. Ideas:
25032286d8edStholo
25042286d8edStholo     Files that have a default RCS branch that is not 1.1.1 (From an
25052286d8edStholo   abuse of "admin -b".)
25062286d8edStholo
25072286d8edStholo     Files that have only Revisions 1.1 and 1.1.1.1, with a default
25082286d8edStholo   branch of "MAIN". (From an abuse of "admin -o".)
25092286d8edStholo
25102286d8edStholo     Existing branch tags and various branch consistency checks.
25112286d8edStholo
25122286d8edStholo   Last modified: _6/13/1997_
25132286d8edStholo
25142286d8edStholo    17. How do I move the whole Repository?
25152286d8edStholo
25162286d8edStholo   Copy or move the tree. (On Unix systems, a set of piped "tar" commands
25172286d8edStholo   works great. If the Repository does not contain any symlinks, which it
25182286d8edStholo   normally doesn't, you can also use "cp -r".)
25192286d8edStholo
25202286d8edStholo   If you can avoid changing $CVSROOT (i.e. the "logical" pathname of the
25212286d8edStholo   Repository) by replacing the old location with a symbolic link to the
25222286d8edStholo   new location, you don't have to do anything else.
25232286d8edStholo
25242286d8edStholo   (You could also mount the new location on top of the old location if
25252286d8edStholo   you are using NFS or some other filesystem that allows it.)
25262286d8edStholo
25272286d8edStholo   If you must change $CVSROOT, you must also tell everyone to change the
25282286d8edStholo   CVSROOT environment variable in all running shells and in any personal
25292286d8edStholo   configuration files ('.' files on Unix) where it is set.
25302286d8edStholo
25312286d8edStholo   The Repository itself contains no references to its own name, except
25322286d8edStholo   possibly in some of the files in the CVSROOT directory. If your
25332286d8edStholo   modules (or loginfo, commitinfo, etc.) file mentions helper programs
25342286d8edStholo   directly in the Repository, you'll have to change the pathnames to
25352286d8edStholo   point to the new Repository location.
25362286d8edStholo
25372286d8edStholo   The main changes you'll have to make are to all the CVS administrative
25382286d8edStholo   files (./CVS/Repository and ./CVS/Root) in every working directory
25392286d8edStholo   ever checked out from the previous location of the Repository you just
25402286d8edStholo   moved.
25412286d8edStholo
25422286d8edStholo   You have three choices:
25432286d8edStholo
25442286d8edStholo     If all ./CVS/Repository files in all working directories contain
25452286d8edStholo   relative pathnames, you don't have to do anything else.
25462286d8edStholo
25472286d8edStholo     Have everyone "release" or delete their working directories (after
25482286d8edStholo   committing, or just saving, their work) and check them all out again
25492286d8edStholo   from the new Repository after the move.
25502286d8edStholo
25512286d8edStholo     Use "find . ( -name Repository -o -name Root )" and a PERL or shell
25522286d8edStholo   script to run through all the ./CVS/Repository and ./CVS/Root files
25532286d8edStholo   and edit the values in the files.
25542286d8edStholo
25552286d8edStholo   Last modified: _6/13/1997_
25562286d8edStholo
25572286d8edStholo    18. How do I change permissions on a file in the Repository by using a CVS
25582286d8edStholo    command? (i.e. without using "chmod 777 $CVSROOT/dir/file")
25592286d8edStholo
25602286d8edStholo   When you first "import" or "add"/"commit" a file, the read and execute
25612286d8edStholo   bits on the Repository file are inherited from the original source
25622286d8edStholo   file, while the write bits on the Repository file are are turned off.
25632286d8edStholo   This is a standard RCS action.
25642286d8edStholo
25652286d8edStholo   After that, there is no way to alter the permissions on a file in the
25662286d8edStholo   Repository using CVS (or RCS) commands. You have to change the
25672286d8edStholo   permissions on both your working file and on the Repository file from
25682286d8edStholo   which it was retrieved.
25692286d8edStholo
25702286d8edStholo   Whenever you "checkout" the file or retrieve a new revision via
25712286d8edStholo   "update" (or after a "commit"), your working file is set to match the
25722286d8edStholo   permissions of the Repository file, minus any "umask" bits you have
25732286d8edStholo   set.
25742286d8edStholo
25752286d8edStholo   Last modified: _6/13/1997_
25762286d8edStholo
25772286d8edStholo  Category: /Advanced_Topics_/Tricks_of_the_Trade/
25782286d8edStholo
25792286d8edStholo   " + Tricks of the Trade"
25802286d8edStholo
25812286d8edStholo    1. How can you even check in binary files, let alone allow CVS to do its
25822286d8edStholo    auto-merge trick on them?
25832286d8edStholo
25842286d8edStholo
25852286d8edStholoFirst of all, if you want to use binary files, you should get RCS 5.7
25862286d8edStholoand CVS 1.9 or later (earlier versions had some support, but there have been
25872286d8edStholobug fixes).  Secondly, follow the instructions for installing RCS very
25882286d8edStholocarefully (it is easy to get it installed so it works for everything
25892286d8edStholoexcept binary files).
25902286d8edStholo
25912286d8edStholoThen, specify 'cvs add -kb' instead of just 'cvs add' to add a binary
25922286d8edStholofile.  If you want to set an existing file to binary, run 'cvs admin
25932286d8edStholo-kb' (and then check in a new copy of the file).  Note that old
25942286d8edStholoversions of CVS used -ko instead of -kb for binary files, so if you
25952286d8edStholosee a reference to -ko in the context of binary files, you should
25962286d8edStholothink -kb instead.
25972286d8edStholo
25982286d8edStholoOf course when 'cvs update' finds that a merge is needed, it can't
25992286d8edStholodo this for binary files the same way as for text files.  With the
26002286d8edSthololatest versions (e.g. CVS 1.9.14), it should be able to give you both
26012286d8edStholoversions and let you merge manually.  Another approach is to
26022286d8edStholorun 'cvs admin -l' to lock files, as described in
26032286d8edStholo"How can I lock files while I'm working on them the way RCS does?"
26042286d8edStholoelsewhere in this FAQ.  See also
26052286d8edStholo"Is there any way to import binary files?" and
26062286d8edStholo"How do I "add" a binary file?" elsewhere in this FAQ.
26072286d8edStholo
26082286d8edStholokingdon@cyclic.com
26092286d8edStholo
26102286d8edStholo   Last modified: _9/6/1997_
26112286d8edStholo
26122286d8edStholo    2. Can I edit the RCS (",v") files in the Repository?
26132286d8edStholo
26142286d8edStholo   Yes, but be very careful. The RCS files are not free-form files, they
26152286d8edStholo   have a structure that is easily broken by hand-editing. The only time
26162286d8edStholo   I would suggest doing this is to recover from emergency failures that
26172286d8edStholo   are difficult to deal with using CVS commands, including the "admin"
26182286d8edStholo   command, which can talk directly to RCS.
26192286d8edStholo
26202286d8edStholo   Though no one actively encourages the editing of RCS files, many
26212286d8edStholo   people have succumbed to the urge to do so when pressed for time. The
26222286d8edStholo   reasons given, usually with evident contrition, include:
26232286d8edStholo
26242286d8edStholo   - Editing mistakes in, or adding text to, log entries. (If you have
26252286d8edStholo   RCS 5.6 or later, you should use `cvs admin -m'.)
26262286d8edStholo   - Renaming or moving symbolic names. (You should `cvs admin -N'
26272286d8edStholo   instead.)
26282286d8edStholo   - Unlocking a file by changing the "locker" from someone else to
26292286d8edStholo   yourself. (It's safer to use `cvs admin -u -l'.)
26302286d8edStholo   - Making global changes to past history. Example: Eradicating former
26312286d8edStholo   employees names from old documents and Author entries. (And someone
26322286d8edStholo   thought the "history" command was evidence of Big Brother! I never
26332286d8edStholo   realized how much help a wide-open revision control system could have
26342286d8edStholo   provided to The Ministry of Truth.)
26352286d8edStholo
26362286d8edStholo   Last modified: _6/13/1997_
26372286d8edStholo
26382286d8edStholo    3. Can I edit the ./CVS/{Entries,Repository,Tag} files?
26392286d8edStholo
26402286d8edStholo   Yes, but with CVS 1.3 and later, there is almost no reason to edit any
26412286d8edStholo   of the CVS administrative files.
26422286d8edStholo
26432286d8edStholo   If you move pieces of your Repository around it can be faster to edit
26442286d8edStholo   all the ./CVS/Repository files rather than checking out a large tree.
26452286d8edStholo   But that is nearly the only reason to do so.
26462286d8edStholo
26472286d8edStholo   Last modified: _6/13/1997_
26482286d8edStholo
26492286d8edStholo    4. Someone executed "admin -o" and removed revisions to which tags/symbols
26502286d8edStholo    were attached. How do I fix them?
26512286d8edStholo
26522286d8edStholo   It depends on what you mean by "fix". I can think of three ways to fix
26532286d8edStholo   your predicament:
26542286d8edStholo
26552286d8edStholo     Remove the tags.
26562286d8edStholo
26572286d8edStholo   Assuming you really wanted to get rid of the revision and its
26582286d8edStholo   associated tags, you can remove them with the "admin" command. The
26592286d8edStholo   "tag -d" command will only remove tags attached to existing revisions.
26602286d8edStholo   You can remove a tag, even if it is attached to a non-existent
26612286d8edStholo   revision, by typing:
26622286d8edStholo
26632286d8edStholo                cvs admin -N<tag> <file>
26642286d8edStholo
26652286d8edStholo     Retrieve the outdated revision.
26662286d8edStholo
26672286d8edStholo   You should first look in your backup system for recent versions of the
26682286d8edStholo   file. If you can't use them, you can carefully extract each revision
26692286d8edStholo   that followed the earliest outdated revision using RCS (or "cvs
26702286d8edStholo   admin") commands and reconstruct the file with all the right
26712286d8edStholo   revisions, branches and tags. This is a lot of work.
26722286d8edStholo
26732286d8edStholo   You *can't* insert a revision into the current RCS file.
26742286d8edStholo
26752286d8edStholo     Move the Tags to another revision in each file.
26762286d8edStholo
26772286d8edStholo   If you want to move the tags to another valid revision, you have two
26782286d8edStholo   choices, both of which require that you find all the revision numbers
26792286d8edStholo   of the files you want to "tag" and execute the following command
26802286d8edStholo   sequences on each <file>.
26812286d8edStholo
26822286d8edStholo     Use "update" to grab the revision you want, then execute a normal
26832286d8edStholo   "tag" command to Tag that revision:
26842286d8edStholo
26852286d8edStholo                        cvs update -r <rev> <file>
26862286d8edStholo                        cvs tag <tag> <file>
26872286d8edStholo
26882286d8edStholo     Use "admin" to set the tag to a specific revision:
26892286d8edStholo
26902286d8edStholo                        cvs admin -N<tag>:<rev> <file>
26912286d8edStholo
26922286d8edStholo   Last modified: _6/13/1997_
26932286d8edStholo
26942286d8edStholo    5. How do I move or rename a magic branch tag?
26952286d8edStholo
26962286d8edStholo   (To rename a non-branch <tag> see 3O.9.)
26972286d8edStholo
26982286d8edStholo   Before reading this, read 3M.3 and 3M.4 and understand exactly how tag
26992286d8edStholo   and rtag use '-r' and why it won't do the right job here.
27002286d8edStholo
27012286d8edStholo     First, I have to explain exactly what a magic branch tag is.
27022286d8edStholo
27032286d8edStholo   A magic <branch_tag> is an artificial tag attached to a non-existent
27042286d8edStholo   revision on a non-existent branch number zero. It looks like this:
27052286d8edStholo
27062286d8edStholo                TAG1:<X>.0.Y
27072286d8edStholo
27082286d8edStholo   <X> is the "branch point revision", a normal revision with an
27092286d8edStholo                odd number of '.'s in it. (e.g. 1.5, 1.3.1.6, etc)
27102286d8edStholo
27112286d8edStholo             Y  is an even number (e.g. 2, 4, 6, etc.)  All CVS branches,
27122286d8edStholo                other than the Vendor branch, are even numbered.
27132286d8edStholo
27142286d8edStholo   TAG1 is considered by CVS to be attached to revision <X>. The first
27152286d8edStholo   "update -r TAG1 <file>" after applying TAG1 will produce a copy of
27162286d8edStholo   revision <X> with a sticky tag of TAG1. The first "commit" to that
27172286d8edStholo   file will cause CVS to construct an RCS branch named <X>.Y and check
27182286d8edStholo   in revision <X>.Y.1 on the new branch.
27192286d8edStholo
27202286d8edStholo   Note: TAG1 is *not* considered to be attached to <X> by RCS, which
27212286d8edStholo   explains why you can't refer directly to the branch point revision for
27222286d8edStholo   some CVS commands.
27232286d8edStholo
27242286d8edStholo     Moving a magic <branch_tag> is the act of reapplying the same tag to
27252286d8edStholo   different revisions in the file:
27262286d8edStholo
27272286d8edStholo                TAG1:<X>.0.Y
27282286d8edStholo           to
27292286d8edStholo                TAG1:<X>.0.Z    or      TAG1:<A>.0.B
27302286d8edStholo
27312286d8edStholo   You can move a magic branch tag to the revisions of your choice by
27322286d8edStholo   using "update" to find the revisions you want to tag and reapplying
27332286d8edStholo   the tag to all the files with the '-F' option to force it to move the
27342286d8edStholo   existing <branch_tag>.
27352286d8edStholo
27362286d8edStholo                cvs update -r <tag/rev>  (or '-A' for the Main Branch)
27372286d8edStholo                cvs tag -F -b <branch_tag>
27382286d8edStholo
27392286d8edStholo   If the earlier location of TAG1 refers to a physical branch within any
27402286d8edStholo   RCS file, moving it will make the existing branch in the file seem to
27412286d8edStholo   disappear from CVS's view. This is not a good idea unless you really
27422286d8edStholo   want to forget the existence of those RCS branches.
27432286d8edStholo
27442286d8edStholo   If the "update" above retrieves the original branch point revision
27452286d8edStholo   (<X>), the "tag" command above will create the tag:
27462286d8edStholo
27472286d8edStholo                TAG1:<X>.0.Z
27482286d8edStholo
27492286d8edStholo   Where Z is 2 greater than the highest magic branch already on revision
27502286d8edStholo   <X>. The TAG1 branch will still have the same branch point (i.e.
27512286d8edStholo   revision <X>), but the first commit to the new TAG1 branch will create
27522286d8edStholo   a different RCS branch number (<X>.Z instead of <X>.Y).
27532286d8edStholo
27542286d8edStholo     Renaming a magic <branch_tag> is the act of changing
27552286d8edStholo
27562286d8edStholo                TAG1:<X>.0.Y
27572286d8edStholo           to
27582286d8edStholo                TAG2:<X>.0.Y
27592286d8edStholo
27602286d8edStholo   There is no harm in changing a tag name as long as you forget that
27612286d8edStholo   TAG1 ever existed and you clean up any working directories with sticky
27622286d8edStholo   TAG1 tags on them by using "update -A", "update -r <other_tag>" or by
27632286d8edStholo   removing the working directories.
27642286d8edStholo
27652286d8edStholo   On the other hand, actually changing the tag is not easy.
27662286d8edStholo
27672286d8edStholo   See 3M.3 for why the seemingly obvious solution won't work:
27682286d8edStholo
27692286d8edStholo                cvs tag -b -r <old_branch_tag> <new_branch_tag>
27702286d8edStholo
27712286d8edStholo   The only direct way to rename a magic tag is to use the "admin"
27722286d8edStholo   command on each file: (You might want to use '-n'. Read "man rcs" and
27732286d8edStholo   look at the '-n' and '-N' options.)
27742286d8edStholo
27752286d8edStholo                cvs admin -N<new_branch_tag>:<old_branch_tag> .
27762286d8edStholo                cvs tag -d <old_branch_tag>
27772286d8edStholo
27782286d8edStholo   But you have to be careful because "admin" is different from other CVS
27792286d8edStholo   commands:
27802286d8edStholo
27812286d8edStholo     "admin" can be used recursively, but only by specifying directory
27822286d8edStholo   names in its argument list (e.g. '.'),
27832286d8edStholo
27842286d8edStholo     Where "rtag -r <old_branch_tag>" would interpret <old_branch_tag> as
27852286d8edStholo   a magic CVS branch tag, "admin" is a direct interface to RCS which
27862286d8edStholo   sees a magic branch tag as a simple (though non-existent) RCS revision
27872286d8edStholo   number.
27882286d8edStholo
27892286d8edStholo   This is good for us in this particular case, but different from normal
27902286d8edStholo   CVS.
27912286d8edStholo
27922286d8edStholo     "admin" also skips the Attic and produces different kinds of errors
27932286d8edStholo   than CVS usually does. (Because they are coming directly from RCS.)
27942286d8edStholo
27952286d8edStholo   The other way to rename a magic <branch_tag> is to edit the Repository
27962286d8edStholo   files with a script of some kind. I've done it in the past, but I'll
27972286d8edStholo   leave it as an exercise for the reader.
27982286d8edStholo
27992286d8edStholo   Last modified: _6/13/1997_
28002286d8edStholo
28012286d8edStholo    6. Can I use RCS locally to record my changes without making them globally
28022286d8edStholo    visible by committing them?
28032286d8edStholo
28042286d8edStholo   You can, but it will probably confuse CVS to have ",v" files in your
28052286d8edStholo   working directory. And you will lose all your log entries when you
28062286d8edStholo   finally commit it.
28072286d8edStholo
28082286d8edStholo   Your best bet is to create your own CVS branch and work there. You can
28092286d8edStholo   commit as many revisions as you want, then merge it back into the main
28102286d8edStholo   line (or parent branch) when you are finished.
28112286d8edStholo
28122286d8edStholo   Last modified: _6/13/1997_
28132286d8edStholo
28142286d8edStholo    7. How can I allow access to the Repository by both CVS and RCS?
28152286d8edStholo
28162286d8edStholo   The first step is to try not to. If some people are using CVS, there
28172286d8edStholo   is no reason for everyone not to. It is not hard to learn the basics
28182286d8edStholo   and CVS makes certain operations *easier* than a series of RCS
28192286d8edStholo   commands. Personal preference in what software tools can be applied to
28202286d8edStholo   a shared Repository has to take second place to system integration
28212286d8edStholo   needs. If you disagree, try writing some Lisp code for inclusion in
28222286d8edStholo   your Unix kernel and see what kind of reception you get.
28232286d8edStholo
28242286d8edStholo   If you really must allow routine RCS access to the CVS Repository, you
28252286d8edStholo   can link an RCS sub-directory into a piece of the Repository:
28262286d8edStholo
28272286d8edStholo                ln -s /Repository/some/directory/I/want RCS
28282286d8edStholo
28292286d8edStholo   and RCS will work just fine.
28302286d8edStholo
28312286d8edStholo   Those who are using RCS will have to keep the following in mind:
28322286d8edStholo
28332286d8edStholo     If a file was originally added to the Repository by "import" and has
28342286d8edStholo   not been changed using CVS, the *RCS* default branch will remain
28352286d8edStholo   attached to the Vendor branch, causing revisions checked-in by "ci" to
28362286d8edStholo   wind up on the Vendor branch, instead of the main branch. Only CVS
28372286d8edStholo   moves the RCS default branch on first commit.
28382286d8edStholo
28392286d8edStholo   The way around this is to checkin (using "ci") all the files first and
28402286d8edStholo   move them into the Repository. That way they won't have Vendor
28412286d8edStholo   branches. Then RCS will work OK.
28422286d8edStholo
28432286d8edStholo     It is possible to use "rcs" and "ci" to make the files unusable by
28442286d8edStholo   CVS. The same is true of the CVS "admin" command.
28452286d8edStholo
28462286d8edStholo     Normal RCS practice locks a file on checkout with "co -l". In such
28472286d8edStholo   an environment, RCS users should plan to keep survival gear and food
28482286d8edStholo   for at least 30 days near their desks. When faced with bizarre and
28492286d8edStholo   unexpected permission errors, howling mobs of slavering CVS users will
28502286d8edStholo   run the RCS users out of town with pitchforks and machetes.
28512286d8edStholo
28522286d8edStholo   See 3C.8 for a way to avoid machetes aroused by lock collisions.
28532286d8edStholo
28542286d8edStholo     Though files checked in by RCS users will correctly cause
28552286d8edStholo   "up-to-date" failures during CVS "commits" and they will be
28562286d8edStholo   auto-merged into CVS working directories during "update", the opposite
28572286d8edStholo   won't happen.
28582286d8edStholo
28592286d8edStholo   RCS users will get no warning and will not be required to merge older
28602286d8edStholo   work into their code. They can easily checkin an old file on top of a
28612286d8edStholo   new revision added by CVS, discarding work committed earlier by CVS
28622286d8edStholo   users.
28632286d8edStholo
28642286d8edStholo   See the howling mob scenario described above.
28652286d8edStholo
28662286d8edStholo   RCS is great. I have used it for years. But I wouldn't mix it this
28672286d8edStholo   way. In a two-camp society, you are asking for real trouble, both in
28682286d8edStholo   technical hassles to clean up and in political hassles to soothe.
28692286d8edStholo   Branch merges will also be a major problem.
28702286d8edStholo
28712286d8edStholo   Last modified: _6/13/1997_
28722286d8edStholo
28732286d8edStholo    8. I "updated" a file my friend, "bubba", committed yesterday. Why doesn't
28742286d8edStholo    the file now have a modified date of yesterday?
28752286d8edStholo
28762286d8edStholo   CVS restores dates from the RCS files only on first "checkout". After
28772286d8edStholo   that, it is more important to maintain a timestamp relative to the
28782286d8edStholo   other files in the working directory.
28792286d8edStholo
28802286d8edStholo   Example: You committed a source file at 5PM. Bubba updated his copy of
28812286d8edStholo   the file, grabbing your changes, then changed and committed a new
28822286d8edStholo   revision of the file at 6PM. At 7PM, you compile your file. Then you
28832286d8edStholo   execute "update". If CVS sets the date to the one in the RCS file, the
28842286d8edStholo   file would be given a timestamp of 6PM and your Makefile wouldn't
28852286d8edStholo   rebuild anything that depended on it. Bad news.
28862286d8edStholo
28872286d8edStholo   Note that the same logic applies to retrieving a revision out of the
28882286d8edStholo   Repository to replace a deleted file. If CVS changes your file in an
28892286d8edStholo   existing working directory, whether it was because a new revision was
28902286d8edStholo   committed by someone else or because you deleted your working file,
28912286d8edStholo   the timestamp on the retrieved working file *must* be set to the
28922286d8edStholo   current time.
28932286d8edStholo
28942286d8edStholo   When you first retrieve a file, there is no reason to expect any
28952286d8edStholo   particular timestamp on the file within your working area. But later,
28962286d8edStholo   when dependency checking is performed during a build, it is more
28972286d8edStholo   important for the timestamps on the local files to be consistent with
28982286d8edStholo   each other than than it is for working files to match the timestamps
28992286d8edStholo   on the files in the Repository. See 4D.17 for some more about
29002286d8edStholo   timestamps.
29012286d8edStholo
29022286d8edStholo   Last modified: _6/13/1997_
29032286d8edStholo
2904c71bc7e2Stholo    9. Why do timestamps sometimes get set to the date of the revision,
2905c71bc7e2Stholo    sometimes not? The inconsistency causes unnecessary recompiles.
2906c71bc7e2Stholo
2907c71bc7e2Stholo   The "checkout" command normally sets the timestamp of a working file
2908c71bc7e2Stholo   to match the timestamp stored on the revision in the Repository's RCS
2909c71bc7e2Stholo   file.
2910c71bc7e2Stholo
2911c71bc7e2Stholo   The "commit" command retains the timestamp of the file, if the act of
2912c71bc7e2Stholo   checking it in didn't change it (by expanding keywords).
2913c71bc7e2Stholo
2914c71bc7e2Stholo   The "update" command sets the time to the revision time the first time
2915c71bc7e2Stholo   it sees the file. After that, it sets the time of the file to the
2916c71bc7e2Stholo   current time. See 4D.8 for a reason why.
2917c71bc7e2Stholo
2918c71bc7e2Stholo   Here's a two-line PERL program to set timestamps on files based on
2919c71bc7e2Stholo   other timestamps. I've found this program useful. When you are certain
2920c71bc7e2Stholo   you don't want a source file to be recompiled, you can set its
2921c71bc7e2Stholo   timestamp to the stamp on the object file.
2922c71bc7e2Stholo
2923c71bc7e2Stholo        #!/usr/local/bin/perl
2924c71bc7e2Stholo        #
2925c71bc7e2Stholo        # Set timestamp of args 2nd-Last to that of the first arg.
2926c71bc7e2Stholo        #
2927c71bc7e2Stholo        ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime)
2928c71bc7e2Stholo                = stat(shift);
2929c71bc7e2Stholo        utime($atime,$mtime,@ARGV);
2930c71bc7e2Stholo
2931c71bc7e2Stholo   Last modified: _6/13/1997_
2932c71bc7e2Stholo
2933c71bc7e2Stholo    10. While in the middle of a large "commit", how do I run other commands,
29342286d8edStholo    like "diff" or "stat" without seeing lock errors?
29352286d8edStholo
29362286d8edStholo   Type:
29372286d8edStholo                cvs -n <command>
29382286d8edStholo
29392286d8edStholo   The '-n' option to the main cvs command turns off lock checking, a
29402286d8edStholo   reasonable act for read-only commands given the promise offered by
29412286d8edStholo   '-n' not to alter anything. The "diff", "log" and "stat" commands
29422286d8edStholo   provide the same information (for files that are not being committed)
29432286d8edStholo   when used with and without the '-n' option.
29442286d8edStholo
29452286d8edStholo   Warning: Ignoring locks can produce inconsistent information across a
29462286d8edStholo   collection of files if you are looking at the revisions affected by an
29472286d8edStholo   active commit. Be careful when creating "patches" from the output of
29482286d8edStholo   "cvs -n diff". If you are looking only at your working files, tagged
29492286d8edStholo   revisions, and BASE revisions (revisions whose numbers are read from
29502286d8edStholo   your ./CVS/Entries files), you should get consistent results. Of
29512286d8edStholo   course, if you catch a single file in the middle of RCS activity, you
29522286d8edStholo   might get some strange errors.
29532286d8edStholo
29542286d8edStholo   Note that the suggested command is "cvs -n <command>". The visually
29552286d8edStholo   similar command "cvs <command> -n" has no relation to the suggested
29562286d8edStholo   usage and has an entirely different meaning for each command.
29572286d8edStholo
29582286d8edStholo   "cvs -n update" also works in the middle of a commit, providing
29592286d8edStholo   slightly different information from a plain "cvs update". But, of
29602286d8edStholo   course, it also avoids modifying anything.
29612286d8edStholo
29622286d8edStholo   You could also use the RCS functions, "rlog" and "rcsdiff" to display
29632286d8edStholo   some of the information by referring directly to the Repository files.
29642286d8edStholo
29652286d8edStholo   You need RCS version 5 or later for the commands described above to
29662286d8edStholo   work reliably.
29672286d8edStholo
29682286d8edStholo   Last modified: _6/13/1997_
29692286d8edStholo
2970c71bc7e2Stholo    11. Where did the ./CVS/Entries.Static file come from? What is it for?
29712286d8edStholo
29722286d8edStholo   Each CVS working directory contains a ./CVS/Entries file listing the
29732286d8edStholo   files managed by CVS in that working directory. Normally, if the
29742286d8edStholo   "update" command finds a file in the Repository that is not in the
29752286d8edStholo   ./CVS/Entries file, "update" copies the appropriate revision of the
29762286d8edStholo   "new" file out of the Repository and adds the filename to the Entries
29772286d8edStholo   file. This happens for files:
29782286d8edStholo
29792286d8edStholo     Added to the Repository from another working directory.
29802286d8edStholo
29812286d8edStholo     Dragged out of the Attic when switching branches with "update -A" or
29822286d8edStholo   "update -r".
29832286d8edStholo
29842286d8edStholo     Whose names were deleted from the ./CVS/Entries file.
29852286d8edStholo
29862286d8edStholo   If the ./CVS/Entries.Static file exists, CVS will only bring out
29872286d8edStholo   revisions of files that are contained in either ./CVS/Entries or
29882286d8edStholo   ./CVS/Entries.Static. If a Repository file is found in *neither* file,
29892286d8edStholo   it is ignored.
29902286d8edStholo
29912286d8edStholo   The ./CVS/Entries.Static file is created when you check out an
29922286d8edStholo   individual file or a module that creates working directories that
29932286d8edStholo   don't contain all files in the corresponding Repository directory. In
29942286d8edStholo   those cases, without an ./CVS/Entries.Static file, a simple "update"
29952286d8edStholo   would bring more files out of the Repository than the original
29962286d8edStholo   "checkout" wanted.
29972286d8edStholo
29982286d8edStholo   The ./CVS/Entries.Static file can be removed by hand. It is
29992286d8edStholo   automatically removed if you run "update -d" to create new directories
30002286d8edStholo   (even if no new directories are created). (Internally, since
30012286d8edStholo   "checkout" turns on the '-d' flag and calls the "update" routine, a
30022286d8edStholo   "checkout" of a module or directory that writes into an existing
30032286d8edStholo   directory will also remove the ./CVS/Entries.Static file.)
30042286d8edStholo
30052286d8edStholo   Last modified: _6/13/1997_
30062286d8edStholo
3007c71bc7e2Stholo    12. Why did I get the wrong Repository in the loginfo message?
30082286d8edStholo
30092286d8edStholo   You probably:
30102286d8edStholo
30112286d8edStholo     Use multiple Repositories.
30122286d8edStholo
30132286d8edStholo     Configured CVS to use absolute pathnames in the ./CVS/Repository
30142286d8edStholo   file.
30152286d8edStholo
30162286d8edStholo     Configured CVS not to use the ./CVS/Root file.
30172286d8edStholo
30182286d8edStholo     Typed the "commit" command in one Repository with your $CVSROOT
30192286d8edStholo   pointing at another.
30202286d8edStholo
30212286d8edStholo   "commit" and all other CVS commands will heed an absolute pathname in
30222286d8edStholo   the ./CVS/Repository file (or in the "-d CVSrootdir" override), but
30232286d8edStholo   the log function doesn't take arguments -- it just looks at $CVSROOT.
30242286d8edStholo
30252286d8edStholo   If you avoid even one of the four steps above, you won't see this
30262286d8edStholo   problem. If you configure ./CVS/Root, you won't be allowed to execute
30272286d8edStholo   the program causing the error.
30282286d8edStholo
30292286d8edStholo   Last modified: _6/13/1997_
30302286d8edStholo
3031c71bc7e2Stholo    13. How do I run CVS setuid so I can only allow access through the CVS
30322286d8edStholo    program itself?
30332286d8edStholo
30342286d8edStholo   Setuid to root is not a great idea. Any program that modifies files
30352286d8edStholo   and is used by a widely distributed group of users is not a good
30362286d8edStholo   candidate for a setuid program. (The worst suggestion I've ever heard
30372286d8edStholo   was to make *Emacs* setuid to root.)
30382286d8edStholo
30392286d8edStholo   Root access on Unix is too powerful. Also, it might not work in some
30402286d8edStholo   (secure?) environments.
30412286d8edStholo
30422286d8edStholo   Running it setuid to some user other than root might work, if you add
30432286d8edStholo   this line to main.c near the beginning:
30442286d8edStholo
30452286d8edStholo                setuid(geteuid());
30462286d8edStholo
30472286d8edStholo   Otherwise it uses *your* access rights, rather than the effective
30482286d8edStholo   uid's.
30492286d8edStholo
30502286d8edStholo   Also, you have to invent a fake user whose name will show up in
30512286d8edStholo   various places. But many sites, especially those who might want a
30522286d8edStholo   setuid CVS for "security", want personal accountability -- no generic
30532286d8edStholo   accounts. I don't know whether accountability outweighs file security.
30542286d8edStholo
30552286d8edStholo   And finally, unless you take action to limit the "admin" command, you
30562286d8edStholo   are leaving yourself unprotected anyway.
30572286d8edStholo
30582286d8edStholo   Last modified: _6/13/1997_
30592286d8edStholo
3060c71bc7e2Stholo    14. How about using groups and setgid() then?
30612286d8edStholo
30622286d8edStholo   Here is a way to run CVS setgid in some environments:
30632286d8edStholo
30642286d8edStholo     Stick this near the front of the main() in main.c:
30652286d8edStholo
30662286d8edStholo   setgid(getegid());
30672286d8edStholo
30682286d8edStholo   This will allow "access" to work on systems where it only works on the
30692286d8edStholo   real gid.
30702286d8edStholo
30712286d8edStholo     Create a group named "cvsg". (This example uses "cvsg". You can name
30722286d8edStholo   it as you wish.)
30732286d8edStholo
30742286d8edStholo     Put *no* users in the "cvsg" group. You can put Repository
30752286d8edStholo   administrators in this group if you want to.
30762286d8edStholo
30772286d8edStholo     Set the cvs executable to setgid (not setuid):
30782286d8edStholo
30792286d8edStholo   cd /usr/local/bin; chown root.cvsg cvs; chmod 2755 cvs
30802286d8edStholo
30812286d8edStholo     Make sure every file in the Repository is in group "cvsg":
30822286d8edStholo
30832286d8edStholo   chown -R root.cvsg $CVSROOT
30842286d8edStholo
30852286d8edStholo     Change all directory permissions to 770. This allows all access to
30862286d8edStholo   the files by the "cvsg" group (which has no members!) and no access at
30872286d8edStholo   all to anyone else.
30882286d8edStholo
30892286d8edStholo   find $CVSROOT -type d -exec chmod 2770 {} \;
30902286d8edStholo
30912286d8edStholo   On some systems you might have to type:
30922286d8edStholo
30932286d8edStholo   find $CVSROOT -type d -exec chmod u=rwx,g=rwx,o=,g+s {} \;
30942286d8edStholo
30952286d8edStholo   This should allow only the cvs program (or other "setgid to group
30962286d8edStholo   cvsg") programs to write into the area, but no one else. Yes the user
30972286d8edStholo   winds up owning the file, but s/he can't find it again later since
30982286d8edStholo   s/he can't traverse the tree. (If you enable the world execute bit
30992286d8edStholo   (mode 2771) on directories, users can traverse the tree and the user
31002286d8edStholo   who last wrote the file can still write to it.)
31012286d8edStholo
31022286d8edStholo   If you want to allow read access, check out an entire tree somewhere.
31032286d8edStholo   You have to do this anyway to build it.
31042286d8edStholo
31052286d8edStholo   Note: If you are using a stupid file system that can't inherit file
31062286d8edStholo   groups from the parent directory (even with the "setgid" (Octal 2000)
31072286d8edStholo   bit set), you might have to modify CVS (or RCS) to reset the group
31082286d8edStholo   every time you create a new file. I have not tested this.
31092286d8edStholo
31102286d8edStholo   The setgid() method shares with the setuid() method the problem of
31112286d8edStholo   keeping "admin" from breaking things.
31122286d8edStholo
31132286d8edStholo   Last modified: _6/13/1997_
31142286d8edStholo
3115c71bc7e2Stholo    15. How do I use the "commitinfo" file?
31162286d8edStholo
31172286d8edStholo   Go read 4B.2 first.
31182286d8edStholo
31192286d8edStholo   The "commitinfo" file allows you to execute "sanity check" functions
31202286d8edStholo   before allowing a commit. If any function called from within the
31212286d8edStholo   commitinfo file exits with a non-zero status, the commit is denied.
31222286d8edStholo
31232286d8edStholo   To fill out a "commitinfo" file, ask yourself (and those sharing your
31242286d8edStholo   Repository) these questions:
31252286d8edStholo
31262286d8edStholo   - Is there anything you want to check or change before someone is
31272286d8edStholo   allowed to commit a file? If not, forget commitinfo.
31282286d8edStholo
31292286d8edStholo   If you want to serialize binary files, you might consider something
31302286d8edStholo   like the rcslock.pl program in the contrib directory of the CVS
31312286d8edStholo   sources.
31322286d8edStholo
31332286d8edStholo   - Do you want to execute the same exact thing before committing to
31342286d8edStholo   every file in the Repository? (This is useful if you want to program
31352286d8edStholo   the restrictions yourself.) If so, set up a single line in the
31362286d8edStholo   commitinfo:
31372286d8edStholo
31382286d8edStholo                DEFAULT         /absolute/path/to/program
31392286d8edStholo
31402286d8edStholo   CVS executes the program once for each directory that "commit"
31412286d8edStholo   traverses, passing as arguments the directory and the files to be
31422286d8edStholo   committed within that directory.
31432286d8edStholo
31442286d8edStholo   Write your program accordingly. Some examples exist in the contrib
31452286d8edStholo   directory.
31462286d8edStholo
31472286d8edStholo   - Do you want a different kind of sanity check performed for different
31482286d8edStholo   directories? If so, you'll have to decide what to do for all
31492286d8edStholo   directories and enter lines like this:
31502286d8edStholo
31512286d8edStholo                regexp1         /absolute/path/to/program-for-regexp1
31522286d8edStholo                regexp2         /absolute/path/to/program-for-regexp2
31532286d8edStholo                DEFAULT         /absolute/path/to/program-for-all-else
31542286d8edStholo
31552286d8edStholo   - Is there anything you want to happen before *all* commits, in
31562286d8edStholo   addition to other pattern matches? If so, include a line like this:
31572286d8edStholo
31582286d8edStholo                ALL             /absolute/path/to/program
31592286d8edStholo
31602286d8edStholo   It is executed independently of all the above. And it's repeatable --
31612286d8edStholo   you can have as many ALL lines as you like.
31622286d8edStholo
31632286d8edStholo   Last modified: _6/13/1997_
31642286d8edStholo
3165c71bc7e2Stholo    16. How do I use the "loginfo" files?
31662286d8edStholo
31672286d8edStholo   See 4B.2 and the "commitinfo" question above.
31682286d8edStholo
31692286d8edStholo   The "loginfo" file has the same format as the "commitinfo" file, but
31702286d8edStholo   its function is different. Where the "commitinfo" information is used
31712286d8edStholo   before a commit, the "loginfo" file is used after a commit.
31722286d8edStholo
31732286d8edStholo   All the commands in the "loginfo" file should read data from standard
31742286d8edStholo   input, then either append it to a file or send a message to a mailing
31752286d8edStholo   list. If you want to make it simple, you can put shell (the shell used
31762286d8edStholo   by "popen(3)") command lines directly in the "loginfo" (or
31772286d8edStholo   "commitinfo") file. These seem to work:
31782286d8edStholo
31792286d8edStholo   ^special /usr/ucb/Mail -s %s special-mailing-list ^other /usr/ucb/Mail
31802286d8edStholo   -s %s other-mailing-list DEFAULT (echo '===='; echo %s; cat) >
31812286d8edStholo   /path/name/to/log/file
31822286d8edStholo
31832286d8edStholo   Last modified: _6/13/1997_
31842286d8edStholo
3185c71bc7e2Stholo    17. How can I keep people with restrictive umask values from blocking
31862286d8edStholo    access to the Repository?
31872286d8edStholo
31882286d8edStholo   If a user creates a new file with restricted permissions (e.g. 0600),
31892286d8edStholo   and commits it, the Repository will have a file in it that is
31902286d8edStholo   unreadable by everyone. The 0600 example would be unreadable by
31912286d8edStholo   *anyone* but root and the user who created it.
31922286d8edStholo
31932286d8edStholo   There are 3 solutions to this:
31942286d8edStholo
31952286d8edStholo     Let it happen. This is a valid way to protect things. If everyone is
31962286d8edStholo   working alone, a umask of 077 is OK. If everyone is working only in
31972286d8edStholo   small groups, a umask of 007 is OK.
31982286d8edStholo
31992286d8edStholo     Train your users not to create such things if you expect to share
32002286d8edStholo   them.
32012286d8edStholo
32022286d8edStholo     See 4B.5 for a small script that will reset the umask.
32032286d8edStholo
32042286d8edStholo   I personally don't like the idea of a program automatically
32052286d8edStholo   *loosening* security. It would be better for you all to talk about the
32062286d8edStholo   issue and decide how to work together.
32072286d8edStholo
32082286d8edStholo   Last modified: _6/13/1997_
32092286d8edStholo
32102286d8edStholo  Category: /Commands_/
32112286d8edStholo
32122286d8edStholo   " Commands "
32132286d8edStholo
32142286d8edStholo  Category: /Commands_/add_ad_new/
32152286d8edStholo
32162286d8edStholo   " + "add", "ad", "new""
32172286d8edStholo
32182286d8edStholo    1. What is "add" for?
32192286d8edStholo
32202286d8edStholo   To add a new directory to the Repository or to register the desire to
32212286d8edStholo   add a new file to the Repository.
32222286d8edStholo
32232286d8edStholo   The directory is created immediately, while the desire to add the file
32242286d8edStholo   is recorded in the local ./CVS administrative directory. To really add
32252286d8edStholo   the file to the Repository, you must then "commit" it.
32262286d8edStholo
32272286d8edStholo   Last modified: _6/13/1997_
32282286d8edStholo
32292286d8edStholo    2. How do I add a new file to the branch I'm working on?
32302286d8edStholo
32312286d8edStholo   The user actions for adding a file to any branch, including the Main
32322286d8edStholo   Branch, are exactly the same.
32332286d8edStholo
32342286d8edStholo   You are in a directory checked out (or updated) with the '-A' option
32352286d8edStholo   (to place you on the Main Branch) or the "-r <branch_tag>" option (to
32362286d8edStholo   place you on a branch tagged with <branch_tag>). To add <file> to the
32372286d8edStholo   branch you are on, you type:
32382286d8edStholo
32392286d8edStholo                cvs add <file>
32402286d8edStholo                cvs commit <file>
32412286d8edStholo
32422286d8edStholo   If no ./CVS/Tag file exists (the '-A' option deletes it), the file
32432286d8edStholo   will be added to the Main Branch. If a ./CVS/Tag file exists (the "-r
32442286d8edStholo   <branch_tag>" option creates it), the file will be added to the branch
32452286d8edStholo   named (i.e. tagged with) <branch_tag>.
32462286d8edStholo
32472286d8edStholo   Unless you took steps to first add the file to the Main Branch, your
32482286d8edStholo   new file ends up in the Attic.
32492286d8edStholo
32502286d8edStholo   Last modified: _6/13/1997_
32512286d8edStholo
32522286d8edStholo    3. Why did my new file end up in the Attic?
32532286d8edStholo
32542286d8edStholo   The file is thrown into the Attic to keep it from being visible when
32552286d8edStholo   you check out the Main Branch, since it was never committed to the
32562286d8edStholo   Main Branch.
32572286d8edStholo
32582286d8edStholo   Last modified: _6/13/1997_
32592286d8edStholo
32602286d8edStholo    4. Now that it's in the Attic, how do I connect it to the Main branch?
32612286d8edStholo
32622286d8edStholo   That can be considered a kind of "merge". See 4C.8
32632286d8edStholo
32642286d8edStholo   Last modified: _6/13/1997_
32652286d8edStholo
32662286d8edStholo    5. How do I avoid the hassle of reconnecting an Attic-only file to the Main
32672286d8edStholo    Branch?
32682286d8edStholo
32692286d8edStholo   You create it on the Main Branch first, then branch it.
32702286d8edStholo
32712286d8edStholo   If you haven't yet added the file or if you decided to delete the new
32722286d8edStholo   Attic file and start over, then do the following: (If you added the
32732286d8edStholo   file (or worse, the 157 files) to the Attic and don't want to start
32742286d8edStholo   over, try the procedure in 4C.8.)
32752286d8edStholo
32762286d8edStholo     Temporarily remove the sticky branch information. Either:
32772286d8edStholo
32782286d8edStholo     Move the whole directory back to the Main Branch. [This might not be
32792286d8edStholo   a good idea if you have modified files, since it will require a merge
32802286d8edStholo   in each direction.]
32812286d8edStholo
32822286d8edStholo                cvs update -A
32832286d8edStholo
32842286d8edStholo                        *or*
32852286d8edStholo
32862286d8edStholo     Move the ./CVS/Tag file out of the way.
32872286d8edStholo
32882286d8edStholo                mv ./CVS/Tag HOLD_Tag
32892286d8edStholo
32902286d8edStholo     Add and branch the file "normally":
32912286d8edStholo
32922286d8edStholo                cvs add <file>
32932286d8edStholo                cvs commit <file>
32942286d8edStholo                cvs tag -b <branch_tag> <file>
32952286d8edStholo
32962286d8edStholo   [<branch_tag> is the same Branch Tag as you used on all the other
32972286d8edStholo   files. Look at ./CVS/Entries or the output from "cvs stat" for sticky
32982286d8edStholo   tags.]
32992286d8edStholo
33002286d8edStholo     Clean up the temporary step.
33012286d8edStholo
33022286d8edStholo     If you moved the ./CVS/Tag file, put it back. Then move the new file
33032286d8edStholo   onto the branch where you are working.
33042286d8edStholo
33052286d8edStholo                mv HOLD_Tag ./CVS/Tag
33062286d8edStholo                cvs update -r <branch_tag> <file>
33072286d8edStholo
33082286d8edStholo     If you ran "update -A" rather than moving the ./CVS/Tag file, move
33092286d8edStholo   the whole directory (including the new file) back onto the branch
33102286d8edStholo   where you were working:
33112286d8edStholo
33122286d8edStholo                cvs update -r <branch_tag>
33132286d8edStholo
33142286d8edStholo   Last modified: _6/13/1997_
33152286d8edStholo
33162286d8edStholo    6. How do I cancel an "add"?
33172286d8edStholo
33182286d8edStholo   If you want to remove the file entirely and cancel the "add" at the
33192286d8edStholo   same time, type:
33202286d8edStholo
33212286d8edStholo                cvs remove -f <file>
33222286d8edStholo
33232286d8edStholo   If you want to cancel the "add", but leave the file as it was before
33242286d8edStholo   you typed "cvs add", then you have to fake it:
33252286d8edStholo
33262286d8edStholo                mv <file> <file>.hold
33272286d8edStholo                cvs remove <file>
33282286d8edStholo                mv <file>.hold <file>
33292286d8edStholo
33302286d8edStholo   Last modified: _6/13/1997_
33312286d8edStholo
33322286d8edStholo    7. What are the ./CVS/file,p and ./CVS/file,t files for?
33332286d8edStholo
33342286d8edStholo   The ./CVS/file,p and ./CVS/file,t files are created by the "add"
33352286d8edStholo   command to hold command line options and message text between the time
33362286d8edStholo   of the "add" command and the expected "commit".
33372286d8edStholo
33382286d8edStholo   The ./CVS/file,p file is always null, since its function was absorbed
33392286d8edStholo   by the "options" field in the ./CVS/Entries file. If you put something
33402286d8edStholo   in this file it will be used as arguments to the RCS "ci" command that
33412286d8edStholo   commit uses to check the file in, but CVS itself doesn't put anything
33422286d8edStholo   there.
33432286d8edStholo
33442286d8edStholo   The ./CVS/file,t file is null unless you specify an initial message in
33452286d8edStholo   an "add -m 'message'" command. The text is handed to "rcs -i
33462286d8edStholo   -t./CVS/file,t" to create the initial RCS file container.
33472286d8edStholo
33482286d8edStholo   Both files must exist to commit a newly added file. If the
33492286d8edStholo   ./CVS/file,p file doesn't exist, CVS prints an error and aborts the
33502286d8edStholo   commit. If the ./CVS/file,t file doesn't exist, RCS prints an error
33512286d8edStholo   and CVS gets confused, but does no harm.
33522286d8edStholo
33532286d8edStholo   To recover from missing ,p and ,t files, just create two zero-length
33542286d8edStholo   files and rerun the "commit".
33552286d8edStholo
33562286d8edStholo   Last modified: _6/13/1997_
33572286d8edStholo
33582286d8edStholo    8. How do I "add" a binary file?
33592286d8edStholo
33602286d8edStholo   If you configured CVS to use the GNU version of "diff" and "diff3",
33612286d8edStholo   you only need to turn off RCS keyword expansion.
33622286d8edStholo
33632286d8edStholo   First you turn off RCS keyword expansion for the initial checkin by
33642286d8edStholo   using "add -ko". It works like "update -ko" in creating a "sticky"
33652286d8edStholo   option only for the copy of the file in the current working directory.
33662286d8edStholo
33672286d8edStholo                cvs add -ko <file>
33682286d8edStholo
33692286d8edStholo   Commit the file normally. The sticky -ko option will be used.
33702286d8edStholo
33712286d8edStholo                cvs commit <file>
33722286d8edStholo
33732286d8edStholo   Then mark the RCS file in the Repository so that keyword expansion is
33742286d8edStholo   turned off for all checked out versions of the file.
33752286d8edStholo
33762286d8edStholo                cvs admin -ko <file>
33772286d8edStholo
33782286d8edStholo   Since "admin -ko" records the keyword substitution value in the
33792286d8edStholo   Repository's RCS file, you no longer need the sticky option. You can
33802286d8edStholo   turn it off with the "update -A" command, but if you were on a branch,
33812286d8edStholo   you'll have to follow it "update -r <branch_tag>" to put yourself back
33822286d8edStholo   on the branch.
33832286d8edStholo
33842286d8edStholo   Managing that binary file is another problem. See 4D.1.
33852286d8edStholo
33862286d8edStholo   Last modified: _6/13/1997_
33872286d8edStholo
33882286d8edStholo  Category: /Commands_/admin_adm_rcs/
33892286d8edStholo
33902286d8edStholo   " + "admin", "adm", "rcs""
33912286d8edStholo
33922286d8edStholo    1. What is "admin" for?
33932286d8edStholo
33942286d8edStholo   To provide direct access to the underlying "rcs" command (which is not
33952286d8edStholo   documented in this FAQ) bypassing all safeguards and CVS assumptions.
33962286d8edStholo
33972286d8edStholo   Last modified: _6/13/1997_
33982286d8edStholo
33992286d8edStholo    2. Wow! Isn't that dangerous?
34002286d8edStholo
34012286d8edStholo   Yes.
34022286d8edStholo
34032286d8edStholo   Though you can't hurt the internal structure of an RCS file using its
34042286d8edStholo   own "rcs" command, you *can* change the underlying RCS files using
34052286d8edStholo   "admin" in ways that CVS can't handle.
34062286d8edStholo
34072286d8edStholo   If you feel the need to use "admin", create some test files with the
34082286d8edStholo   RCS "ci" command and experiment on them with "rcs" before blasting any
34092286d8edStholo   CVS files.
34102286d8edStholo
34112286d8edStholo   Last modified: _6/13/1997_
34122286d8edStholo
34132286d8edStholo    3. What would I normally use "admin" for?
34142286d8edStholo
34152286d8edStholo   Normally, you wouldn't use admin at all. In unusual circumstances,
34162286d8edStholo   experts can use it to set up or restore the internal RCS state that
34172286d8edStholo   CVS requires.
34182286d8edStholo
34192286d8edStholo   You can use "admin -o" (for "outdate") to remove revisions you don't
34202286d8edStholo   care about. This has its own problems, such as leaving dangling Tags
34212286d8edStholo   and confusing the "update" command.
34222286d8edStholo
34232286d8edStholo   There is some feeling among manipulators of binary files that "admin
34242286d8edStholo   -l" should be used to serialize access. See 3C.8.
34252286d8edStholo
34262286d8edStholo   An interesting use for "admin" came up while maintaining CVS itself. I
34272286d8edStholo   import versions of CVS onto the Vendor branch of my copy of CVS, make
34282286d8edStholo   changes to some files and ship the diffs (created by "cvs diff -c -r
34292286d8edStholo   TO_BRIAN") off to Brian Berliner. After creating the diff, I retag
34302286d8edStholo   ("cvs tag -F TO_BRIAN") the working directory, which is then ready to
34312286d8edStholo   produce the next patch.
34322286d8edStholo
34332286d8edStholo   I'll use "add.c" as an example (only because the name is short).
34342286d8edStholo
34352286d8edStholo   When the next release came out, I discovered that the released "add.c"
34362286d8edStholo   (version 1.1.1.3 on the Vendor branch) was exactly the same as my
34372286d8edStholo   modified file (version 1.3). I didn't care about the changelog on
34382286d8edStholo   versions 1.2 and 1.3 (or the evidence of having done the work), so I
34392286d8edStholo   decided to revert the file to the state where it looked like I had not
34402286d8edStholo   touched the file -- where I was just using the latest on the vendor
34412286d8edStholo   branch after a sequence of imports.
34422286d8edStholo
34432286d8edStholo   To do that, I removed all the revisions on the main branch, except for
34442286d8edStholo   the original 1.1 from which the Vendor branch sprouts:
34452286d8edStholo
34462286d8edStholo                cvs admin -o1.2: add.c
34472286d8edStholo
34482286d8edStholo   Then I set the RCS "default branch" back to the Vendor branch, the way
34492286d8edStholo   import would have created it:
34502286d8edStholo
34512286d8edStholo                cvs admin -b1.1.1 add.c
34522286d8edStholo
34532286d8edStholo   And I moved the "TO_BRIAN" Tag to the latest revision on the Vendor
34542286d8edStholo   branch, since that is the base from which further patches would be
34552286d8edStholo   created (if I made any):
34562286d8edStholo
34572286d8edStholo                cvs admin -NTO_BRIAN:1.1.1.3 add.c
34582286d8edStholo
34592286d8edStholo   Instead of 1.1.1.3, I could have used one of the "Release Tags" last
34602286d8edStholo   applied by "import" (3rd through Nth arguments).
34612286d8edStholo
34622286d8edStholo   Suggestion: Practice on non-essential files.
34632286d8edStholo
34642286d8edStholo   Last modified: _6/13/1997_
34652286d8edStholo
34662286d8edStholo    4. What should I avoid when using "admin"?
34672286d8edStholo
34682286d8edStholo   If you know exactly what you are doing, hack away. But under normal
34692286d8edStholo   circumstances:
34702286d8edStholo
34712286d8edStholo   Never use "admin" to alter branches (using the '-b' option), which CVS
34722286d8edStholo   takes very seriously. If you change the default branch, CVS will not
34732286d8edStholo   work as expected. If you create new branches without using the "tag
34742286d8edStholo   -b" command, you may not be able to treat them as CVS branches.
34752286d8edStholo
34762286d8edStholo   See 3C.8 for a short discussion of how to use "admin -l" for
34772286d8edStholo   serializing access to binary files.
34782286d8edStholo
34792286d8edStholo   The "admin -o <file>" allows you to delete revisions, usually a bad
34802286d8edStholo   idea. You should commit a correction rather than back out a revision.
34812286d8edStholo   Outdating a revision is prone to all sorts of problems:
34822286d8edStholo
34832286d8edStholo     Discarding data is always a bad idea. Unless something in the
34842286d8edStholo   revision you just committed is a threat to your job or your life,
34852286d8edStholo   (like naming a function "<boss's name>_is_a_dweeb", or including the
34862286d8edStholo   combination to the local Mafioso's safe in a C comment), just leave it
34872286d8edStholo   there. No one cares about simple mistakes -- just commit a corrected
34882286d8edStholo   revision.
34892286d8edStholo
34902286d8edStholo     The time travel paradoxes you can cause by changing history are not
34912286d8edStholo   worth the trouble. Even if CVS can't interfere with your parents'
34922286d8edStholo   introduction, it *can* log commits in at least two ways (history and
34932286d8edStholo   loginfo). The reports now lie -- the revision referred to in the logs
34942286d8edStholo   no longer exists.
34952286d8edStholo
34962286d8edStholo     If you used "import" to place <file> into CVS, outdating all the
34972286d8edStholo   revisions on the Main branch back to and including revision 1.2 (or
34982286d8edStholo   worse, 1.1), will produce an invalid CVS file.
34992286d8edStholo
35002286d8edStholo   If the <file>,v file only contains revision 1.1 (and the connected
35012286d8edStholo   branch revision 1.1.1.1), then the default branch must be set to the
35022286d8edStholo   Vendor branch as it was when you first imported the file. Outdating
35032286d8edStholo   back through 1.2 doesn't restore the branch setting. Despite the above
35042286d8edStholo   admonition against it, "admin -b" is the only way to recover:
35052286d8edStholo
35062286d8edStholo                cvs admin -b1.1.1 <file>
35072286d8edStholo
35082286d8edStholo     Although you can't outdate a physical (RCS) branch point without
35092286d8edStholo   removing the whole branch, you *can* outdate a revision referred to by
35102286d8edStholo   a magic branch tag. If you do so, you will invalidate the branch.
35112286d8edStholo
35122286d8edStholo     If you "outdate" a tagged revision, you will invalidate all uses of
35132286d8edStholo   the <tag>, not just the one on <file>. A tag is supposed to be
35142286d8edStholo   attached to a consistent set of files, usually a set built as a unit.
35152286d8edStholo   By discarding one of the files in the set, you have destroyed the
35162286d8edStholo   utility of the <tag>. And it leaves a dangling tag, which points to
35172286d8edStholo   nothing.
35182286d8edStholo
35192286d8edStholo     And even worse, if you commit a revision already tagged, you will
35202286d8edStholo   alter what the <tag> pointed to without using the "tag" command. For
35212286d8edStholo   example, if revision 1.3 has <tag> attached to it and you "outdate"
35222286d8edStholo   the 1.3 revision, <tag> will point to a nonexistent revision. Although
35232286d8edStholo   this is annoying, it is nowhere near as much trouble as the problem
35242286d8edStholo   that will occur when you commit to this file again, recreating
35252286d8edStholo   revision 1.3. The old tag will point to the new revision, a file that
35262286d8edStholo   was not in existence when the <tag> was applied. And the discrepancy
35272286d8edStholo   is nearly undetectable.
35282286d8edStholo
35292286d8edStholo   If you don't understand the above, you should not use the admin
35302286d8edStholo   command at all.
35312286d8edStholo
35322286d8edStholo   Last modified: _6/13/1997_
35332286d8edStholo
35342286d8edStholo    5. How do I restrict the "admin" command? The -i flag in the modules file
35352286d8edStholo    can restrict commits. What's the equivalent for "admin"?
35362286d8edStholo
35372286d8edStholo   At this writing, to disable the "admin" command, you will have to
35382286d8edStholo   change the program source code, recompile and reinstall.
35392286d8edStholo
35402286d8edStholo   Last modified: _6/13/1997_
35412286d8edStholo
35422286d8edStholo    6. I backed out a revision with "admin -o" and committed a replacement. Why
35432286d8edStholo    doesn't "update" retrieve the new revision?
35442286d8edStholo
35452286d8edStholo   CVS is confused because the revision in the ./CVS/Entries file matches
35462286d8edStholo   the latest revision in the Repository *and* the timestamp in the
35472286d8edStholo   ./CVS/Entries file matches your working file. CVS believes that your
35482286d8edStholo   file is "up-to-date" and doesn't need to be updated.
35492286d8edStholo
35502286d8edStholo   You can cause CVS to notice the change by "touch"ing the file.
35512286d8edStholo   Unfortunately what CVS will tell you is that you have a "Modified"
35522286d8edStholo   file. If you then "commit" the file, you will bypass the normal CVS
35532286d8edStholo   check for "up-to-date" and will probably commit the revision that was
35542286d8edStholo   originally removed by "admin -o".
35552286d8edStholo
35562286d8edStholo   Changing a file without changing the revision number confuses CVS no
35572286d8edStholo   matter whether you did it by replacing the revision (using "admin -o"
35582286d8edStholo   and "commit" or raw RCS commands) or by applying an editor directly to
35592286d8edStholo   a Repository (",v") file. Don't do it unless you are absolutely
35602286d8edStholo   certain no one has the latest revision of the file checked out.
35612286d8edStholo
35622286d8edStholo   The best solution to this is to institute a program of deterrent
35632286d8edStholo   flogging of abusers of "admin -o".
35642286d8edStholo
35652286d8edStholo   The "admin" command has other problems." See 3B.4 above.
35662286d8edStholo
35672286d8edStholo   Last modified: _6/13/1997_
35682286d8edStholo
35692286d8edStholo  Category: /Commands_/checkout_co_get/
35702286d8edStholo
35712286d8edStholo   " + "checkout", "co", "get""
35722286d8edStholo
35732286d8edStholo    1. What is "checkout" for?
35742286d8edStholo
35752286d8edStholo   To acquire a copy of a module (or set of files) to work on.
35762286d8edStholo
35772286d8edStholo   All work on files controlled by CVS starts with a "checkout".
35782286d8edStholo
35792286d8edStholo   Last modified: _6/13/1997_
35802286d8edStholo
35812286d8edStholo    2. What is the "module" that "checkout" takes on the command line?
35822286d8edStholo
35832286d8edStholo   It is a name for a directory or a collection of files in the
35842286d8edStholo   Repository. It provides a compact name space and the ability to
35852286d8edStholo   execute before and after helper functions based on definitions in the
35862286d8edStholo   modules file.
35872286d8edStholo
35882286d8edStholo   See 1D.11.
35892286d8edStholo
35902286d8edStholo   Last modified: _6/13/1997_
35912286d8edStholo
35922286d8edStholo    3. Isn't a CVS "checkout" just a bunch of RCS checkouts?
35932286d8edStholo
35942286d8edStholo   Like much of CVS, a similar RCS concept is used to support a CVS
35952286d8edStholo   function. But a CVS checkout is *not* the same as an RCS checkout.
35962286d8edStholo
35972286d8edStholo   Differences include:
35982286d8edStholo
35992286d8edStholo     CVS does not lock the files. Others may access them at the same
36002286d8edStholo   time.
36012286d8edStholo
36022286d8edStholo     CVS works best when you provide a name for a collection of files (a
36032286d8edStholo   module or a directory) rather than an explicit list of files to work
36042286d8edStholo   on.
36052286d8edStholo
36062286d8edStholo     CVS remembers what revisions you checked out and what branch you are
36072286d8edStholo   on, simplifying later commands.
36082286d8edStholo
36092286d8edStholo   Last modified: _6/13/1997_
36102286d8edStholo
36112286d8edStholo    4. What's the difference between "update" and "checkout"?
36122286d8edStholo
36132286d8edStholo   The "checkout" and "update" commands are nearly equivalent in how they
36142286d8edStholo   treat individual files. They differ in the following ways:
36152286d8edStholo
36162286d8edStholo     The "checkout" command always creates a directory, moves into it,
36172286d8edStholo   then becomes equivalent to "update -d".
36182286d8edStholo
36192286d8edStholo     The "update" command does not create directories unless you add the
36202286d8edStholo   '-d' option.
36212286d8edStholo
36222286d8edStholo     "Update" is intended to be executed within a working directory
36232286d8edStholo   created by "checkout". It doesn't take a module or directory argument,
36242286d8edStholo   but figures out what Repository files to look at by reading the files
36252286d8edStholo   in the ./CVS administrative directory.
36262286d8edStholo
36272286d8edStholo     The two commands generate completely different types of records in
36282286d8edStholo   the "history" file.
36292286d8edStholo
36302286d8edStholo   Last modified: _6/13/1997_
36312286d8edStholo
36322286d8edStholo    5. Why can't I check out a file from within my working directory?
36332286d8edStholo
36342286d8edStholo   Though you *can* check out a file, you normally check out a module or
36352286d8edStholo   directory. And you normally do it only once at the beginning of a
36362286d8edStholo   project.
36372286d8edStholo
36382286d8edStholo   After the initial "checkout", you can use the "update" command to
36392286d8edStholo   retrieve any file you want within the checked-out directory. There is
36402286d8edStholo   no need for further "checkout" commands.
36412286d8edStholo
36422286d8edStholo   If you want to retrieve another module or directory to work on, you
36432286d8edStholo   must provide two pathnames: where to find it in the Repository and
36442286d8edStholo   where to put it on disk. The "modules" file and your current directory
36452286d8edStholo   supply two pieces of naming information. While inside a checked-out
36462286d8edStholo   working directory, the CVS administrative information provides most of
36472286d8edStholo   the rest.
36482286d8edStholo
36492286d8edStholo   You should be careful not to confuse CVS with RCS and use "checkout"
36502286d8edStholo   in the RCS sense. An RCS "checkout" (which is performed by the RCS
36512286d8edStholo   "co" command) is closer to a "cvs update" than to a "cvs checkout".
36522286d8edStholo
36532286d8edStholo   Last modified: _6/13/1997_
36542286d8edStholo
36552286d8edStholo    6. How do I avoid dealing with those long relative pathnames?
36562286d8edStholo
36572286d8edStholo   This question has also been phrased:
36582286d8edStholo
36592286d8edStholo   How do I avoid all those layers of directories on checkout? or Why do
36602286d8edStholo   I have to go to the top of my working directory and checkout some long
36612286d8edStholo   pathname to get a file or two?
36622286d8edStholo
36632286d8edStholo   This type of question occurs only among groups of people who decide
36642286d8edStholo   not to use "modules". The answer is to use "modules".
36652286d8edStholo
36662286d8edStholo   When you hand the "checkout" command a relative pathname rather than a
36672286d8edStholo   module name, all directories in the path are created, maintaining the
36682286d8edStholo   same directory hierarchy as in the Repository. The same kind of
36692286d8edStholo   environment results if you specify a "module" that is really an alias
36702286d8edStholo   expanding into a list of relative pathnames rather than a list of
36712286d8edStholo   module names.
36722286d8edStholo
36732286d8edStholo   If you use "module" names, "checkout" creates a single directory by
36742286d8edStholo   the name of the module in your current directory. This "module"
36752286d8edStholo   directory becomes your working directory.
36762286d8edStholo
36772286d8edStholo   The "module" concept combines the ability to "name" a collection of
36782286d8edStholo   files with the ability to structure the Repository so that consistent
36792286d8edStholo   sets of files are checked out together. It is the responsibility of
36802286d8edStholo   the Repository Administrators to set up a modules file that describes
36812286d8edStholo   the software within the Repository.
36822286d8edStholo
36832286d8edStholo   Last modified: _6/13/1997_
36842286d8edStholo
36852286d8edStholo    7. Can I move a checked-out directory? Does CVS remember where it was
36862286d8edStholo    checked out?
36872286d8edStholo
36882286d8edStholo   Yes and Yes.
36892286d8edStholo
36902286d8edStholo   The ./CVS/Repository file in each working directory contains a
36912286d8edStholo   pathname pointing to the matching directory within the Repository. The
36922286d8edStholo   pathname is either absolute or relative to $CVSROOT, depending on how
36932286d8edStholo   you configured CVS.
36942286d8edStholo
36952286d8edStholo   When you move a checked-out directory, the CVS administrative files
36962286d8edStholo   will move along with it. As long as you don't move the Repository
36972286d8edStholo   itself, or alter your $CVSROOT variable, the moved directory will
36982286d8edStholo   continue to be usable.
36992286d8edStholo
37002286d8edStholo   CVS remembers where you checked out the directory in the "history"
37012286d8edStholo   file, which can be edited, or even ignored if you don't use the
37022286d8edStholo   "working directory" information displayed by the "history" command.
37032286d8edStholo
37042286d8edStholo   Last modified: _6/13/1997_
37052286d8edStholo
37062286d8edStholo    8. How can I lock files while I'm working on them the way RCS does?
37072286d8edStholo
37082286d8edStholo   Until the day arrives of the all-powerful merge tool, there are still
37092286d8edStholo   files that must be accessed serially. For those instances, here's a
37102286d8edStholo   potential solution:
37112286d8edStholo
37122286d8edStholo     Install a pre-commit program in the "commitinfo" file to check for
37132286d8edStholo   RCS locks. The program "rcslock.pl" performs this function. It can be
37142286d8edStholo   found in the contrib directory of the CVS source distribution.
37152286d8edStholo
37162286d8edStholo     When you want to make a change to a file you know can't be merged,
37172286d8edStholo   first use "cvs admin -l" to lock the file. If you can't acquire the
37182286d8edStholo   lock, use the standard "locked out" protocol: go talk to the person
37192286d8edStholo   holding the lock.
37202286d8edStholo
37212286d8edStholo     Make sure the pre-commit program prints a message and exits with a
37222286d8edStholo   non-zero status if someone besides the user running "commit" has the
37232286d8edStholo   file locked. This non-zero exist status will cause the "commit" to
37242286d8edStholo   fail cleanly.
37252286d8edStholo
37262286d8edStholo     Make sure the pre-commit program exits with a zero status if the
37272286d8edStholo   file is either unlocked or locked by the user running "commit". The
37282286d8edStholo   "cvs commit" command that kicked off the pre-commit program will take
37292286d8edStholo   a zero exist status as an OK and checkin the file, which has the
37302286d8edStholo   side-effect of unlocking it.
37312286d8edStholo
37322286d8edStholo   ===> The following is opinion and context. Don't read it if you are
37332286d8edStholo   looking for a quick fix.
37342286d8edStholo
37352286d8edStholo   The topic of locking CVS files resurfaces on the network every so
37362286d8edStholo   often, producing the same results each time:
37372286d8edStholo
37382286d8edStholo   The Big Endians:
37392286d8edStholo
37402286d8edStholo   CVS was designed to avoid locks, using a copy-modify-merge model.
37412286d8edStholo   Locking is not necessary and you should take the time to learn the CVS
37422286d8edStholo   model which many people find workable. So why not get with the program
37432286d8edStholo   and learn how to think the CVS way?
37442286d8edStholo
37452286d8edStholo   The Little Endians:
37462286d8edStholo
37472286d8edStholo   The users determine how a tool is to be used, not the designers. We,
37482286d8edStholo   the users, have always used locking, our bosses demand locking,
37492286d8edStholo   locking is good, locking is God. I don't want to hear any more
37502286d8edStholo   lectures on the CVS model. Make locking work.
37512286d8edStholo
37522286d8edStholo   Any organization making active changes to a source base will
37532286d8edStholo   eventually face the need to do parallel development. Parallel
37542286d8edStholo   development implies merges. (If you plan to keep separate copies of
37552286d8edStholo   everything and never merge, good luck. Tell me who you work for so I
37562286d8edStholo   can buy stock in your disk suppliers this year and sell your stock
37572286d8edStholo   short next year.)
37582286d8edStholo
37592286d8edStholo   Merges will never go away. CVS chose to make "merges" stand front and
37602286d8edStholo   center as an important, common occurrence in development. It is one
37612286d8edStholo   way of looking at things.
37622286d8edStholo
37632286d8edStholo   For free-format text, the merge paradigm gives you a considerable
37642286d8edStholo   amount of freedom. It does take a bit of management, but any project
37652286d8edStholo   should be ready to deal with it.
37662286d8edStholo
37672286d8edStholo   On the other hand, there are many files that can't be merged using
37682286d8edStholo   text merge techniques. Straight text merge programs like "diff3" are
37692286d8edStholo   guaranteed to fail on executables (with relative branch statements),
37702286d8edStholo   files with self-referential counts stored in the file (such as TAGS
37712286d8edStholo   files), or files with relative motion statements in them (such as
37722286d8edStholo   Frame MIF files, many postscript files). They aren't all binary files.
37732286d8edStholo
37742286d8edStholo   For these types of files, and many others, there are only two
37752286d8edStholo   solutions:
37762286d8edStholo
37772286d8edStholo     Complex merge tools that are intimately aware of the contents of the
37782286d8edStholo   files to be merged. (ClearCase, and probably others, allow you to
37792286d8edStholo   define your own "files types" with associated "merge tools".)
37802286d8edStholo
37812286d8edStholo     Serialization of access to the file. The only technical solution to
37822286d8edStholo   the problem of serialization is "locking".
37832286d8edStholo
37842286d8edStholo   Since you can call a program that offers:
37852286d8edStholo
37862286d8edStholo   "Which one do you want? A/B?"
37872286d8edStholo
37882286d8edStholo   a "merge tool", more and more merge tools will appear which can be
37892286d8edStholo   hooked into a merge-intensive program like CVS. Think of a bitmap
37902286d8edStholo   "merge" tool that displays the bitmaps on the screen and offers a
37912286d8edStholo   "paint" interface to allow you to cut and paste, overlay, invert or
37922286d8edStholo   fuse the two images such that the result is a "merged" file.
37932286d8edStholo
37942286d8edStholo   My conclusion is that the need for locking is temporary, awaiting
37952286d8edStholo   better technology. For large development groups, locking is not an
37962286d8edStholo   alternative to merging for text files.
37972286d8edStholo
37982286d8edStholo   Last modified: _6/13/1997_
37992286d8edStholo
38002286d8edStholo    9. What is "checkout -s"? How is it different from "checkout -c"?
38012286d8edStholo
38022286d8edStholo   The '-c' and '-s' options to "checkout" both cause the modules file to
38032286d8edStholo   appear on standard output, but formatted differently.
38042286d8edStholo
38052286d8edStholo   "checkout -c" lists the modules file alphabetized by the module name.
38062286d8edStholo   It also prints all data (including options like '-a' and "-o <prog>")
38072286d8edStholo   specified in the modules file.
38082286d8edStholo
38092286d8edStholo   "checkout -s" lists the modules file sorted by "status" field, then by
38102286d8edStholo   module name. The status field was intended to allow you to mark
38112286d8edStholo   modules with strings of your choice to get a quick sorted report based
38122286d8edStholo   on the data you chose to put in the status fields. I have used it for
38132286d8edStholo   priority ("Showstopper", etc as tied into a bug database), for porting
38142286d8edStholo   status ("Ported", "Compiled", etc. when porting a large collection of
38152286d8edStholo   modules), for "assignee" (the person responsible for maintenance), and
38162286d8edStholo   for "test suite" (which automatic test procedure to run for a
38172286d8edStholo   particular module).
38182286d8edStholo
38192286d8edStholo   Last modified: _6/13/1997_
38202286d8edStholo
38212286d8edStholo  Category: /Commands_/commit_ci_com/
38222286d8edStholo
38232286d8edStholo   " + "commit", "ci", "com""
38242286d8edStholo
38252286d8edStholo    1. What is "commit" for?
38262286d8edStholo
38272286d8edStholo   To store new revisions in the Repository, making them visible to other
38282286d8edStholo   users.
38292286d8edStholo
38302286d8edStholo   Last modified: _6/13/1997_
38312286d8edStholo
38322286d8edStholo    2. If I edit ten files, do I have to type "commit" ten times?
38332286d8edStholo
38342286d8edStholo   No. The "commit" command will take multiple filenames, directory names
38352286d8edStholo   and relative pathnames on the command line and commit them all with
38362286d8edStholo   the same log message. If a file is unchanged, even if it is explicitly
38372286d8edStholo   listed on the command line, CVS will skip it.
38382286d8edStholo
38392286d8edStholo   Like all CVS commands, "commit" will work on the whole directory by
38402286d8edStholo   default. Just type "cvs commit" to tell CVS to commit all modified
38412286d8edStholo   files (i.e. the files that "update" would display preceded by 'M') in
38422286d8edStholo   the current directory and in all sub-directories.
38432286d8edStholo
38442286d8edStholo   Last modified: _6/13/1997_
38452286d8edStholo
38462286d8edStholo    3. Explain: cvs commit: Up-to-date check failed for `<file>'
38472286d8edStholo
38482286d8edStholo   You may not "commit" a file if your BASE revision (i.e. the revision
38492286d8edStholo   you last checked out, committed or retrieved via "update") doesn't
38502286d8edStholo   match the HEAD revision (i.e the latest revision on your branch,
38512286d8edStholo   usually the Main Branch).
38522286d8edStholo
38532286d8edStholo   In other words, someone committed a revision since you last executed
38542286d8edStholo   "checkout", "update" or "commit". You must now execute "update" to
38552286d8edStholo   merge the other person's changes into your working file before
38562286d8edStholo   "commit" will work. You are thus protected (somewhat) from a common
38572286d8edStholo   form of race condition in source control systems, where a checkin of a
38582286d8edStholo   minor alteration of a second copy of the same base file obliterates
38592286d8edStholo   the changes made in the first.
38602286d8edStholo
38612286d8edStholo   Normally, the "update" command's auto-merge should be followed by
38622286d8edStholo   another round of building and testing before the "commit".
38632286d8edStholo
38642286d8edStholo   Last modified: _6/13/1997_
38652286d8edStholo
38662286d8edStholo    4. What happens if two people try to "commit" conflicting changes?
38672286d8edStholo
38682286d8edStholo   Conflicts can occur only when two developers check out the same
38692286d8edStholo   revision of the same file and make changes. The first developer to
38702286d8edStholo   commit the file has no chance of seeing the conflict. Only the second
38712286d8edStholo   developer runs into it, usually when faced with the "Up-to-date" error
38722286d8edStholo   explained in the previous question.
38732286d8edStholo
38742286d8edStholo   There are two types of conflicts:
38752286d8edStholo
38762286d8edStholo     When two developers make changes to the same section of code, the
38772286d8edStholo   auto-merge caused by "update" will print a 'C' on your terminal and
38782286d8edStholo   leave "overlap" markers in the file.
38792286d8edStholo
38802286d8edStholo   You are expected to examine and clean them up before committing the
38812286d8edStholo   file. (That may be obvious to *some* of you, but . . .)
38822286d8edStholo
38832286d8edStholo     A more difficult problem arises when two developers change different
38842286d8edStholo   sections of code, but make calls to, or somehow depend on, the old
38852286d8edStholo   version of each other's code.
38862286d8edStholo
38872286d8edStholo   The auto-merge does the "right" thing, if you view the file as a
38882286d8edStholo   series of text lines. But as a program, the two developers have
38892286d8edStholo   created a problem for themselves.
38902286d8edStholo
38912286d8edStholo   This is no different from making cross-referential changes in
38922286d8edStholo   *separate* files. CVS can't help you. In a perfect world, you would
38932286d8edStholo   each refer to the specification and resolve it independently. In the
38942286d8edStholo   real world you have to talk/argue, read code, test and debug until the
38952286d8edStholo   combined changes work again.
38962286d8edStholo
38972286d8edStholo   Welcome to the world of parallel development.
38982286d8edStholo
38992286d8edStholo   Last modified: _6/13/1997_
39002286d8edStholo
39012286d8edStholo    5. I committed something and I don't like it. How do I remove it?
39022286d8edStholo
39032286d8edStholo   Though you *can* use the "admin -o" (synonym: "rcs -o") command to
39042286d8edStholo   delete revisions, unless the file you committed is so embarrassing
39052286d8edStholo   that the need to eradicate it overrides the need to be careful, you
39062286d8edStholo   should just grab an old version of the file ("update -p -r
39072286d8edStholo   <previous-rev>" might help here) and commit it on top of the offending
39082286d8edStholo   revision.
39092286d8edStholo
39102286d8edStholo   See Section 3B on "admin".
39112286d8edStholo
39122286d8edStholo   Last modified: _6/13/1997_
39132286d8edStholo
39142286d8edStholo    6. Explain: cvs commit: sticky tag `V3' for file `X' is not a branch
39152286d8edStholo
39162286d8edStholo   The message implies two things:
39172286d8edStholo
39182286d8edStholo     You created your working directory by using "checkout -r V3", or you
39192286d8edStholo   recently executed "update -r V3".
39202286d8edStholo
39212286d8edStholo     The tag named V3 is not a branch tag.
39222286d8edStholo
39232286d8edStholo   CVS records (i.e. makes "sticky") any "-r <tag/rev>" argument handed
39242286d8edStholo   to the "checkout" or "update" commands. The <tag/rev> is recorded as
39252286d8edStholo   the CVS working branch, which is the branch to which "commit" will add
39262286d8edStholo   a new revision.
39272286d8edStholo
39282286d8edStholo   Branch tags are created when you use the -b switch on the "tag" or
39292286d8edStholo   "rtag" commands. Branch tags are magic tags that don't create a
39302286d8edStholo   physical branch, but merely mark the revision to branch from when the
39312286d8edStholo   branch is needed. The first commit to a magic branch creates a
39322286d8edStholo   physical branch in the RCS files.
39332286d8edStholo
39342286d8edStholo   You can commit onto the end of the Main Trunk, if you have no sticky
39352286d8edStholo   tag at all, or onto the end of a branch, if you have a sticky branch
39362286d8edStholo   tag. But you can't commit a file that has a sticky tag not pointing to
39372286d8edStholo   a branch. CVS assumes a sticky Tag or Revision that does not refer to
39382286d8edStholo   a branch is attached to the middle of a series of revisions. You can't
39392286d8edStholo   squeeze a new revision between two others. Sticky dates also block
39402286d8edStholo   commits since they never refer to a branch.
39412286d8edStholo
39422286d8edStholo   Scenario1:
39432286d8edStholo
39442286d8edStholo   If you don't want a branch and were just looking at an old revision,
39452286d8edStholo   then you can move back to the Main Branch by typing:
39462286d8edStholo
39472286d8edStholo                cvs update -A {files or dirs, default is '.'}
39482286d8edStholo
39492286d8edStholo   or you can move to the branch named <branch_tag> by:
39502286d8edStholo
39512286d8edStholo                cvs update -r <branch_tag> {files or dirs, default is '.'}
39522286d8edStholo
39532286d8edStholo   Scenario2:
39542286d8edStholo
39552286d8edStholo   If you really wanted to be on a branch and made an earlier mistake by
39562286d8edStholo   tagging your branch point with a non-branch tag, you can recover by
39572286d8edStholo   adding a new branch tag to the old non-branch tag:
39582286d8edStholo
39592286d8edStholo                    cvs rtag -b -r <oldtag> <newtag> <module>
39602286d8edStholo
39612286d8edStholo   (It was not a big mistake. Branch-point tags can be useful. But the
39622286d8edStholo   <newtag> must have a different name.)
39632286d8edStholo
39642286d8edStholo   If you don't know the <module> name or don't use "modules", you can
39652286d8edStholo   also use "tag" this way:
39662286d8edStholo
39672286d8edStholo                    cvs update -r <oldtag>
39682286d8edStholo                    cvs tag -b <newtag> .
39692286d8edStholo
39702286d8edStholo   Then, to put your working directory onto the branch, you type:
39712286d8edStholo
39722286d8edStholo                    cvs update -r <newtag>
39732286d8edStholo
39742286d8edStholo   You can't delete <oldtag> before adding <newtag>, and I would not
39752286d8edStholo   advise deleting the <oldtag> at all, because it is useful in referring
39762286d8edStholo   to the branch point. If you must, you can delete the non-branch tag
39772286d8edStholo   by:
39782286d8edStholo
39792286d8edStholo                    cvs rtag -d <oldtag> <module>
39802286d8edStholo                or
39812286d8edStholo                    cvs tag -d <oldtag> .
39822286d8edStholo
39832286d8edStholo   Scenario3:
39842286d8edStholo
39852286d8edStholo   If you made the same mistake as in Scenario2 (of placing a non-branch
39862286d8edStholo   tag where you wanted a branch tag), but really want <oldtag> to be the
39872286d8edStholo   name of your branch, you can execute a slightly different series of
39882286d8edStholo   commands to rename it and move your working directory onto the branch.
39892286d8edStholo
39902286d8edStholo   Warning: This is not a way to rename a branch tag. It is a way to turn
39912286d8edStholo   a non-branch tag into a branch tag with the same name.
39922286d8edStholo
39932286d8edStholo                    cvs rtag -r <oldtag> <branch_point_tag> <module>
39942286d8edStholo                    cvs rtag -d <oldtag> <module>
39952286d8edStholo                    cvs rtag -b -r <branch_point_tag> <oldtag> <module>
39962286d8edStholo
39972286d8edStholo   Then, if you really must, delete the <branch_point_tag>:
39982286d8edStholo
39992286d8edStholo                    cvs rtag -d <branch_point_tag> <module>
40002286d8edStholo
40012286d8edStholo   Note: The unwieldy mixture of "tag" and "rtag" is mostly because you
40022286d8edStholo   can't specify a revision (-r <tag>) to the "tag" command.
40032286d8edStholo
40042286d8edStholo   See 4C.3 for more info on creating a branch.
40052286d8edStholo
40062286d8edStholo   Last modified: _6/13/1997_
40072286d8edStholo
40082286d8edStholo    7. Why does "commit -r <tag/rev>" put newly added files in the Attic?
40092286d8edStholo
40102286d8edStholo   If you specify "-r <rev>" (where <rev> is a dotted numeric number like
40112286d8edStholo   2.4), it correctly sets the initial revision to <rev>, but it also
40122286d8edStholo   attaches the numeric <rev> as a sticky tag and throws the file into
40132286d8edStholo   the Attic. This is a bug. The obvious solution is to move the file out
40142286d8edStholo   of the Attic into the associated Repository directory and "update -A"
40152286d8edStholo   the file. There are no Tags to clean up.
40162286d8edStholo
40172286d8edStholo   If you specify "-r <tag>" to commit a newly added file, the <tag> is
40182286d8edStholo   treated like a <branch_tag>, which becomes a symbolic RCS label
40192286d8edStholo   pointing to the string '1', which can be considered to be the "Main
40202286d8edStholo   branch number" when the main branch is still at revision 1.N. The file
40212286d8edStholo   is also thrown into the Attic. See 4C.8 for a way to recover from
40222286d8edStholo   this.
40232286d8edStholo
40242286d8edStholo   In fact, a plain "commit" without the "-r" will throw a newly added
40252286d8edStholo   file into the Attic if you added it to a directory checked out on a
40262286d8edStholo   branch. See 3A.[2-5].
40272286d8edStholo
40282286d8edStholo   See Section 4C, on Branching, for many more details.
40292286d8edStholo
40302286d8edStholo   Last modified: _6/13/1997_
40312286d8edStholo
40322286d8edStholo    8. Why would a "commit" of a newly added file not produce rev 1.1?
40332286d8edStholo
40342286d8edStholo   When committing a newly added file CVS looks for the highest main
40352286d8edStholo   branch major number in all files in the ./CVS/Entries file. Normally
40362286d8edStholo   it is '1', but if you have a file of revision 3.27 in your directory,
40372286d8edStholo   CVS will find the '3' and create revision 3.1 for the first rev of
40382286d8edStholo   <file>. Normally, the first revision is 1.1.
40392286d8edStholo
40402286d8edStholo   Last modified: _6/13/1997_
40412286d8edStholo
40422286d8edStholo  Category: /Commands_/diff_di_dif/
40432286d8edStholo
40442286d8edStholo   " + "diff", "di", "dif""
40452286d8edStholo
40462286d8edStholo    1. What is "diff" for?
40472286d8edStholo
40482286d8edStholo     To display the difference between a working file and its BASE
40492286d8edStholo   revision (the revision last checked out, updated or committed):
40502286d8edStholo
40512286d8edStholo                cvs diff <file>
40522286d8edStholo
40532286d8edStholo     To display the difference between a working file and a committed
40542286d8edStholo   revision of the same file:
40552286d8edStholo
40562286d8edStholo                cvs diff -r <tag/rev> <file>
40572286d8edStholo
40582286d8edStholo     To display the difference between two committed revisions of the
40592286d8edStholo   same file:
40602286d8edStholo
40612286d8edStholo                cvs diff -r <tag1/rev1> -r <tag2/rev2> <file>
40622286d8edStholo
40632286d8edStholo   You can specify any number of <file> arguments. Without any <file>
40642286d8edStholo   arguments, it compares the whole directory.
40652286d8edStholo
40662286d8edStholo   In the examples above, "-D <date>" may be substituted wherever "-r
40672286d8edStholo   <tag/rev>" appears. The revision a <date> refers to is the revision
40682286d8edStholo   that existed on that date.
40692286d8edStholo
40702286d8edStholo   Last modified: _6/13/1997_
40712286d8edStholo
40722286d8edStholo    2. Why did "diff" display nothing when I know there are later committed
40732286d8edStholo    revisions in the Repository?
40742286d8edStholo
40752286d8edStholo   By default, "diff" displays the difference between your working file
40762286d8edStholo   and the BASE revision. If you haven't made any changes to the file
40772286d8edStholo   since your last "checkout", "update" or "commit" there is no
40782286d8edStholo   difference to display.
40792286d8edStholo
40802286d8edStholo   To display the difference between your working file and the latest
40812286d8edStholo   revision committed to your current branch, type:
40822286d8edStholo
40832286d8edStholo                cvs diff -r HEAD <file>
40842286d8edStholo
40852286d8edStholo   Last modified: _6/13/1997_
40862286d8edStholo
40872286d8edStholo    3. How do I display what changed in the Repository since I last executed
40882286d8edStholo    "checkout", "update" or "commit"?
40892286d8edStholo
40902286d8edStholo   A special tag (interpreted by CVS -- it does not appear in the Tag
40912286d8edStholo   list) named "BASE" always refers to the revision you last checked out,
40922286d8edStholo   updated or committed. Another special tag named "HEAD" always refers
40932286d8edStholo   to the latest revision on your working branch.
40942286d8edStholo
40952286d8edStholo   To compare BASE and HEAD, you type:
40962286d8edStholo
40972286d8edStholo                cvs diff -r BASE -r HEAD <file>
40982286d8edStholo
40992286d8edStholo   Last modified: _6/13/1997_
41002286d8edStholo
41012286d8edStholo    4. How do I display the difference between my working file and what I
41022286d8edStholo    checked in last Thursday?
41032286d8edStholo
41042286d8edStholo                cvs diff -D "last Thursday" <file>
41052286d8edStholo
41062286d8edStholo   where "last Thursday" is a date string. To be more precise, the
41072286d8edStholo   argument to the '-D' option is a timestamp. Many formats are accepted.
41082286d8edStholo   See the man page under "-D date_spec" for details.
41092286d8edStholo
41102286d8edStholo   Last modified: _6/13/1997_
41112286d8edStholo
41122286d8edStholo    5. Why can't I pass long options, like --unified, to "diff"?
41132286d8edStholo
41142286d8edStholo   CVS only handles single character '-X' arguments, not the FSF long
41152286d8edStholo   options. CVS also passes through only arguments it knows about,
41162286d8edStholo   because a few arguments are captured and interpreted by CVS.
41172286d8edStholo
41182286d8edStholo   If you didn't configure RCS and CVS to use the GNU version of diff,
41192286d8edStholo   long options wouldn't work even if future versions of CVS acquire the
41202286d8edStholo   ability to pass them through.
41212286d8edStholo
41222286d8edStholo   Most of the long options have equivalent single-character options,
41232286d8edStholo   which do work. The "--unified" option is equivalent to '-u' in
41242286d8edStholo   revisions of GNU diff since 1.15.
41252286d8edStholo
41262286d8edStholo   Last modified: _6/13/1997_
41272286d8edStholo
41282286d8edStholo  Category: /Commands_/export_exp_ex/
41292286d8edStholo
41302286d8edStholo   " + "export", "exp", "ex""
41312286d8edStholo
41322286d8edStholo    1. What is "export" for?
41332286d8edStholo
41342286d8edStholo   "export" checks out a copy of a module in a form intended for export
41352286d8edStholo   outside the CVS environment. The "export" command produces the same
41362286d8edStholo   directory and file structure as the "checkout" command, but it doesn't
41372286d8edStholo   create "CVS" sub-directories and it removes all the RCS keywords from
41382286d8edStholo   the files.
41392286d8edStholo
41402286d8edStholo   Last modified: _6/13/1997_
41412286d8edStholo
41422286d8edStholo    2. Why does it remove the RCS keywords so I can't use the "ident" command
41432286d8edStholo    on the source files?
41442286d8edStholo
41452286d8edStholo   It removes the RCS keywords, so that if the recipient of the exported
41462286d8edStholo   sources checks them into another set of RCS files (with or without
41472286d8edStholo   CVS), and then makes modifications through RCS or CVS commands, the
41482286d8edStholo   revision numbers that they had when you exported them will be
41492286d8edStholo   preserved. (That ident no longer works is just an unfortunate side
41502286d8edStholo   effect.)
41512286d8edStholo
41522286d8edStholo   The theory is that you are exporting the sources to someone else who
41532286d8edStholo   will make independent changes, and at some point you or they will want
41542286d8edStholo   to know what revisions from your Repository they started with
41552286d8edStholo   (probably to merge changes, or to try to decide whether to merge
41562286d8edStholo   changes).
41572286d8edStholo
41582286d8edStholo   A better way to handle this situation would be to give them their own
41592286d8edStholo   branch of your Repository. They would need to remember to checkin the
41602286d8edStholo   exported sources with RCS IDs intact (ci -k) so that their changes
41612286d8edStholo   would get revision numbers from the branch, rather than starting at
41622286d8edStholo   1.1 again. Perhaps a future version of CVS will provide a way to
41632286d8edStholo   export sources this way.
41642286d8edStholo
41652286d8edStholo                                Contributed by Dan Franklin
41662286d8edStholo
41672286d8edStholo   Last modified: _6/13/1997_
41682286d8edStholo
41692286d8edStholo    3. Can I override the '-kv' flag CVS passes to RCS?
41702286d8edStholo
41712286d8edStholo   Not as of CVS version 1.4.
41722286d8edStholo
41732286d8edStholo   Last modified: _6/13/1997_
41742286d8edStholo
41752286d8edStholo    4. Why doesn't "export" have a '-k' flag like "import" does?
41762286d8edStholo
41772286d8edStholo   Export is intended for a specific purpose -- to remove all trace of
41782286d8edStholo   revision control on the way *out* of CVS.
41792286d8edStholo
41802286d8edStholo   Last modified: _6/13/1997_
41812286d8edStholo
41822286d8edStholo    5. Why does "export -D" check out every file in the Attic?
41832286d8edStholo
41842286d8edStholo   See 5B.3 for an explanation of the same problem with "update".
41852286d8edStholo
41862286d8edStholo   Last modified: _6/13/1997_
41872286d8edStholo
41882286d8edStholo  Category: /Commands_/history_hi_his/
41892286d8edStholo
41902286d8edStholo   " + "history", "hi", "his""
41912286d8edStholo
41922286d8edStholo    1. What is "history" for?
41932286d8edStholo
41942286d8edStholo   To provide information difficult or impossible to extract out of the
41952286d8edStholo   RCS files, such as a "tag" history or a summary of module activities.
41962286d8edStholo
41972286d8edStholo   Last modified: _6/13/1997_
41982286d8edStholo
41992286d8edStholo    2. Of what use is it?
42002286d8edStholo
42012286d8edStholo   I have found it useful in a number of ways, including:
42022286d8edStholo
42032286d8edStholo     Providing a list of files changed since
42042286d8edStholo
42052286d8edStholo   - A tagged release.
42062286d8edStholo   - Yesterday, last Thursday, or a specific date.
42072286d8edStholo   - Someone changed a specific file.
42082286d8edStholo
42092286d8edStholo     Providing a list of special events:
42102286d8edStholo
42112286d8edStholo   - Files added or removed since one of the above events.
42122286d8edStholo   - Merge failures since one of the above events. (Where did the
42132286d8edStholo   conflicts occur?)
42142286d8edStholo   - Has anyone (and who) grabbed the revision of this file I committed
42152286d8edStholo   last week, or are they still working blind?
42162286d8edStholo
42172286d8edStholo     Telling me how often a file/directory/module has been changed.
42182286d8edStholo
42192286d8edStholo     Dumping a summary of work done on a particular module, including who
42202286d8edStholo   last worked on it and what changed.
42212286d8edStholo
42222286d8edStholo     Displaying the checked-out modules and where they are being worked
42232286d8edStholo   on.
42242286d8edStholo
42252286d8edStholo     To tell me what users "joe" and "malcolm" have done this week.
42262286d8edStholo
42272286d8edStholo   Last modified: _6/13/1997_
42282286d8edStholo
42292286d8edStholo    3. What is this, Big Brother?
42302286d8edStholo
42312286d8edStholo                War is Peace.
42322286d8edStholo                Freedom is Slavery.
42332286d8edStholo                Ignorance is Strength.
42342286d8edStholo
42352286d8edStholo   Normally manager types and those with the power to play Big Brother
42362286d8edStholo   don't care about this information. The Software Engineer responsible
42372286d8edStholo   for integration usually wants to know who is working on what and what
42382286d8edStholo   changed. Use your imagination.
42392286d8edStholo
42402286d8edStholo   Last modified: _6/13/1997_
42412286d8edStholo
42422286d8edStholo    4. I deleted my working directory and "history" still says I have it
42432286d8edStholo    checked out. How do I fix it?
42442286d8edStholo
42452286d8edStholo   You can use "release -f" to forcibly add a "release" record to the
42462286d8edStholo   history file for a working directory associated with a "module". If
42472286d8edStholo   your version of "release" doesn't have the '-f' option, or you checked
42482286d8edStholo   out the directory using a relative path, you have to edit the
42492286d8edStholo   $CVSROOT/CVSROOT/history file.
42502286d8edStholo
42512286d8edStholo   You can remove the last 'O' line in the history file referring to the
42522286d8edStholo   module in question or add an 'F' record.
42532286d8edStholo
42542286d8edStholo   Last modified: _6/13/1997_
42552286d8edStholo
42562286d8edStholo    5. So I *can* edit the History file?
42572286d8edStholo
42582286d8edStholo   Yes, but if you are using history at all, you should take a little
42592286d8edStholo   care not to lose information. I normally use Emacs on the file, since
42602286d8edStholo   it can detect that a file has changed out from under it. You could
42612286d8edStholo   also copy and zero out the history file, edit the copy and append any
42622286d8edStholo   new records to the edited copy before replacing it.
42632286d8edStholo
42642286d8edStholo   Last modified: _6/13/1997_
42652286d8edStholo
42662286d8edStholo    6. Why does the history file grow so quickly?
42672286d8edStholo
42682286d8edStholo   It stores 'U' records, which come in handy sometimes when you are
42692286d8edStholo   tracking whether people have updated each other's code before testing.
42702286d8edStholo   There should (and probably will sometime) be a way to choose what
42712286d8edStholo   kinds of events go into the history file.
42722286d8edStholo
42732286d8edStholo   The contributed "cln_hist.pl" script will remove all the 'U' records,
42742286d8edStholo   plus matching pairs of 'O' and 'F' records during your normal clean up
42752286d8edStholo   of the history file.
42762286d8edStholo
42772286d8edStholo   Last modified: _6/13/1997_
42782286d8edStholo
42792286d8edStholo    7. What is the difference between "cvs history -r <tag/rev>" and "cvs
42802286d8edStholo    history -t <tag>"?
42812286d8edStholo
42822286d8edStholo   The '-t' option looks for a Tag record stored by "rtag" in the history
42832286d8edStholo   file and limits the search to dates after the last <tag> of the given
42842286d8edStholo   name was added.
42852286d8edStholo
42862286d8edStholo   The '-r' option was intended to search all files looking for the <tag>
42872286d8edStholo   in the RCS files. It takes forever and needs to be rewritten.
42882286d8edStholo
42892286d8edStholo   Last modified: _6/13/1997_
42902286d8edStholo
42912286d8edStholo    8. Why does "cvs history -c -t <tag>" fail to print anything?
42922286d8edStholo
42932286d8edStholo   You have been using "tag" instead of "rtag". The "tag" command
42942286d8edStholo   currently doesn't store a history record. This is another remnant of
42952286d8edStholo   CVS's earlier firm belief in "modules". But it also has a basis in how
42962286d8edStholo   "rtag" and "tag" were originally used.
42972286d8edStholo
42982286d8edStholo   "rtag" was intended for large-scale tagging of large chunks of the
42992286d8edStholo   Repository, an event work recording. "tag" was intended for adding and
43002286d8edStholo   updating tags on a few files or directories, though it could also be
43012286d8edStholo   used to tag the entire checked-out working tree when there is no
43022286d8edStholo   module defined to match the tree or when the working tree is the only
43032286d8edStholo   place where the right collection of revisions to tag can be found.
43042286d8edStholo
43052286d8edStholo   Last modified: _6/13/1997_
43062286d8edStholo
43072286d8edStholo    9. "cvs history -a -o" only printed one line for each checked-out module.
43082286d8edStholo    Shouldn't it print all the directories where the modules are checked out?
43092286d8edStholo
43102286d8edStholo   Not as designed.
43112286d8edStholo
43122286d8edStholo        Command                 Question it is supposed to answer.
43132286d8edStholo        ----------------        ------------------------------------------
43142286d8edStholo        cvs history -o          What modules do I have checked out?
43152286d8edStholo        cvs history -a -o       <same for all users>
43162286d8edStholo
43172286d8edStholo        cvs history -o -w       What working directories have I created
43182286d8edStholo                                and what modules are in them?
43192286d8edStholo        cvs history -a -o -w    <same for every user>
43202286d8edStholo
43212286d8edStholo   The -o option chooses the "checked out modules" report, which is the
43222286d8edStholo   default history report.
43232286d8edStholo
43242286d8edStholo   Last modified: _6/13/1997_
43252286d8edStholo
43262286d8edStholo    10. I can't figure out "history", can you give me concrete examples?
43272286d8edStholo
43282286d8edStholo   Default output selects records only for the user who executes the
43292286d8edStholo   "history" command. To see records for other users, add one or more "-u
43302286d8edStholo   user" options or the '-a' option to select *all* users.
43312286d8edStholo
43322286d8edStholo   To list (for the selected users): Type "cvs history" and:
43332286d8edStholo
43342286d8edStholo   * Checked out modules: -o (the default)
43352286d8edStholo   * Files added since creation: -x A
43362286d8edStholo   * Modified files since creation: -c
43372286d8edStholo   * Modified files since last Friday: -c -D 'last Friday'
43382286d8edStholo   * Modified files since TAG was added: -c -t <tag>
43392286d8edStholo   * Modified files since TAG on files: -c -r <tag>
43402286d8edStholo   * Last modifier of file/Repository X? -c -l -[fp] X
43412286d8edStholo   * Modified files since string "str": -c -b str
43422286d8edStholo   * Tag history: (Actually "rtag".) -T
43432286d8edStholo   * History of file/Repository/module X: -[fpn] X
43442286d8edStholo   * Module report on "module": -m module
43452286d8edStholo
43462286d8edStholo   Last modified: _6/13/1997_
43472286d8edStholo
43482286d8edStholo    11. Can we merge history files when we merge Repositories?
43492286d8edStholo
43502286d8edStholo   Assuming that the two Repositories have different sets of pathnames,
43512286d8edStholo   it should be possible to merge two history files by sorting them
43522286d8edStholo   together by the timestamp fields.
43532286d8edStholo
43542286d8edStholo   You should be able to run:
43552286d8edStholo
43562286d8edStholo   sort +0.1 ${dir1}/history ${dir2}/history > history
43572286d8edStholo
43582286d8edStholo   If you "diff" a standard history file before and after such a sort,
43592286d8edStholo   you might see other differences caused by garbage (split lines, nulls,
43602286d8edStholo   etc) in the file. If your Repository is mounted through NFS onto
43612286d8edStholo   multiple machines you will also see a few differences caused by
43622286d8edStholo   different clocks on different machines. (Especially if you don't use
43632286d8edStholo   NTP to keep the clocks in sync.)
43642286d8edStholo
43652286d8edStholo   Last modified: _6/13/1997_
43662286d8edStholo
43672286d8edStholo  Category: /Commands_/import_im_imp/
43682286d8edStholo
43692286d8edStholo   " + "import", "im", "imp""
43702286d8edStholo
43712286d8edStholo    1. What is "import" for?
43722286d8edStholo
43732286d8edStholo   The "import" command is a fast way to insert a whole tree of files
43742286d8edStholo   into CVS.
43752286d8edStholo
43762286d8edStholo   The first "import" to a particular file within the Repository creates
43772286d8edStholo   an RCS file with a single revision on the "Vendor branch." Subsequent
43782286d8edStholo   "import"s of the same file within the Repository append a new revision
43792286d8edStholo   onto the Vendor branch. It does not, as some seem to believe, create a
43802286d8edStholo   new branch for each "import". All "imports" are appended to the single
43812286d8edStholo   Vendor branch.
43822286d8edStholo
43832286d8edStholo   If the file hasn't changed, no new revision is created -- the new
43842286d8edStholo   "Release-Tag" is added to the previous revision.
43852286d8edStholo
43862286d8edStholo   After the import is finished, files you have not changed locally are
43872286d8edStholo   considered to have changed in the "Main line of development". Files
43882286d8edStholo   you *have* changed locally must have the new Vendor code merged into
43892286d8edStholo   them before they are visible on the "Main line".
43902286d8edStholo
43912286d8edStholo                See 4C.6 and 4C.15
43922286d8edStholo
43932286d8edStholo   Last modified: _6/13/1997_
43942286d8edStholo
43952286d8edStholo    2. How am I supposed to use "import"?
43962286d8edStholo
43972286d8edStholo   Create a source directory containing only the files you want to
43982286d8edStholo   import. Make sure you clean up any cruft left over from previous
43992286d8edStholo   builds or editing. You want to make sure that the directory contains
44002286d8edStholo   only what you want to call "source" from which everything else is
44012286d8edStholo   built.
44022286d8edStholo
44032286d8edStholo   If this is not the first import from this "Vendor", you should also
44042286d8edStholo   compare the output of "find . ! -name CVS -print | sort" executed both
44052286d8edStholo   at the head of a checked out working directory and at the head of the
44062286d8edStholo   sources to be imported. If you find any deleted or renamed files, you
44072286d8edStholo   have to deal with them by hand. (See 4B.8 on renaming.)
44082286d8edStholo
44092286d8edStholo   "cd" into your source directory and type:
44102286d8edStholo
44112286d8edStholo            cvs import -m "Message" <repos> <Vendor-Tag> <Release-Tag>
44122286d8edStholo
44132286d8edStholo   where <repos> is the relative directory pathname within the Repository
44142286d8edStholo   that corresponds to the sources you are importing.
44152286d8edStholo
44162286d8edStholo   You might also consider using the "-I !" option to avoid ignoring
44172286d8edStholo   anything. It is easier to remove bogus files from the Repository than
44182286d8edStholo   to create a sparse tree of the ignored files and rerun "import".
44192286d8edStholo
44202286d8edStholo   For example, if the FSF, CVS, Make and I are still active in the year
44212286d8edStholo   2015, I'll import version 89.53 of GNU make this way:
44222286d8edStholo
44232286d8edStholo            cvs import -m "GNUmake V89.53" gnu/make GNU GNUMAKE_89_53
44242286d8edStholo
44252286d8edStholo   See 3H.13 for more details.
44262286d8edStholo
44272286d8edStholo   Last modified: _6/13/1997_
44282286d8edStholo
44292286d8edStholo    3. Why does import put files on a branch? Why can't I work on the main
44302286d8edStholo    trunk instead of a Vendor branch?
44312286d8edStholo
44322286d8edStholo   This was a Design choice. The Vendor branch is the way "import" deals
44332286d8edStholo   with a Vendor release. It is a solution to the Engineering problem of
44342286d8edStholo   how to merge multiple external releases of Vendor-supplied sources
44352286d8edStholo   into your ongoing work. The Vendor releases are kept on a separate,
44362286d8edStholo   special, "Vendor" branch and your work is kept on the RCS trunk. New
44372286d8edStholo   Vendor releases are imported onto the Vendor branch and then merged
44382286d8edStholo   into your work, if there is any, on the trunk.
44392286d8edStholo
44402286d8edStholo   This way, you can use CVS to find out not only about your work, but
44412286d8edStholo   you can also find out what the Vendor changed by diffing between two
44422286d8edStholo   of the Release Tags you handed to "import".
44432286d8edStholo
44442286d8edStholo   CVS was designed to work this way. If you use CVS in some other way,
44452286d8edStholo   you should think carefully about what you are doing.
44462286d8edStholo
44472286d8edStholo   Note that the CVS "Main Branch" and the RCS Main Trunk are not the
44482286d8edStholo   same. Placing files on the Vendor Branch doesn't keep you from
44492286d8edStholo   creating a development branch to work on.
44502286d8edStholo
44512286d8edStholo   See Section 4C, on Branching.
44522286d8edStholo
44532286d8edStholo   If you are not working with 3rd party (i.e. Vendor) sources, you can
44542286d8edStholo   skip the "import" and avoid the Vendor branch entirely. It works just
44552286d8edStholo   as well to move pre-existing RCS files into Repository directories.
44562286d8edStholo
44572286d8edStholo   You can create a whole Repository tree by copying a directory
44582286d8edStholo   hierarchy of normal source files directly into the Repository and
44592286d8edStholo   applying CVS to it. Here's an idea you should *test* before using:
44602286d8edStholo
44612286d8edStholo                cd <your source tree>
44622286d8edStholo                set source = `pwd`
44632286d8edStholo                set module = xyzzy      <<== Your choice of directory name
44642286d8edStholo                mkdir $CVSROOT/$module
44652286d8edStholo                cd $CVSROOT/$module
44662286d8edStholo                (cd $source; tar cf - .) | tar xvpBf -
44672286d8edStholo                find . -type f -exec ci -t-Original. {} \;
44682286d8edStholo
44692286d8edStholo   The RCS "ci" command, without -u or -l options, will turn your source
44702286d8edStholo   file into an RCS (",v") and delete the original source.
44712286d8edStholo
44722286d8edStholo   Last modified: _6/13/1997_
44732286d8edStholo
44742286d8edStholo    4. Is there any way to import binary files?
44752286d8edStholo
44762286d8edStholo   If you configured CVS to use the GNU version of "diff" and "diff3",
44772286d8edStholo   then you can import any kind of file.
44782286d8edStholo
44792286d8edStholo   Binary files with RCS keywords in them are a problem, since you don't
44802286d8edStholo   want them to expand.
44812286d8edStholo
44822286d8edStholo   If the tree you are about to "import" is entirely filled with binary
44832286d8edStholo   files, you can use the '-ko' option on "import". Otherwise, I would
44842286d8edStholo   run the import normally, then fix the binary files as described below
44852286d8edStholo   in 3H.5.
44862286d8edStholo
44872286d8edStholo   See 4D.1 on Binary files.
44882286d8edStholo
44892286d8edStholo   Last modified: _6/13/1997_
44902286d8edStholo
44912286d8edStholo    5. Why does "import" corrupt some binary files?
44922286d8edStholo
44932286d8edStholo   The RCS "co" command, when it is invoked by a CVS "checkout" or
44942286d8edStholo   "update" (or after a "commit") command, searches for and expands a
44952286d8edStholo   list of keywords within the file. They are documented in the RCS "co"
44962286d8edStholo   man page. Strings such as "$\Id$" (or "$\Id:"), or "$\Revision$" (or
44972286d8edStholo   "$\Revision:") are altered to the include the indicated information.
44982286d8edStholo
44992286d8edStholo   [[Note: The keywords should appear in the text without the '\'
45002286d8edStholo   character I have inserted to *avoid* expansion here. The only real RCS
45012286d8edStholo   keywords in this document are at the top of the file, where I store
45022286d8edStholo   the Revision and Date.]]
45032286d8edStholo
45042286d8edStholo   If RCS keyword strings show up in a binary file, they will be altered
45052286d8edStholo   unless you set the '-ko' option on the RCS files to tell RCS to keep
45062286d8edStholo   the original keyword values and not to expand new ones. After
45072286d8edStholo   "import", you can set the '-ko' option this way:
45082286d8edStholo
45092286d8edStholo                cvs admin -ko <file>
45102286d8edStholo                rm <file>
45112286d8edStholo                cvs update <file>
45122286d8edStholo
45132286d8edStholo   After an import that didn't use '-ko' (because the whole tree wasn't
45142286d8edStholo   of binary files) you should fix up the binary files as described above
45152286d8edStholo   before checking out any new copies of the files and before updating
45162286d8edStholo   any working directories you checked out earlier.
45172286d8edStholo
45182286d8edStholo   See 4D.1 on Binary files.
45192286d8edStholo
45202286d8edStholo   Last modified: _6/13/1997_
45212286d8edStholo
45222286d8edStholo    6. How do I retain the original $\Revision$ strings in the sources?
45232286d8edStholo
45242286d8edStholo   If you want to leave old RCS keywords as they are, you can use the
45252286d8edStholo   '-ko' tricks described above.
45262286d8edStholo
45272286d8edStholo   Last modified: _6/13/1997_
45282286d8edStholo
45292286d8edStholo    7. I imported some files for the Yarg compiler that compiles files with a
45302286d8edStholo    suffix of ".yarg" and whose comment prefix is "YARG> ". When I check them
45312286d8edStholo    out, they will no longer compile because they have this junk in them. Why?
45322286d8edStholo
45332286d8edStholo        YARG>YARG>YARG>YARG>YARG>YARG>YARG>YARG>YARG>YARG>YARG>YARG>YARG>
45342286d8edStholo        YARG> $\Log:
45352286d8edStholo        # Revision 1.3  1998/03/03  00:16:16  bubba
45362286d8edStholo        # What is 2+2 anyway?
45372286d8edStholo        #
45382286d8edStholo        # Revision 1.2  1998/03/03  00:15:15  bubba
45392286d8edStholo        # Added scorekeeping.
45402286d8edStholo        YARG>
45412286d8edStholo        YARG>YARG>YARG>YARG>YARG>YARG>YARG>YARG>YARG>YARG>YARG>YARG>YARG>
45422286d8edStholo
45432286d8edStholo   Well bubba, "Yarg" hasn't hit the big time yet. Neither RCS nor CVS
45442286d8edStholo   know about your suffix or your comment prefix. So you have two
45452286d8edStholo   choices:
45462286d8edStholo
45472286d8edStholo     Check out the Yarg-less module, and tell all the files about your
45482286d8edStholo   comment prefix. Visit each directory and type:
45492286d8edStholo
45502286d8edStholo                cvs admin -c"YARG> " *.yarg
45512286d8edStholo
45522286d8edStholo   If *all* files in the whole directory tree are Yarg files, you can use
45532286d8edStholo   this instead:
45542286d8edStholo
45552286d8edStholo                cvs admin -c"YARG> " .
45562286d8edStholo
45572286d8edStholo   Then save any changes you made, remove all the "*.yarg" files and grab
45582286d8edStholo   new copies from the Repository:
45592286d8edStholo
45602286d8edStholo   rm *.yarg (or: find . -name '*.yarg' -exec rm {} ';') (or: find .
45612286d8edStholo   -name '*.yarg' -print | xargs rm) (or: find . -name '*.yarg' -print0 |
45622286d8edStholo   xargs -0 rm if you have spaces in filenames and the GNU find/xargs.)
45632286d8edStholo   cvs update
45642286d8edStholo
45652286d8edStholo   It might be faster to remove the whole directory and check it out
45662286d8edStholo   again.
45672286d8edStholo
45682286d8edStholo     Change the import.c file in the CVS sources and add the .yarg
45692286d8edStholo   suffix, along with the "YARG> " comment prefix to the "comtable"
45702286d8edStholo   array.
45712286d8edStholo
45722286d8edStholo   If you ever plan to add new files with $\Log in them, you should also
45732286d8edStholo   go into the RCS sources and make the same change in the table
45742286d8edStholo   contained in the "rcsfnms.c" file.
45752286d8edStholo
45762286d8edStholo   Then delete the imported files from the Repository and re-"import" the
45772286d8edStholo   sources.
45782286d8edStholo
45792286d8edStholo   Last modified: _6/13/1997_
45802286d8edStholo
45812286d8edStholo    8. How do I make "import" save the timestamps on the original files?
45822286d8edStholo
45832286d8edStholo   Use "import -d" to save the current timestamps on the files as the RCS
45842286d8edStholo   revision times.
45852286d8edStholo
45862286d8edStholo   See 4D.8 for another aspect of file timestamps.
45872286d8edStholo
45882286d8edStholo   Last modified: _6/13/1997_
45892286d8edStholo
45902286d8edStholo    9. Why can't I "import" 3 releases on different branches?
45912286d8edStholo
45922286d8edStholo   I'll bet you typed something like this:
45932286d8edStholo
45942286d8edStholo                cd /src/blasto.v2
45952286d8edStholo                cvs import -b 1.1.2  VENDOR2 Version2
45962286d8edStholo                cd /src/blasto.v3
45972286d8edStholo                cvs import -b 1.1.3  VENDOR3 Version3
45982286d8edStholo                cd /src/blasto.v4
45992286d8edStholo                cvs import -b 1.1.4  VENDOR4 Version4
46002286d8edStholo
46012286d8edStholo   This is wrong, or at least it won't help you much. You have created
46022286d8edStholo   three separate Vendor branches, which is probably not what you wanted.
46032286d8edStholo
46042286d8edStholo   Earlier versions of CVS, as described in Brian Berliner's Usenix
46052286d8edStholo   paper, tried to support multiple Vendor branches on the theory that
46062286d8edStholo   you might receive source for the *same* program from multiple vendors.
46072286d8edStholo   It turns out that this is very rare, whereas the need to branch in
46082286d8edStholo   *your* development, for releases and for project branches, is much
46092286d8edStholo   greater.
46102286d8edStholo
46112286d8edStholo   So the model now is to use a single vendor branch to contain a series
46122286d8edStholo   of releases from the same vendor. Your work moves along on the Main
46132286d8edStholo   Trunk, or on a CVS branch to support a real "branch in development".
46142286d8edStholo
46152286d8edStholo   To set this up, you should type this instead of the above:
46162286d8edStholo
46172286d8edStholo                cd /src/blasto.v2
46182286d8edStholo                cvs import VENDOR Version2
46192286d8edStholo                cd /src/blasto.v3
46202286d8edStholo                cvs import VENDOR Version3
46212286d8edStholo                cd /src/blasto.v4
46222286d8edStholo                cvs import VENDOR Version4
46232286d8edStholo
46242286d8edStholo   Last modified: _6/13/1997_
46252286d8edStholo
46262286d8edStholo    10. What do I do if the Vendor adds or deletes files between releases?
46272286d8edStholo
46282286d8edStholo   Added files show up with no extra effort. To handle "removed" files,
46292286d8edStholo   you should always compare the tree structure of the new release
46302286d8edStholo   against the one you have in your Repository. If the Vendor has removed
46312286d8edStholo   files since the previous release, go into a working directory
46322286d8edStholo   containing your current version of the sources and "cvs remove"
46332286d8edStholo   (followed by "cvs commit" to make it really take effect) each file
46342286d8edStholo   that is no longer in the latest release.
46352286d8edStholo
46362286d8edStholo   Using this scheme will allow you to "checkout" any version of the
46372286d8edStholo   vendor's code, with the correct revisions and files, by using
46382286d8edStholo   "checkout -r Version[234]".
46392286d8edStholo
46402286d8edStholo   Renames are harder to find, since you have to compare file contents to
46412286d8edStholo   determine that one has occurred. If you notice one, see 4B.8 on
46422286d8edStholo   renaming files.
46432286d8edStholo
46442286d8edStholo   Last modified: _6/13/1997_
46452286d8edStholo
46462286d8edStholo    11. What about if the Vendor changes the names of files or directories, or
46472286d8edStholo    rearranges the whole structure between releases?
46482286d8edStholo
46492286d8edStholo   Currently CVS can't handle this cleanly. It requires "renaming" a
46502286d8edStholo   bunch of files or directories.
46512286d8edStholo
46522286d8edStholo   See 4B.8 on "renaming" for more details.
46532286d8edStholo
46542286d8edStholo   What I generally do is to close the Repository for a while and make
46552286d8edStholo   changes in both the Repository and in a copy of the vendor release
46562286d8edStholo   until the structure matches, then execute the import.
46572286d8edStholo
46582286d8edStholo   If you ever have to check out and build an old version, you may have
46592286d8edStholo   to use the new, or completely different Makefiles.
46602286d8edStholo
46612286d8edStholo   Last modified: _6/13/1997_
46622286d8edStholo
46632286d8edStholo    12. I thought "import" was for Vendor releases, why would I use it for code
46642286d8edStholo    of my own? Do I have to use import?
46652286d8edStholo
46662286d8edStholo   For code you produce yourself, "import" is a convenience for fast
46672286d8edStholo   insertion of whole trees. It is not necessary. You can just as easily
46682286d8edStholo   create ",v" files using the RCS "ci" command and move them directly
46692286d8edStholo   into the Repository.
46702286d8edStholo
46712286d8edStholo   Other than the CVSROOT directory, the Repository consists entirely of
46722286d8edStholo   directories of ",v" files. The Repository contains no other state
46732286d8edStholo   information.
46742286d8edStholo
46752286d8edStholo   See Section 4B, on Setting up and Managing the Repository.
46762286d8edStholo
46772286d8edStholo   Last modified: _6/13/1997_
46782286d8edStholo
46792286d8edStholo    13. How do I import a large Vendor release?
46802286d8edStholo
46812286d8edStholo   When the sum of the changes made by the Vendor and the changes made by
46822286d8edStholo   local developers is small, "import" is not a big problem. But when you
46832286d8edStholo   are managing a large Repository, any care taken up front will save you
46842286d8edStholo   time later.
46852286d8edStholo
46862286d8edStholo   First read the following, then, before executing "import", see the
46872286d8edStholo   questions in Section 4C dealing with branch merges and Vendor branch
46882286d8edStholo   merges.
46892286d8edStholo
46902286d8edStholo     If this is not the first import of this code, before starting, rtag
46912286d8edStholo   the whole directory you will be changing.
46922286d8edStholo
46932286d8edStholo     The first step is to make sure the structure of the new files
46942286d8edStholo   matches the structure of the current Repository.
46952286d8edStholo
46962286d8edStholo   Run "find . -print | sort" on both trees and "diff" the output.
46972286d8edStholo
46982286d8edStholo     Alter the "source" tree until the "diff" (of the list of filenames,
46992286d8edStholo   not of the whole trees) shows that the directory structures are
47002286d8edStholo   equivalent.
47012286d8edStholo
47022286d8edStholo   The "comm" command, if you have it, can help figure out what has been
47032286d8edStholo   added or deleted between releases.
47042286d8edStholo
47052286d8edStholo     If they deleted any files, you can handle them cleanly with "cvs
47062286d8edStholo   remove". The command "comm -23 files.old files.new" will show you a
47072286d8edStholo   list of files that need to be removed.
47082286d8edStholo
47092286d8edStholo   You should examine the list first to see if any have been renamed
47102286d8edStholo   rather than simply deleted.
47112286d8edStholo
47122286d8edStholo     If they renamed any files, see 4B.8 on renaming files.
47132286d8edStholo
47142286d8edStholo     Remember to *SAVE* the output from the import command.
47152286d8edStholo
47162286d8edStholo     When you have dealt with removed and renamed files, then you can
47172286d8edStholo   execute the import:
47182286d8edStholo
47192286d8edStholo   cd <new source>
47202286d8edStholo           cvs import -I ! -m "Message" <repos> <VendorTag> <ReleaseTag>
47212286d8edStholo
47222286d8edStholo   Where
47232286d8edStholo
47242286d8edStholo   "-I !" is an optional argument that keeps "import" from ignoring
47252286d8edStholo   files. The comparison of the "find" commands above will probably avoid
47262286d8edStholo   the need for this, but it is easier to remove files from the
47272286d8edStholo   Repository than to run a subset "import" to catch just the ignored
47282286d8edStholo   files. [You might have to quote or backwhack the '!'.]
47292286d8edStholo
47302286d8edStholo           Message      is the log message to be stored in the RCS files.
47312286d8edStholo
47322286d8edStholo           <repos>      is a relative path to a directory within the
47332286d8edStholo                        Repository.  The directory <new source> must be at
47342286d8edStholo                        the same relative level within the new sources as
47352286d8edStholo                        the <repos> you give is within the Repository.  (I
47362286d8edStholo                        realize this is not obvious.  Experiment first.)
47372286d8edStholo
47382286d8edStholo           <VendorTag>  is a Tag used to identify the Vendor who sent you
47392286d8edStholo                        the files you are importing.  All "imports" into
47402286d8edStholo                        the same <repos> *must* use the same VendorTag.
47412286d8edStholo                        You can find it later by using the "log" command.
47422286d8edStholo
47432286d8edStholo   <ReleaseTag> is a Tag used to identify the particular release of the
47442286d8edStholo   software you are importing. It must be unique and should be mnemonic
47452286d8edStholo   -- at least include the revision number in it. (Note: you can't use
47462286d8edStholo   '.' characters in a Tag. Substitute '_' or '-'.)
47472286d8edStholo
47482286d8edStholo     There will be six categories of files to deal with. (Actually there
47492286d8edStholo   are eight, but you have already dealt with "removed" and "renamed"
47502286d8edStholo   files.)
47512286d8edStholo
47522286d8edStholo   If this is the first "import" into a given <repos> directory, only the
47532286d8edStholo   first three of these ('I', 'L' and 'N') can occur.
47542286d8edStholo
47552286d8edStholo     Ignored file.
47562286d8edStholo
47572286d8edStholo   CVS prints: I filename
47582286d8edStholo
47592286d8edStholo   You'll need to examine it to see if it *should* have been ignored. If
47602286d8edStholo   you use "-I !", nothing will be ignored.
47612286d8edStholo
47622286d8edStholo     Symbolic link.
47632286d8edStholo
47642286d8edStholo   CVS prints: L linkname
47652286d8edStholo
47662286d8edStholo   Links are "ignored", but you'll probably want to create a "checkout
47672286d8edStholo   helper" function to regenerate them.
47682286d8edStholo
47692286d8edStholo     New file.
47702286d8edStholo
47712286d8edStholo   CVS prints: N filename
47722286d8edStholo
47732286d8edStholo   CVS creates a new file in the Repository. You don't have to do
47742286d8edStholo   anything to the file, but you might have to change Makefiles to refer
47752286d8edStholo   to it if this is really a new file.
47762286d8edStholo
47772286d8edStholo     A file unchanged by the Vendor since its last release.
47782286d8edStholo
47792286d8edStholo   CVS prints: U filename
47802286d8edStholo
47812286d8edStholo   CVS will notice this and simply add the new ReleaseTag to the latest
47822286d8edStholo   rev on the Vendor branch.
47832286d8edStholo
47842286d8edStholo   No work will be needed by you, whether you have changed the file or
47852286d8edStholo   not. No one will notice anything.
47862286d8edStholo
47872286d8edStholo     A file changed by the Vendor, but not by you.
47882286d8edStholo
47892286d8edStholo   CVS prints: U filename
47902286d8edStholo
47912286d8edStholo   CVS should add the file onto the vendor branch and attach the Release
47922286d8edStholo   Tag to it.
47932286d8edStholo
47942286d8edStholo   When you next execute "update" in any working directory you'll get the
47952286d8edStholo   new revision.
47962286d8edStholo
47972286d8edStholo     A file changed by both the Vendor and by you.
47982286d8edStholo
47992286d8edStholo   CVS prints: C filename
48002286d8edStholo
48012286d8edStholo   These are the trouble files. For each of these files (or in groups --
48022286d8edStholo   I usually do one directory at a time), you must execute:
48032286d8edStholo
48042286d8edStholo                    cvs update -j <PreviousReleaseTag> -j <ReleaseTag>
48052286d8edStholo                or
48062286d8edStholo                    cvs update -j <VendorTag:yesterday> -j <VendorTag>
48072286d8edStholo
48082286d8edStholo   It will print either 'M' (if no overlaps) or 'C', if overlaps. If a
48092286d8edStholo   'C' shows up, you'll need to edit the file by hand.
48102286d8edStholo
48112286d8edStholo   Then, for every file, you'll need to execute "cvs commit".
48122286d8edStholo
48132286d8edStholo   See the part of Section 4C dealing with branch merges.
48142286d8edStholo
48152286d8edStholo     If you are truly performing a large import, you will most likely
48162286d8edStholo   need help. Managing those people is another problem area.
48172286d8edStholo
48182286d8edStholo   Since the merge of the Vendor branch is just like any other merge, you
48192286d8edStholo   should read section 4C for more info about performing and cleaning up
48202286d8edStholo   merges.
48212286d8edStholo
48222286d8edStholo   The larger the import, and the larger the group of people involved,
48232286d8edStholo   the more often you should use "tag" and "rtag" to record even trivial
48242286d8edStholo   milestones. See 4C.14, especially the "paranoid" section.
48252286d8edStholo
48262286d8edStholo   Before starting the import, you should install and test a "commitinfo"
48272286d8edStholo   procedure to record all commits in a file or via Email to a mail
48282286d8edStholo   archive. Along with the tags you placed on the Repository before the
48292286d8edStholo   import, this archive will help to track what was changed, if problems
48302286d8edStholo   occur
48312286d8edStholo
48322286d8edStholo   There are four stages to the recovery:
48332286d8edStholo
48342286d8edStholo     Parcel out the work -- Effective Emacs Engineering.
48352286d8edStholo
48362286d8edStholo   As input to the assignment process, you might want to examine the tree
48372286d8edStholo   and record the last person who changed the file. You can also
48382286d8edStholo   research, if you don't already know, who is expert in each area of the
48392286d8edStholo   software.
48402286d8edStholo
48412286d8edStholo   Examine the import log (you saved the output, right?), estimate how
48422286d8edStholo   much work is involved in each area and assign groups of files to
48432286d8edStholo   individual developers. Unless some directory is immense, it is easier
48442286d8edStholo   to manage if you assign whole directories to one person.
48452286d8edStholo
48462286d8edStholo   Keep a list. Suggest a completion date/time. Tell them to "commit" the
48472286d8edStholo   file when they are finished with the merge. If you tagged the
48482286d8edStholo   Repository before starting the import, you should have no trouble
48492286d8edStholo   figuring out what happened.
48502286d8edStholo
48512286d8edStholo   If you can, find out (or tell them) which working directory to use.
48522286d8edStholo   You should verify that the working directory they use is on the Main
48532286d8edStholo   Branch ("update -A") and without modified files.
48542286d8edStholo
48552286d8edStholo   If you trust your crew, have them notify you by Email. Have them send
48562286d8edStholo   you the output from "cvs update" in their working directory. You might
48572286d8edStholo   have to poll some people until you are certain they have finished, or
48582286d8edStholo   have given up. (This is not an invention. I've heard a false, "Yeah,
48592286d8edStholo   sure. I finished yesterday," more times that you'd believe.)
48602286d8edStholo
48612286d8edStholo   When all reports are in, go on to the Source Verification stage.
48622286d8edStholo
48632286d8edStholo     Source Verification -- CVS and other Tools.
48642286d8edStholo
48652286d8edStholo   If you didn't dictate which ones to use, find all working directories
48662286d8edStholo   and run "cvs -n update" in all of them. The history command and the
48672286d8edStholo   "commitinfo" log you set up might help to find checked out working
48682286d8edStholo   directories.
48692286d8edStholo
48702286d8edStholo   Sticky conflict flags will help, but they can't recover from
48712286d8edStholo   sloppiness or incompetence. You might want to check everything out
48722286d8edStholo   into a tree and grep for the parts of the merge conflict markers CVS
48732286d8edStholo   doesn't look for. CVS looks for the string '^>>>>>>> '. The merge
48742286d8edStholo   operation also puts '^<<<<<<< ' and '^======= ' markers in the file
48752286d8edStholo   that careless developers might leave there.
48762286d8edStholo
48772286d8edStholo   If you find problems simply by looking at the source files and working
48782286d8edStholo   directories, start the flogging now. Resolving the textual conflicts
48792286d8edStholo   is the easy part. Weed the turkeys out before reaching the next part
48802286d8edStholo   of the cleanup -- the resolution of logical conflicts.
48812286d8edStholo
48822286d8edStholo   Then apply a set of post-commit tags.
48832286d8edStholo
48842286d8edStholo     Logical Verification -- Diff and powerful eyeballs.
48852286d8edStholo
48862286d8edStholo   No source control system can solve the problem of resolving
48872286d8edStholo   distributed conflicts in program logic. If you change the argument
48882286d8edStholo   template for function A (defined in file A.c) and add new calls to
48892286d8edStholo   function A from within function B (defined in file B.c) using the old
48902286d8edStholo   argument format, you are outside the realm of CVS's competence.
48912286d8edStholo
48922286d8edStholo   Assign someone to understand what the Vendor changed by running "cvs
48932286d8edStholo   diff -c -r <PreviousReleaseTag> <ReleaseTag>", where the tags were
48942286d8edStholo   those handed to the last two invocations of "import".
48952286d8edStholo
48962286d8edStholo   Then have the same person compare that output (logically or you can
48972286d8edStholo   actually diff the diffs) to the output of the similar "cvs diff -c -r
48982286d8edStholo   <pre-import-tag> <post-commit-tag>". The two sets of differences
48992286d8edStholo   should be almost identical. They should both show only the work *you*
49002286d8edStholo   have performed.
49012286d8edStholo
49022286d8edStholo     Product Verification -- Build and Test.
49032286d8edStholo
49042286d8edStholo   Don't let your help off the hook until you verify that the merge
49052286d8edStholo   actually produced something that can compile and pass tests. Compiling
49062286d8edStholo   should really be part of the logical verification phase, but you
49072286d8edStholo   should test the output of the build system before declaring victory
49082286d8edStholo   and releasing the troops.
49092286d8edStholo
49102286d8edStholo     After it is all built, apply another set of tags to mark the end of
49112286d8edStholo   the "import process". You can delete the intermediate tags you added
49122286d8edStholo   during source and logic testing, but keep the "pre-import" and
49132286d8edStholo   "post-import" tags forever.
49142286d8edStholo
49152286d8edStholo   Of course, experience can tell you when to skip a step. But I'd start
49162286d8edStholo   out by considering each one as necessary unless you can prove
49172286d8edStholo   otherwise.
49182286d8edStholo
49192286d8edStholo   Last modified: _6/13/1997_
49202286d8edStholo
49212286d8edStholo    14. Explain: ERROR: cannot create link to <file>: Permission denied
49222286d8edStholo
49232286d8edStholo   This error appears when you try to execute a second (or later)
49242286d8edStholo   "import" into the same module from a directory to which you don't have
49252286d8edStholo   write access.
49262286d8edStholo
49272286d8edStholo   The "link error" is caused by a feature purposely added to speed up
49282286d8edStholo   the import.
49292286d8edStholo
49302286d8edStholo   Though the error message is somewhat strange, it indicates that
49312286d8edStholo   "import" is supposed to be executed only in writable directories.
49322286d8edStholo
49332286d8edStholo   Last modified: _6/13/1997_
49342286d8edStholo
49352286d8edStholo    15. Where does the -m <message> go when the file doesn't change?
49362286d8edStholo
49372286d8edStholo   The <message> handed to import is used as an RCS log message, but only
49382286d8edStholo   if the imported file changed since the last version on the Vendor
49392286d8edStholo   branch. If the imported file hasn't changed, then no new revision is
49402286d8edStholo   created. The <ReleaseTag> is still applied, but to the previous
49412286d8edStholo   revision. So the Tags are still correct, but the message is lost.
49422286d8edStholo
49432286d8edStholo   Maybe it should be appended to the previous log message. But currently
49442286d8edStholo   it isn't.
49452286d8edStholo
49462286d8edStholo   Last modified: _6/13/1997_
49472286d8edStholo
49482286d8edStholo    16. How do I "import" just the files ignored by a previous "import"?
49492286d8edStholo
49502286d8edStholo   A real answer follows, but first, an editorial:
49512286d8edStholo
49522286d8edStholo   I am now convinced that you should always use the "-I !" option.
49532286d8edStholo   Removing a few extraneous files from the Repository is a lot easier
49542286d8edStholo   than the recovery step described below.
49552286d8edStholo
49562286d8edStholo   Let's assume your original import procedure was: (We assume there is
49572286d8edStholo   enough disk space in /tmp.)
49582286d8edStholo
49592286d8edStholo   cd <head-of-vendor-tree>
49602286d8edStholo            cvs import -m 'xyz 1.3' gnu/xyz GNU GNUXYZ_1_3 | tee /tmp/IMP
49612286d8edStholo
49622286d8edStholo   To import just the files ignored by "import", I would do this:
49632286d8edStholo
49642286d8edStholo     Create a list of the ignored files to import:
49652286d8edStholo
49662286d8edStholo   cd <head-of-vendor-tree> awk '/^I / {print $2}' /tmp/IMP | sed
49672286d8edStholo   's|^gnu/xyz/||' > /tmp/IG [Edit the IG file to contain just the files
49682286d8edStholo   you want.]
49692286d8edStholo
49702286d8edStholo     Then create a sparse directory by handing your list to the GNU
49712286d8edStholo   version of "tar", installed in many places as "gtar":
49722286d8edStholo
49732286d8edStholo   mkdir /tmp/FIXUP gtar -T /tmp/IG -c -f - . | (cd /tmp/FIXUP; gtar xvBf
49742286d8edStholo   -)
49752286d8edStholo
49762286d8edStholo     Then rerun the import. Use the exact same command, but execute it in
49772286d8edStholo   the sparse directory tree you just created. And this time, tell it not
49782286d8edStholo   to ignore anything.
49792286d8edStholo
49802286d8edStholo   cd /tmp/FIXUP
49812286d8edStholo           cvs import -I ! -m 'xyz 1.3' gnu/xyz GNU GNUXYZ_1_3
49822286d8edStholo
49832286d8edStholo   Last modified: _6/13/1997_
49842286d8edStholo
49852286d8edStholo    17. Why did "import" ignore all the symlinks?
49862286d8edStholo
49872286d8edStholo   This is another design choice.
49882286d8edStholo
49892286d8edStholo   Like the Unix "tar" command, "import" could sprout an option to follow
49902286d8edStholo   symbolic links, but I don't think CVS will ever follow symbolic links
49912286d8edStholo   by default.
49922286d8edStholo
49932286d8edStholo   Two possible future enhancements have been seriously discussed:
49942286d8edStholo
49952286d8edStholo     Treat symbolic links as data in its parent directory (the way
49962286d8edStholo   ClearCase does) in some sort of per-directory control file.
49972286d8edStholo
49982286d8edStholo     Treat symbolic links as version-controlled elements themselves,
49992286d8edStholo   whose data is the value of readlink(2).
50002286d8edStholo
50012286d8edStholo   For now, they are simply ignored.
50022286d8edStholo
50032286d8edStholo   If you want to save and reconstruct symlinks, you might want to define
50042286d8edStholo   a "checkout" or "update" program in the modules file which could
50052286d8edStholo   consult a file kept under CVS in your working directory and make sure
50062286d8edStholo   the specified links are in place.
50072286d8edStholo
50082286d8edStholo   Last modified: _6/13/1997_
50092286d8edStholo
50102286d8edStholo  Category: /Commands_/log_lo_rlog/
50112286d8edStholo
50122286d8edStholo   " + "log", "lo", "rlog""
50132286d8edStholo
50142286d8edStholo    1. What is "log" for?
50152286d8edStholo
50162286d8edStholo   To provide an interface to the RCS "rlog" command, which displays
50172286d8edStholo   information about the underlying RCS files, including the revision
50182286d8edStholo   history and Tag (RCS calls it a "symbol") list.
50192286d8edStholo
50202286d8edStholo   Last modified: _6/13/1997_
50212286d8edStholo
50222286d8edStholo    2. How do I extract the log entries between two revisions?
50232286d8edStholo
50242286d8edStholo   If both <rev1> and <rev2> are on the same branch, you can get what you
50252286d8edStholo   are looking for with: (If they aren't on the same branch you'll either
50262286d8edStholo   get an error or a display of the whole change log.)
50272286d8edStholo
50282286d8edStholo                cvs log -r<rev1>:<rev2> <file>
50292286d8edStholo
50302286d8edStholo   If you want all the revisions on the branch from <rev1> to the end of
50312286d8edStholo   the branch <rev1> is on, you can use:
50322286d8edStholo
50332286d8edStholo                cvs log -r<rev1>: <file>
50342286d8edStholo
50352286d8edStholo   (If <rev1> is a numeric RCS symbol attached to a branch revision with
50362286d8edStholo   an even number of '.'s in it, you get the whole branch.)
50372286d8edStholo
50382286d8edStholo   If you want all the revisions on the branch from the beginning of the
50392286d8edStholo   branch <rev2> is on up to revision <rev2>, you can use:
50402286d8edStholo
50412286d8edStholo                cvs log -r:<rev2> <file>
50422286d8edStholo
50432286d8edStholo   Note: Depending on whether <rev1> and <rev2> are:
50442286d8edStholo
50452286d8edStholo                        - numeric or symbolic
50462286d8edStholo                        - in the file or not
50472286d8edStholo                        - on the same branch or not
50482286d8edStholo
50492286d8edStholo                the RCS "rlog" (and therefore the "cvs log") command will
50502286d8edStholo                display some combination of:
50512286d8edStholo
50522286d8edStholo                        - error messages
50532286d8edStholo                        - (intuitively correct) partial log listings
50542286d8edStholo                        - a display of the entire change log.
50552286d8edStholo
50562286d8edStholo   Last modified: _6/13/1997_
50572286d8edStholo
50582286d8edStholo    3. How do I extract the log entries on a whole branch?
50592286d8edStholo
50602286d8edStholo                cvs log -r<rev> <file>
50612286d8edStholo
50622286d8edStholo   where <rev> must be a branch revision (one with an even number of
50632286d8edStholo   dots) or a *non-branch* tag on a branch revision. Non-branch tags on a
50642286d8edStholo   branch revision are not normally attached by CVS, to add one you will
50652286d8edStholo   have to explicitly tag a physical branch number within each file.
50662286d8edStholo   Since these branch numbers are almost never the same in different
50672286d8edStholo   files, this command is not all that useful.
50682286d8edStholo
50692286d8edStholo   The intuitive command (at least from the CVS perspective):
50702286d8edStholo
50712286d8edStholo                cvs log -r<branch_tag> <file>
50722286d8edStholo
50732286d8edStholo   does not work.
50742286d8edStholo
50752286d8edStholo   Last modified: _6/13/1997_
50762286d8edStholo
50772286d8edStholo    4. How do I generate ChangeLogs from RCS logs?
50782286d8edStholo
50792286d8edStholo   A program called rcs2log is distributed as part of GNU Emacs 19. A
50802286d8edStholo   (possibly older) version of this program appears in the contrib
50812286d8edStholo   directory of the cvs source tree.
50822286d8edStholo
50832286d8edStholo   Last modified: _6/13/1997_
50842286d8edStholo
50852286d8edStholo    5. Why does "log" tell me a file was committed exactly 5 hours later
50862286d8edStholo
50872286d8edStholo   than I know it was?
50882286d8edStholo
50892286d8edStholo   I can tell by this question that you were working in a time zone that
50902286d8edStholo   is 5 hours behind GMT (e.g. the U.S. East Coast in winter).
50912286d8edStholo
50922286d8edStholo   RCS file dates are stored in GMT to allow users in different time
50932286d8edStholo   zones to agree on the meaning of a timestamp. At first glance this
50942286d8edStholo   doesn't seem necessary, but many companies use distributed file
50952286d8edStholo   systems, such as NFS or AFS, across multiple timezones.
50962286d8edStholo
50972286d8edStholo   Some standard form must be used. GMT, as the "grid origin", is an
50982286d8edStholo   obvious candidate. The only other reasonable choice is to put the
50992286d8edStholo   timezone information in all the time stamps, but that changes the RCS
51002286d8edStholo   file format incompatibly, a step which has been avoided in the last
51012286d8edStholo   few RCS releases.
51022286d8edStholo
51032286d8edStholo   Last modified: _6/13/1997_
51042286d8edStholo
51052286d8edStholo  Category: /Commands_/patch_pa_rdiff/
51062286d8edStholo
51072286d8edStholo   " + "patch", "pa", "rdiff""
51082286d8edStholo
51092286d8edStholo    1. What is "patch" for?
51102286d8edStholo
51112286d8edStholo   To produce a "diff" between tagged releases to be handed to the
51122286d8edStholo   "patch" command at other sites. This is the standard way that source
51132286d8edStholo   patches are distributed on the network.
51142286d8edStholo
51152286d8edStholo   Last modified: _6/13/1997_
51162286d8edStholo
51172286d8edStholo    2. Why does "patch" include files from the Attic when I use '-D'?
51182286d8edStholo
51192286d8edStholo   See the explanation of the same problem with "update -D" contained in
51202286d8edStholo   section 5B.
51212286d8edStholo
51222286d8edStholo   Last modified: _6/13/1997_
51232286d8edStholo
51242286d8edStholo    3. How do I make "patch" produce a patch for one or two files? It seems to
51252286d8edStholo    work only with modules.
51262286d8edStholo
51272286d8edStholo   Patch is intended for producing patches of whole modules between
51282286d8edStholo   releases to be distributed to remote sites. Instead of "patch", you
51292286d8edStholo   can use the "diff" command with the '-c' context option:
51302286d8edStholo
51312286d8edStholo             cvs diff -c -r <rev/tag> -r <rev/tag> <file1> . . .
51322286d8edStholo
51332286d8edStholo   The patch command will be able to merge such a "diff" into the remote
51342286d8edStholo   source files.
51352286d8edStholo
51362286d8edStholo   If you configured CVS to use a version of "diff" that supports the
51372286d8edStholo   '-u' option, you can produce a more compact "patch" in "unidiff"
51382286d8edStholo   format. The latest revisions of the patch command can parse and apply
51392286d8edStholo   patches in "unidiff" format.
51402286d8edStholo
51412286d8edStholo   Last modified: _6/13/1997_
51422286d8edStholo
51432286d8edStholo  Category: /Commands_/release_re_rel/
51442286d8edStholo
51452286d8edStholo   " + "release", "re", "rel""
51462286d8edStholo
51472286d8edStholo    1. What is "release" for?
51482286d8edStholo
51492286d8edStholo   To register that a module is no longer in use. It is intended to
51502286d8edStholo   reverse the effects of a "checkout" by adding a record to the history
51512286d8edStholo   file to balance the checkout record and by optionally allowing you to
51522286d8edStholo   delete the checked-out directory associated with the module name.
51532286d8edStholo
51542286d8edStholo   Last modified: _6/13/1997_
51552286d8edStholo
51562286d8edStholo    2. Why can't I reverse a "cvs checkout path/name/subdir" with a "cvs
51572286d8edStholo    release path/name/subdir" without an "unknown module name"?
51582286d8edStholo
51592286d8edStholo   A simplistic implementation. (I can say this -- I wrote it.)
51602286d8edStholo
51612286d8edStholo   The "release" function was written for CVS 1.2 under the assumption
51622286d8edStholo   that the "module name" is a first class, unavoidable interface to the
51632286d8edStholo   Repository, allowing no way to retrieve anything other than by module
51642286d8edStholo   name. Though it is easier to program that way, many users of CVS
51652286d8edStholo   believe the modules support to be too primitive to allow such a
51662286d8edStholo   limitation.
51672286d8edStholo
51682286d8edStholo   Since "release" was written, other parts of CVS broke that assumption.
51692286d8edStholo   It needs to be revised.
51702286d8edStholo
51712286d8edStholo   Last modified: _6/13/1997_
51722286d8edStholo
51732286d8edStholo    3. Why can't I "release" portions of a checked out directory? I should be
51742286d8edStholo    able to "release" any file or sub-directory within my working directory.
51752286d8edStholo
51762286d8edStholo   This isn't really a limitation in "release", per se. CVS doesn't try
51772286d8edStholo   to keep track of which files in which directories are "checked out"
51782286d8edStholo   and which are just lying there. You can delete directories and
51792286d8edStholo   "update" will not bring them back unless you add a special "-d"
51802286d8edStholo   option.
51812286d8edStholo
51822286d8edStholo   In other words, CVS doesn't keep track of how you adjust the partition
51832286d8edStholo   between files you consider part of your working set and files that
51842286d8edStholo   were checked out because they are part of the same module or
51852286d8edStholo   directory. And neither does "release".
51862286d8edStholo
51872286d8edStholo   In future CVS releases, "release" might become sophisticated enough to
51882286d8edStholo   handle both the reversal of a "checkout" and the deletion of random
51892286d8edStholo   portions of the working directory, but it isn't that way now.
51902286d8edStholo
51912286d8edStholo   Last modified: _6/13/1997_
51922286d8edStholo
51932286d8edStholo    4. I removed the tree that I was about to start working on. How do I tell
51942286d8edStholo    cvs that I want to release it if I don't have it anymore?
51952286d8edStholo
51962286d8edStholo   See 3G.4.
51972286d8edStholo
51982286d8edStholo   Last modified: _6/13/1997_
51992286d8edStholo
52002286d8edStholo    5. Why doesn't "release -d module" reverse a "checkout module"?
52012286d8edStholo
52022286d8edStholo   It does, if you are using "module" in a way that "release" expects: a
52032286d8edStholo   non-alias string in the left column of the "modules" database.
52042286d8edStholo
52052286d8edStholo   If "module" is really an alias, or if you are using a relative path in
52062286d8edStholo   the place of "module", or if you renamed the directory with the -d
52072286d8edStholo   option in the modules file or on the "checkout" command line, then the
52082286d8edStholo   current version of "release" won't work.
52092286d8edStholo
52102286d8edStholo   Future versions of "release" will probably fix most of these.
52112286d8edStholo
52122286d8edStholo   Last modified: _6/13/1997_
52132286d8edStholo
52142286d8edStholo    6. Why can't I release a module renamed with "cvs checkout -d"?
52152286d8edStholo
52162286d8edStholo   The current version of "release" doesn't know how to track the
52172286d8edStholo   renaming option ('-d') of the "checkout" command. It will probably be
52182286d8edStholo   fixed in the future.
52192286d8edStholo
52202286d8edStholo   Last modified: _6/13/1997_
52212286d8edStholo
52222286d8edStholo  Category: /Commands_/remove_rm_delete/
52232286d8edStholo
52242286d8edStholo   " + "remove", "rm", "delete""
52252286d8edStholo
52262286d8edStholo    1. What is "remove" for?
52272286d8edStholo
52282286d8edStholo   To remove a file from the working branch. It removes a file from the
52292286d8edStholo   main branch by placing it in an "Attic" directory.
52302286d8edStholo
52312286d8edStholo   Last modified: _6/13/1997_
52322286d8edStholo
52332286d8edStholo    2. Why doesn't "remove" work on directories when it appears to try?
52342286d8edStholo
52352286d8edStholo   Oversight. It should be able to delete an empty directory, but you
52362286d8edStholo   still don't have a way to remember when it was there and when it
52372286d8edStholo   disappeared to allow the "-D " option to work.
52382286d8edStholo
52392286d8edStholo   You'll have to remove the working directory and the matching directory
52402286d8edStholo   in the Repository.
52412286d8edStholo
52422286d8edStholo   Note that you want to do a _cvs remove dir_ in the working directory,
52432286d8edStholo   do a cvs commit, and then do a _rmdir dir_ in the Repository.
52442286d8edStholo   (msusrtsp.mark at eds dot com)
52452286d8edStholo
52462286d8edStholo   Last modified: _12/18/1997_
52472286d8edStholo
52482286d8edStholo    3. I don't like removing files. Is there another way to ignore them?
52492286d8edStholo
52502286d8edStholo   There's no reason to be hasty in using the "remove" command.
52512286d8edStholo
52522286d8edStholo   If there is a way to ignore files in your build procedures, I'd just
52532286d8edStholo   do that. Later, when you decide that the files are really ancient, you
52542286d8edStholo   can execute a "remove" command to clean up.
52552286d8edStholo
52562286d8edStholo   The CVS "ignore" concept can't ignore files already in CVS.
52572286d8edStholo
52582286d8edStholo   Last modified: _6/13/1997_
52592286d8edStholo
52602286d8edStholo    4. I just removed a file. How do I resurrect it?
52612286d8edStholo
52622286d8edStholo   If you executed "remove", but haven't typed "commit" (you can tell
52632286d8edStholo   this by the 'R' notation that "update" prints next to the file), you
52642286d8edStholo   can execute "add" to reverse the "remove".
52652286d8edStholo
52662286d8edStholo   If you followed the "remove" with a "commit", you'll have to move it
52672286d8edStholo   back out of the Attic by hand:
52682286d8edStholo
52692286d8edStholo   I use something like this: (csh-like syntax)
52702286d8edStholo
52712286d8edStholo                set repos = `cat ./CVS/Repository`
52722286d8edStholo                mv $repos/Attic/filename,v $repos/filename,v
52732286d8edStholo
52742286d8edStholo   (If you use relative paths in your Repository files, that first line
52752286d8edStholo   becomes: set repos = $CVSROOT/`cat ./CVS/Repository`)
52762286d8edStholo
52772286d8edStholo   While a file is in the Attic, you can't "add" another file by the same
52782286d8edStholo   name. To add such a file you either have to move it by hand as in the
52792286d8edStholo   above, or delete it from the Attic.
52802286d8edStholo
52812286d8edStholo   The main reason for the Attic is to retain files with tags in them. If
52822286d8edStholo   you execute: "update -r <oldtag>", files with <oldtag> attached to
52832286d8edStholo   some revision will be taken from the normal Repository area and from
52842286d8edStholo   the Attic. That's why you can't "add" a file with the same name.
52852286d8edStholo   "remove" only moves a file off the main branch, it doesn't obliterate
52862286d8edStholo   it.
52872286d8edStholo
52882286d8edStholo   Last modified: _6/13/1997_
52892286d8edStholo
52902286d8edStholo    5. Why doesn't "remove" delete the file? Instead, it prints an error
52912286d8edStholo    message and tells me to remove the file by hand.
52922286d8edStholo
52932286d8edStholo   Design choice. Unix software written within last decade, usually
52942286d8edStholo   requires an extra verification step, such as answering a question or
52952286d8edStholo   adding a flag on the command line. CVS currently requires that you
52962286d8edStholo   delete the file first unless you specify the '-f' (force) option,
52972286d8edStholo   which deletes the file before performing "cvs remove".
52982286d8edStholo
52992286d8edStholo   Last modified: _6/13/1997_
53002286d8edStholo
53012286d8edStholo  Category: /Commands_/rtag_rt_rfreeze/
53022286d8edStholo
53032286d8edStholo   " + "rtag", "rt", "rfreeze""
53042286d8edStholo
53052286d8edStholo    1. What is "rtag" for?
53062286d8edStholo
53072286d8edStholo   To add a symbolic label (a "tag") to the last committed revisions of a
53082286d8edStholo   module directly in the Repository.
53092286d8edStholo
53102286d8edStholo   Last modified: _6/13/1997_
53112286d8edStholo
53122286d8edStholo    2. Why use "rtag"? It assumes no one is changing the Repository.
53132286d8edStholo
53142286d8edStholo   Though the "tag" command is more useful in marking the revisions you
53152286d8edStholo   have in a particular working directory, "rtag" is much handier for
53162286d8edStholo   whole-Repository actions, which occur at major release boundaries.
53172286d8edStholo
53182286d8edStholo   Last modified: _6/13/1997_
53192286d8edStholo
53202286d8edStholo    3. What revision does "rtag -r <tag1> <tag2>" actually put the tag on?
53212286d8edStholo
53222286d8edStholo   In short, the '-r' option is another way to select the revision to
53232286d8edStholo   tag. The revision is selected the same way for all commands that
53242286d8edStholo   accept a "-r <tag/rev>" option.
53252286d8edStholo
53262286d8edStholo   Depending on whether <tag1> is a <branch_tag>, or a non-branch <tag>
53272286d8edStholo   and on whether you use the '-b' option to "rtag", you get four
53282286d8edStholo   different results:
53292286d8edStholo
53302286d8edStholo     rtag -r <tag1> <tag2>
53312286d8edStholo
53322286d8edStholo   Adds the non-branch tag <tag2> to the same revision that the
53332286d8edStholo   non-branch tag <tag1> is attached to.
53342286d8edStholo
53352286d8edStholo   Example:
53362286d8edStholo                <tag1>          --> TT1
53372286d8edStholo                <tag2>          --> TT2
53382286d8edStholo                <file>          --> Symbols: TT1:1.4
53392286d8edStholo                After           --> Symbols: TT1:1.4,TT2:1.4
53402286d8edStholo
53412286d8edStholo     rtag -r <branch_tag1> <tag2>
53422286d8edStholo
53432286d8edStholo   Adds the non-branch tag <tag2> to the HEAD of (the highest revision
53442286d8edStholo   number on) the branch labelled with tag <branch_tag1>.
53452286d8edStholo
53462286d8edStholo   Example:
53472286d8edStholo                <branch_tag1>   --> BR1
53482286d8edStholo                <tag2>          --> TT2
53492286d8edStholo                <file>          --> Symbols: BR1:1.2.0.2 (1.2.2.5 is HEAD)
53502286d8edStholo                After           --> Symbols: BR1:1.2.0.2,TT2:1.2.2.5
53512286d8edStholo
53522286d8edStholo   If the branch tagged by <branch_tag1> has not been created, then the
53532286d8edStholo   tag shows up on the branch point revision:
53542286d8edStholo
53552286d8edStholo   Example:
53562286d8edStholo                <branch_tag1>   --> BR1
53572286d8edStholo                <tag2>          --> TT2
53582286d8edStholo                <file>          --> Symbols: BR1:1.2.0.2 (No 1.2.X exists.)
53592286d8edStholo                After           --> Symbols: BR1:1.2.0.2,TT2:1.2
53602286d8edStholo
53612286d8edStholo     rtag -b -r <tag1> <branch_tag2>
53622286d8edStholo
53632286d8edStholo   Adds the magic branch tag <branch_tag2> to the revision that the
53642286d8edStholo   non-branch tag <tag1> is attached to, preparing it to be a branch
53652286d8edStholo   point.
53662286d8edStholo
53672286d8edStholo   Example:
53682286d8edStholo                <tag1>          --> TT1
53692286d8edStholo                <branch_tag2>   --> BR2
53702286d8edStholo                <file>          --> Symbol: TT1:1.4
53712286d8edStholo                After           --> Symbol: TT1:1.4, BR2:1.4.0.2
53722286d8edStholo
53732286d8edStholo     rtag -b -r <branch_tag1> <branch_tag2>
53742286d8edStholo
53752286d8edStholo   Adds the magic branch tag <branch_tag2> to the revision at the HEAD of
53762286d8edStholo   (the highest revision number on) the branch labelled with
53772286d8edStholo   <branch_tag1>, preparing it to be a branch point.
53782286d8edStholo
53792286d8edStholo   Example:
53802286d8edStholo                <branch_tag1>   --> BR1
53812286d8edStholo                <branch_tag2>   --> BR2
53822286d8edStholo                <file>          --> Symbol: BR1:1.2.0.2 (1.2.2.5 is HEAD)
53832286d8edStholo                After           --> Symbol: BR1:1.2.0.2,BR2:1.2.2.5.0.2
53842286d8edStholo
53852286d8edStholo   If the branch tagged by <branch_tag1> has not been created, then the
53862286d8edStholo   tag shows up as a second branch off the same branch point revision:
53872286d8edStholo
53882286d8edStholo   Example:
53892286d8edStholo                <branch_tag1>   --> BR1
53902286d8edStholo                <tag2>          --> TT2
53912286d8edStholo                <file>          --> Symbols: BR1:1.2.0.2 (No 1.2.X exists.)
53922286d8edStholo                After           --> Symbols: BR1:1.2.0.2,TT2:1.2.0.4
53932286d8edStholo
53942286d8edStholo   In all four cases above, if <tag2> already exists on the file, you get
53952286d8edStholo   an error unless you specify the '-F' option.
53962286d8edStholo
53972286d8edStholo   In all four cases, if <tag1> does not exist on the file, <tag2> is not
53982286d8edStholo   added unless you specify the '-f' option.
53992286d8edStholo
54002286d8edStholo   Last modified: _6/13/1997_
54012286d8edStholo
54022286d8edStholo    4. What happens if the tags are the same in "rtag -r <tag> <tag>"?
54032286d8edStholo
54042286d8edStholo   Again, there are four cases depending on whether <tag> is a branch
54052286d8edStholo   tag, or a non-branch tag and on whether you use the '-b' option to
54062286d8edStholo   "rtag":
54072286d8edStholo
54082286d8edStholo     rtag -r <tag> <tag>
54092286d8edStholo
54102286d8edStholo   Is a no-op. It does nothing even with '-F' specified.
54112286d8edStholo
54122286d8edStholo   If you add the '-f' option ("rtag -f -r <tag> <tag>"), then <tag> is
54132286d8edStholo   attached to the latest revision on the Main Branch if the file does
54142286d8edStholo   *not* already have <tag> on some revision.
54152286d8edStholo
54162286d8edStholo   If the <tag> is already on the file, using "rtag -f" is still a no-op.
54172286d8edStholo
54182286d8edStholo     rtag -r <branch_tag> <branch_tag>
54192286d8edStholo
54202286d8edStholo   Produces an error, since the <branch_tag> is already on some revision
54212286d8edStholo   of the file.
54222286d8edStholo
54232286d8edStholo   But, "rtag -F -r <branch_tag> <branch_tag>" turns the magic branch tag
54242286d8edStholo   into a non-branch tag.
54252286d8edStholo
54262286d8edStholo   Symbols: BR1:1.4.0.2 becomes Symbols: BR1:1.4
54272286d8edStholo
54282286d8edStholo     rtag -b -r <tag> <tag>
54292286d8edStholo
54302286d8edStholo   Produces an error, since the <tag> is already on the file.
54312286d8edStholo
54322286d8edStholo   But, "rtag -F -b -r <tag> <tag>" turns the non-branch tag into a magic
54332286d8edStholo   branch tag.
54342286d8edStholo
54352286d8edStholo   Symbols: BR1:1.4 becomes Symbols: BR1:1.4.0.2
54362286d8edStholo
54372286d8edStholo     rtag -b -r <branch_tag> <branch_tag>
54382286d8edStholo
54392286d8edStholo   Produces an error, since the <branch_tag> is already on the file.
54402286d8edStholo
54412286d8edStholo   But, "rtag -F -b -r <branch_tag> <branch_tag>" increments the branch
54422286d8edStholo   number. It essentially removes the branch and creates a new one by the
54432286d8edStholo   same name.
54442286d8edStholo
54452286d8edStholo   Symbols: BR1:1.2.0.4 becomes Symbols: BR1:1.2.0.6
54462286d8edStholo
54472286d8edStholo   Last modified: _6/13/1997_
54482286d8edStholo
54492286d8edStholo    5. Why doesn't "rtag -b -r <branch_tag1> <branch_tag2>" rename or duplicate
54502286d8edStholo    a magic branch tag?
54512286d8edStholo
54522286d8edStholo   None of the "tag" or "rtag" options rename anything. They only apply
54532286d8edStholo   (or, with the '-F' option, move) tags to specific revisions in the
54542286d8edStholo   file.
54552286d8edStholo
54562286d8edStholo   See 3M.[3-4] above for details of how it works.
54572286d8edStholo
54582286d8edStholo   To rename a non-branch tag, see 3O.9. To rename a magic branch tag,
54592286d8edStholo   see 4D.5
54602286d8edStholo
54612286d8edStholo   Last modified: _6/13/1997_
54622286d8edStholo
54632286d8edStholo  Category: /Commands_/status_st_stat/
54642286d8edStholo
54652286d8edStholo   " + "status", "st", "stat""
54662286d8edStholo
54672286d8edStholo    1. What is "status" for?
54682286d8edStholo
54692286d8edStholo   To display the status of files, including the revision and branch you
54702286d8edStholo   are working on and the existence of "sticky" information.
54712286d8edStholo
54722286d8edStholo   Last modified: _6/13/1997_
54732286d8edStholo
54742286d8edStholo    2. Why does "status" limit the File: at the top to 17 characters?
54752286d8edStholo
54762286d8edStholo   Designed that way to line up with other data. You can find the whole
54772286d8edStholo   filename in the line beginning with "RCS version:", which is not
54782286d8edStholo   limited in length.
54792286d8edStholo
54802286d8edStholo   Last modified: _6/13/1997_
54812286d8edStholo
54822286d8edStholo    3. Why does it print "Sticky" lines when the values are "(none)"?
54832286d8edStholo
54842286d8edStholo   Oversight. It should probably elide lines without information.
54852286d8edStholo
54862286d8edStholo   Last modified: _6/13/1997_
54872286d8edStholo
54882286d8edStholo    4. Shouldn't the status "Needs Checkout" be "Needs Update"?
54892286d8edStholo
54902286d8edStholo   Probably.
54912286d8edStholo
54922286d8edStholo   [[Did this show up in CVS 1.4?]]
54932286d8edStholo
54942286d8edStholo   Last modified: _6/13/1997_
54952286d8edStholo
54962286d8edStholo  Category: /Commands_/tag_ta_freeze/
54972286d8edStholo
54982286d8edStholo   " + "tag", "ta", "freeze""
54992286d8edStholo
55002286d8edStholo    1. What is "tag" for?
55012286d8edStholo
55022286d8edStholo   To add a symbolic label (a "tag") to the RCS files last checked out,
55032286d8edStholo   updated or committed in a working directory.
55042286d8edStholo
55052286d8edStholo   Last modified: _6/13/1997_
55062286d8edStholo
55072286d8edStholo    2. What is the difference between "tag" and "rtag"?
55082286d8edStholo
55092286d8edStholo   The end result of both commands is that a <tag>, or symbolic name, is
55102286d8edStholo   attached to a single revision in each of a collection of files.
55112286d8edStholo
55122286d8edStholo   The differences lie in:
55132286d8edStholo
55142286d8edStholo     The collection of files they work on.
55152286d8edStholo
55162286d8edStholo   "rtag" works on the collection of files referred to by a "module" name
55172286d8edStholo   as defined in the "modules" file, or a relative path within the
55182286d8edStholo   Repository.
55192286d8edStholo
55202286d8edStholo   "tag" works on files and directories specified on the command line
55212286d8edStholo   within the user's working directory. (Default is '.')
55222286d8edStholo
55232286d8edStholo   Both commands recursively follow directory hierarchies within the
55242286d8edStholo   named files and directories.
55252286d8edStholo
55262286d8edStholo     The revisions they choose to tag.
55272286d8edStholo
55282286d8edStholo   "rtag" places a tag on the latest committed revision of each file on
55292286d8edStholo   the branch specified by the '-r' option. By default it tags the Main
55302286d8edStholo   Branch.
55312286d8edStholo
55322286d8edStholo   "tag" places a tag on the BASE (i.e. last checked out, updated or
55332286d8edStholo   committed) revision of each file found in the working directory. (The
55342286d8edStholo   BASE revision of a file is the one stored in the ./CVS/Entries file.)
55352286d8edStholo
55362286d8edStholo     A different set of command line options.
55372286d8edStholo
55382286d8edStholo   For example, "rtag" takes a "-r <oldtag>" option to retag an existing
55392286d8edStholo   tag. The "tag" command does not.
55402286d8edStholo
55412286d8edStholo     How it is logged.
55422286d8edStholo
55432286d8edStholo   Currently "rtag" records the <tag> and the module in the "history"
55442286d8edStholo   file, while "tag" does not.
55452286d8edStholo
55462286d8edStholo   Last modified: _6/13/1997_
55472286d8edStholo
55482286d8edStholo    3. Why does "tag -b" not put a tag on the Branch Point revision? How do I
55492286d8edStholo    refer to the Branch Point?
55502286d8edStholo
55512286d8edStholo   This is probably an oversight, or a disbelief in the need for it. If
55522286d8edStholo   everything works perfectly, the "update -j" command will do the merge
55532286d8edStholo   you need and you don't need to check up on it by playing with the
55542286d8edStholo   branch point revision.
55552286d8edStholo
55562286d8edStholo   The '-b' option attaches a magic branch tag to allow CVS later to
55572286d8edStholo   figure out the branch point. The actual revision that <tag> is
55582286d8edStholo   attached to does not exist. References to the branch tag are
55592286d8edStholo   equivalent to references to the latest revision on the branch.
55602286d8edStholo
55612286d8edStholo   There is no way to refer to the branch point without adding a
55622286d8edStholo   non-branch tag. You might want to add non-branch tags as a habit and
55632286d8edStholo   add branch tags later, possibly immediate after adding the non-branch
55642286d8edStholo   tag. See 4C.3 on Creating a Branch.
55652286d8edStholo
55662286d8edStholo   Last modified: _6/13/1997_
55672286d8edStholo
55682286d8edStholo    4. So "{r}tag" labels a bunch of files. What do you use a Tag for?
55692286d8edStholo
55702286d8edStholo   You use it to "checkout" the labeled collection of files as a single
55712286d8edStholo   object, referring to it by name.
55722286d8edStholo
55732286d8edStholo   Anywhere a revision number can be used a Tag can be used. In fact tags
55742286d8edStholo   are more useful because they draw a line through a collection of
55752286d8edStholo   files, marking a development milestone.
55762286d8edStholo
55772286d8edStholo   The way to think about a Tag is as a curve drawn through a matrix of
55782286d8edStholo   filename vs. revision number. Consider this:
55792286d8edStholo
55802286d8edStholo   Say we have 5 files (in some arbitrary modules, some may be in 2 or
55812286d8edStholo   more modules by name, some may be in 2 or more modules because of the
55822286d8edStholo   Repository tree structure) with the following revisions:
55832286d8edStholo
55842286d8edStholo                file1   file2   file3   file4   file5
55852286d8edStholo
55862286d8edStholo                1.1     1.1     1.1     1.1  /--1.1*      <-*-  <tag>
55872286d8edStholo                1.2*-   1.2     1.2    -1.2*-
55882286d8edStholo                1.3  \- 1.3*-   1.3   / 1.3
55892286d8edStholo                1.4          \  1.4  /  1.4
55902286d8edStholo                              \-1.5*-   1.5
55912286d8edStholo                                1.6
55922286d8edStholo
55932286d8edStholo   At some time in the past, the '*' versions were tagged. Think of the
55942286d8edStholo   <tag> as a handle attached to the curve drawn through the tagged
55952286d8edStholo   revisions. When you pull on the handle, you get all the tagged
55962286d8edStholo   revisions. Another way to look at it is that you draw a straight line
55972286d8edStholo   through the set of revisions you care about and shuffle the other
55982286d8edStholo   revisions accordingly. Like this:
55992286d8edStholo
56002286d8edStholo                file1   file2   file3   file4   file5
56012286d8edStholo
56022286d8edStholo                                1.1
56032286d8edStholo                                1.2
56042286d8edStholo                        1.1     1.3                       _
56052286d8edStholo                1.1     1.2     1.4     1.1              /
56062286d8edStholo                1.2*----1.3*----1.5*----1.2*----1.1     (--- <-- Look here
56072286d8edStholo                1.3             1.6     1.3              \_
56082286d8edStholo                1.4                     1.4
56092286d8edStholo                                        1.5
56102286d8edStholo
56112286d8edStholo   I find that using these visual aids, it is much easier to understand
56122286d8edStholo   what a <tag> is and what it is useful for.
56132286d8edStholo
56142286d8edStholo   Last modified: _6/13/1997_
56152286d8edStholo
56162286d8edStholo    5. How do I get "tag" and "rtag" to send mail the way "commit" does?
56172286d8edStholo
56182286d8edStholo   The "commit" command is supported by two files ("commitinfo" and
56192286d8edStholo   "loginfo") not used by other commands. To do logging the same way for
56202286d8edStholo   "tag" and "rtag" would require another file like loginfo, which
56212286d8edStholo   currently doesn't exist.
56222286d8edStholo
56232286d8edStholo   The "rtag" command requires a "module" entry, which can specify a
56242286d8edStholo   "tag" program using the "-t programname" option on the module line.
56252286d8edStholo
56262286d8edStholo   There is no equivalent support for "tag".
56272286d8edStholo
56282286d8edStholo   Last modified: _6/13/1997_
56292286d8edStholo
56302286d8edStholo    6. Why can't "tag" handle the '-r' option that "rtag" takes?
56312286d8edStholo
56322286d8edStholo   Oversight. The answer is probably "Fixed in a Future Release."
56332286d8edStholo
56342286d8edStholo   Last modified: _6/13/1997_
56352286d8edStholo
56362286d8edStholo    7. After a "tag <tag>" in my working directory, why doesn't "checkout -r
56372286d8edStholo    <tag>" somewhere else produce copies of my current files?
56382286d8edStholo
56392286d8edStholo   The only reason this would fail, other than misspelling the <tag>
56402286d8edStholo   string, is that you didn't "commit" your work before "tagging" it.
56412286d8edStholo   Only committed revisions may be tagged. Modified files are not marked
56422286d8edStholo   for later tagging.
56432286d8edStholo
56442286d8edStholo   Last modified: _6/13/1997_
56452286d8edStholo
56462286d8edStholo    8. Why doesn't "tag" write a history record the way "rtag" does?
56472286d8edStholo
56482286d8edStholo   The "rtag" command was originally intended to place major "release"
56492286d8edStholo   tags onto modules. The "tag" functionality was developed to *move* the
56502286d8edStholo   more significant tag when slight changes to individual files sneaked
56512286d8edStholo   in after the release tag was stamped onto the Repository.
56522286d8edStholo
56532286d8edStholo   The significant event was the "rtag", which was recorded in the
56542286d8edStholo   "history" file for the "history -T" option to work.
56552286d8edStholo
56562286d8edStholo   It turns out that "tag" is generally more useful than "rtag", so the
56572286d8edStholo   model has changed. Future revisions of CVS will probably store both
56582286d8edStholo   kinds of tags in the history file.
56592286d8edStholo
56602286d8edStholo   Last modified: _6/13/1997_
56612286d8edStholo
56622286d8edStholo    9. How do I rename a <tag>?
56632286d8edStholo
56642286d8edStholo   For a procedure to rename a branch tag, See section 4D.5 The following
56652286d8edStholo   covers only non-branch tags.
56662286d8edStholo
56672286d8edStholo   First, pick a <newtag> that is not in use. You could reuse (i.e. move)
56682286d8edStholo   an existing tag to the new revisions using the '-F' option, but that
56692286d8edStholo   will confuse matters when both tags are not already on a file. (It
56702286d8edStholo   will probably confuse "rtag -f" too.)
56712286d8edStholo
56722286d8edStholo   Use "rtag" to place <newtag> only on revisions attached to <oldtag> in
56732286d8edStholo   the whole Repository, then delete the old one.
56742286d8edStholo
56752286d8edStholo                cvs rtag -r <oldtag> <newtag> world
56762286d8edStholo                cvs rtag -d <oldtag> world.
56772286d8edStholo
56782286d8edStholo   You can also checkout or update your working directory to the <oldtag>
56792286d8edStholo   and "tag" rather than "rtag" the result. But that will take longer and
56802286d8edStholo   it has the chance of producing conflicts.
56812286d8edStholo
56822286d8edStholo                cvs update -r <oldtag>
56832286d8edStholo                cvs tag <newtag>
56842286d8edStholo                cvs tag -d <oldtag>
56852286d8edStholo                cvs update -A  (or cvs update -r <previous_tag>)
56862286d8edStholo
56872286d8edStholo   Last modified: _6/13/1997_
56882286d8edStholo
56892286d8edStholo  Category: /Commands_/update_up_upd/
56902286d8edStholo
56912286d8edStholo   " + "update", "up", "upd""
56922286d8edStholo
56932286d8edStholo    1. What is "update" for?
56942286d8edStholo
56952286d8edStholo   The "update" command is by far the most important command and is
56962286d8edStholo   probably also the most used command.
56972286d8edStholo
56982286d8edStholo   It has five purposes: (And many options.)
56992286d8edStholo
57002286d8edStholo     To display the status of your working files.
57012286d8edStholo
57022286d8edStholo   Though a plain "update" also displays the status, it does so after
57032286d8edStholo   possibly altering your working directory. To see the status of your
57042286d8edStholo   working files without changing anything, type:
57052286d8edStholo
57062286d8edStholo                cvs -n update {optional list of files}
57072286d8edStholo
57082286d8edStholo     To merge changes made by others to the branch you are working on
57092286d8edStholo   into your working files.
57102286d8edStholo
57112286d8edStholo   Each working directory is attached to a branch, usually the Main
57122286d8edStholo   branch. To merge changes made on your working branch since your last
57132286d8edStholo   checkout, update or commit, type:
57142286d8edStholo
57152286d8edStholo   cvs update {optional list of files}
57162286d8edStholo
57172286d8edStholo     To merge changes made on another branch into the branch you are
57182286d8edStholo   working on (your "working branch").
57192286d8edStholo
57202286d8edStholo   If you want to grab a whole branch, from the branch point, which is
57212286d8edStholo   assumed to be on the Main Branch, to the end of the branch, you type:
57222286d8edStholo
57232286d8edStholo                cvs update -j <branch_tag> {optional files}
57242286d8edStholo
57252286d8edStholo   If you want to grab the changes made between two tags or revisions,
57262286d8edStholo   you type:
57272286d8edStholo
57282286d8edStholo                cvs update -j <tag1> -j <tag2> {optional files}
57292286d8edStholo
57302286d8edStholo   (If you are working with a single file, the Tags could also be
57312286d8edStholo   revisions numbers. Unless you take great care to match revision
57322286d8edStholo   numbers across different files (a waste of time given the way Tags
57332286d8edStholo   work), using revision numbers in place of the Tags for multiple files
57342286d8edStholo   would be meaningless.)
57352286d8edStholo
57362286d8edStholo     To move your working directory to another branch.
57372286d8edStholo
57382286d8edStholo   A working directory is presumed to be attached to (or working on) a
57392286d8edStholo   particular branch, usually the Main branch. To alter what CVS believes
57402286d8edStholo   to be your working branch, you "move" to that branch.
57412286d8edStholo
57422286d8edStholo   To move to a tagged branch, type:
57432286d8edStholo
57442286d8edStholo                cvs update -r <branch_tag> {optional files}
57452286d8edStholo
57462286d8edStholo   To move to the Main Branch, type:
57472286d8edStholo
57482286d8edStholo                cvs update -A {optional files}
57492286d8edStholo
57502286d8edStholo   If you have modified files in your working directory, this is not a
57512286d8edStholo   clean move. CVS will attempt to merge the changes necessary to make it
57522286d8edStholo   look like you made the same changes to the new branch as you made in
57532286d8edStholo   the old one. But if you do this twice without resolving the merge
57542286d8edStholo   conflicts each time, you can lose work.
57552286d8edStholo
57562286d8edStholo     To retrieve old revisions of files.
57572286d8edStholo
57582286d8edStholo   This option is similar to 4 above but you are not restricted to using
57592286d8edStholo   a <branch_tag>. You may specify any revision or <tag> with '-r' and
57602286d8edStholo   get the specified revision or the tagged revision:
57612286d8edStholo
57622286d8edStholo                cvs update -r <tag/rev> {optional files}
57632286d8edStholo
57642286d8edStholo   Or you may specify any date with '-D':
57652286d8edStholo
57662286d8edStholo                cvs update -D <date> {optional files}
57672286d8edStholo
57682286d8edStholo   The '-p' option sends the revisions to standard output (normally your
57692286d8edStholo   terminal) rather than setting the "sticky" tag and changing the files.
57702286d8edStholo
57712286d8edStholo   Last modified: _6/13/1997_
57722286d8edStholo
57732286d8edStholo    2. What do 'U', 'M' and 'C' mean when I type "update"? Are they different
57742286d8edStholo    for "cvs -n update"?
57752286d8edStholo
57762286d8edStholo   "cvs update" merges changes made to the Repository, since your last
57772286d8edStholo   "checkout", "update" or "commit", into your working files. You can
57782286d8edStholo   think of it as changing your BASE revision.
57792286d8edStholo
57802286d8edStholo   "cvs update" prints lines beginning with:
57812286d8edStholo
57822286d8edStholo   'U' after replacing your unmodified file with a different
57832286d8edStholo                revision from the Repository.
57842286d8edStholo
57852286d8edStholo   'M' for two different reasons:
57862286d8edStholo
57872286d8edStholo     for files you have modified that have not changed in the Repository.
57882286d8edStholo
57892286d8edStholo     after a merge, if it detected no conflicts.
57902286d8edStholo
57912286d8edStholo   'C' after a merge, if it detected conflicts. See 2D.7 and 3P.6 for
57922286d8edStholo   more info on conflict resolution and "sticky conflicts."
57932286d8edStholo
57942286d8edStholo   "cvs -n update" shows what it *would* do, rather than doing it. Or,
57952286d8edStholo   another way of looking at it, "cvs -n update" displays the
57962286d8edStholo   relationship between your current BASE revisions (identified in your
57972286d8edStholo   ./CVS/Entries file) and the HEAD revisions (the latest revisions in
57982286d8edStholo   the Repository).
57992286d8edStholo
58002286d8edStholo   "cvs -n update" prints lines beginning with:
58012286d8edStholo
58022286d8edStholo   'U' for files you have not modified that have changed in the
58032286d8edStholo   Repository.
58042286d8edStholo
58052286d8edStholo   'M' for files you have modified that have not changed in the
58062286d8edStholo   Repository.
58072286d8edStholo
58082286d8edStholo   'C' for files you have modified that have also been changed in the
58092286d8edStholo   Repository.
58102286d8edStholo
58112286d8edStholo   See 4C.6 for what the letters mean when merging in from another
58122286d8edStholo   branch. The output is almost the same for a normal update if you
58132286d8edStholo   consider the Repository as the branch and your working directory as
58142286d8edStholo   the "trunk".
58152286d8edStholo
58162286d8edStholo   Last modified: _6/13/1997_
58172286d8edStholo
58182286d8edStholo    3. What's the difference between "update" and "checkout"?
58192286d8edStholo
58202286d8edStholo   See 3C.4 above.
58212286d8edStholo
58222286d8edStholo   Last modified: _6/13/1997_
58232286d8edStholo
58242286d8edStholo    4. Why don't I get new files when I execute "update"?
58252286d8edStholo
58262286d8edStholo   There are six reasons for nothing to happen during an "update":
58272286d8edStholo
58282286d8edStholo     Nothing on your branch changed in the Repository.
58292286d8edStholo
58302286d8edStholo   If no one has committed anything to the branch you are working on
58312286d8edStholo   (normally the Main branch) since the last time you executed
58322286d8edStholo   "checkout", "update" or "commit", nothing will happen.
58332286d8edStholo
58342286d8edStholo   It's like shouting "xyzzy" or "plugh" in the wrong room.
58352286d8edStholo
58362286d8edStholo     You have a "sticky" non-branch <tag> or <date> attached to the
58372286d8edStholo   working files you are trying to "update".
58382286d8edStholo
58392286d8edStholo   At some time in the past you checked out or updated your directory
58402286d8edStholo   with the "-r <tag>" or "-D <date>" option. Until you do it again with
58412286d8edStholo   a different tag or date, or go back to the Main Branch with "update
58422286d8edStholo   -A", you will never again see any updates.
58432286d8edStholo
58442286d8edStholo     The ./CVS/Entries.Static file exists and you are expecting a new
58452286d8edStholo   file.
58462286d8edStholo
58472286d8edStholo   If your ./CVS administrative directory contains a file named
58482286d8edStholo   Entries.Static, no files will be checked out that aren't already in
58492286d8edStholo   the Entries or Entries.Static file.
58502286d8edStholo
58512286d8edStholo     You forgot to use the '-d' option and are looking for new
58522286d8edStholo   directories.
58532286d8edStholo
58542286d8edStholo   If you execute "update" without the '-d' option, it will not create
58552286d8edStholo   new directories that have been added to the Repository.
58562286d8edStholo
58572286d8edStholo     You typed "update" instead of "cvs update".
58582286d8edStholo
58592286d8edStholo   On most Unix systems, your disk caches are now furiously being flushed
58602286d8edStholo   by multiple update daemons, destroying performance and proving to
58612286d8edStholo   management that you need more CPU power. :-)
58622286d8edStholo
58632286d8edStholo   On HP systems you might be asked what package you want to install from
58642286d8edStholo   the "update server".
58652286d8edStholo
58662286d8edStholo     Someone removed (using "admin -o") your BASE revision (the revision
58672286d8edStholo   CVS thought you had in your working directory), then committed a
58682286d8edStholo   "replacement". CVS is now confused because the revision in the
58692286d8edStholo   Repository matches your BASE revision when the files themselves don't
58702286d8edStholo   match. See 3B.6.
58712286d8edStholo
58722286d8edStholo   Last modified: _6/13/1997_
58732286d8edStholo
58742286d8edStholo    5. Why does "update" say 'M' both for plain modified files and for
58752286d8edStholo    successful (i.e. conflict-free) merges? Aren't they different?
58762286d8edStholo
58772286d8edStholo   A design choice. Yes, they are different internally, but that
58782286d8edStholo   shouldn't matter. Your files are in the same condition after the
58792286d8edStholo   "update" as they were before -- a "diff" will display only your
58802286d8edStholo   modifications. And you are expected to continue onward with parts two
58812286d8edStholo   and three of the normal development cycle: "emacs" (a synonym for
58822286d8edStholo   "edit" in most of the civilized world) and "commit".
58832286d8edStholo
58842286d8edStholo   Last modified: _6/13/1997_
58852286d8edStholo
58862286d8edStholo    6. What's a "sticky conflict"? How does it know a conflict occurred?
58872286d8edStholo
58882286d8edStholo   When a "cvs update" (or an "update -j") creates a conflict, it prints
58892286d8edStholo   a 'C' and stores the timestamp of the file after the merge in a
58902286d8edStholo   special field in the ./CVS/Entries file.
58912286d8edStholo
58922286d8edStholo   This conflict indication implies that the merge command altered your
58932286d8edStholo   working file to contain conflict markers surrounding the overlapping
58942286d8edStholo   code segments. For example, say that
58952286d8edStholo
58962286d8edStholo   - Two developers acquire revision 1.2 of <file> via "checkout" or
58972286d8edStholo   "update".
58982286d8edStholo
58992286d8edStholo   - Developer A changes line 1 from "9999" to "5555", then commits the
59002286d8edStholo   file, creating revision 1.3.
59012286d8edStholo
59022286d8edStholo   - Developer B changes line 1 from "9999" to "7777", then tries to
59032286d8edStholo   commit the file, but is blocked because the file is not up to date.
59042286d8edStholo   Developer B then runs "update" and sees the conflict marker 'C'. The
59052286d8edStholo   beginning of the file would look like this:
59062286d8edStholo
59072286d8edStholo   <<<<<<< <file> The working <file> in question.
59082286d8edStholo            7777                Change made to the working <file>.
59092286d8edStholo            =======
59102286d8edStholo            5555                Change made in the first commit (1.3)
59112286d8edStholo            >>>>>>> 1.3         The revision created by the first commit.
59122286d8edStholo
59132286d8edStholo   The conflict is "sticky", which means that until the conflict is
59142286d8edStholo   cleared, the "update" command will continue to display the file's
59152286d8edStholo   status as 'C' and the "status" command will show the file's status as
59162286d8edStholo   "Unresolved Conflict".
59172286d8edStholo
59182286d8edStholo   Until the conflict is cleared, "commit" is blocked for this file.
59192286d8edStholo
59202286d8edStholo   The sticky conflict indicator can be cleared by:
59212286d8edStholo
59222286d8edStholo     Resolving the conflict by editing the file. Two things must happen
59232286d8edStholo   before the conflict is considered resolved:
59242286d8edStholo
59252286d8edStholo   The timestamp of the file must change. *and* The file must contain no
59262286d8edStholo   conflict markers. (The string searched for in the file is the regexp:
59272286d8edStholo   "^>>>>>>> ".)
59282286d8edStholo
59292286d8edStholo   After clearing the sticky conflict indicator, you may then commit the
59302286d8edStholo   file normally.
59312286d8edStholo
59322286d8edStholo     Removing the file and running "update". This throws away the local
59332286d8edStholo   changes and accepts the latest committed file on this branch. No
59342286d8edStholo   commit is needed.
59352286d8edStholo
59362286d8edStholo     Forcing the commit to happen by using "commit -f". This is probably
59372286d8edStholo   a mistake since there are few lines of real text that begin with
59382286d8edStholo   ">>>>>>> ".
59392286d8edStholo
59402286d8edStholo   Last modified: _6/13/1997_
59412286d8edStholo
59422286d8edStholo    7. Is there a feature to tell me what I have changed, added and removed
59432286d8edStholo    without changing anything?
59442286d8edStholo
59452286d8edStholo   The command "cvs -n update" will do exactly that.
59462286d8edStholo
59472286d8edStholo   Last modified: _6/13/1997_
59482286d8edStholo
59492286d8edStholo    8. Why were all my files deleted when I executed "update"?
59502286d8edStholo
59512286d8edStholo   You probably executed "update -r <tag>" some time ago, then removed
59522286d8edStholo   <tag> from the Repository files. "update -r <tag>" will delete a file
59532286d8edStholo   that doesn't contain <tag>.
59542286d8edStholo
59552286d8edStholo   A way to fix this is to "cd" into your working directory and type:
59562286d8edStholo
59572286d8edStholo                cvs update -A
59582286d8edStholo
59592286d8edStholo   If you don't want the latest revisions on the Main (or Vendor) Branch,
59602286d8edStholo   then decide what Tag (normal or branch) you want and type:
59612286d8edStholo
59622286d8edStholo                cvs update -r <the_tag_you_want>
59632286d8edStholo
59642286d8edStholo   Another way to make a file disappear is to execute "update -D <date>"
59652286d8edStholo   where <date> is before the date stamped onto the first revision in the
59662286d8edStholo   RCS file.
59672286d8edStholo
59682286d8edStholo   Last modified: _6/13/1997_
59692286d8edStholo
59702286d8edStholo  Category: /Past__Future_/
59712286d8edStholo
59722286d8edStholo   " Past & Future "
59732286d8edStholo
59742286d8edStholo  Category: /Past__Future_/Bugs_and_Patches/
59752286d8edStholo
59762286d8edStholo   " + Bugs and Patches"
59772286d8edStholo
59782286d8edStholo    1. Why can't CVS handle deletion of directories?
59792286d8edStholo
59802286d8edStholo   An oversight, probably. [[Fixed in a future release?]]
59812286d8edStholo
59822286d8edStholo   Last modified: _6/13/1997_
59832286d8edStholo
59842286d8edStholo    2. Why can't CVS handle the moving of sources from one place in the
59852286d8edStholo
59862286d8edStholo   directory hierarchy to another?
59872286d8edStholo
59882286d8edStholo   A "renaming database" has been proposed to track the history of
59892286d8edStholo   pathname changes in the Repository. A general solution is a difficult
59902286d8edStholo   problem. See 4B.8.
59912286d8edStholo
59922286d8edStholo   Last modified: _6/13/1997_
59932286d8edStholo
59942286d8edStholo    3. When I typed "cvs update -D <date>", why did it check out all
59952286d8edStholo
59962286d8edStholo   sorts of ancient files from the Attic? Shouldn't it just create the
59972286d8edStholo   set of files and revisions that existed at that date?
59982286d8edStholo
59992286d8edStholo   This seems to be a bug, but is really the lack of any obvious place to
60002286d8edStholo   store the date when a file is "removed".
60012286d8edStholo
60022286d8edStholo   There are four ranges of dates that CVS has to deal with when trying
60032286d8edStholo   to determine what revision was available on <date>:
60042286d8edStholo
60052286d8edStholo     Dates before the earliest revision in the file.
60062286d8edStholo
60072286d8edStholo     Dates between any two revisions in the file.
60082286d8edStholo
60092286d8edStholo     Dates between the latest revision in the file and the date when the
60102286d8edStholo   file was moved to the Attic by "commit".
60112286d8edStholo
60122286d8edStholo     Dates after moving the file to the Attic.
60132286d8edStholo
60142286d8edStholo   Since the date when a file is moved to the Attic is not stored
60152286d8edStholo   anywhere, CVS can't tell the difference between #3 and #4. To avoid
60162286d8edStholo   not producing a file that should exist in case #3, it produces
60172286d8edStholo   extraneous files in case #4.
60182286d8edStholo
60192286d8edStholo   For the above reason, if you have removed files in the Attic, it is
60202286d8edStholo   better to use "-r <tag>, or even "-r HEAD" than to use a date spec.
60212286d8edStholo
60222286d8edStholo   If you must use "-D <date>", then you should either archive and delete
60232286d8edStholo   Attic files (losing some past history) or construct your Makefiles to
60242286d8edStholo   work with an explicit list of files and let the old source files stay
60252286d8edStholo   in the working directory. The contents of the revision-controlled
60262286d8edStholo   Makefile can then be considered to contain deletion "information".
60272286d8edStholo
60282286d8edStholo   Last modified: _6/13/1997_
60292286d8edStholo
60302286d8edStholo    4. When I typed "cvs update -D <date>" in my branch, why did it screw up
60312286d8edStholo    all my files?
60322286d8edStholo
60332286d8edStholo   Currently, the internal routine ("version_ts") that looks up info
60342286d8edStholo   about a file, overrides both the tag and date if *either* the tag or
60352286d8edStholo   date is specified on the command line. If only the date is specified,
60362286d8edStholo   it should not override a branch tag, but it does.
60372286d8edStholo
60382286d8edStholo   In CVS 1.3, the documented "-D <branch_tag>:<date>" syntax only works
60392286d8edStholo   with the Main Branch and the Vendor Branch.
60402286d8edStholo
60412286d8edStholo   [[Is this fixed in CVS 1.4? This is one item I didn't check.]]
60422286d8edStholo
60432286d8edStholo   Last modified: _6/13/1997_
60442286d8edStholo
60452286d8edStholo    5. When I executed "checkout" into an existing directory I got "No such
60462286d8edStholo    file or directory" errors. Why?
60472286d8edStholo
60482286d8edStholo   Though the man page says that "checkout" turns into an "update -d" in
60492286d8edStholo   directories that already exist, it is referring to directories that
60502286d8edStholo   already exist *and* were created by CVS.
60512286d8edStholo
60522286d8edStholo   When you try to run "checkout" on top of an existing directory
60532286d8edStholo   structure, some of which wasn't created by CVS, it will handle
60542286d8edStholo   directories and non-CVS files within directories already under CVS,
60552286d8edStholo   but it will display the above error on non-CVS files within non-CVS
60562286d8edStholo   directories.
60572286d8edStholo
60582286d8edStholo   Last modified: _6/13/1997_
60592286d8edStholo
60602286d8edStholo    6. Why does "update" send all output to the terminal after 26 files have
60612286d8edStholo    been updated?
60622286d8edStholo
60632286d8edStholo   CVS uses the "tmpnam()" function to generate temporary file names. The
60642286d8edStholo   ANSI standard for the "tmpnam()" function says:
60652286d8edStholo
60662286d8edStholo   "The tmpnam function generates a different string each time it is
60672286d8edStholo   called, up to TMP_MAX times. If it is called more than TMP_MAX times,
60682286d8edStholo   the behavior is implementation defined."
60692286d8edStholo
60702286d8edStholo   Later it says that the value of "TMP_MAX shall be at least 25."
60712286d8edStholo
60722286d8edStholo   On some platforms, the above specification is taken literally by
60732286d8edStholo   turning "at least 25" into "exactly 26" and by doing something foolish
60742286d8edStholo   (i.e. "implementation defined") after that. Some systems return the
60752286d8edStholo   same name repeatedly, which causes one form of trouble. Others return
60762286d8edStholo   NULL or garbage, which causes a different form of trouble.
60772286d8edStholo
60782286d8edStholo   The broken systems appear to be cycling a single character through the
60792286d8edStholo   alphabet. SunOS cycles 3 characters through the alphabet, so it won't
60802286d8edStholo   cause trouble until 26 cubed or 17576 calls to "tmpnam()".
60812286d8edStholo
60822286d8edStholo   Since CVS doesn't depend on the exact format of the tmp files, the
60832286d8edStholo   workaround is to provide a "tmpnam()" that doesn't have a limit on the
60842286d8edStholo   number of calls to it.
60852286d8edStholo
60862286d8edStholo   Last modified: _6/13/1997_
60872286d8edStholo
60882286d8edStholo    7. Why does the merge occasionally resurrect lines of code?
60892286d8edStholo
60902286d8edStholo   The diff3 program provided by GNU diff version 1.15 has a bug that
60912286d8edStholo   occasionally causes text to come back from the dead.
60922286d8edStholo
60932286d8edStholo   This is an old problem which you can avoid by upgrading to the latest
60942286d8edStholo   GNU "diffutils" package. If you were using GNU diff version 1.15 and
60952286d8edStholo   plan to upgrade to the latest GNU diff program, see the next question.
60962286d8edStholo
60972286d8edStholo   Last modified: _6/13/1997_
60982286d8edStholo
60992286d8edStholo    8. Why does the merge fail when my "rcsmerge" program is configured to use
61002286d8edStholo    GNU diff version 2.1 or later?
61012286d8edStholo
61022286d8edStholo   A change in the overlap format was introduced in GNU diff3 between
61032286d8edStholo   versions 2.0 and 2.1 that causes RCS versions before 5.6.0.1 to fail
61042286d8edStholo   during a merge.
61052286d8edStholo
61062286d8edStholo   To get consistent rcsmerge behavior, you have four choices:
61072286d8edStholo
61082286d8edStholo     Go back to using GNU diff 1.15 or 2.0 with RCS versions 5.5 or 5.6.
61092286d8edStholo   If you want to use GNU diff 2.1 or later, you'll have to pick one of
61102286d8edStholo   the other three choices in this list.
61112286d8edStholo
61122286d8edStholo     Grab RCS version 5.6.0.1 from an FSF archive and set the DIFF3_A
61132286d8edStholo   macro to '1' as it tells you to in the Makefile:
61142286d8edStholo
61152286d8edStholo   #define DIFF3_A 1
61162286d8edStholo
61172286d8edStholo     Patch the RCS 5.6 source. Change line 84 in "merger.c" from:
61182286d8edStholo
61192286d8edStholo   DIFF3, "-am", "-L", label[0], "-L", label[1], to DIFF3, "-amE", "-L",
61202286d8edStholo   label[0], "-L", "", "-L", label[1],
61212286d8edStholo
61222286d8edStholo     Wait both for RCS version 5.7 to be released and for a new version
61232286d8edStholo   of CVS that can deal with it.
61242286d8edStholo
61252286d8edStholo   Last modified: _6/13/1997_
61262286d8edStholo
61272286d8edStholo  Category: /Past__Future_/Contributors/
61282286d8edStholo
61292286d8edStholo   " + Contributors"
61302286d8edStholo
61312286d8edStholo    1. Who wrote CVS?
61322286d8edStholo
61332286d8edStholo   Brian Berliner <berliner@sun.com> converted a collection of scripts
61342286d8edStholo   written by Dick Grune <dick@cs.vu.nl> into a C program, then added all
61352286d8edStholo   sorts of features. He continues to maintain CVS.
61362286d8edStholo
61372286d8edStholo   Jeff Polk <polk@bsdi.com> wrote much of the code added between
61382286d8edStholo   revisions 1.2 and 1.3. Many others were involved at some level.
61392286d8edStholo
61402286d8edStholo   david d zuhn <zoo@armadillo.com> fixed a number of bugs, added some of
61412286d8edStholo   the new features, reworked the whole thing to be more portable, and
61422286d8edStholo   provided much of the energy to push CVS 1.4 out the door.
61432286d8edStholo
61442286d8edStholo   Jim Kingdon implemented CVS 1.5's remote repository access features,
61452286d8edStholo   fixed many bugs, and managed the release of version 1.5.
61462286d8edStholo
61472286d8edStholo   Take a look at the README and the ChangeLog files in the CVS sources
61482286d8edStholo   for more contributors.
61492286d8edStholo
61502286d8edStholo   Last modified: _6/13/1997_
61512286d8edStholo
61522286d8edStholo    2. You didn't write all of this FAQ, did you?
61532286d8edStholo
61542286d8edStholo   In the original hunt for questions to answer (performed in Jan/Feb,
61552286d8edStholo   1993), I polled hundreds of people and I rephrased all sorts of text
61562286d8edStholo   found on the net. Between 2/93 and 10/93, I released about 20
61572286d8edStholo   versions, with corrections and additions from the info-cvs mailing
61582286d8edStholo   list and private correspondence.
61592286d8edStholo
61602286d8edStholo   Between 10/93 and 10/94 I extracted frequently asked questions from
61612286d8edStholo   the 1200 mail messages to the info-cvs mailing list, turned them into
61622286d8edStholo   focused questions and tried to answer them.
61632286d8edStholo
61642286d8edStholo   93/02/?? ~4000 lines 93/06/?? ~5000 lines 93/10/23 7839 lines 278K
61652286d8edStholo   94/10/29 9856 lines 360K 95/05/09 9981 lines 365K
61662286d8edStholo
61672286d8edStholo   Because there are so many posers of questions, I will list only those
61682286d8edStholo   who contribute answers or help significantly with the content and
61692286d8edStholo   structure of this document.
61702286d8edStholo
61712286d8edStholo   If I used someone else's text verbatim, I mentioned it in the given
61722286d8edStholo   answer. The people whose email postings have added to this document or
61732286d8edStholo   who have added to my understanding are:
61742286d8edStholo
61752286d8edStholo   Brian Berliner <berliner@sun.com>, CVS maintainer. Paul Eggert
61762286d8edStholo   <eggert@twinsun.com>, RCS maintainer.
61772286d8edStholo
61782286d8edStholo   Gray Watson <gray@antaire.com> Per Cederqvist <ceder@signum.se> Pete
61792286d8edStholo   Clark <pclark@is.com>
61802286d8edStholo
61812286d8edStholo   all of whom have sent me copies of their tutorials and local CVS
61822286d8edStholo   documentation.
61832286d8edStholo
61842286d8edStholo   Additional contributors, who have sent me ideas, text, corrections and
61852286d8edStholo   support include (in alphabetical order):
61862286d8edStholo
61872286d8edStholo   Per Abrahamsen <amanda@iesd.auc.dk> Donald Amby
61882286d8edStholo   <amby@mixcom.mixcom.com> Mark D Baushke <mdb@cisco.com> Jim Blandy
61892286d8edStholo   <jimb@cyclic.com> Tom Cunningham <tomc@bouwsma,sps.mot.com> Graydon
61902286d8edStholo   Dodson <grdodson@lexmark.com> Joe Drumgoole
61912286d8edStholo   <joed@splatter.demon.co.uk> Don Dwiggins <dwig@markv.com> Bryant
61922286d8edStholo   Eastham <bryant@ced.utah.edu> Dan Franklin <dan@diamond.bbn.com>
61932286d8edStholo   Michael Ganzberger <ganzbergermd@ES.net> Steve Harris
61942286d8edStholo   <vsh%etnibsd@uunet.uu.net> Erik van Linstee
61952286d8edStholo   <linstee@dutecaj.et.tudelft.nl> Jeffrey M Loomis <jml@world.std.com>
61962286d8edStholo   Barry Margolin <barmar@near.net> Mark K. Mellis <mkm@ncd.com> Chris
61972286d8edStholo   Moore <Chris.Moore@src.bae.co.uk> Gary Oberbrunner <garyo@avs.com>
61982286d8edStholo   Steve Turner <stevet@carrier.sps.mot.com> Dave Wolfe
61992286d8edStholo   <dwolfe@pffft.sps.mot.com> Dale Woolridge <dwoolridge@cid.aes.doe.ca>
62002286d8edStholo
62012286d8edStholo   Please send corrections. If I forgot you, remind me and I'll add your
62022286d8edStholo   name to the list.
62032286d8edStholo
62042286d8edStholo   Last modified: _6/13/1997_
62052286d8edStholo
62062286d8edStholo  Category: /Past__Future_/Development/
62072286d8edStholo
62082286d8edStholo   " + Development"
62092286d8edStholo
62102286d8edStholo    1. Where do I send bug reports?
62112286d8edStholo
62122286d8edStholo   First make sure it is a bug. Talk to your friends, coworkers and
62132286d8edStholo   anyone you know who uses CVS. Search this FAQ for related issues. Then
62142286d8edStholo   test it carefully. Try out variations to narrow down the problem. Make
62152286d8edStholo   sure it is repeatable. Look for workarounds so you can report them.
62162286d8edStholo
62172286d8edStholo   If you are still sure it's a bug and you tried to fix it, skip to the
62182286d8edStholo   next question. Otherwise, send a message to the info-cvs mailing list
62192286d8edStholo   containing one of the following:
62202286d8edStholo
62212286d8edStholo     If you have a good repeatable case and you think you know what is
62222286d8edStholo   going on, then describe the problem in detail. Include a workaround if
62232286d8edStholo   you have one.
62242286d8edStholo
62252286d8edStholo     If you have no idea what is going on, go ahead and send a question
62262286d8edStholo   to the info-cvs mailing list. Include any information you have
62272286d8edStholo   describing the symptoms.
62282286d8edStholo
62292286d8edStholo   Last modified: _6/13/1997_
62302286d8edStholo
62312286d8edStholo    2. Where do I send fixes and patches?
62322286d8edStholo
62332286d8edStholo   First make sure the "fix" does something useful. Have someone review
62342286d8edStholo   your fix. Spend a bit of one person's time in a detailed analysis of
62352286d8edStholo   your vast idea before displaying a half-vast idea to hundreds of
62362286d8edStholo   people.
62372286d8edStholo
62382286d8edStholo   If you tried to fix it and the patch is small, include the patch in
62392286d8edStholo   your message. Make sure the patch is based on the latest released
62402286d8edStholo   version of CVS.
62412286d8edStholo
62422286d8edStholo   If you tried to fix it and the patch is large, you should think about
62432286d8edStholo   why it is so large. Did you add a generally useful feature, or did it
62442286d8edStholo   grow out of hand?
62452286d8edStholo
62462286d8edStholo   If you still believe it is solid, produce a patch file using the CVS
62472286d8edStholo   commands "patch" or "diff -c". [[You *are* keeping CVS under CVS,
62482286d8edStholo   right?]] The patch should be based on the latest released version of
62492286d8edStholo   CVS. Then use the "cvsbug" program (provided with the CVS sources) to
62502286d8edStholo   send it to the CVS maintainers. A self-contained patch that provides a
62512286d8edStholo   single useful feature or correction might show up independently in the
62522286d8edStholo   patches directory of the FTP archive.
62532286d8edStholo
62542286d8edStholo   If careful testing reveals an RCS bug rather than a CVS bug, you can
62552286d8edStholo   send bug reports to: rcs-bugs@cs.purdue.edu
62562286d8edStholo
62572286d8edStholo   Last modified: _6/13/1997_
62582286d8edStholo
62592286d8edStholo    3. Where do I send ideas for future development?
62602286d8edStholo
62612286d8edStholo   If you have a bright idea, discuss it on the info-cvs mailing list. If
62622286d8edStholo   you have the time to implement something you can test, send the diffs
62632286d8edStholo   along too as described above.
62642286d8edStholo
62652286d8edStholo   Last modified: _6/13/1997_
62662286d8edStholo
62672286d8edStholo    4. What plans are there for new features?
62682286d8edStholo
62692286d8edStholo
62702286d8edStholo
62712286d8edStholoA "rename" or "per-directory" database has been bandied about on
62722286d8edStholothe net for years.  Many of the goals of the rename database have
62732286d8edStholobeen achieved by the so-called "death support" in recent versions of
62742286d8edStholoCVS (such as 1.9).  For more information on what may remain to be
62752286d8edStholodone, see item #189 in the TODO file of a development version of CVS.
62762286d8edStholo
62772286d8edStholoCVS version 1.5 supports remote repository access, but Paul
62782286d8edStholoKunz  has produced another version
62792286d8edStholo(rCVS) that also runs remotely.  Note that as far as I know there
62802286d8edStholoare no advantages to rCVS over the remote CVS in CVS 1.5 and later,
62812286d8edStholoand the rCVS user community has migrated to remote CVS.
62822286d8edStholorCVS is *not* a multisite CVS (see item #186 in TODO for more on
62832286d8edStholomultisite).  For more on rCVS, see
62842286d8edStholo
62852286d8edStholoftp://ftp.slac.stanford.edu/software/rcvs
62862286d8edStholo
62872286d8edStholokingdon@cyclic.com
62882286d8edStholo
62892286d8edStholo   Last modified: _9/6/1997_
62902286d8edStholo
62912286d8edStholo    5. I have some time and I'd like to help. What can I do for you?
62922286d8edStholo
62932286d8edStholo
62942286d8edStholo        You can review this document, correct errors and fill in any of
62952286d8edStholo        the incomplete sections.
62962286d8edStholo
62972286d8edStholo        You can write scripts or CVS add-ons and make them available by
62982286d8edStholo        web/FTP/etc.
62992286d8edStholo
63002286d8edStholo        You could work on the regression test suite (src/sanity.sh in the
63012286d8edStholo        CVS source distribution).
63022286d8edStholo
63032286d8edStholo        You can write specs for new features, fix bugs, review the
63042286d8edStholo        documentation or . . .
63052286d8edStholo
63062286d8edStholo        For more information, see the files HACKING and DEVEL-CVS in the
63072286d8edStholo        CVS source distribution or
63082286d8edStholo        http://www.cyclic.com/cyclic-pages/cvsdev.html
63092286d8edStholo
63102286d8edStholo        kingdon@cyclic.com
63112286d8edStholo
63122286d8edStholo   Last modified: _9/6/1997_
63132286d8edStholo
63142286d8edStholo  Category: /Past__Future_/Professional_Support/
63152286d8edStholo
63162286d8edStholo   " + Professional Support"
63172286d8edStholo
63182286d8edStholo    1. Doesn't Cygnus support CVS?
63192286d8edStholo
63202286d8edStholo
63212286d8edStholo
63222286d8edStholo
63232286d8edStholo        Cygnus is a company that supports free software such as the GCC
63242286d8edStholo        compiler.  They have never sold support for CVS, however.  They
63252286d8edStholo        do use CVS internally and have contributed much code to CVS over
63262286d8edStholo        the years (for which CVS users should be grateful).
63272286d8edStholo
63282286d8edStholo        kingdon@cyclic.com
63292286d8edStholo
63302286d8edStholo   Last modified: _9/6/1997_
63312286d8edStholo
63322286d8edStholo    2. What is Cyclic Software doing with CVS?
63332286d8edStholo
63342286d8edStholo
63352286d8edStholoCyclic Software exists to provide support for CVS.  For details such
63362286d8edStholoas prices and what this covers, see http://www.cyclic.com or ask
63372286d8edStholoinfo@cyclic.com.
63382286d8edStholo
63392286d8edStholokingdon@cyclic.com
63402286d8edStholo
63412286d8edStholo   Last modified: _9/6/1997_
63422286d8edStholo
63432286d8edStholo  Category: /User_Tasks_/
63442286d8edStholo
63452286d8edStholo   " User Tasks "
63462286d8edStholo
63472286d8edStholo  Category: /User_Tasks_/Common_User_Tasks/
63482286d8edStholo
63492286d8edStholo   " + Common User Tasks"
63502286d8edStholo
63512286d8edStholo    1. What is the absolute minimum I have to do to edit a file?
63522286d8edStholo
63532286d8edStholo   Tell your Repository Administrator to create a module covering the
63542286d8edStholo   directory or files you care about. You will be told that your module
63552286d8edStholo   name is <module>. Then type:
63562286d8edStholo
63572286d8edStholo                cvs checkout <module>
63582286d8edStholo                cd <module>
63592286d8edStholo                emacs <file>          # Isn't Emacs a synonym for edit?
63602286d8edStholo                cvs commit <file>
63612286d8edStholo
63622286d8edStholo   If you don't use modules (in my opinion, a mistake), you can check out
63632286d8edStholo   a directory by substituting its relative path within the Repository
63642286d8edStholo   for <module> in the example above.
63652286d8edStholo
63662286d8edStholo   To work on a single file, you'll have to change "cd <module>" to "cd
63672286d8edStholo   `dirname <module>`".
63682286d8edStholo
63692286d8edStholo   Last modified: _6/13/1997_
63702286d8edStholo
63712286d8edStholo    2. If I edit multiple files, must I type "commit" for each one?
63722286d8edStholo
63732286d8edStholo   No. You can commit a list of files and directories, including relative
63742286d8edStholo   paths into multiple directories. You can also commit every modified
63752286d8edStholo   file in the current directory or in all directories and subdirectories
63762286d8edStholo   from your current directory downward. See 3D.2.
63772286d8edStholo
63782286d8edStholo   Last modified: _6/13/1997_
63792286d8edStholo
63802286d8edStholo    3. How do I get rid of the <module> directory that "checkout" created?
63812286d8edStholo
63822286d8edStholo   Change your directory to be the same as when you executed the
63832286d8edStholo   "checkout" command that created <module>.
63842286d8edStholo
63852286d8edStholo   If you want to get rid of the CVS control information, but leave the
63862286d8edStholo   files and directories, type:
63872286d8edStholo
63882286d8edStholo                cvs release <module>
63892286d8edStholo
63902286d8edStholo   If you want to obliterate the entire directory, type:
63912286d8edStholo
63922286d8edStholo                cvs release -d <module>
63932286d8edStholo
63942286d8edStholo   ("release -d" searches through the output of "cvs -n update" and
63952286d8edStholo   refuses to continue if the "update" command finds any modified files
63962286d8edStholo   or non-ignored foreign files. Foreign directories too.)
63972286d8edStholo
63982286d8edStholo   If you don't care about keeping "history", or checking for modified
63992286d8edStholo   and foreign files, you can just remove the whole directory. That's "rm
64002286d8edStholo   -rf <module>" under Unix.
64012286d8edStholo
64022286d8edStholo   Last modified: _6/13/1997_
64032286d8edStholo
64042286d8edStholo    4. How do I find out what has changed since my last update?
64052286d8edStholo
64062286d8edStholo   There are many ways to answer this.
64072286d8edStholo
64082286d8edStholo   To find out what you've changed in your current working directory
64092286d8edStholo   since your last checkout, update or commit, type:
64102286d8edStholo
64112286d8edStholo                cvs diff
64122286d8edStholo
64132286d8edStholo   To find out what other people have added (to your branch) since you
64142286d8edStholo   last checked out or updated, type:
64152286d8edStholo
64162286d8edStholo                cvs diff -r BASE -r HEAD
64172286d8edStholo
64182286d8edStholo   To look at a revision history containing the comments for all changes,
64192286d8edStholo   you can use the "log" command.
64202286d8edStholo
64212286d8edStholo   You can also use "history" to trace a wide variety of events.
64222286d8edStholo
64232286d8edStholo   Last modified: _6/13/1997_
64242286d8edStholo
64252286d8edStholo    5. I just created a new file. How do I add it to the Repository?
64262286d8edStholo
64272286d8edStholo   The "update" command will mark files CVS doesn't know about in your
64282286d8edStholo   working directory with a '?' indicator.
64292286d8edStholo
64302286d8edStholo                ? <file>
64312286d8edStholo
64322286d8edStholo   To add <file> to the Repository, type:
64332286d8edStholo
64342286d8edStholo                cvs add <file>
64352286d8edStholo                cvs commit <file>
64362286d8edStholo
64372286d8edStholo   See 3A.[2-5] and 4C.8 for branch and merge considerations.
64382286d8edStholo
64392286d8edStholo   Last modified: _6/13/1997_
64402286d8edStholo
64412286d8edStholo    6. How do I merge changes made by others into my working directory?
64422286d8edStholo
64432286d8edStholo   If you are asking about other branches, see Section 4C on "Branching".
64442286d8edStholo   You will have to use the "update -j" command.
64452286d8edStholo
64462286d8edStholo   Retrieving changes made to the Repository on the *same* branch you are
64472286d8edStholo   working on is the main purpose of the "update" command. The "update"
64482286d8edStholo   command tries to merge work committed to the Repository by others
64492286d8edStholo   since you last executed "checkout", "update" or "commit" into your
64502286d8edStholo   working files.
64512286d8edStholo
64522286d8edStholo   For a single file, there are six possible results when you type the
64532286d8edStholo   "update" command:
64542286d8edStholo
64552286d8edStholo     If the file is lying in your working directory, but is not under
64562286d8edStholo   CVS, it will do nothing but print:
64572286d8edStholo
64582286d8edStholo   ? <file>
64592286d8edStholo
64602286d8edStholo     If neither you nor anyone else has committed changes to <file>,
64612286d8edStholo   since your last "checkout", "update" or "commit", "update" will print
64622286d8edStholo   nothing and do nothing.
64632286d8edStholo
64642286d8edStholo     If you have made no changes to a working file, but you or others
64652286d8edStholo   have committed changes to the Repository since your last "checkout",
64662286d8edStholo   "update" or "commit" of this working file, CVS will remove your
64672286d8edStholo   working file and replace it with a copy of the latest revision of that
64682286d8edStholo   file in the Repository. It will print:
64692286d8edStholo
64702286d8edStholo   U <file>
64712286d8edStholo
64722286d8edStholo   You might want to examine the changes (using the CVS "diff" command)
64732286d8edStholo   to see if they mesh with your own in related files.
64742286d8edStholo
64752286d8edStholo     If you have made changes to a working file, but no one has changed
64762286d8edStholo   your BASE revision (the revision you retrieved from the Repository in
64772286d8edStholo   your last "checkout", "update" or "commit"), "update" will print:
64782286d8edStholo
64792286d8edStholo   M <file>
64802286d8edStholo
64812286d8edStholo   Nothing changes. You were told that you have a modified file in your
64822286d8edStholo   directory.
64832286d8edStholo
64842286d8edStholo     If you have made changes to your working file and you or others have
64852286d8edStholo   committed changes to the Repository, but in different sections of the
64862286d8edStholo   file, CVS will merge the changes stored in the Repository since your
64872286d8edStholo   last "checkout", "update" or "commit" into your working file. "update"
64882286d8edStholo   will print:
64892286d8edStholo
64902286d8edStholo   RCS file: /Repository/module/<file> retrieving revision 1.X retrieving
64912286d8edStholo   revision 1.Y Merging differences between 1.X and 1.Y into <file> M
64922286d8edStholo   <file>
64932286d8edStholo
64942286d8edStholo   If you execute "diff" before and after this step, you should see the
64952286d8edStholo   same output, since both the base file and your working file changed in
64962286d8edStholo   parallel. This is one of the few times the otherwise nonsensical
64972286d8edStholo   phrase "same difference" means something.
64982286d8edStholo
64992286d8edStholo     If both you and those who committed files (since your last checkout,
65002286d8edStholo   update or commit) have made changes to the same section of a file, CVS
65012286d8edStholo   will merge the changes into your file as in #5 above, but it will
65022286d8edStholo   leave conflict indicators in the file. "update" will print:
65032286d8edStholo
65042286d8edStholo   RCS file: /Repository/module/<file> retrieving revision 1.X retrieving
65052286d8edStholo   revision 1.Y Merging differences between 1.X and 1.Y into <file>
65062286d8edStholo   rcsmerge warning: overlaps during merge
65072286d8edStholo                cvs update: conflicts found in <file>
65082286d8edStholo                C <file>
65092286d8edStholo
65102286d8edStholo   This is a "conflict". The file will contain markers surrounding the
65112286d8edStholo   overlapping text. The 'C' conflict indicator is sticky -- subsequent
65122286d8edStholo   "update" commands will continue to show a 'C' until you edit the file.
65132286d8edStholo
65142286d8edStholo   You must examine the overlaps with care and resolve the problem by
65152286d8edStholo   analyzing how to retain the features of both changes. See 2D.7 and
65162286d8edStholo   3P.6 for more details on conflict resolution.
65172286d8edStholo
65182286d8edStholo   Last modified: _6/13/1997_
65192286d8edStholo
65202286d8edStholo    7. How do I label a set of revisions so I can retrieve them later?
65212286d8edStholo
65222286d8edStholo   To "tag" the BASE revisions (the ones you last checked out, updated,
65232286d8edStholo   or committed) you should "cd" to the head of the working directory you
65242286d8edStholo   want to tag and type:
65252286d8edStholo
65262286d8edStholo                cvs tag <tag>
65272286d8edStholo
65282286d8edStholo   It recursively walks through your working directory tagging the BASE
65292286d8edStholo   revisions of all files.
65302286d8edStholo
65312286d8edStholo   To "tag" the latest revision on the Main branch in the Repository, you
65322286d8edStholo   can use the following from anywhere: (No "cd" is required -- it works
65332286d8edStholo   directly on the Repository.)
65342286d8edStholo
65352286d8edStholo                cvs rtag <tag> <module>
65362286d8edStholo
65372286d8edStholo   Last modified: _6/13/1997_
65382286d8edStholo
65392286d8edStholo    8. How do I checkout an old release of a module, directory or file?
65402286d8edStholo
65412286d8edStholo   Module names and directories are simply ways to name sets of files.
65422286d8edStholo   Once the names are determined, there are 6 ways to specify which
65432286d8edStholo   revision of a particular file to check out:
65442286d8edStholo
65452286d8edStholo     By tag or symbolic name, via the "-r <tag>" option.
65462286d8edStholo
65472286d8edStholo     By date, via the "-D <date>" option.
65482286d8edStholo
65492286d8edStholo     By branch tag (a type of tag with a magic format), via the "-r
65502286d8edStholo   <branch_tag>" option.
65512286d8edStholo
65522286d8edStholo     By date within a branch, via the "-r <branch_tag>:<date>" option.
65532286d8edStholo
65542286d8edStholo     By an explicit branch revision number ("-r <rev>"), which refers to
65552286d8edStholo   the latest revision on the branch. This isn't really an "old"
65562286d8edStholo   revision, from the branch's perspective, but from the user's
65572286d8edStholo   perspective the whole branch might have been abandoned in the past.
65582286d8edStholo
65592286d8edStholo     An explicit revision number: "-r <rev>" Though this works, it is
65602286d8edStholo   almost useless for more than one file.
65612286d8edStholo
65622286d8edStholo   You type:
65632286d8edStholo
65642286d8edStholo                cvs checkout <option-specified-above> <module>
65652286d8edStholo                cd <module>
65662286d8edStholo
65672286d8edStholo   Last modified: _6/13/1997_
65682286d8edStholo
65692286d8edStholo    9. What do I have to remember to do periodically?
65702286d8edStholo
65712286d8edStholo   You should execute "cvs -n update" fairly often to keep track of what
65722286d8edStholo   you and others have changed. It won't change anything -- it will just
65732286d8edStholo   give you a report.
65742286d8edStholo
65752286d8edStholo   Unless you are purposely delaying the inclusion of others' work, you
65762286d8edStholo   should execute "update" once in a while and resolve the conflicts. It
65772286d8edStholo   is not good to get too far out of sync with the rest of the developers
65782286d8edStholo   working on your branch.
65792286d8edStholo
65802286d8edStholo   It is assumed that your system administrators have arranged for editor
65812286d8edStholo   backup and Unix temp files (#* and .#*) to be deleted after a few
65822286d8edStholo   weeks. But you might want to look around for anything else that is
65832286d8edStholo   ignored or hidden. Try "cvs -n update -I !" to see all the ignored
65842286d8edStholo   files.
65852286d8edStholo
65862286d8edStholo   If you are the Repository Administrator, see 4B.16 on Administrator
65872286d8edStholo   responsibilities.
65882286d8edStholo
65892286d8edStholo   Last modified: _6/13/1997_
65902286d8edStholo
65912286d8edStholo  Category: /User_Tasks_/General_Questions/
65922286d8edStholo
65932286d8edStholo   " + General Questions"
65942286d8edStholo
65952286d8edStholo    1. How do I see what CVS is trying to do?
65962286d8edStholo
65972286d8edStholo   The '-t' option on the main "cvs" command will display every external
65982286d8edStholo   command (mostly RCS commands and file deletions) it executes. When
65992286d8edStholo   combined with the '-n' option, which prevents the execution of any
66002286d8edStholo   command that might modify a file, you can see what it will do before
66012286d8edStholo   you let it fly. The '-t' option will *not* display every internal
66022286d8edStholo   action, only calls to external programs.
66032286d8edStholo
66042286d8edStholo   To see a harmless example, try typing:
66052286d8edStholo
66062286d8edStholo                cvs -nt update
66072286d8edStholo
66082286d8edStholo   Some systems offer a "trace" or "truss" command that will display all
66092286d8edStholo   system calls as they happen. This is a *very* low-level interface that
66102286d8edStholo   does not normally follow the execution of external commands, but it
66112286d8edStholo   can be useful.
66122286d8edStholo
66132286d8edStholo   The most complete answer is to read the source, compile it with the
66142286d8edStholo   '-g' option and step through it under a debugger.
66152286d8edStholo
66162286d8edStholo   Last modified: _6/13/1997_
66172286d8edStholo
66182286d8edStholo    2. If I work with multiple modules, should I check them all out and commit
66192286d8edStholo    them occasionally? Is it OK to leave modules checked out?
66202286d8edStholo
66212286d8edStholo   The simple answers are "Yes."
66222286d8edStholo
66232286d8edStholo   There is no reason to remove working directories, other than to save
66242286d8edStholo   disk space. As long as you have committed the files you choose to make
66252286d8edStholo   public, your working directory is just like any other directory.
66262286d8edStholo
66272286d8edStholo   CVS doesn't care whether you leave modules checked out or not. The
66282286d8edStholo   advantage of leaving them checked out is that you can quickly visit
66292286d8edStholo   them to make and commit changes.
66302286d8edStholo
66312286d8edStholo   Last modified: _6/13/1997_
66322286d8edStholo
66332286d8edStholo    3. What is a "sticky" tag? What makes it sticky? How do I loosen it?
66342286d8edStholo
66352286d8edStholo   When you execute "update -r <tag>", CVS remembers the <tag>. It has
66362286d8edStholo   become "sticky" in the sense that until you change it or remove it,
66372286d8edStholo   the tag is remembered and used in references to the file as if you had
66382286d8edStholo   typed "-r <tag>" on the command line.
66392286d8edStholo
66402286d8edStholo   It is most useful for a <branch_tag>, which is a sticky tag indicating
66412286d8edStholo   what branch you are working on.
66422286d8edStholo
66432286d8edStholo   A revision number ("-r <rev-number>") or date ("-D <date>") can also
66442286d8edStholo   become sticky when they are specified on the command line.
66452286d8edStholo
66462286d8edStholo   A sticky tag, revision or date remains until you specify another tag,
66472286d8edStholo   revision or date the same way. The "update -A" command moves back to
66482286d8edStholo   the Main branch, which has the side-effect of clearing all sticky
66492286d8edStholo   items on the updated files.
66502286d8edStholo
66512286d8edStholo   The "checkout" command creates sticky tags, revisions and dates the
66522286d8edStholo   same way "update" does.
66532286d8edStholo
66542286d8edStholo   Also, the '-k' option records a "sticky" keyword option that is used
66552286d8edStholo   in further "updates until "update -A" is specified.
66562286d8edStholo
66572286d8edStholo   Last modified: _6/13/1997_
66582286d8edStholo
66592286d8edStholo    4. How do I get an old revision without updating the "sticky tag"?
66602286d8edStholo
66612286d8edStholo   Use the '-p' option to "pipe" data to standard output. The command
66622286d8edStholo   "update -p -r <tag/rev>" sends the selected revision to your standard
66632286d8edStholo   output (usually the terminal, unless redirected). The '-p' affects no
66642286d8edStholo   disk files, leaving a "sticky tag" unaltered and avoiding all other
66652286d8edStholo   side-effects of a normal "update".
66662286d8edStholo
66672286d8edStholo   If you want to save the result, you can redirect "stdout" to a file
66682286d8edStholo   using your shell's redirection capability. In most shells the
66692286d8edStholo   following command works:
66702286d8edStholo
66712286d8edStholo            cvs update -p -r <tag/rev> filename > diskfile
66722286d8edStholo
66732286d8edStholo   Last modified: _6/13/1997_
66742286d8edStholo
66752286d8edStholo    5. What operations disregard sticky tags?
66762286d8edStholo
66772286d8edStholo   The functions that routinely disregard sticky tags are:
66782286d8edStholo
66792286d8edStholo     Those that work directly on the Repository or its administrative
66802286d8edStholo   files:
66812286d8edStholo
66822286d8edStholo                admin   rtag    log     status  remove  history
66832286d8edStholo
66842286d8edStholo     Those that take Tags or revisions as arguments and ignore everything
66852286d8edStholo   else: (They also never *set* a sticky tag.)
66862286d8edStholo
66872286d8edStholo                rdiff   import  export
66882286d8edStholo
66892286d8edStholo     The "release" command itself ignores sticky tags, but it calls "cvs
66902286d8edStholo   -n update" (which *does* pay attention to a sticky tag) to figure out
66912286d8edStholo   what inconsistencies exist in the working directory. If no
66922286d8edStholo   discrepancies exist between the files you originally checked out
66932286d8edStholo   (possibly marked by a sticky tag) and what is there now, "release -d"
66942286d8edStholo   will delete them all.
66952286d8edStholo
66962286d8edStholo     The "tag" command works on the revision lying in the working
66972286d8edStholo   directory however it got there. That the revision lying there might
66982286d8edStholo   happen to have a sticky tag attached to it is not the "tag" command's
66992286d8edStholo   concern.
67002286d8edStholo
67012286d8edStholo   The main function that *does* read and write sticky tags is the
67022286d8edStholo   "update" command. You can avoid referring to or changing the sticky
67032286d8edStholo   tag by using the '-p' option, which sends files to your terminal,
67042286d8edStholo   touching nothing else.
67052286d8edStholo
67062286d8edStholo   The "checkout" command sets sticky tags when checking out a new module
67072286d8edStholo   and it acts like "update" when checking out a module into an existing
67082286d8edStholo   directory.
67092286d8edStholo
67102286d8edStholo   The "diff" and "commit" commands use the sticky tags, unless
67112286d8edStholo   overridden on the command line. They do not set sticky tags. Note that
67122286d8edStholo   you can only "commit" to a file checked out with a sticky tag, if the
67132286d8edStholo   tag identifies a branch.
67142286d8edStholo
67152286d8edStholo   There are really two types of sticky tags, one attached to individual
67162286d8edStholo   files (in the ./CVS/Entries file) and one attached to each directory
67172286d8edStholo   (in the ./CVS/Tag file). They can differ.
67182286d8edStholo
67192286d8edStholo   The "add" command registers the desire to add a new file. If the
67202286d8edStholo   "directory tag" (./CVS/Tag) file exists at the time of the "add", the
67212286d8edStholo   value stored in ./CVS/Tag becomes the "sticky tag" on the new file.
67222286d8edStholo   The file doesn't exist in the Repository until you "commit" it, but
67232286d8edStholo   the ./CVS/Entries file holds the sticky tag name from the time of the
67242286d8edStholo   "add" forward.
67252286d8edStholo
67262286d8edStholo   Last modified: _6/13/1997_
67272286d8edStholo
67282286d8edStholo    6. Is there a way to avoid reverting my Emacs buffer after committing a
67292286d8edStholo    file? Is there a "cvs-mode" for Emacs?
67302286d8edStholo
67312286d8edStholo   See Section 4F.1
67322286d8edStholo
67332286d8edStholo   Last modified: _6/13/1997_
67342286d8edStholo
67352286d8edStholo    7. How does conflict resolution work? What *really* happens if two of us
67362286d8edStholo    change the same file?
67372286d8edStholo
67382286d8edStholo   While editing files, there is no conflict. You are working on separate
67392286d8edStholo   copies of the file stored in the virtual "branch" represented by your
67402286d8edStholo   working directories. After one of you commits a file, the other may
67412286d8edStholo   not commit the same file until "update" has merged the earlier
67422286d8edStholo   committed changes into the later working file.
67432286d8edStholo
67442286d8edStholo   For example, say you both check out rev 1.2 of <file> and make change
67452286d8edStholo   to your working files. Your coworker commits revision 1.3. When you
67462286d8edStholo   try to commit your file, CVS says:
67472286d8edStholo
67482286d8edStholo                cvs commit: Up-to-date check failed for `<file>'
67492286d8edStholo
67502286d8edStholo   You must merge your coworker's changes into your working file by
67512286d8edStholo   typing:
67522286d8edStholo
67532286d8edStholo                cvs update <file>
67542286d8edStholo
67552286d8edStholo   which will produce the output described in 2B.6.
67562286d8edStholo
67572286d8edStholo   If a conflict occurs, the filename will be shown with a status of 'C'.
67582286d8edStholo   After you resolve any overlaps caused by the merging process, you may
67592286d8edStholo   then commit the file. See 3P.6 for info on "sticky conflicts".
67602286d8edStholo
67612286d8edStholo   Even if you get a simple 'M', you should examine the differences
67622286d8edStholo   before committing the file. A smooth, error-free text merge is still
67632286d8edStholo   no indication that the file is in proper shape. Compile and test it at
67642286d8edStholo   least.
67652286d8edStholo
67662286d8edStholo   The answer to two obvious questions is "Yes".
67672286d8edStholo
67682286d8edStholo   Yes, the first one who commits avoids the merge. Later developers have
67692286d8edStholo   to merge the earlier changes into their working files before
67702286d8edStholo   committing the merged result. Depending on how difficult the merge is
67712286d8edStholo   and how important the contending projects are, the order of commits
67722286d8edStholo   and updates might have to be carefully staged.
67732286d8edStholo
67742286d8edStholo   And yes, between the time you execute "update" and "commit" (while you
67752286d8edStholo   are fixing conflicts and testing the results) someone else may commit
67762286d8edStholo   another revision of <file>. You will have to execute "update" again to
67772286d8edStholo   merge the new work before committing. Most organizations don't have
67782286d8edStholo   this problem. If you do, you might consider splitting the file. Or
67792286d8edStholo   hiring a manager.
67802286d8edStholo
67812286d8edStholo   Last modified: _6/13/1997_
67822286d8edStholo
67832286d8edStholo    8. How can I tell who has a module checked out?
67842286d8edStholo
67852286d8edStholo   If you "checkout" module names (not relative pathnames) and you use
67862286d8edStholo   the release command, the "history" command will display active
67872286d8edStholo   checkouts, who has them and where they were checked out. It is
67882286d8edStholo   advisory only; it can be circumvented by using the '-l' option on the
67892286d8edStholo   main "cvs" command.
67902286d8edStholo
67912286d8edStholo   Last modified: _6/13/1997_
67922286d8edStholo
67932286d8edStholo    9. Where did the .#<file>.1.3 file in my working directory come from?
67942286d8edStholo
67952286d8edStholo   It was created during an "update" when CVS merged changes from the
67962286d8edStholo   Repository into your modified working file.
67972286d8edStholo
67982286d8edStholo   It serves the same purpose as any "backup" file: saving your bacon
67992286d8edStholo   often enough to be worth retaining. It is invaluable in recovering
68002286d8edStholo   when things go wrong.
68012286d8edStholo
68022286d8edStholo   Say Developers A (you) and B check out rev 1.3 of file <file>. You
68032286d8edStholo   both make changes -- different changes. B commits first, so <file>,v
68042286d8edStholo   in the Repository contains revisions up through 1.4.
68052286d8edStholo
68062286d8edStholo   At this point, there are 5 (yes, five) versions of the file of
68072286d8edStholo   interest to you:
68082286d8edStholo
68092286d8edStholo     Revision 1.3 (What you originally checked out.)
68102286d8edStholo
68112286d8edStholo     Revision 1.4 (What you need from developer B.)
68122286d8edStholo
68132286d8edStholo     Your old working file. (Before the update.)
68142286d8edStholo
68152286d8edStholo     Your new working file. (After the merge caused by "update".)
68162286d8edStholo
68172286d8edStholo     Revision 1.5 (Which you will commit shortly.)
68182286d8edStholo
68192286d8edStholo   In the case where your working file was not modified, #1 and #3 will
68202286d8edStholo   be the same, as will #2 and #4. In this degenerate case, there is no
68212286d8edStholo   need to create #5. The following assumes that your working file was
68222286d8edStholo   modified.
68232286d8edStholo
68242286d8edStholo   If the merge executed by the "update" caused no overlaps, and you
68252286d8edStholo   commit the file immediately, #4 and #5 will be the same. But you can
68262286d8edStholo   make arbitrary changes before committing, so the difference between #4
68272286d8edStholo   and #5 might be more than just the correction of overlaps. In general,
68282286d8edStholo   though, you don't need #4 after a commit.
68292286d8edStholo
68302286d8edStholo   But #3 (which is the one saved as ".#<file>.1.3") holds all of your
68312286d8edStholo   work, independent of B's work. It could represent a major effort that
68322286d8edStholo   you couldn't afford to lose. If you don't save it somewhere, the merge
68332286d8edStholo   makes #3 *disappear* under a potential blizzard of conflicts caused by
68342286d8edStholo   overlapping changes.
68352286d8edStholo
68362286d8edStholo   I have been saved a few times, and others I support have been saved
68372286d8edStholo   hundreds of times, by the ability to "diff <original file> <original
68382286d8edStholo   file with only my work added>", which can be done in the example above
68392286d8edStholo   by the Unix shell command:
68402286d8edStholo
68412286d8edStholo                cvs update -p -r 1.3 <file> | diff - .#<file>.1.3
68422286d8edStholo
68432286d8edStholo   The assumption is that the ".#" files will be useful far beyond the
68442286d8edStholo   "commit" point, but not forever. You are expected to run the "normal"
68452286d8edStholo   Unix cleanup script from "cron", which removes "#*" and ".#*" files
68462286d8edStholo   older than a some period chosen by your sysadmin, usually ranging from
68472286d8edStholo   7 to 30 days.
68482286d8edStholo
68492286d8edStholo   A question was raised about the need for #3 after #5 has been
68502286d8edStholo   committed, under the assumption that you won't commit files until
68512286d8edStholo   everything is exactly as you like them.
68522286d8edStholo
68532286d8edStholo   This assumes perfect humans, which violates one of the Cardinal rules
68542286d8edStholo   of Software Engineering: Never assume any form of discipline on the
68552286d8edStholo   part of the users of software. If restrictions are not bound into the
68562286d8edStholo   software, then you, the toolsmith, have to arrange a recovery path.
68572286d8edStholo
68582286d8edStholo   In other words, I've seen every possible variety of screwup you can
68592286d8edStholo   imagine in #5. There is no way to make assumptions about what "should"
68602286d8edStholo   happen. I've seen #5 filled with zeros because of NFS failures, I've
68612286d8edStholo   seen emacs core dumps that leave #5 in an unreasonable state, I've
68622286d8edStholo   seen a foolish developer uppercase the whole file (with his "undo"
68632286d8edStholo   size set low so he couldn't undo it) and decide that it would be less
68642286d8edStholo   work to play with the uppercased file than to blow it away and start
68652286d8edStholo   over. I've even seen committed files with conflict markers still in
68662286d8edStholo   them, a sure sign of carelessness.
68672286d8edStholo
68682286d8edStholo   There are all sorts of scenarios where having #3 is incredibly useful.
68692286d8edStholo   You can move it back into place and try again.
68702286d8edStholo
68712286d8edStholo   Last modified: _6/13/1997_
68722286d8edStholo
68732286d8edStholo    10. What is this "ignore" business? What is it ignoring?
68742286d8edStholo
68752286d8edStholo   The "update" and "import" commands use collections of Unix wildcards
68762286d8edStholo   to skip over files and directories matching any of those patterns.
68772286d8edStholo
68782286d8edStholo   You may add to the built-in ignore list by adding lines of
68792286d8edStholo   whitespace-separated wildcards to the following places: (They are read
68802286d8edStholo   in this order.)
68812286d8edStholo
68822286d8edStholo     In a file named "cvsignore" in $CVSROOT/CVSROOT.
68832286d8edStholo
68842286d8edStholo   A Repository Administrator uses this to add site-specific files and
68852286d8edStholo   patterns to the built-in ignore list.
68862286d8edStholo
68872286d8edStholo     In a file named ".cvsignore" in your home directory.
68882286d8edStholo
68892286d8edStholo   For user-specific files. For example, if you use "__" as your default
68902286d8edStholo   junk file prefix, you can put "__*" in your .cvsignore file.
68912286d8edStholo
68922286d8edStholo   People who play around exclusively in directory trees where the
68932286d8edStholo   Makefiles are generated by "imake" or "configure" might want to put
68942286d8edStholo   "Makefile" in their ignore list, since they are all generated and
68952286d8edStholo   usually don't end up in the Repository.
68962286d8edStholo
68972286d8edStholo     In the CVSIGNORE environment variable.
68982286d8edStholo
68992286d8edStholo   For session-specific files.
69002286d8edStholo
69012286d8edStholo     Via the '-I' option on "import" or "update" commands.
69022286d8edStholo
69032286d8edStholo   For this-command-only files.
69042286d8edStholo
69052286d8edStholo     In a file named ".cvsignore" within each directory.
69062286d8edStholo
69072286d8edStholo   The contents of a ".cvsignore" file in each directory is temporarily
69082286d8edStholo   added to the ignore list. This way you can ignore files that are
69092286d8edStholo   peculiar to that directory, such as executables and other generated
69102286d8edStholo   files without known wildcard patterns.
69112286d8edStholo
69122286d8edStholo   In any of the places listed above, a single '!' character nulls out
69132286d8edStholo   the ignore list. A Repository administrator can use this to override,
69142286d8edStholo   rather than enhance, the built-in ignore list. A user can choose to
69152286d8edStholo   override the system-wide ignore list. For example, if you place "! *.o
69162286d8edStholo   *.a" in your .cvsignore file, only *.o *.a files, plus any files a
69172286d8edStholo   local-directory .cvsignore file, are ignored.
69182286d8edStholo
69192286d8edStholo   A variant of the ignore-file scheme is used internally during
69202286d8edStholo   checkout. "Module names" found in the modules file (or on the
69212286d8edStholo   "checkout" command line) that begin with a '!' are ignored during
69222286d8edStholo   checkout. This is useful to permanently ignore (if the '!' path is in
69232286d8edStholo   the modules file) or temporarily ignore (if the '!' path is on the
69242286d8edStholo   command line) a sub-directory within a Repository hierarchy. For
69252286d8edStholo   example:
69262286d8edStholo
69272286d8edStholo   cvs checkout !gnu/emacs/tests gnu/emacs
69282286d8edStholo
69292286d8edStholo   would checkout the module (or relative path within $CVSROOT) named
69302286d8edStholo   "gnu/emacs", but ignore the "tests" directory within it.
69312286d8edStholo
69322286d8edStholo   Last modified: _6/13/1997_
69332286d8edStholo
69342286d8edStholo    11. Is there a way to set user-specific configuration options?
69352286d8edStholo
69362286d8edStholo   User-specific configuration is available through use of a ".cvsrc"
69372286d8edStholo   file in your home directory.
69382286d8edStholo
69392286d8edStholo   CVS searches the first column of your ~/.cvsrc file for the cvs
69402286d8edStholo   command name you invoked. If the command is found, the rest of the
69412286d8edStholo   line is treated like a set of command line options, stuffed into the
69422286d8edStholo   command line before the arguments you actually typed.
69432286d8edStholo
69442286d8edStholo   For example, if you always want to see context diffs and you never
69452286d8edStholo   want to have to delete a file before you run "cvs remove", then you
69462286d8edStholo   should create a .cvsrc file containing the following:
69472286d8edStholo
69482286d8edStholo                diff -c
69492286d8edStholo                remove -f
69502286d8edStholo
69512286d8edStholo   which will add the given options to every invocation of the given
69522286d8edStholo   commands.
69532286d8edStholo
69542286d8edStholo   [[The rest of this will be removed someday, when CVS changes.]]
69552286d8edStholo
69562286d8edStholo   I would like to stop here with a comment that the command name to use
69572286d8edStholo   is the full, canonical one. But the command that the cvsrc support
69582286d8edStholo   uses is the string you typed on the command line, not the proper
69592286d8edStholo   command. So to get the full effect of the above example, you should
69602286d8edStholo   also add all the alternate command names:
69612286d8edStholo
69622286d8edStholo                di -c
69632286d8edStholo                dif -c
69642286d8edStholo                rm -f
69652286d8edStholo                delete -f
69662286d8edStholo
69672286d8edStholo   There are two other limitations that will probably be fixed when CVS
69682286d8edStholo   sprouts long option names:
69692286d8edStholo
69702286d8edStholo     It only affects options made available on the command line.
69712286d8edStholo
69722286d8edStholo   There is a limited number of short options. With long option names,
69732286d8edStholo   there is no problem. You can have as many long options as you like,
69742286d8edStholo   affecting anything that looks malleable.
69752286d8edStholo
69762286d8edStholo     The existing command line options do not come in on/off pairs, so
69772286d8edStholo   there is no easy way to override your ~/.cvsrc configuration for a
69782286d8edStholo   single invocation of a command.
69792286d8edStholo
69802286d8edStholo   Choosing a good set of long option pairs would fix this.
69812286d8edStholo
69822286d8edStholo   Last modified: _6/13/1997_
69832286d8edStholo
69842286d8edStholo    12. Is it safe to interrupt CVS using Control-C?
69852286d8edStholo
69862286d8edStholo   It depends on what you mean by "safe". ("Ah," said Arthur, "this is
69872286d8edStholo   obviously some strange usage of the word *safe* that I wasn't
69882286d8edStholo   previously aware of." -- Hitchhiker's Guide to the Galaxy)
69892286d8edStholo
69902286d8edStholo   You won't hurt the underlying RCS files and if you are executing a
69912286d8edStholo   command that only *reads* data, you will have no cleanup to do.
69922286d8edStholo
69932286d8edStholo   But you may have to hit Control-C repeatedly to stop it. CVS uses the
69942286d8edStholo   Unix "system" routine which blocks signals in the CVS parent process.
69952286d8edStholo   A single Control-C during "system" will only halt the child process,
69962286d8edStholo   usually some form of RCS command.
69972286d8edStholo
69982286d8edStholo   If you don't hit another Control-C while the CVS process has control,
69992286d8edStholo   it is likely to continue onto the next task assuming that the earlier
70002286d8edStholo   one did its job. It is not enough to hit two Control-C's. You might
70012286d8edStholo   simply kill two child processes and not interrupt CVS at all.
70022286d8edStholo   Depending on the speed of your processor, your terminal and your
70032286d8edStholo   fingers, you might have to hit dozens of Control-C's to stop the damn
70042286d8edStholo   thing.
70052286d8edStholo
70062286d8edStholo   Executing a CVS command, such as "commit" or "tag" that writes to the
70072286d8edStholo   files is a different matter.
70082286d8edStholo
70092286d8edStholo   Since CVS is not a full-fledged database, with what database people
70102286d8edStholo   call "commit points", merely stopping the process will not back out
70112286d8edStholo   the "transaction" and place you back in the starting blocks. CVS has
70122286d8edStholo   no concept of an "atomic" transaction or of "backtracking", which
70132286d8edStholo   means that a command can be half-executed.
70142286d8edStholo
70152286d8edStholo   Hitting Control-C will usually leave lock files that you have to go
70162286d8edStholo   clean up in the Repository.
70172286d8edStholo
70182286d8edStholo   Example1:
70192286d8edStholo
70202286d8edStholo                If you interrupt a multi-file "commit" in the middle of
70212286d8edStholo                an RCS checkin, RCS will leave the file either fully
70222286d8edStholo                checked-in or in its original state.  But CVS might have
70232286d8edStholo                been half-way through the list of files to commit.  The
70242286d8edStholo                directory or module will be inconsistent.
70252286d8edStholo
70262286d8edStholo                To recover, you must remove the lock files, then decide
70272286d8edStholo                whether you want to back out or finish the job.
70282286d8edStholo
70292286d8edStholo                To back out, you'll have to apply the "admin -o"
70302286d8edStholo                command, very carefully, to remove the newly committed
70312286d8edStholo                revisions.  This is usually a bad idea, but is
70322286d8edStholo                occasionally necessary.
70332286d8edStholo
70342286d8edStholo                To finish, you can simply retype the same commit command.
70352286d8edStholo                CVS will figure out what files are still modified and
70362286d8edStholo                commit them.  It helps that RCS doesn't leave a file in an
70372286d8edStholo                intermediate state.
70382286d8edStholo
70392286d8edStholo   Example2:
70402286d8edStholo
70412286d8edStholo                If you interrupt a multi-file "tag" command, you have a
70422286d8edStholo                problem similar, but not equivalent, to interrupting a
70432286d8edStholo                "commit".  The RCS file will still be consistent, but
70442286d8edStholo                unlike "commit", which only *adds* to the RCS file, "tag"
70452286d8edStholo                can *move* a tag and it doesn't keep a history of what
70462286d8edStholo                revision a tag used to be attached to.
70472286d8edStholo
70482286d8edStholo                Normally, you have little choice but to re-execute the
70492286d8edStholo                command and allow it to tag everything consistently.
70502286d8edStholo
70512286d8edStholo                You might be able to recover by carefully re-applying the
70522286d8edStholo                tags via the "cvs admin -N" command, but you'll still have
70532286d8edStholo                to dig up from outside sources the information you use to
70542286d8edStholo                determine what tag was on what revision in what file.
70552286d8edStholo                the Repository, or by using the equivalent: "cvs admin".
70562286d8edStholo
70572286d8edStholo   Halting a new "checkout" should cause no harm. If you don't want it,
70582286d8edStholo   "release" (or rm -rf) it. If you do want it, re-execute the command. A
70592286d8edStholo   repeated "checkout" from above a directory acts like a repeated
70602286d8edStholo   "update -d" within it.
70612286d8edStholo
70622286d8edStholo   Halting "update" half-way will give you an unpredictable collection of
70632286d8edStholo   files and revisions. To continue, you can rerun the update and it
70642286d8edStholo   should move you forward into in a known state. To back out, you'll
70652286d8edStholo   have to examine the output from the first "update" command, take a
70662286d8edStholo   look at each file that was modified and reconstruct the previous state
70672286d8edStholo   by editing the ./CVS/Entries file and by using "cvs admin". Good Luck.
70682286d8edStholo
70692286d8edStholo   Last modified: _6/13/1997_
70702286d8edStholo
70712286d8edStholo    13. How do I turn off the "admin" command?
70722286d8edStholo
70732286d8edStholo   In the current revision, you'd have to edit the source code.
70742286d8edStholo
70752286d8edStholo   Last modified: _6/13/1997_
70762286d8edStholo
70772286d8edStholo    14. How do I turn off the ability to disable history via "cvs -l"?
70782286d8edStholo
70792286d8edStholo   In the current revision, you'd have to edit the source code.
70802286d8edStholo
70812286d8edStholo   Last modified: _6/13/1997_
70822286d8edStholo
70832286d8edStholo    15. How do I keep certain people from accessing certain directories?
70842286d8edStholo
70852286d8edStholo   If you don't try to run CVS set[ug]id, you can use Unix groups and
70862286d8edStholo   permissions to limit access to the Repository.
70872286d8edStholo
70882286d8edStholo   If you only want to limit "commit" commands, you can write a program
70892286d8edStholo   to put in the "commitinfo" file. In the "contrib" directory, there are
70902286d8edStholo   a few scripts that might help you out.
70912286d8edStholo
70922286d8edStholo   Last modified: _6/13/1997_
70932286d8edStholo
70942286d8edStholo  Category: /User_Tasks_/Getting_Started/
70952286d8edStholo
70962286d8edStholo   " + Getting Started"
70972286d8edStholo
70982286d8edStholo    1. What is the first thing I have to know?
70992286d8edStholo
71002286d8edStholo   Your organization has most likely assigned one or more persons to
71012286d8edStholo   understand, baby-sit and administer the CVS programs and the data
71022286d8edStholo   Repository. I call these persons Repository Administrators. They
71032286d8edStholo   should have set up a Repository and "imported" files into it.
71042286d8edStholo
71052286d8edStholo   If you don't believe anyone has this responsibility, or you are just
71062286d8edStholo   testing CVS, then *you* are the Repository Administrator.
71072286d8edStholo
71082286d8edStholo   If you are a normal user of CVS ask your Repository Administrator what
71092286d8edStholo   module you should check out.
71102286d8edStholo
71112286d8edStholo   Then you can work.
71122286d8edStholo
71132286d8edStholo   If you *are* the Repository Administrator, you will want to read
71142286d8edStholo   everything you can get your hands on, including this FAQ. Source
71152286d8edStholo   control issues can be difficult, especially when you get to branches
71162286d8edStholo   and release planning. Expect to feel stupid for a few days/weeks.
71172286d8edStholo
71182286d8edStholo   No tool in the universe avoids the need for intelligent organization.
71192286d8edStholo   In other words, there are all sorts of related issues you will
71202286d8edStholo   probably have to learn. Don't expect to dive in without any
71212286d8edStholo   preparation, stuff your 300 Megabytes of sources into CVS and expect
71222286d8edStholo   to start working. If you don't prepare first, you will probably spend
71232286d8edStholo   a few sleepless nights.
71242286d8edStholo
71252286d8edStholo   Last modified: _6/13/1997_
71262286d8edStholo
71272286d8edStholo    2. Where do I work?
71282286d8edStholo
71292286d8edStholo   Wherever you have disk space. That's one of the advantages of CVS: you
71302286d8edStholo   use the "checkout" command to copy files from the Repository to your
71312286d8edStholo   working directory, which can be anywhere you have the space.
71322286d8edStholo
71332286d8edStholo   Your local group might have conventions for where to work. Ask your
71342286d8edStholo   peers.
71352286d8edStholo
71362286d8edStholo   Last modified: _6/13/1997_
71372286d8edStholo
71382286d8edStholo    3. What does CVS use from my environment?
71392286d8edStholo
71402286d8edStholo   You must set two environment variables. Some shells share these
71412286d8edStholo   variables with local shell variables using a different syntax. You'll
71422286d8edStholo   have to learn how your shell handles them.
71432286d8edStholo
71442286d8edStholo        Variable        Value (or action)
71452286d8edStholo        ---------       ---------------------
71462286d8edStholo        CVSROOT         Absolute pathname of the head of your Repository.
71472286d8edStholo
71482286d8edStholo        PATH            Normally set to a list of ':'-separated directory
71492286d8edStholo                        pathnames searched to find executables.  You must
71502286d8edStholo                        make sure "cvs" is in one of the directories.
71512286d8edStholo
71522286d8edStholo                        If your CVS was built with the RCSBIN directory set
71532286d8edStholo                        to null (""), and you don't set the RCSBIN
71542286d8edStholo                        variable mentioned below, then the RCS commands
71552286d8edStholo                        also must be somewhere in your PATH.
71562286d8edStholo
71572286d8edStholo   Optional variables: (Used if set, but ignored otherwise.)
71582286d8edStholo
71592286d8edStholo        Variable        Value (or action)
71602286d8edStholo        ---------       ---------------------
71612286d8edStholo        CVSEDITOR       The name of your favorite fast-start editor
71622286d8edStholo                        program.  You'll be kicked into your editor to
71632286d8edStholo                        supply revision comments if you don't specify them
71642286d8edStholo                        via -m "Log message" on the command line.
71652286d8edStholo
71662286d8edStholo        EDITOR          Used if CVSEDITOR doesn't exist.  If EDITOR
71672286d8edStholo                        doesn't exist, CVS uses a configured constant,
71682286d8edStholo                        usually, "vi".
71692286d8edStholo
71702286d8edStholo        CVSREAD         Sets files to read-only on "checkout".
71712286d8edStholo
71722286d8edStholo        RCSBIN          Changes where CVS finds the RCS commands.
71732286d8edStholo
71742286d8edStholo        CVSIGNORE       Adds to the ignore list.  See Section 2D.
71752286d8edStholo
71762286d8edStholo   Other variables used by CVS that are normally set upon login:
71772286d8edStholo
71782286d8edStholo        Variable        Value (or action)
71792286d8edStholo        ---------       ---------------------
71802286d8edStholo        LOGNAME         Used to find the real user name.
71812286d8edStholo
71822286d8edStholo        USER            Used to find the real user name if no LOGNAME.
71832286d8edStholo
71842286d8edStholo        HOME            Used to determine your home directory, if set.
71852286d8edStholo                        Otherwise LOGNAME/USER/getuid() are used to find
71862286d8edStholo                        your home directory from the passwd file.
71872286d8edStholo
71882286d8edStholo        TMPDIR          Used during import.  It might also be used if your
71892286d8edStholo                        platform's version of mktemp(3) is unusual, or
71902286d8edStholo                        you have changed the source to use tmpnam(3).
71912286d8edStholo
71922286d8edStholo   Last modified: _6/13/1997_
71932286d8edStholo
71942286d8edStholo    4. OK, I've been told that CVS is set up, my module is named "ralph" and I
71952286d8edStholo    have to start editing. What do I type?
71962286d8edStholo
71972286d8edStholo                cd <where you have some space to work>
71982286d8edStholo                cvs checkout ralph
71992286d8edStholo                cd ralph
72002286d8edStholo
72012286d8edStholo   And hack away.
72022286d8edStholo
72032286d8edStholo   Last modified: _6/13/1997_
72042286d8edStholo
72052286d8edStholo    5. I have been using RCS for a while. Can I convert to CVS without losing
72062286d8edStholo    my revision history? How about converting from SCCS?
72072286d8edStholo
72082286d8edStholo   If you are asking such questions, you are not a mere user of CVS, but
72092286d8edStholo   one of its Administrators! You should take a look at Section 4A,
72102286d8edStholo   "Installing CVS" and Section 4B, "Setting up and Managing the
72112286d8edStholo   Repository".
72122286d8edStholo
72132286d8edStholo   Last modified: _6/13/1997_
72142286d8edStholo
72152286d8edStholo  Category: /User_Tasks_/Less_Common_User_Tas/
72162286d8edStholo
72172286d8edStholo   " + Less Common User Tasks"
72182286d8edStholo
72192286d8edStholo    1. Can I create non-CVS sub-directories in my working directory?
72202286d8edStholo
72212286d8edStholo   Yes. Unless the directory exists in the Repository, "update" will skip
72222286d8edStholo   over them and print a '?' the way it does for files you forgot to add.
72232286d8edStholo   You can avoid seeing the '?' by adding the name of the foreign
72242286d8edStholo   directory to the ./.cvsignore file, just ask you can do with files.
72252286d8edStholo
72262286d8edStholo   If you explicitly mention a foreign directory on the "update" command
72272286d8edStholo   line, it will traverse the directory and waste a bit of time, but if
72282286d8edStholo   any directory or sub-directory lacks the ./CVS administrative
72292286d8edStholo   directory, CVS will print an error and abort.
72302286d8edStholo
72312286d8edStholo   Last modified: _6/13/1997_
72322286d8edStholo
72332286d8edStholo    2. How do I add new sub-directories to the Repository?
72342286d8edStholo
72352286d8edStholo   The "add" command will work on directories. You type:
72362286d8edStholo
72372286d8edStholo   mkdir <dir>
72382286d8edStholo            cvs add <dir>
72392286d8edStholo
72402286d8edStholo   It will respond:
72412286d8edStholo
72422286d8edStholo   Directory /Repos/<dir> added to the repository
72432286d8edStholo
72442286d8edStholo   and will create both a matching directory in the Repository and a
72452286d8edStholo   ./CVS administrative directory within the local <dir> directory.
72462286d8edStholo
72472286d8edStholo   Last modified: _6/13/1997_
72482286d8edStholo
72492286d8edStholo    3. How do I remove a file I don't need?
72502286d8edStholo
72512286d8edStholo   (See the questions in Section 4B on removing files from the
72522286d8edStholo   Repository.)
72532286d8edStholo
72542286d8edStholo   You type:
72552286d8edStholo
72562286d8edStholo                rm <file>
72572286d8edStholo                cvs remove <file>
72582286d8edStholo
72592286d8edStholo   CVS registers the file for removal. To complete the removal, you must
72602286d8edStholo   type:
72612286d8edStholo
72622286d8edStholo                cvs commit <file>
72632286d8edStholo
72642286d8edStholo   CVS moves the file to the Attic associated with your working
72652286d8edStholo   directory. Each directory in the Repository stores its deleted files
72662286d8edStholo   in an Attic sub-directory. A normal "checkout" doesn't look in the
72672286d8edStholo   Attic, but if you specify a tag, a date or a revision, the "checkout"
72682286d8edStholo   (or "update") command will retrieve files from the Attic with that
72692286d8edStholo   tag, date or revision.
72702286d8edStholo
72712286d8edStholo   Last modified: _6/13/1997_
72722286d8edStholo
72732286d8edStholo    4. How do I rename a file?
72742286d8edStholo
72752286d8edStholo   CVS does not offer a way to rename a file in a way that CVS can track
72762286d8edStholo   later. See Section 4B for more information.
72772286d8edStholo
72782286d8edStholo   Here is the best (to some, the only acceptable) way to get the effect
72792286d8edStholo   of renaming, while preserving the change log:
72802286d8edStholo
72812286d8edStholo     Copy the RCS (",v") file directly in the Repository.
72822286d8edStholo
72832286d8edStholo   cp $CVSROOT/<odir>/<ofile>,v $CVSROOT/<ndir>/<nfile>,v
72842286d8edStholo
72852286d8edStholo   By duplicating the file, you will preserve the change history and the
72862286d8edStholo   ability to retrieve earlier revisions of the old file via the "-r
72872286d8edStholo   <tag/rev>" or "-D <date>" options to "checkout" and "update".
72882286d8edStholo
72892286d8edStholo     Remove the old file using CVS.
72902286d8edStholo
72912286d8edStholo   cd <working-dir>/<odir> rm <ofile>
72922286d8edStholo                cvs remove <ofile>
72932286d8edStholo                cvs commit <ofile>
72942286d8edStholo
72952286d8edStholo   This will move the <ofile> to the Attic associated with <odir>.
72962286d8edStholo
72972286d8edStholo     Retrieve <nfile> and remove all the Tags from it.
72982286d8edStholo
72992286d8edStholo   By stripping off all the old Tags, "checkout -r" and "update -r" won't
73002286d8edStholo   retrieve revisions Tagged before the renaming.
73012286d8edStholo
73022286d8edStholo   cd <working-dir>/<ndir>
73032286d8edStholo                cvs update <nfile>
73042286d8edStholo                cvs log <nfile>                 # Save the list of Tags
73052286d8edStholo                cvs tag -d <tag1> <nfile>
73062286d8edStholo                cvs tag -d <tag2> <nfile>
73072286d8edStholo                . . .
73082286d8edStholo
73092286d8edStholo   This technique can be used to rename files within one directory or
73102286d8edStholo   across different directories. You can apply this idea to directories
73112286d8edStholo   too, as long as you apply the above to each file and don't delete the
73122286d8edStholo   old directory.
73132286d8edStholo
73142286d8edStholo   Of course, you have to change your build system (e.g. Makefile) in
73152286d8edStholo   your <working-dir> to know about the name change.
73162286d8edStholo
73172286d8edStholo   Warning: Stripping the old tags from the copied file will allow "-r
73182286d8edStholo   <tag>" to do the right thing, but you will still have problems with
73192286d8edStholo   "-D <date>" because there is no place to store the "deletion time".
73202286d8edStholo   See 5B.3 for more details.
73212286d8edStholo
73222286d8edStholo   Last modified: _6/13/1997_
73232286d8edStholo
73242286d8edStholo    5. How do I make sure that all the files and directories in my working
73252286d8edStholo    directory are really in the Repository?
73262286d8edStholo
73272286d8edStholo   A "cvs update", or "cvs -n update" (which won't modify your working
73282286d8edStholo   directory) will display foreign elements, which have no counterpart in
73292286d8edStholo   the Repository, preceded by a '?'. To register foreign directories,
73302286d8edStholo   you can use "cvs add". To register foreign files, you can use "cvs
73312286d8edStholo   add" followed by "cvs commit".
73322286d8edStholo
73332286d8edStholo   You could also checkout your module, or the Repository directory
73342286d8edStholo   associated with your working directory, a second time into another
73352286d8edStholo   work area and compare it to your working directory using the (non-CVS)
73362286d8edStholo   "diff -r" command.
73372286d8edStholo
73382286d8edStholo   By default many patterns of files are ignored. If you create a file
73392286d8edStholo   named "core" or a file ending in ".o", it is usually ignored. If you
73402286d8edStholo   really want to see all the files that aren't in the Repository, you
73412286d8edStholo   can use a special "ignore" pattern to say "ignore no files". Try
73422286d8edStholo   executing: (You may have to quote or backwhack (i.e. precede by '\')
73432286d8edStholo   the '!' in your shell.)
73442286d8edStholo
73452286d8edStholo                cvs -n update -I !
73462286d8edStholo
73472286d8edStholo   The above command will display not only the normal modified, update
73482286d8edStholo   and conflict indicators ('M', 'U', and 'C' respectively) on files
73492286d8edStholo   within the Repository, but it will also display each file not in the
73502286d8edStholo   Repository preceded by a '?' character.
73512286d8edStholo
73522286d8edStholo   The '-n' option will not allow "update" to alter your working
73532286d8edStholo   directory.
73542286d8edStholo
73552286d8edStholo   Last modified: _6/13/1997_
73562286d8edStholo
73572286d8edStholo    6. How do I create a branch?
73582286d8edStholo
73592286d8edStholo   Type this in your working directory:
73602286d8edStholo
73612286d8edStholo                cvs tag -b <branch_tag>
73622286d8edStholo
73632286d8edStholo   and you will create a branch. No files have real branches in them yet,
73642286d8edStholo   but if you move onto the branch by typing:
73652286d8edStholo
73662286d8edStholo                cvs update -r <branch_tag>
73672286d8edStholo
73682286d8edStholo   and commit a file in the normal way:
73692286d8edStholo
73702286d8edStholo                cvs commit <file>
73712286d8edStholo
73722286d8edStholo   then a branch will be created in the underlying <file>,v file and the
73732286d8edStholo   new revision of <file> will appear only on that branch.
73742286d8edStholo
73752286d8edStholo   See Section 4C, on Branching.
73762286d8edStholo
73772286d8edStholo   Last modified: _6/13/1997_
73782286d8edStholo
73792286d8edStholo    7. How do I modify the modules file? How about the other files in the
73802286d8edStholo    CVSROOT administrative area?
73812286d8edStholo
73822286d8edStholo   A module named "modules" has been provided in the default modules
73832286d8edStholo   file, so you can type:
73842286d8edStholo
73852286d8edStholo                cvs checkout modules
73862286d8edStholo                cd modules
73872286d8edStholo
73882286d8edStholo   Another module named CVSROOT has been provided in the default modules
73892286d8edStholo   file, covering all the administrative files. Type:
73902286d8edStholo
73912286d8edStholo                cvs checkout CVSROOT
73922286d8edStholo                cd CVSROOT
73932286d8edStholo
73942286d8edStholo   Then you can edit your files, followed by:
73952286d8edStholo
73962286d8edStholo                cvs commit
73972286d8edStholo
73982286d8edStholo   If you start with the provided template for the "modules" file, the
73992286d8edStholo   CVSROOT and the "modules" module will have the "mkmodules" program as
74002286d8edStholo   a "commit helper". After a file is committed to such a module,
74012286d8edStholo   "mkmodules" will convert a number of standard files (See 4B.2) in the
74022286d8edStholo   CVSROOT directory inside the Repository into a form that is usable by
74032286d8edStholo   CVS.
74042286d8edStholo
74052286d8edStholo   Last modified: _6/13/1997_
74062286d8edStholo
74072286d8edStholo    8. How do I split a file into pieces, retaining revision histories?
74082286d8edStholo
74092286d8edStholo   If you and a coworker find yourselves repeatedly committing the same
74102286d8edStholo   file, but never for changes in the same area of the file, you might
74112286d8edStholo   want to split the file into two or more pieces. If you are both
74122286d8edStholo   changing the same section of code, splitting the file is of no use.
74132286d8edStholo   You should talk to each other instead.
74142286d8edStholo
74152286d8edStholo   If you decide to split the file, here's a suggestion. In many ways, it
74162286d8edStholo   is similar to multiple "renamings" as described in 2C.4 above.
74172286d8edStholo
7418c71bc7e2Stholo   Say you want to split , which already in the Repository, into three
7419c71bc7e2Stholo   pieces, , and .
74202286d8edStholo
74212286d8edStholo     Copy the RCS (",v") files directly in the Repository, creating the
74222286d8edStholo   new files, then bring readable copies of the new files into the
74232286d8edStholo   working directory via "update".
74242286d8edStholo
7425c71bc7e2Stholo   cp $CVSROOT//,v $CVSROOT//,v cp $CVSROOT//,v $CVSROOT//,v
7426c71bc7e2Stholo                cvs update
74272286d8edStholo
7428c71bc7e2Stholo     Then remove all the from the new files, either using:
74292286d8edStholo
7430c71bc7e2Stholo                cvs log               # Save the list of
7431c71bc7e2Stholo                cvs tag -d
7432c71bc7e2Stholo                cvs tag -d
74332286d8edStholo                . . .
74342286d8edStholo
7435c71bc7e2Stholo   (eivind@freebsd.org) or using the following little script to
7436c71bc7e2Stholo   autmatically remove the tags directly from the repository files:
7437c71bc7e2Stholo
7438c71bc7e2Stholo#!/bin/sh
7439c71bc7e2Stholofor file in $*
7440c71bc7e2Stholodo
7441c71bc7e2Stholo        TAGS=`rlog $file | awk '/^symbolic names:/,/^keyword subst/' | awk 'BEG
7442c71bc7e2StholoIN {FS=":"} /^\t/ {print $1}'`
7443c71bc7e2Stholo        echo The tags in $file are
7444c71bc7e2Stholo        echo $TAGS
7445c71bc7e2Stholo        echo Is it OK to remove these?
7446c71bc7e2Stholo        read confirm
7447c71bc7e2Stholo        if [ "$confirm" = "y" -o "$confirm" = "yes" ]
7448c71bc7e2Stholo        then
7449c71bc7e2Stholo                for tag in $TAGS
7450c71bc7e2Stholo                do
7451c71bc7e2Stholo                        echo Removing $file:$tag
7452c71bc7e2Stholo                        rcs -n$tag $file
7453c71bc7e2Stholo                done
7454c71bc7e2Stholo        fi
7455c71bc7e2Stholodone
7456c71bc7e2Stholo
74572286d8edStholo     Edit each file until it has the data you want in it. This is a
74582286d8edStholo   hand-editing job, not something CVS can handle. Then commit all the
74592286d8edStholo   files.
74602286d8edStholo
74612286d8edStholo   [From experience, I'd suggest making sure that only one copy of each
74622286d8edStholo   line of code exists among the three files, except for "include"
74632286d8edStholo   statements, which must be duplicated. And make sure the code
74642286d8edStholo   compiles.]
74652286d8edStholo
7466c71bc7e2Stholo   emacs
7467c71bc7e2Stholo                cvs commit
74682286d8edStholo
74692286d8edStholo   As in the "rename" case, by duplicating the files, you'll preserve the
74702286d8edStholo   change history and the ability to retrieve earlier revisions.
74712286d8edStholo
74722286d8edStholo   Of course, you have to alter your build system (e.g. Makefiles) to
74732286d8edStholo   take the new names and the change in contents into account.
74742286d8edStholo
7475c71bc7e2Stholo   Last modified: _3/11/1998_
74762286d8edStholo
74772286d8edStholo  Category: /What_is_CVS_/
74782286d8edStholo
74792286d8edStholo   " What is CVS? "
74802286d8edStholo
74812286d8edStholo  Category: /What_is_CVS_/How_does_CVS_differ_/
74822286d8edStholo
74832286d8edStholo   " + How does CVS differ from other, similar software?"
74842286d8edStholo
74852286d8edStholo    1. How does CVS differ from RCS?
74862286d8edStholo
74872286d8edStholo   CVS uses RCS to do much of its work and absolutely all the work of
74882286d8edStholo   changing the underlying RCS files in the Repository.
74892286d8edStholo
74902286d8edStholo   RCS comprises a set of programs designed to keep track of changes to
74912286d8edStholo   individual files. Of course, it also allows you to refer to multiple
74922286d8edStholo   files on the command line, but they are handled by iterating over
74932286d8edStholo   individual files. There is no pretense of coordinated interaction
74942286d8edStholo   among groups of files.
74952286d8edStholo
74962286d8edStholo   CVS's main intent is to provide a set of grouping functions that allow
74972286d8edStholo   you to treat a collection of RCS files as a single object. Of course,
74982286d8edStholo   CVS also has to do a lot of iteration, but it tries its best to hide
74992286d8edStholo   that it is doing so. In addition, CVS has some truly group-oriented
75002286d8edStholo   facets, such as the modules file and the CVS administrative files that
75012286d8edStholo   refer to a whole directory or module.
75022286d8edStholo
75032286d8edStholo   One group aspect that can be a bit confusing is that a CVS branch is
75042286d8edStholo   not the same as an RCS branch. To support a CVS branch, CVS uses
75052286d8edStholo   "tags" (what RCS calls "symbols") and some local state, in addition to
75062286d8edStholo   RCS branches.
75072286d8edStholo
75082286d8edStholo   Other features offered by CVS that are not supported directly by RCS
75092286d8edStholo   are
75102286d8edStholo
75112286d8edStholo     Automatic determination of the state of a file, (e.g. modified,
75122286d8edStholo   up-to-date with the Repository, already tagged with the same string,
75132286d8edStholo   etc.) which helps in limiting the amount of displayed text you have to
75142286d8edStholo   wade through to figure out what changed and what to do next.
75152286d8edStholo
75162286d8edStholo     A copy-modify-merge scheme that avoids locking the files and allows
75172286d8edStholo   simultaneous development on a single file.
75182286d8edStholo
75192286d8edStholo     Serialization of commits. CVS requires you to merge all changes
75202286d8edStholo   committed (via "update") since you checked out your working copy of
75212286d8edStholo   the file. Although it is still possible to commit a file filled with
75222286d8edStholo   old data, it is less likely than when using raw RCS.
75232286d8edStholo
75242286d8edStholo     Relatively easy merging of releases from external Vendors.
75252286d8edStholo
75262286d8edStholo   Last modified: _6/13/1997_
75272286d8edStholo
75282286d8edStholo    2. How does CVS differ from SCCS?
75292286d8edStholo
75302286d8edStholo   SCCS is much closer to RCS than to CVS, so some of the previous entry
75312286d8edStholo   applies.
75322286d8edStholo
75332286d8edStholo   You might want to take a look at Walter Tichy's papers on RCS, which
75342286d8edStholo   are referred to in the RCS man pages.
75352286d8edStholo
75362286d8edStholo   [[More info here?]]
75372286d8edStholo
75382286d8edStholo   Last modified: _6/13/1997_
75392286d8edStholo
75402286d8edStholo    3. How does CVS differ from ClearCase?
75412286d8edStholo
75422286d8edStholo   ClearCase is a distributed client-server version control system.
75432286d8edStholo   ClearCase is a variant DSEE tools, formerly available on Apollo
75442286d8edStholo   platforms. The ClearCase tool set includes a few X-based interface
75452286d8edStholo   tools, a command-line interface, and C programmer API. It is currently
75462286d8edStholo   available on Sun, HP, SGI and OSF/1 platforms.
75472286d8edStholo
75482286d8edStholo   ClearCase uses a special Unix filesystem type, called "mvfs" for
75492286d8edStholo   "multi-version file system". Conceptually, mvfs adds another dimension
75502286d8edStholo   to a regular Unix filesystem. The new axis is used to store the
75512286d8edStholo   different versions of files and to provide a tree-hierarchical view of
75522286d8edStholo   a collection of objects that might be scattered across any number of
75532286d8edStholo   separate hosts on your local network.
75542286d8edStholo
75552286d8edStholo   Each user acquires a "view" into the file database by creating a
75562286d8edStholo   special mvfs mount point on their machine. Each view has a
75572286d8edStholo   "configuration spec" containing a set of selection rules that specify
75582286d8edStholo   the particular version of each file to make visible in that view. You
75592286d8edStholo   can think of a "view" as a work area in CVS, except that the files
75602286d8edStholo   don't really exist on your local disk until you modify them. This
75612286d8edStholo   technique conserves disk space because it doesn't keep private copies
75622286d8edStholo   of read-only files.
75632286d8edStholo
75642286d8edStholo   Another advantage is that a view is "transparent" in the sense that
75652286d8edStholo   all of the files in a "view" appear to be regular Unix files to other
75662286d8edStholo   tools and Unix system calls. An extended naming convention allows
75672286d8edStholo   access to particular versions of a file directly:
75682286d8edStholo   "test.cc@@/main/bugfix/3" identifies the third version of test.c on
75692286d8edStholo   the bugfix branch.
75702286d8edStholo
75712286d8edStholo   ClearCase supports both the copy-modify-merge model of CVS (by using
75722286d8edStholo   what are called "unreserved checkouts" and the checkin/checkout
75732286d8edStholo   development model with file locking. Directories are
75742286d8edStholo   version-controlled objects as well as files. A graphical merge tool is
75752286d8edStholo   provided. Like RCS, ClearCase supports branches, symbolic tags, and
75762286d8edStholo   delta compression. ASCII as well as binary files are supported, and
75772286d8edStholo   converters from RCS, SCCS, DSEE formats are also included.
75782286d8edStholo
75792286d8edStholo   A make-compatible build facility is provided that can identify common
75802286d8edStholo   object code and share it among developers. A build auditing feature
75812286d8edStholo   automatically records file dependencies by tracking every file that is
75822286d8edStholo   opened when producing a derived object, thus making explicit
75832286d8edStholo   dependency lists unnecessary. Pre- and post-event triggers are
75842286d8edStholo   available for most ClearCase operations to invoke user programs or
75852286d8edStholo   shell scripts. User-defined attributes can be assigned to any version
75862286d8edStholo   or object. Hyper-links between version controlled objects can record
75872286d8edStholo   their relationship.
75882286d8edStholo
75892286d8edStholo   For more information, contact:
75902286d8edStholo
75912286d8edStholo   Atria Software, Inc. 24 Prime Park Way Natick, MA 01760 info@atria.com
75922286d8edStholo
75932286d8edStholo   (508) 650-1193 (phone) (508) 650-1196 (fax)
75942286d8edStholo
75952286d8edStholo                                Originally contributed by Steve Turner
75962286d8edStholo                                Edited by the author of this FAQ.
75972286d8edStholo
75982286d8edStholo   Last modified: _6/13/1997_
75992286d8edStholo
76002286d8edStholo    4. How does CVS differ from TeamWare/SparcWorks?
76012286d8edStholo
76022286d8edStholo   TeamWare is a configuration management tool from Sun Microsystems, a
76032286d8edStholo   part of SparcWorks. It uses the same copy and merge model as CVS. The
76042286d8edStholo   central abstraction is a workspace, which corresponds to either a CVS
76052286d8edStholo   branch or a checked out module. TeamWare allows you to manipulate
76062286d8edStholo   workspaces directly, including moving and merging code between
76072286d8edStholo   workspaces. You can put your workspace on tape and continue to work
76082286d8edStholo   with it at home, just like you can with CVS. TeamWare is built upon
76092286d8edStholo   and compatible with SCCS.
76102286d8edStholo
76112286d8edStholo   TeamWare provides both a command line interface and a graphical
76122286d8edStholo   interface. The CodeManager tool will display the project as a tree of
76132286d8edStholo   workspaces, and allows you to manipulate them with drag and drop. The
76142286d8edStholo   other tools are VersionTool that displays and manipulates a dag with a
76152286d8edStholo   version history of a single file, CheckPoint that will create symbolic
76162286d8edStholo   tags, MakeTool, a make compatible tool with a GUI, and FileMerge which
76172286d8edStholo   will interactively merge files when needed (like emerge for emacs). If
76182286d8edStholo   you have a sun, you can try /usr/old/mergetool for an old SunView
76192286d8edStholo   version of FileMerge.
76202286d8edStholo
76212286d8edStholo   Email: sunprosig@sun.com
76222286d8edStholo
76232286d8edStholo                                Originally extracted from TeamWare
76242286d8edStholo                                Marketing literature by Per Abrahamsen.
76252286d8edStholo                                Edited by the author of this FAQ.
76262286d8edStholo
76272286d8edStholo   For more information, contact:
76282286d8edStholo
76292286d8edStholo   SunExpress, Inc. P.O. Box 4426 Bridgeton, MO 63044-9863 (800)873-7869
76302286d8edStholo
76312286d8edStholo   Last modified: _6/13/1997_
76322286d8edStholo
76332286d8edStholo    5. How does CVS differ from Aegis?
76342286d8edStholo
76352286d8edStholo   Aegis appears to be a policy-setting tool that allows you to use other
76362286d8edStholo   sub-programs (make, RCS, etc.) to implement pieces of the imposed
76372286d8edStholo   policy.
76382286d8edStholo
76392286d8edStholo   The initial document seems to say that most Unix tools are inadequate
76402286d8edStholo   for use under Aegis.
76412286d8edStholo
76422286d8edStholo   It is not really similar to CVS and requires a different mindset.
76432286d8edStholo
76442286d8edStholo   [[Need more info here.]]
76452286d8edStholo
76462286d8edStholo   Last modified: _6/13/1997_
76472286d8edStholo
76482286d8edStholo    6. How does CVS differ from Shapetools?
76492286d8edStholo
76502286d8edStholo   Shapetools includes a build mechanism (called Shape, not surprisingly)
76512286d8edStholo   that is aware of the version mechanism, and some dependency tracking.
76522286d8edStholo   It is based on a file system extension called Attributed File System,
76532286d8edStholo   which allows arbitrary-sized "attributes" to be associated with a
76542286d8edStholo   file. Files are version controlled in a manner similar to RCS.
76552286d8edStholo   Configurations are managed through the Shapefile, an extension of the
76562286d8edStholo   Makefile syntax and functionality. Shape includes version selection
76572286d8edStholo   rules to allow sophisticated selection of component versions in a
76582286d8edStholo   build.
76592286d8edStholo
76602286d8edStholo   Shapetools' concurrency control is pessimistic, in contrast to that of
76612286d8edStholo   CVS. Also, there's very limited support for branching and merging. It
76622286d8edStholo   has a built-in policy for transitioning a system from initial
76632286d8edStholo   development to production.
76642286d8edStholo
76652286d8edStholo                                Contributed by Don Dwiggins
76662286d8edStholo
76672286d8edStholo   Last modified: _6/13/1997_
76682286d8edStholo
76692286d8edStholo    7. How does CVS differ from TeamNet?
76702286d8edStholo
76712286d8edStholo   TeamNet is a configuration management tool from TeamOne.
76722286d8edStholo
76732286d8edStholo   For more information, contact:
76742286d8edStholo
76752286d8edStholo   TeamOne 710 Lakeway Drive, Ste 100 Sunnyvale, CA 94086 (800) 442-6650
76762286d8edStholo
76772286d8edStholo                                Contributed by Steve Turner
76782286d8edStholo
76792286d8edStholo   Last modified: _6/13/1997_
76802286d8edStholo
76812286d8edStholo    8. How does CVS differ from ProFrame?
76822286d8edStholo
76832286d8edStholo   ProFrame is a new system integration framework from IBM. ProFrame is
76842286d8edStholo   compliant with the CFI (CAD Framework Initiative) industry standards,
76852286d8edStholo   including the Scheme extension language.
76862286d8edStholo
76872286d8edStholo   ProFrame consists of three major components: (1) the Process Manager
76882286d8edStholo   that automates your local design methodology (2) the Design Data
76892286d8edStholo   Manager handles configuration management, and (3) Inter-tool
76902286d8edStholo   Communication to provide a communication path among tools running on
76912286d8edStholo   heterogeneous servers.
76922286d8edStholo
76932286d8edStholo   The Design Data Manager(2) is probably the appropriate component to
76942286d8edStholo   compare to CVS. The Design Data Manager provides version control with
76952286d8edStholo   checkin/checkout capability, configuration management, and data
76962286d8edStholo   dependency tracking. A graphical data selection interface is provided.
76972286d8edStholo   Using this interface, you may create and manipulate objects and
76982286d8edStholo   hierarchy structures, view the revision history for an object, and
76992286d8edStholo   view and assign attributes to a design object.
77002286d8edStholo
77012286d8edStholo   The ProFrame server currently runs only on RS6000, but clients may be
77022286d8edStholo   a wide variety of Unix platforms. Contact IBM for the latest platform
77032286d8edStholo   information.
77042286d8edStholo
77052286d8edStholo   For more information, contact:
77062286d8edStholo
77072286d8edStholo   IBM EDA Marketing and Sales P.O. Box 950, M/S P121 Poughkeepsie, NY
77082286d8edStholo   12602 (800) 332-0066
77092286d8edStholo
77102286d8edStholo                                Contributed by Steve Turner
77112286d8edStholo                        [extracted from the ProFrame 1.1.0 datasheet]
77122286d8edStholo
77132286d8edStholo   Last modified: _6/13/1997_
77142286d8edStholo
77152286d8edStholo    9. How does CVS differ from CaseWare/CM?
77162286d8edStholo
77172286d8edStholo   CaseWare/CM is a software configuration management product from
77182286d8edStholo   CaseWare, Inc. CaseWare/CM may be customized to support a wide variety
77192286d8edStholo   of methodologies, including various phases of the software lifecycle,
77202286d8edStholo   and different access rights for users.
77212286d8edStholo
77222286d8edStholo   A GUI is provided to view version histories and configurations. A
77232286d8edStholo   merge tools is also included. CaseWare supports type-specific
77242286d8edStholo   lifecycles, which allows different types of files to move through
77252286d8edStholo   different lifecycles. Also provided is a build facility to support
77262286d8edStholo   automatic dependency analysis, parallel, distributed, and remote
77272286d8edStholo   builds, and variant releases.
77282286d8edStholo
77292286d8edStholo   CaseWare/CM has been integrated with other CASE tools, including
77302286d8edStholo   FrameMaker, ALSYS Ada, CodeCenter/Object Center, HP SoftBench, and
77312286d8edStholo   Software Through Pictures. CaseWare also offers CaseWare/PT, a problem
77322286d8edStholo   tracking system to integrate change requests with configuration
77332286d8edStholo   management.
77342286d8edStholo
77352286d8edStholo   Multiple vendors and operating systems are supported.
77362286d8edStholo
77372286d8edStholo   For more information, contact:
77382286d8edStholo
77392286d8edStholo   CaseWare, Inc. 108 Pacifica, 2nd Floor Irvine, CA 92718-3332 (714)
77402286d8edStholo   453-2200 (phone) (714) 453-2276 (fax)
77412286d8edStholo
77422286d8edStholo                                Contributed by Steve Turner
77432286d8edStholo                        [extracted from the CaseWare/CM data sheet]
77442286d8edStholo
77452286d8edStholo   Last modified: _6/13/1997_
77462286d8edStholo
7747c71bc7e2Stholo    10. How does CVS differ from SABLIME?
77482286d8edStholo
77492286d8edStholo   Produced by AT&T. Sablime uses SCCS as the underlying source code
77502286d8edStholo   control system. It uses some other control system (called sbcs I
77512286d8edStholo   think) for managing binary files. It uses lock, edit, comit, unlock
77522286d8edStholo   mechanism. It has a motif based GUI and curses based GUI (that works
77532286d8edStholo   only with ksh, not tcsh, or bash) to do more common tasks. It has even
77542286d8edStholo   a command line interface.
77552286d8edStholo
77562286d8edStholo   Changing source happens as a result of MR. A testing person or a
77572286d8edStholo   developer assigns an MR (modification request) to a group of people.
77582286d8edStholo   They are allowed to take out files under that MR and change them and
77592286d8edStholo   check them back in. You can set up dependencies between and MR and do
77602286d8edStholo   release management to say "I want the sources to include these MRs"
77612286d8edStholo   etc. It is a reasonably good maintanance system. It is bit heavy
77622286d8edStholo   weight though, and the interface is not too polished and does not work
77632286d8edStholo   on windows (though that may have changed). rama@savera.com
77642286d8edStholo
7765c71bc7e2Stholo   Last modified: _7/30/1998_
77662286d8edStholo
77672286d8edStholo    11. How does CVS differ from PVCS?
77682286d8edStholo
77692286d8edStholo   PVCS works on single files like RCS and SCCS, CVS works on complete
77702286d8edStholo   subsystems. PVCS has a make utility (called a configuration builder),
77712286d8edStholo   CVS does not. PVCS has a GUI interface for Unix, DOS, OS/2, and MS
77722286d8edStholo   Windows.
77732286d8edStholo
77742286d8edStholo                Intersolv, Inc.
77752286d8edStholo                1700 NW 167th Place
77762286d8edStholo                OR 97006
77772286d8edStholo
77782286d8edStholo                                Contributed by Per Abrahamsen
77792286d8edStholo                        [Extracted from Intersolv Marketing literature.]
77802286d8edStholo
77812286d8edStholo   Last modified: _6/13/1997_
77822286d8edStholo
77832286d8edStholo    12. How does CVS differ from CMVC?
77842286d8edStholo
77852286d8edStholo   CMVC is an IBM Configuration Management and Version Control system.
77862286d8edStholo   (Though I'm not certain that's the right acronym expansion.) It runs
77872286d8edStholo   on Suns, HPs, RS6000s, OS/2 and Windows.
77882286d8edStholo
77892286d8edStholo   Other than revision control, it apparently has features to manage
77902286d8edStholo   releases, bug tracking and the connection between alterations and
77912286d8edStholo   reported bugs and feature requests. It is a client/server system,
77922286d8edStholo   based on a choice of commercial Relational Database systems, and it
77932286d8edStholo   provides a Motif or command line interface.
77942286d8edStholo
77952286d8edStholo   Unlike CVS, it uses a strict locking protocol to serialize source code
77962286d8edStholo   alterations.
77972286d8edStholo
77982286d8edStholo   Last modified: _6/13/1997_
77992286d8edStholo
78002286d8edStholo  Category: /What_is_CVS_/What_do_you_mean_by_/
78012286d8edStholo
78022286d8edStholo   " + What do you mean by . . .? (Definitions)"
78032286d8edStholo
78042286d8edStholo    1. What are "The Repository", "$CVSROOT" and "CVSROOT"?
78052286d8edStholo
78062286d8edStholo   The Repository is a directory tree containing the CVS administrative
78072286d8edStholo   files and all the RCS files that constitute "imported" or "committed"
78082286d8edStholo   work. The Repository is kept in a shared area, separate from the
78092286d8edStholo   working areas of all developers.
78102286d8edStholo
78112286d8edStholo   Users of CVS must set their "CVSROOT" environment variable to the
78122286d8edStholo   absolute pathname of the head of the Repository. Most command line
78132286d8edStholo   interpreters replace an instance of "$CVSROOT" with the value of the
78142286d8edStholo   "CVSROOT" environment variable. By analogy, in this document
78152286d8edStholo   "$CVSROOT" is used as shorthand for "the absolute pathname of the
78162286d8edStholo   directory at the head of the Repository".
78172286d8edStholo
78182286d8edStholo   One of the things found in $CVSROOT is a directory named CVSROOT. It
78192286d8edStholo   contains all the "state", the administrative files, that CVS needs
78202286d8edStholo   during execution. The "modules", "history", "commitinfo", "loginfo"
78212286d8edStholo   and other files can be found there. See 4B.2 for more information
78222286d8edStholo   about CVSROOT files.
78232286d8edStholo
78242286d8edStholo   Last modified: _6/13/1997_
78252286d8edStholo
78262286d8edStholo    2. What is an RCS file?
78272286d8edStholo
78282286d8edStholo   An RCS file is a text file containing the source text and the revision
78292286d8edStholo   history for all committed revisions of a source file. It is stored
78302286d8edStholo   separately from the working files, in a directory hierarchy, called
78312286d8edStholo   the Repository.
78322286d8edStholo
78332286d8edStholo   RCS is the "Revision Control System" that CVS uses to manage
78342286d8edStholo   individual files. RCS file names normally end in ",v", but that can be
78352286d8edStholo   altered (via the RCS -x option) to conform to file naming standards on
78362286d8edStholo   platforms with unusual filename limitations.
78372286d8edStholo
78382286d8edStholo   Last modified: _6/13/1997_
78392286d8edStholo
78402286d8edStholo    3. What is a working file?
78412286d8edStholo
78422286d8edStholo   A working file is a disk file containing a checked-out copy of a
78432286d8edStholo   source file that earlier had been placed under CVS. If the working
78442286d8edStholo   file has been edited, the changes since the last committed revision
78452286d8edStholo   are invisible to other users of CVS.
78462286d8edStholo
78472286d8edStholo   Last modified: _6/13/1997_
78482286d8edStholo
78492286d8edStholo    4. What is a working directory (or working area)?
78502286d8edStholo
78512286d8edStholo   A working directory is the place where you work and the place from
78522286d8edStholo   which you "commit" files.
78532286d8edStholo
78542286d8edStholo   The "checkout" command creates a tree of working directories, filling
78552286d8edStholo   them with working files. Each working directory contains a
78562286d8edStholo   sub-directory named ./CVS containing three administrative files, which
78572286d8edStholo   are created by "checkout" and are always present:
78582286d8edStholo
78592286d8edStholo   ./CVS/Entries
78602286d8edStholo                contains information about working files.
78612286d8edStholo
78622286d8edStholo   ./CVS/Repository
78632286d8edStholo                contains the location of the directory within the
78642286d8edStholo                Repository that was used to create the working directory.
78652286d8edStholo
78662286d8edStholo   ./CVS/Root
78672286d8edStholo                contains the value of $CVSROOT at the time you created
78682286d8edStholo                the working directory.
78692286d8edStholo
78702286d8edStholo   Other files may also appear in ./CVS depending on the state of your
78712286d8edStholo   working directory:
78722286d8edStholo
78732286d8edStholo   ./CVS/Tag
78742286d8edStholo                contains the "sticky tag" associated with the whole
78752286d8edStholo                directory.  See 3A.2 for its main purpose.
78762286d8edStholo                [Created by "checkout" or "update" when using "-r <tag>".]
78772286d8edStholo                [Deleted by "checkout" or "update" when using '-A'.]
78782286d8edStholo
78792286d8edStholo   ./CVS/Entries.Static
78802286d8edStholo                contains a fixed list of working files.  If this file
78812286d8edStholo                exists, an "update" doesn't automatically bring newly
78822286d8edStholo                added files out of the Repository.
78832286d8edStholo                [Created and maintained by hand.]
78842286d8edStholo
78852286d8edStholo   ./CVS/Checkin.prog
78862286d8edStholo                contains a program to run whenever anything in the
78872286d8edStholo                working directory is committed.
78882286d8edStholo                [Created by checkout if "-i <prog>" appears in the
78892286d8edStholo                 modules file for the checked-out module.]
78902286d8edStholo
78912286d8edStholo   ./CVS/Update.prog
78922286d8edStholo                contains a program to run whenever anything in the
78932286d8edStholo                working directory is updated.
78942286d8edStholo                [Created by checkout if "-u <prog>" appears in the
78952286d8edStholo                 modules file for the checked-out module.]
78962286d8edStholo
78972286d8edStholo   ./CVS/<file>,p ./CVS/<file>,t
78982286d8edStholo                contain (possibly zero-length) state information about an
78992286d8edStholo                "add" that has not been committed.
79002286d8edStholo                [Created by "add".]
79012286d8edStholo                [Deleted by "commit" or "remove".]
79022286d8edStholo
79032286d8edStholo   Last modified: _6/13/1997_
79042286d8edStholo
79052286d8edStholo    5. What is "checking out"?
79062286d8edStholo
79072286d8edStholo   "Checking out" is the act of using the "checkout" command to copy a
79082286d8edStholo   particular revision from a set of RCS files into your working area.
79092286d8edStholo   You normally execute "checkout" only once per working directory (or
79102286d8edStholo   tree of working directories), maintaining them thereafter with the
79112286d8edStholo   "update" command.
79122286d8edStholo
79132286d8edStholo   See section 3C on the "checkout" command.
79142286d8edStholo
79152286d8edStholo   Last modified: _6/13/1997_
79162286d8edStholo
79172286d8edStholo    6. What is a revision?
79182286d8edStholo
79192286d8edStholo   A "revision" is a version of a file that was "committed" ("checked
79202286d8edStholo   in", in RCS terms) some time in the past. CVS (and RCS) can retrieve
79212286d8edStholo   any file that was committed by specifying its revision number or its
79222286d8edStholo   "tag" ("symbolic name", in RCS terms).
79232286d8edStholo
79242286d8edStholo   In CVS, a "tag" is more useful than a revision number. It usually
79252286d8edStholo   marks a milestone in development represented by different revision
79262286d8edStholo   numbers in different files, all available as one "tagged" collection.
79272286d8edStholo
79282286d8edStholo   Sometimes the word "revision" is used as shorthand for "the file you
79292286d8edStholo   get if you retrieve (via "checkout" or "update") the given revision
79302286d8edStholo   from the Repository."
79312286d8edStholo
79322286d8edStholo   Last modified: _6/13/1997_
79332286d8edStholo
79342286d8edStholo    7. What is a "Tag"?
79352286d8edStholo
79362286d8edStholo   A "Tag" is a symbolic name, a synonym or alias for a particular
79372286d8edStholo   revision number in a file. The CVS "tag" command places the same "Tag"
79382286d8edStholo   on all files in a working directory, allowing you to retrieve those
79392286d8edStholo   files by name in the future.
79402286d8edStholo
79412286d8edStholo   The CVS "Tag" is implemented by applying RCS "symbols" to each
79422286d8edStholo   individual file. The Tags on a file (or collection of files) may be
79432286d8edStholo   displayed using the "log" command.
79442286d8edStholo
79452286d8edStholo   Last modified: _6/13/1997_
79462286d8edStholo
79472286d8edStholo    8. What are "HEAD" and "BASE"?
79482286d8edStholo
79492286d8edStholo   HEAD and BASE are built-in tags that don't show up in the "log" or
79502286d8edStholo   "status" listings. They are interpreted directly by CVS.
79512286d8edStholo
79522286d8edStholo   "HEAD" refers to the latest revision on the current branch in the
79532286d8edStholo   Repository. The current branch is either the main line of development,
79542286d8edStholo   or a branch in development created by placing a branch tag on a set of
79552286d8edStholo   files and checking out that branch.
79562286d8edStholo
79572286d8edStholo   "BASE" refers to the revision on the current branch you last checked
79582286d8edStholo   out, updated, or committed. If you have not modified your working
79592286d8edStholo   file, "BASE" is the committed revision matching it.
79602286d8edStholo
79612286d8edStholo   Most of the time BASE and HEAD refer to the same revision. They can
79622286d8edStholo   become different in two ways:
79632286d8edStholo
79642286d8edStholo     Someone else changed HEAD by committing a new revision of your file
79652286d8edStholo   to the Repository. You can pull BASE up to equal HEAD by executing
79662286d8edStholo   "update".
79672286d8edStholo
79682286d8edStholo     You moved BASE backward by executing "checkout" or "update" with the
79692286d8edStholo   option "-r <rev/tag>" or "-D <date>". CVS records a sticky tag and
79702286d8edStholo   moves your files to the specified earlier revision. You can clear the
79712286d8edStholo   sticky tag and pull BASE up to equal HEAD again by executing "update
79722286d8edStholo   -A".
79732286d8edStholo
79742286d8edStholo   Last modified: _6/13/1997_
79752286d8edStholo
79762286d8edStholo    9. What is a Branch?
79772286d8edStholo
79782286d8edStholo   In general, a branch is any mechanism that allows one or more
79792286d8edStholo   developers to modify a file without affecting anyone other than those
79802286d8edStholo   working on the same branch.
79812286d8edStholo
79822286d8edStholo   There are four kinds of "branch" CVS can manage:
79832286d8edStholo
79842286d8edStholo     The Vendor Branch.
79852286d8edStholo
79862286d8edStholo   A single vendor branch is supported. The "import" command takes a
79872286d8edStholo   sequence of releases from a source code vendor (called a "vendor" even
79882286d8edStholo   if no money is involved), placing them on a special "Vendor" branch.
79892286d8edStholo   The Vendor branch is considered part of the "Main line" of
79902286d8edStholo   development, though it must be merged into locally modified files on
79912286d8edStholo   the RCS Main branch before the "import" is complete.
79922286d8edStholo
79932286d8edStholo   See Section 3H ("import").
79942286d8edStholo
79952286d8edStholo     Your Working directory.
79962286d8edStholo
79972286d8edStholo   A checked-out working directory, can be treated like a private branch.
79982286d8edStholo   No one but you can touch your files. You have complete control over
79992286d8edStholo   when you include work committed by others. However, you can't commit
80002286d8edStholo   or tag intermediate versions of your work.
80012286d8edStholo
80022286d8edStholo     A Development branch.
80032286d8edStholo
80042286d8edStholo   A group of developers can share changes among the group, without
80052286d8edStholo   affecting the Main line of development, by creating a branch. Only
80062286d8edStholo   those who have checked-out the branch see the changes committed to
80072286d8edStholo   that branch. This kind of branch is usually temporary, collapsing
80082286d8edStholo   (i.e. merge and forget) into the Main line when the project requiring
80092286d8edStholo   the branch is completed.
80102286d8edStholo
80112286d8edStholo   You can also create a private branch of this type, allowing an
80122286d8edStholo   individual to commit (and tag) intermediate revisions without changing
80132286d8edStholo   the Main line. It should be managed exactly like a Development Branch
80142286d8edStholo   -- collapsed into the Main line (or its parent branch, if that is not
80152286d8edStholo   the Main Branch) and forgotten when the work is done.
80162286d8edStholo
80172286d8edStholo     A Release branch.
80182286d8edStholo
80192286d8edStholo   At release time, a branch should be created marking what was released.
80202286d8edStholo   Later, small changes (sometimes called "patches") can be made to the
80212286d8edStholo   release without including everything else on the Main line of
80222286d8edStholo   development. You avoid forcing the customer to accept new, possibly
80232286d8edStholo   untested, features added since the release. This is also the way to
80242286d8edStholo   correct bugs found during testing in an environment where other
80252286d8edStholo   developers have continued to commit to the Main line while you are
80262286d8edStholo   testing and packaging the release.
80272286d8edStholo
80282286d8edStholo   Although the internal format of this type of branch (branch tag and
80292286d8edStholo   RCS branches) is the same as in a development branch, its purpose and
80302286d8edStholo   the way it is managed are different. The major difference is that a
80312286d8edStholo   Release branch is normally Permanent. Once you let a release out the
80322286d8edStholo   door to customers, or to the next stage of whatever process you are
80332286d8edStholo   using, you should retain forever the branch marking that release.
80342286d8edStholo
80352286d8edStholo   Since the branch is permanent, you cannot incorporate the branch fixes
80362286d8edStholo   into the Main line by "collapsing" (merging and forgetting) the
80372286d8edStholo   release branch. For large changes to many files on the release branch,
80382286d8edStholo   you will have to perform a branch merge using "update -j <rev> -j
80392286d8edStholo   <rev>". (See 4C.7)
80402286d8edStholo
80412286d8edStholo   The most common way to merge small changes back into Main line
80422286d8edStholo   development is to make the change in both places simultaneously. This
80432286d8edStholo   is faster than trying to perform a selective merge.
80442286d8edStholo
80452286d8edStholo   See 1D.12 (merges) and Section 4C, on Branching for more info.
80462286d8edStholo
80472286d8edStholo   Last modified: _6/13/1997_
80482286d8edStholo
80492286d8edStholo    10. What is "the trunk"?
80502286d8edStholo
80512286d8edStholo   Another name for the RCS Main Branch. The RCS Main Branch is related,
80522286d8edStholo   but not equivalent, to both the CVS Main branch and what developers
80532286d8edStholo   consider to be the Main line of development. See 3H.3 and Section 4C
80542286d8edStholo   on Branching.
80552286d8edStholo
80562286d8edStholo   Last modified: _6/13/1997_
80572286d8edStholo
80582286d8edStholo    11. What is a module?
80592286d8edStholo
80602286d8edStholo   In essence, a module is a name you hand to the "checkout" command to
80612286d8edStholo   retrieve one or more files to work on. It was originally intended to
80622286d8edStholo   be a simple, unique name in the "modules" file attached to a directory
80632286d8edStholo   or a subset of files within a directory.
80642286d8edStholo
80652286d8edStholo   The module idea is now a somewhat slippery concept that can be defined
80662286d8edStholo   in two different ways:
80672286d8edStholo     * A module is an argument to "checkout". There are three types:
80682286d8edStholo         1. An entry in the modules file. A "module" name as described in
80692286d8edStholo            'B.' below.
80702286d8edStholo         2. A relative path to a directory or file in the Repository.
80712286d8edStholo         3. A mixed-mode string of "modulename/relative-path". Everything
80722286d8edStholo            up to the first slash ('/') is looked up as a module. The
80732286d8edStholo            relative path is appended to the directory associated with
80742286d8edStholo            the module name and the resulting path is checked out as in
80752286d8edStholo            #2 above.
80762286d8edStholo     * A module is a unique (within the file) character string in the
80772286d8edStholo       first column of the modules file. There are five types:
80782286d8edStholo         1. A name for a directory within the Repository that allows you
80792286d8edStholo            to ignore the parent directories above it.
80802286d8edStholo            Example:
80812286d8edStholo                  emacs  gnu/emacs
80822286d8edStholo         2. A name for a subset of the files within such a directory.
80832286d8edStholo            Example:
80842286d8edStholo                  ls    unix/bin Makefile ls.c
80852286d8edStholo            The 2nd through Nth strings in the above can be files,
80862286d8edStholo            directories or module substitutions. No relative paths.
80872286d8edStholo            A module substitution occurs when you use a '&module-name'
80882286d8edStholo            reference. The module-name referred to is logically
80892286d8edStholo            substituted for the '&module-name' string.
80902286d8edStholo         3. A relative pathname to a directory within the Repository
80912286d8edStholo            which, when checked out, creates an image of part of the
80922286d8edStholo            Repository structure in your current directory.
80932286d8edStholo            Example:
80942286d8edStholo            gnu/emacs -o /bin/emacs.helper gnu/emacs
80952286d8edStholo            The files checked out are exactly the same as the files
80962286d8edStholo            "checkout" would retrieve if the path weren't even in the
80972286d8edStholo            modules file. The only reason to put this kind of relative
80982286d8edStholo            pathname into the modules file is to hook one of the helper
80992286d8edStholo            functions onto it.
81002286d8edStholo         4. A relative pathname to a single file within the Repository
81012286d8edStholo            which, when checked out, creates something you probably don't
81022286d8edStholo            want: It creates a directory by the name of the file and puts
81032286d8edStholo            the file in it.
81042286d8edStholo            Example:
81052286d8edStholo            gnu/emacs/Makefile -o /bin/emacs.helper gnu/emacs Makefile
81062286d8edStholo            The file checked out is the same as what you would get if you
81072286d8edStholo            handed the relative pathname to the "checkout" command. But
81082286d8edStholo            it puts it in a strange place. The only reason to do this is
81092286d8edStholo            to hook a helper function onto a specific file name.
81102286d8edStholo         5. An alias consisting of a list of any of the above, including
81112286d8edStholo            other aliases, plus exceptions.
81122286d8edStholo            Example:
81132286d8edStholo            my_work -a emacs !emacs/tests gnu/bison unix/bin/ls.c
81142286d8edStholo            The exception "!emacs/test" above is functionally equivalent
81152286d8edStholo            to specifying "!emacs/tests" on the "checkout" command line.
81162286d8edStholo
81172286d8edStholo   Another way to look at it is that the modules file is simply another
81182286d8edStholo   way to "name" files. The hierarchical directory structure provides
81192286d8edStholo   another. You should use whatever turns out to be simplest for your
81202286d8edStholo   development group.
81212286d8edStholo
81222286d8edStholo   See 4G.2 for some specific ideas about how to use the modules file.
81232286d8edStholo
81242286d8edStholo   Last modified: _11/12/1997_
81252286d8edStholo
81262286d8edStholo    12. What does "merge" mean?
81272286d8edStholo
81282286d8edStholo   A merge is a way of combining changes made in two independent copies
81292286d8edStholo   of a common starting file. Checking out an RCS revision produces a
81302286d8edStholo   file, so for the purposes of a merge "file" and "revision" are
81312286d8edStholo   equivalent. So, we can say there are always three "files" involved in
81322286d8edStholo   a merge:
81332286d8edStholo
81342286d8edStholo     The original, starting, "base" or "branch point" file.
81352286d8edStholo
81362286d8edStholo     A copy of the base file modified in one way.
81372286d8edStholo
81382286d8edStholo     Another copy of the base file modified in a different way.
81392286d8edStholo
81402286d8edStholo   Humans aren't very good at handling three things at once, so the
81412286d8edStholo   terminology dealing with merges can become strained. One way to think
81422286d8edStholo   about it is that all merges are performed by inserting the difference
81432286d8edStholo   between a base revision and a later revision (committed by someone
81442286d8edStholo   else) into your working file. Both the "later" revision and your
81452286d8edStholo   working file are presumed to have started life as a copy of the "base"
81462286d8edStholo   revision.
81472286d8edStholo
81482286d8edStholo   In CVS, there are three main types of "merge":
81492286d8edStholo
81502286d8edStholo     The "update" command automatically merges revisions committed by
81512286d8edStholo   others into your working file. In this case, the three files involved
81522286d8edStholo   in the merge are:
81532286d8edStholo
81542286d8edStholo   Base: The revision you originally checked out. Later: A revision
81552286d8edStholo   committed onto the current branch after you checked out the Base
81562286d8edStholo   revision. Working: Your working file. The one lying in the working
81572286d8edStholo   directory containing changes you have made.
81582286d8edStholo
81592286d8edStholo     The "update -j <branch_tag> {optional files}" command merges changes
81602286d8edStholo   made on the given branch into your working files, which is presumed to
81612286d8edStholo   be on the Main line of development.
81622286d8edStholo
81632286d8edStholo   See 4C.6
81642286d8edStholo
81652286d8edStholo     The "update -j <rev> -j <rev> {optional files}" command merges the
81662286d8edStholo   difference between two specified revisions into files in your working
81672286d8edStholo   directory. The two revisions <rev> are usually on the same branch and,
81682286d8edStholo   when updating multiple files, they are most useful when they are Tag
81692286d8edStholo   names rather than numeric revisions.
81702286d8edStholo
81712286d8edStholo   See 4C.7
81722286d8edStholo
81732286d8edStholo   Last modified: _6/13/1997_
81742286d8edStholo
81752286d8edStholo  Category: /What_is_CVS_/What_is_CVS_Whats_it/
81762286d8edStholo
81772286d8edStholo   " + What is CVS? What's it for? Why CVS?"
81782286d8edStholo
81792286d8edStholo    1. What does CVS stand for? Can you describe it in one sentence?
81802286d8edStholo
81812286d8edStholo   "CVS" is an acronym for the "Concurrent Versions System".
81822286d8edStholo
81832286d8edStholo   CVS is a "Source Control" or "Revision Control" tool designed to keep
81842286d8edStholo   track of source changes made by groups of developers working on the
81852286d8edStholo   same files, allowing them to stay in sync with each other as each
81862286d8edStholo   individual chooses.
81872286d8edStholo
81882286d8edStholo   Last modified: _6/13/1997_
81892286d8edStholo
81902286d8edStholo    2. What is CVS for? What does it do for me?
81912286d8edStholo
81922286d8edStholo   CVS is used to keep track of collections of files in a shared
81932286d8edStholo   directory called "The Repository". Each collection of files can be
81942286d8edStholo   given a "module" name, which is used to "checkout" that collection.
81952286d8edStholo
81962286d8edStholo   After checkout, files can be modified (using your favorite editor),
81972286d8edStholo   "committed" back into the Repository and compared against earlier
81982286d8edStholo   revisions. Collections of files can be "tagged" with a symbolic name
81992286d8edStholo   for later retrieval.
82002286d8edStholo
82012286d8edStholo   You can add new files, remove files you no longer want, ask for
82022286d8edStholo   information about sets of files in three different ways, produce patch
82032286d8edStholo   "diffs" from a base revision and merge the committed changes of other
82042286d8edStholo   developers into your working files.
82052286d8edStholo
82062286d8edStholo   Last modified: _6/13/1997_
82072286d8edStholo
82082286d8edStholo    3. How does CVS work?
82092286d8edStholo
82102286d8edStholo   CVS saves its version-control information in RCS files stored in a
82112286d8edStholo   directory hierarchy, called the Repository, which is separate from the
82122286d8edStholo   user's working directory.
82132286d8edStholo
82142286d8edStholo   Files in the Repository are stored in a format dictated by the RCS
82152286d8edStholo   commands CVS uses to do much of its real work. RCS files are standard
82162286d8edStholo   byte-stream files with an internal format described by keywords stored
82172286d8edStholo   in the files themselves.
82182286d8edStholo
82192286d8edStholo   To begin work, you execute a "checkout" command, handing it a module
82202286d8edStholo   name or directory path (relative to the $CVSROOT variable) you want to
82212286d8edStholo   work on. CVS copies the latest revision of each file in the specified
82222286d8edStholo   module or directory out of the Repository and into a directory tree
82232286d8edStholo   created in your current directory. You may specify a particular branch
82242286d8edStholo   to work on by symbolic name if you don't want to work on the default
82252286d8edStholo   (main or trunk) branch.
82262286d8edStholo
82272286d8edStholo   You may then modify files in the new directory tree, build them into
82282286d8edStholo   output files and test the results. When you want to make your changes
82292286d8edStholo   available to other developers, you "commit" them back into the
82302286d8edStholo   Repository.
82312286d8edStholo
82322286d8edStholo   Other developers can check out the same files at the same time. To
82332286d8edStholo   merge the committed work of others into your working files you use the
82342286d8edStholo   "update" command. When your merged files build and test correctly, you
82352286d8edStholo   may commit the merged result. This method is referred to as
82362286d8edStholo   "copy-modify-merge", which does not require locks on the source files.
82372286d8edStholo
82382286d8edStholo   At any time, usually at some milestone, you can "tag" the committed
82392286d8edStholo   files, producing a symbolic name that can be handed to a future
82402286d8edStholo   "checkout" command. A special form of "tag" produces a branch in
82412286d8edStholo   development, as usually happens at "release" time.
82422286d8edStholo
82432286d8edStholo   When you no longer plan to modify or refer to your local copy of the
82442286d8edStholo   files, they can be removed.
82452286d8edStholo
82462286d8edStholo   Last modified: _6/13/1997_
82472286d8edStholo
82482286d8edStholo    4. What is CVS useful for?
82492286d8edStholo
82502286d8edStholo   CVS is intended to handle source control for files in three major
82512286d8edStholo   situations:
82522286d8edStholo
82532286d8edStholo     Multiple developers working on the same files.
82542286d8edStholo
82552286d8edStholo   The major advantage of using CVS over the simpler tools like RCS or
82562286d8edStholo   SCCS is that it allows multiple developers to work on the same sources
82572286d8edStholo   at the same time.
82582286d8edStholo
82592286d8edStholo   The shared Repository provides a rendezvous for committed sources that
82602286d8edStholo   allows developers a fair amount of flexibility in how often to publish
82612286d8edStholo   (via the "commit" command) changes or include work committed by others
82622286d8edStholo   (via the "update" command).
82632286d8edStholo
82642286d8edStholo     Tracking a stream of releases from a source vendor.
82652286d8edStholo
82662286d8edStholo   If you are making changes to sources distributed by someone else, the
82672286d8edStholo   CVS feature, called the Vendor Branch, allows you to combine local
82682286d8edStholo   modifications with repeated vendor releases.
82692286d8edStholo
82702286d8edStholo   I have found this most useful when dealing with sources from three
82712286d8edStholo   major classes of source vendor:
82722286d8edStholo
82732286d8edStholo     Large companies who send you tapes full of the latest release (e.g.
82742286d8edStholo   Unix OS vendors, database companies).
82752286d8edStholo
82762286d8edStholo     Public Domain software which *always* requires work.
82772286d8edStholo
82782286d8edStholo     Pseudo-Public sources which may require work. (e.g. GNU programs, X,
82792286d8edStholo   CVS itself, etc.)
82802286d8edStholo
82812286d8edStholo     Branching development.
82822286d8edStholo
82832286d8edStholo   Aside from the "Vendor Branch", there are three kinds of "branches in
82842286d8edStholo   development" that CVS can support:
82852286d8edStholo
82862286d8edStholo     Your working directory can be treated as a private branch.
82872286d8edStholo
82882286d8edStholo     A Development branch can be shared by one or more developers.
82892286d8edStholo
82902286d8edStholo     At release time, a branch is usually created for bug fixes.
82912286d8edStholo
82922286d8edStholo   (See 1D.9 and Section 4C for more info on branches.)
82932286d8edStholo
82942286d8edStholo   CVS's branch support is a bit primitive, but it was designed to allow
82952286d8edStholo   you to create branches, work on them for while and merge them back
82962286d8edStholo   into the main line of development. You should also be able to merge
82972286d8edStholo   work performed on the main branch into the branch you are working on.
82982286d8edStholo   Arbitrary sharing and merging between branches is not currently
82992286d8edStholo   supported.
83002286d8edStholo
83012286d8edStholo   Last modified: _6/13/1997_
83022286d8edStholo
83032286d8edStholo    5. What is CVS *not* useful for?
83042286d8edStholo
83052286d8edStholo   CVS is not a build system.
83062286d8edStholo
83072286d8edStholo   Though the structure of your Repository and modules file interact with
83082286d8edStholo   your build system (e.g. a tree of Makefiles), they are essentially
83092286d8edStholo   independent.
83102286d8edStholo
83112286d8edStholo   CVS does not dictate how you build anything. It merely stores files
83122286d8edStholo   for retrieval in a tree structure you devise.
83132286d8edStholo
83142286d8edStholo   CVS does not dictate how to use disk space in the checked out working
83152286d8edStholo   directories. If you require your Makefiles or build procedures to know
83162286d8edStholo   the relative positions of everything else, you wind up requiring the
83172286d8edStholo   entire Repository to be checked out. That's simply bad planning.
83182286d8edStholo
83192286d8edStholo   If you modularize your work, and construct a build system that will
83202286d8edStholo   share files (via links, mounts, VPATH in Makefiles, etc.), you can
83212286d8edStholo   arrange your disk usage however you like.
83222286d8edStholo
83232286d8edStholo   But you have to remember that *any* such system is a lot of work to
83242286d8edStholo   construct and maintain. CVS does not address the issues involved. You
83252286d8edStholo   must use your brain and a collection of other tools to provide a build
83262286d8edStholo   scheme to match your plans.
83272286d8edStholo
83282286d8edStholo   Of course, you should use CVS to maintain the tools created to support
83292286d8edStholo   such a build system (scripts, Makefiles, etc).
83302286d8edStholo
83312286d8edStholo   CVS is not a substitute for management.
83322286d8edStholo
83332286d8edStholo   You and your project leaders are expected to plan what you are doing.
83342286d8edStholo   Everyone involved must be aware of schedules, merge points, branch
83352286d8edStholo   names, release dates and the range of procedures needed to build
83362286d8edStholo   products. (If you produce it and someone else uses it, it is a
83372286d8edStholo   product.) CVS can't cover for a failure to manage your project.
83382286d8edStholo
83392286d8edStholo   CVS is an instrument for making sources dance to your tune. But you
83402286d8edStholo   are the piper and the composer. No instrument plays itself or writes
83412286d8edStholo   its own music.
83422286d8edStholo
83432286d8edStholo   CVS is not a substitute for developer communication.
83442286d8edStholo
83452286d8edStholo   When faced with conflicts within a single file, most developers manage
83462286d8edStholo   to resolve them without too much effort. But a more general definition
83472286d8edStholo   of "conflict" includes problems too difficult to solve without
83482286d8edStholo   communication between developers.
83492286d8edStholo
83502286d8edStholo   CVS cannot determine when simultaneous changes within a single file,
83512286d8edStholo   or across a whole collection of files, will logically conflict with
83522286d8edStholo   one another. Its concept of a "conflict" is purely textual, arising
83532286d8edStholo   when two changes to the same base file are near enough to spook the
83542286d8edStholo   merge command into dropping conflict markers into the merged file.
83552286d8edStholo
83562286d8edStholo   CVS is not capable of figuring out distributed conflicts in program
83572286d8edStholo   logic. For example, if you change the arguments to function X defined
83582286d8edStholo   in file A and, at the same time, edit file B, adding new calls to
83592286d8edStholo   function X using the old arguments. You are outside the realm of CVS's
83602286d8edStholo   competence.
83612286d8edStholo
83622286d8edStholo   Acquire the habit of reading specs and talking to your peers.
83632286d8edStholo
83642286d8edStholo   CVS is not a configuration management system.
83652286d8edStholo
83662286d8edStholo   CVS is a source control system. The phrase "configuration management"
83672286d8edStholo   is a marketing term, not an industry-recognized set of functions.
83682286d8edStholo
83692286d8edStholo   A true "configuration management system" would contain elements of the
83702286d8edStholo   following:
83712286d8edStholo
83722286d8edStholo                * Source control.
83732286d8edStholo                * Dependency tracking.
83742286d8edStholo                * Build systems (i.e. What to build and how to find
83752286d8edStholo                  things during a build.  What is shared?  What is local?)
83762286d8edStholo                * Bug tracking.
83772286d8edStholo                * Automated Testing procedures.
83782286d8edStholo                * Release Engineering documentation and procedures.
83792286d8edStholo                * Tape Construction.
83802286d8edStholo                * Customer Installation.
83812286d8edStholo                * A way for users to run different versions of the same
83822286d8edStholo                  software on the same host at the same time.
83832286d8edStholo
83842286d8edStholo   CVS provides only the first.
83852286d8edStholo
83862286d8edStholo   Last modified: _6/13/1997_
83872286d8edStholo
83882286d8edStholo  Category: /What_is_CVS_/Where_do_I_find_CVS_/
83892286d8edStholo
83902286d8edStholo   " + Where do I find CVS? Where can I find Help?"
83912286d8edStholo
83922286d8edStholo    1. How do I get more information about CVS?
83932286d8edStholo
83942286d8edStholo     The first thing I would do is to read the Info file that comes with
83952286d8edStholo   the CVS sources under "doc". You can format and read the cvs.texinfo
83962286d8edStholo   file in two ways: 1. Use TeX to format it and a "dvips" command to
83972286d8edStholo   print it and 2. Install the cvs.info files that are created by the
83982286d8edStholo   Makefile and read them online using the Emacs "info-mode" or a
83992286d8edStholo   stand-alone "info" reader.
84002286d8edStholo
84012286d8edStholo     Then I'd run "cvsinit" to set up a Repository and read the man page
84022286d8edStholo   while trying out the commands.
84032286d8edStholo
84042286d8edStholo   Type "cvs -H" for general help or "cvs -H command" for
84052286d8edStholo   command-specific help.
84062286d8edStholo
84072286d8edStholo     For background, you can read the original CVS paper (in the source
84082286d8edStholo   tree, under "doc"). It describes the purpose of CVS and some of how it
84092286d8edStholo   was designed. Note that the emphasis of the document (especially on
84102286d8edStholo   multiple vendors providing the same sources) is somewhat out of date.
84112286d8edStholo
84122286d8edStholo     For more detailed information about "internals", read the man pages
84132286d8edStholo   for RCS. If you are a programmer, you can also read the source code to
84142286d8edStholo   CVS.
84152286d8edStholo
84162286d8edStholo     Other information and tutorials may be available in the "doc"
84172286d8edStholo   directory of the FTP archive described below.
84182286d8edStholo
84192286d8edStholo     For current information, and a fair amount of detail, join the
84202286d8edStholo   info-cvs mailing list described below.
84212286d8edStholo
84222286d8edStholo   Last modified: _6/13/1997_
84232286d8edStholo
84242286d8edStholo    2. Is there an archive of CVS material?
84252286d8edStholo
84262286d8edStholo   An anonymous FTP area has been set up. It contains many of the CVS
84272286d8edStholo   files you might want, including extra documentation, patches and a
84282286d8edStholo   copy of the latest release.
84292286d8edStholo
84302286d8edStholo                ftp ftp.delos.com
84312286d8edStholo                >>> User:       anonymous
8432c71bc7e2Stholo                >>> Passwd:
84332286d8edStholo                cd /pub/cvs
84342286d8edStholo                get README
84352286d8edStholo                get Index
84362286d8edStholo
84372286d8edStholo   The README has more (and more up-to-date) information. The Index
84382286d8edStholo   contains a terse list of what is in the archive.
84392286d8edStholo
84402286d8edStholo   A WWW home page is also available at http://www.delos.com/cvs.
84412286d8edStholo
8442c71bc7e2Stholo                          This Didn't Exist 6/23/1998
8443c71bc7e2Stholo
8444c71bc7e2Stholo   Last modified: _6/24/1998_
84452286d8edStholo
84462286d8edStholo    3. How do I get files out of the archive if I don't have FTP?
84472286d8edStholo
84482286d8edStholo   Use one of the FTP<->Email servers. These are the ones I've been told
84492286d8edStholo   about:
84502286d8edStholo
84512286d8edStholo     FTPMAIL service is available from the same host as the FTP server
84522286d8edStholo   described above. Send mail to "ftpmail@delos.com" containing "help" in
84532286d8edStholo   the body of the message. For example, on most Unix systems, you can
84542286d8edStholo   type:
84552286d8edStholo
84562286d8edStholo   echo help | Mail ftpmail@delos.com
84572286d8edStholo
84582286d8edStholo   The FTPMAIL server will respond with a document describing how to use
84592286d8edStholo   the server. If the "Mail" command doesn't exist on your system, try
84602286d8edStholo   "mailx", "/usr/ucb/mail" or "/bin/mail".
84612286d8edStholo
84622286d8edStholo     If you are on BITNET, use Princeton's BITFTP server. Type
84632286d8edStholo
84642286d8edStholo   echo 'send help' | Mail bitftp@pucc.princeton.edu
84652286d8edStholo
84662286d8edStholo   (It is likely that only BITNET addresses can use this one.)
84672286d8edStholo
84682286d8edStholo     Other possibilities I've heard of from the net: (Try the one closest
84692286d8edStholo   to you.)
84702286d8edStholo
84712286d8edStholo   ftpmail@decwrl.dec.com ftpmail@sunsite.unc.edu ftpmail@cs.arizona.edu
84722286d8edStholo   ftpmail@cs.uow.edu.au ftpmail@doc.ic.ac.uk
84732286d8edStholo
84742286d8edStholo   Last modified: _6/13/1997_
84752286d8edStholo
84762286d8edStholo    4. How do I get a copy of the latest version of CVS?
84772286d8edStholo
84782286d8edStholo   The latest released version of CVS and all the programs it depends on
84792286d8edStholo   should be available through anonymous FTP on any FSF archive. The main
84802286d8edStholo   FSF archive is at "prep.ai.mit.edu". There are mirrors of the FSF
84812286d8edStholo   archive on UUNET and other large Internet sites.
84822286d8edStholo
84832286d8edStholo                Program(s)      Suggested revision
84842286d8edStholo                -----------     -----------------------
84852286d8edStholo                CVS             1.5
84862286d8edStholo                RCS             5.7 (latest version available today)
84872286d8edStholo                GNU diff        2.7 (or later) [contained in diffutils-2.7]
84882286d8edStholo                GDBM            1.5 (or later) [optional]
84892286d8edStholo
84902286d8edStholo   The GNU version of diff is suggested by both the RCS and CVS
84912286d8edStholo   configuration instructions because it works better than the standard
84922286d8edStholo   version.
84932286d8edStholo
84942286d8edStholo   It is a good idea not to accept the versions of CVS, RCS or diff you
84952286d8edStholo   find lying on your system unless you have checked out their
84962286d8edStholo   provenance. Using inconsistent collections of tools can cause you more
84972286d8edStholo   trouble than you can probably afford.
84982286d8edStholo
84992286d8edStholo   The FTP archive mentioned above should contain the latest official
85002286d8edStholo   release of CVS, some official and unofficial patches and possibly
85012286d8edStholo   complete patched versions of CVS in use somewhere.
85022286d8edStholo
85032286d8edStholo   Last modified: _6/13/1997_
85042286d8edStholo
85052286d8edStholo    5. Is there a mailing list devoted to CVS? How do I find it?
85062286d8edStholo
85072286d8edStholo   An Internet mailing list named "info-cvs" grew out of the private
85082286d8edStholo   mailing list used by the CVS 1.3 alpha testers in early 1992.
85092286d8edStholo   Throughout 1994, the list received an average of 100 messages per
85102286d8edStholo   month.
85112286d8edStholo
85122286d8edStholo   You can add yourself to the mailing list by sending an Email message
85132286d8edStholo   to:
85142286d8edStholo
85152286d8edStholo                info-cvs-request@prep.ai.mit.edu
85162286d8edStholo
85172286d8edStholo   (Don't forget the "-request" or you'll send a message to the whole
85182286d8edStholo   list, some of whom are capable of remote execution.)
85192286d8edStholo
85202286d8edStholo   Mail to the whole list should be sent to:
85212286d8edStholo
85222286d8edStholo                info-cvs@prep.ai.mit.edu
85232286d8edStholo
85242286d8edStholo   An archive of the mailing list is maintained in the FTP archive
85252286d8edStholo   mentioned above.
85262286d8edStholo
85272286d8edStholo   Last modified: _6/13/1997_
85282286d8edStholo
85292286d8edStholo    6. What happened to the CVS Usenet newsgroup I heard about?
85302286d8edStholo
85312286d8edStholo
85322286d8edStholo        A Usenet newsgroup named "gnu.cvs.info" was announced in April
85332286d8edStholo        1993, with an expected creation date of August, 1993.  However,
85342286d8edStholo        nothing came of this.
85352286d8edStholo
85362286d8edStholo        If you want to discuss CVS on usenet, the correct group is
85372286d8edStholo        comp.software.config-mgmt (which also covers other configuration
85382286d8edStholo        management systems).  Someday it might be possible to create a
85392286d8edStholo        comp.software.config-mgmt.cvs, but only if there is sufficient
85402286d8edStholo        CVS traffic on comp.software.config-mgmt.
85412286d8edStholo
85422286d8edStholo        kingdon@cyclic.com
85432286d8edStholo
85442286d8edStholo   Last modified: _9/6/1997_
85452286d8edStholo     _________________________________________________________________
85462286d8edStholo
85472286d8edStholo   [Add an answer to this category]
85482286d8edStholo
85492286d8edStholo   [Category /]
85502286d8edStholo     _________________________________________________________________
85512286d8edStholo
8552c71bc7e2Stholo   _Search the FAQ-O-Matic:_ ____________________ Search
85532286d8edStholo   [matching all words]
8554c71bc7e2Stholo   Or look for questions modified in the last: [7.] Days
85552286d8edStholo     _________________________________________________________________
85562286d8edStholo
85572286d8edStholo   The FAQ-O-Matic lives at http://gille.loria.fr:7000/cgi-bin/faqomatic.
85582286d8edStholo   The code was written by Jon Howell, and the content by folks from all
85592286d8edStholo   over the web.
8560*e77048c1Stholo     _________________________________________________________________
8561