<?xml version="1.0"?>
<?xml-stylesheet href="docbook.css" type="text/css"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
           "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
[
 <!ENTITY ci1manpage SYSTEM "ci.1.xml">
 <!ENTITY appendixgfdl SYSTEM "fdl.xml">
 <!ENTITY gnu "<acronym>GNU</acronym>">
 <!ENTITY gpl "<acronym>GPL</acronym>">
 <!ENTITY rcs "<acronym>RCS</acronym>">
 <!ENTITY sccs "<acronym>SCCS</acronym>">
 <!ENTITY cssc "<acronym>CSSC</acronym>">
 <!ENTITY cvs "<acronym>CVS</acronym>">
 <!ENTITY wft "<personname><firstname>Walter</firstname> <othername>F.</othername> <surname>Tichy</surname></personname><indexterm><primary>Tichy, Walter F.</primary></indexterm>">
 <!ENTITY empty "">
]>
<book id="rcs" status="draft"
      fpi="-//FSF www.fsf.org//DOCUMENT GNU RCS Manual//EN//DocBook">
 <bookinfo>
  <title>A Manual to the &gnu; Revision Control System (&rcs;)</title>
  <subtitle>A User Guide for Gaining the Benefits of Version Control</subtitle>
  <titleabbrev>rcs</titleabbrev>
  <subjectset scheme="freesoftwarefoundation">
  <!-- This is not accurate, simply a place-holder. -->
   <subject>
    <subjectterm>Version Control</subjectterm>
   </subject>
  </subjectset>
  <subjectset scheme="libraryofcongress">
   <!-- This is not accurate, simply a place-holder. -->
   <subject>
    <subjectterm>Computer Utilities</subjectterm>
   </subject>
  </subjectset>
  <authorgroup>
   <author>
    <personname>
     <firstname>Aaron</firstname> <surname>Hawley</surname>
    </personname>
   <personblurb>
     <para>Computer science graduate willing to program, design or write for food or freedom.</para>
    </personblurb>
    <email>ashawley at uvm dot edu</email>
    </author>
  </authorgroup>
  <copyright>
<year>2003</year> <year>2004</year> <year>2005</year>
   <holder>Free Software Foundation <remark>Hope to attribute to.</remark></holder>
  </copyright>
  <revhistory>
   <revision>
    <revnumber>1.8</revnumber>
    <date>2005/04/05 19:06:10</date>
    <authorinitials>ashawley</authorinitials>
    <revremark>
     Fixed revision history.
     Added year 2005 to copyright information.
     Re-organized COPYING section of manual.

    </revremark>
   </revision>
   <revision>
    <revnumber>1.7</revnumber>
    <date>2005/03/31 18:35:33</date>
    <authorinitials>ashawley</authorinitials>
    <revremark>
     Improved tutorial section.
     Unified convention for "check-in" and "check-out".
    </revremark>
   </revision>
   <revision>
    <revnumber>1.6</revnumber>
    <date>2005/03/28 17:20:31</date>
    <authorinitials>ashawley</authorinitials>
    <revremark>
     Spell checked document.
    </revremark>
   </revision>
   <revision>
    <revnumber>1.5</revnumber>
    <date>2005/03/24 20:28:35</date>
    <authorinitials>ashawley</authorinitials>
    <revremark>
     Working version of the document (even for docbook2X).
     Other improvements to the material.
    </revremark>
   </revision>
   <revision>
    <revnumber>1.4</revnumber>
    <date>2003/06/04 14:08:29</date>
    <authorinitials>ashawley</authorinitials>
    <revremark>
     Many changes and few new sections
    </revremark>
   </revision>
   <revision>
    <revnumber>1.3</revnumber>
    <date>2003/05/27 16:23:52</date>
    <authorinitials>ashawley</authorinitials>
    <revremark>
     Finished concepts chapter.
     Added tutorial chapter.
    </revremark>
   </revision>
   <revision>
    <revnumber>1.2</revnumber>
    <date>2003/04/04 14:38:32</date>
    <authorinitials>ashawley</authorinitials>
    <revremark>
     Here is a semi-annual update of my work so far.
    </revremark>
   </revision>
   <revision>
    <revnumber>1.1</revnumber>
    <date>2003/01/28 19:15:33</date>
    <authorinitials>ashawley</authorinitials>
    <revremark>
     Here's the initial work.
    </revremark>
   </revision>
  </revhistory>
  <legalnotice>
   <para>Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.</para>
   <para>A copy of the license is included in the section entitled <quote>GNU Free Documentation License</quote>.</para>
  </legalnotice>
  <abstract role="texinfo-node">
   <para>Keeping versions of files with the Revision Control System</para>
  </abstract>
  <subjectset scheme="texinfo-directory">
   <subject><subjectterm>Development</subjectterm></subject>
  </subjectset>
 </bookinfo>
 <chapter id="rcs.preface">
  <title>About This Manual</title>
  <section>
    <title>Who This Manual is For</title>
   <para>This manual is targeted at as many computers users as possible.  The goal of the manual is to prove that all computer users  can benefit from using version control in their work and that the Revision Control System (&rcs;) is the tool which can provide users access to version control.  This manual will teach and also serve as a reference for anyone interested in using &rcs;.</para>
   <para>There are certain previous skills and knowledge needed to use &rcs;.  &rcs; is a typical unix<indexterm><primary>unix</primary></indexterm> command-line tool.  It is therefore similar to learning or understanding other unix command line tools.  This manual does not introduce the concepts of file systems<indexterm><primary>file systems</primary></indexterm>, command-line<indexterm><primary>command-line</primary></indexterm> shells<indexterm><primary>shell</primary></indexterm>, and other basic skills to navigating a unix<indexterm><primary>unix</primary></indexterm> operating system.  Some users may find this manual more helpful if they were to first learn the fundamentals of the &gnu; operating system<indexterm><primary>&gnu; System</primary></indexterm> and working in a shell<indexterm><primary>shell</primary></indexterm>.</para>
  </section>
  <section>
    <title>What is in This Manual</title>
   <para><remark>Write prose here instead of list</remark>.</para>
    <para>This manual serves as a reference manual.</para>
    <para>This manual serves as an introductory manual.</para>
    <para>This manual is a technical manual for &rcs;.</para>
    <para>This manual introduces the history and purpose of version control.</para>
    <para>This manual introduces version control concepts.</para>
    <para>This manual gives suggestions on when to use &rcs;.</para>
    <para>This manual has an introduction to using &rcs;</para>
    <para>This manual gives examples of how to incorporate &rcs; in your work.</para>
    <para>This manual gives suggestions on proper practices in &rcs;.</para>

    <para>This manual has the man pages included with the &gnu; distribution of &rcs;.</para>
    <para>This manual contains technical information about how &rcs; works.</para>
    <para>This manual contains installation information.</para>
    <para>In <remark>some</remark> sections we talk about <remark>this</remark>.  In <remark>some</remark> sections we talk about <remark>that</remark>.  In <remark>some</remark> sections we talk about <remark>the other thing</remark>.</para>
  </section>
 </chapter>
 <chapter>
  <chapterinfo>
   <itermset>
    <indexterm><primary>file systems</primary><secondary>Abstraction</secondary></indexterm>
    <indexterm><primary>file fystems</primary><secondary>Design</secondary></indexterm>
    <indexterm><primary>filesystems</primary><see>file systems</see></indexterm>
    <indexterm>
     <primary>folders</primary>
     <see>directories</see>
    </indexterm>
   </itermset>
   <abstract>
    <para>Where does version control fit in the realm of computer tools and computer design?  The following section takes a look at the problems version control tries to solve.  There is no reason to adopt the use of a system when there is no need for it.  The purpose of version control should become clear by taking a broader view of version control's place as a computer technology.  Specifically, by looking at how version control is an extension of the computer file system design.</para>
   </abstract>
  </chapterinfo>
  <title>Preface to Version Control</title>
  <section id="rcs.preface.file_system_design">
   <sectioninfo>
    <abstract>
     <para>What is a file system?</para>
    </abstract>
   </sectioninfo>
    <title>The File System Design</title>
   <para>The computer <firstterm>file system</firstterm> is a design that has a long history.  Computer users use file systems every day forgetting the importance of this genius abstraction of computer storage.  This pervasive design can seem archaic, clumsy or even outdated.  However, a higher abstraction that provides an improved way for storing digital information has yet to unseat the universally accepted file system.</para>
   <para>File systems are characterized as having components which include <firstterm>files<indexterm><primary>files</primary><secondary>file system component</secondary></indexterm><indexterm><primary>files</primary><secondary>componenet, file system</secondary></indexterm></firstterm> and <firstterm>directories<indexterm><primary>directories</primary><secondary>file system componeent</secondary></indexterm></firstterm> (known to some as <firstterm>folders<indexterm><primary>folders</primary><see>directories</see></indexterm></firstterm>).  These file system elements also have defined properties.  For instance, directories can contain files or more directories (these nested directories are commonly known as <firstterm>subdirectories<indexterm><primary>subdirectories</primary></indexterm></firstterm>.  Files on the other hand are single atomic units that contain varying amounts of data.</para>
   <para>This design makes available a set of operations to these file system objects.  Files and directories can be <emphasis>created</emphasis>, <emphasis>deleted</emphasis>, and <emphasis>renamed</emphasis>.  Files are special since they can have their contents modified, known as read and write operations.</para>
   <para>There are extensions to this design, including linked files, device files, and the ability to execute (run) a file as program.  Information is sometimes attributed to file system objects including file size, creation date, modification date, file ownership and access permissions.  This basic abstraction for file storage on computer systems is a paradigm that pervades all types of computers.  One can only guess this genius but archaic paradigm will last indefinitely.</para>
  </section>
  <section id="rcs.preface.missing_feature_file_system">
   <sectioninfo>
    <abstract>
     <para>What is missing from the file system design?</para>
    </abstract>
   </sectioninfo>
    <title>The Missing Feature of the File System</title>
   <para>Unfortunately (or perhaps fortunately), the file system paradigm only provides a static representation of file systems.  File systems can save the current contents of a file, but the past states of the file are lost.  The notion that files are constantly changing is not incorporated into the design.  In practice, computer users are constantly modifying the contents of files.  File modification represents one of the most common and basic tasks for a computer user.</para>
   <para>When a user edits a file, the state, or makeup, of its previous contents are lost.  To keep an old <firstterm>version<indexterm><primary>version</primary></indexterm></firstterm> of a file a nearly duplicate copy would be needed to continue editing a newer copy.  Keeping an older version of a file requires making a copy with a different name.  This system of renaming files is a weak way of tracing the changes of a file's contents.</para>
    <para>Failing to integrate the dynamic and ever-changing nature of the file system in the original design was not a poor decision.   A good abstraction--which the file system model is--avoids incorporating unnecessary extensions and complicated features.  Another reason file system designers avoided incorporating maintaining file versions is because it is a fundamentally human task.  How could a computer keep track of versions without being able to <emphasis>read the user's mind</emphasis>?  It is suggested to users to save often to avoid losing their current work.  How would a computer system differentiate between <emphasis>substantial revisions</emphasis> and <emphasis>precautionary file saving</emphasis>?  If the solution was to keep every saved version of a file to arbitrary names<footnote><para>Something the VAX operating system did.</para></footnote>, it could take a user forever to find the desired version among the thousand of saved versions.</para>
  </section>
  <section id="rcs.preface.solution">
    <title>A Solution for Changing Files</title>
   <para>The Revision Control System (<firstterm>&rcs;</firstterm>) is a tool that allows users to <emphasis>save</emphasis> the file modifications made over time.  &rcs; allows users to store and retrieve versions of a file and allows users to associate information with each storing operation.  The information associated to versions eases the task of retrieving versions and tracking changes to a file.  Maintaining versions of files in &rcs; allows one to document the changes they have made to a file, for the benefit of themselves and their colleagues.  Further, &rcs; provides features for handling groups of files, managing development among multiple individuals, and embedding and extracting version information in a <firstterm>working file<indexterm><primary>file</primary><secondary>working file</secondary></indexterm></firstterm>, a version of the file currently available to the user.  It is a powerful yet simple tool for tracking the changes made to files.  &rcs; is an addition to the file system design helpful to those who work with files.</para>
  </section>
 </chapter>
 <chapter id="rcs.background">
   <title>Purpose of Version Control</title>
  <section id="rcs.background.problem">
   <sectioninfo>
     <subtitle>Modifying Computer Files</subtitle>
    </sectioninfo>
     <title>The Problem</title>
    <para>The most fundamental task on a computer is file modification.  It is done in writing letters, writing books, creating web pages, writing documentation, programming software, drawing graphics, generating spreadsheets, working with digital imagery, and any other growing number of tasks being made possible on modern computers.  The problem is there is no way to keep track of changes made to all these important files.  Tracking changes to files can be beneficial and even a necessity to tasks that require backing up older versions, undoing previous changes, or documenting the changes of a file. </para>
  </section>
  <section id="rcs.background.homebrwed_solutions">
   <sectioninfo>
    <itermset>
     <indexterm>
      <primary>files</primary>
      <secondary>renaming</secondary>
     </indexterm>
     <indexterm>
      <primary>renaming files</primary>
      <see>files</see>
     </indexterm>
   </itermset>
   </sectioninfo>
    <title>Homebrewed Solutions</title>
    <para>One common situation the Revision Control System (&rcs;) can help users with is when they want to create backup copies.  These backup copies can be for keeping old versions or as a precaution against losing your changes.</para>
   <para>Copying a file to a different name suffices to create versions and keep old copies.  However, a few small modifications in a file often does not warrant the renaming of the file.  Maintaining nearly duplicate copies of a file is a poor use of computer storage space.  Homebrewed solutions of renaming files to <filename>file.old</filename>, <filename>file.bak</filename>, <filename>file.bak2</filename> or some other variant is a weak system for describing the differences.  Further, certain situations require a specific file name or file name extension.  Renaming files is an inadequate way to maintain multiple versions of a file.</para>
  </section>
  <section>
   <sectioninfo id="rcs.background.version_control_systems">
    <indexterm><primary>Version Systems</primary></indexterm>
   </sectioninfo>
    <title>Enter Version Control Systems</title>
   <section>
    <sectioninfo>
     <itermset>
      <indexterm>
       <primary>Version Control Systems</primary>
       <secondary>purpose of</secondary>
      </indexterm>
    </itermset>
   </sectioninfo>
     <title>Purpose of Version Control Systems</title>
   <para>A solution for storing the changes made to files and relating information to their changes is <firstterm>version control</firstterm> which provides the storage and retrieval of file versions (see section on versions).  Version control systems act as <firstterm>databases</firstterm> by storing each version including helpful information about each version.  Version control tools empower users to retrieve older versions of files, track file changes, and even supports multiple people working on the same files.  Version control systems <emphasis>promote</emphasis> saving versions of files.</para>
   </section>
   <section>
    <sectioninfo>
     <itermset>
      <indexterm>
       <primary>Version Control Systems</primary>
       <secondary>features of</secondary>
      </indexterm>
     </itermset>
    </sectioninfo>
     <title>General Features of Version Control Systems</title>
    <para>Version control tools like the Revision Control System (&rcs;) provide a database-like storage system for file versions.  These systems focus on storing revisions of a file in an efficient manner, and minimizing storage space.  Specific information to each version is associated with each version including version date, version number, the person who stored the version, and a log entry entered by the user describing the version changes.</para>
   </section>
  </section>
 </chapter>
 <chapter>
   <title>Introduction to Version Control</title>
  <section id="rcs.background.operations">
   <sectioninfo>
    <itermset>
     <indexterm>
      <primary>Version Control Systems</primary>
      <secondary>basic operations</secondary>
     </indexterm>
     <indexterm>
      <primary>Version Control Systems</primary>
      <secondary>usage, basic</secondary>
     </indexterm>
     <indexterm>
      <primary>Version Control Systems</primary>
      <secondary>operations, basic</secondary>
     </indexterm>
     <indexterm>
      <primary>check-in</primary>
      <secondary>overview of</secondary>
     </indexterm>
     <indexterm>
      <primary>check-out</primary>
      <secondary>overview of</secondary>
     </indexterm>
    </itermset>
   </sectioninfo>
    <title>The Operations of Version Control Systems</title>
   <para>While file systems provide operations like open, save, rename and delete, version control systems provide <firstterm>checking-in<indexterm><primary>checking-in</primary></indexterm></firstterm> and <firstterm>checking-out<indexterm><primary>checking-out</primary></indexterm></firstterm>.  Like their file system counterparts <emphasis>checking-in</emphasis> stores a file version, and <emphasis>checking-out</emphasis> retrieves a file revision from the system.</para>
   <para>Upon <emphasis>checking-in</emphasis> a file, the system notes the current date and time, the name of the user submitting the revision, and prompts the user for a log message to be stored with the version.  Unless otherwise explicitly specified by the user, the version control system automatically increments the version number.</para>
   <para>With <emphasis>checking-out</emphasis>, a complete copy of a file is retrieved from the version control system.  The user can usually specify the version number or specify some other attribute, like revision date and time.  If no information is specified then the most recent version of the file is made available.</para>
  </section>
  <section>
   <sectioninfo>
    <itermset>
     <indexterm>
      <primary>Version Control Systems</primary>
      <secondary>extra features</secondary>
     </indexterm>
     <indexterm>
      <primary>Version Control Systems</primary>
      <secondary>features, extra</secondary>
     </indexterm>
    </itermset>
    </sectioninfo>
    <title>Version Control System Features</title>
   <para>Version control systems usually include other tools and features for controlling files under version control.  A <firstterm>log inspection tool</firstterm> is necessary for allowing users to investigate the version attributes and notes of a file, aiding search for a particular version or to track the revisions made by another person.  A <firstterm>difference finding tool</firstterm> can display to a user what the difference between two versions are, or give what changes were made to the current <emphasis>working</emphasis> copy since the most recently checked-in revision.  A version control system with a <firstterm>locking mechanism</firstterm> provides a means of restricting multiple people editing a file in a group development scenario.  A <firstterm>version embedding and retrieving system</firstterm> would allow users to insert version information into the actual working files.  This allows one to store version information in the working file, and be able to quickly determine version information about a working file.</para>
  </section>
  <section id="rcs.background.when">
   <sectioninfo>
    <itermset>
     <indexterm>
      <primary>Version Control Systems</primary>
      <secondary>applications</secondary>
     </indexterm>
     <indexterm>
      <primary>Version Control Systems</primary>
      <secondary>uses</secondary>
     </indexterm>
    </itermset>
   </sectioninfo>
    <title>When to Use Version Control Systems</title>
   <para>Version control systems should be used by those who edit files.  This is a broad generalization, but is largely true.  There is some effort and learning on the part of the user necessary to utilize a version control system, however it is worth the effort.  There are many tasks that do not require the use of a version control  system, and even more that make it ridiculous.</para>
   <para>However, those who require or find themselves maintaining multiple versions of files, or needing to track the revision of files should seek the rewards of using a version control system.  This is especially the case for those with release-critical tasks including writing, publishing, engineering, and software development.  Being able to record, track and report changes in your work is a powerful asset for any discipline.</para>
   <para>Version control systems can aid group development projects.  If one individual <emphasis>breaks</emphasis> or makes a poor modification to a file, an older version of that file can be retrieved.  File locking (see section on file locking) can enforce multiple people editing a single file.  Further, version control systems usually provide a way to merge two versions of a file, so that if two individuals edit the same version of file, there is still a chance the modifications can be combined.</para>
   <para>Version control systems, including the Revision Control System (&rcs;, were developed for and created by software programmers.  They have provided sometimes awkward and specific tools for version control.  For instance, version control systems assume they are working with text, and assume that changes are made on a line-by-line basis.  However, recent version control systems, including &rcs;, are able to operate on a range of file formats, including <indexterm><primary>Binary Files</primary></indexterm>binary files.</para>
   <para>The greatest rewards of using a version control tool like &rcs; do not come from the rudimentary task of using the tool to store revisions, but come from having used such a tool.  The reward of having used &rcs; appears when you accidentally lost your work, made a change that would have otherwise required you to start completely over, wish you had documented the changes you made to a file, or recognized the consequences of a change made long ago.  Of course &rcs; provides a means of providing short-term revisions of files, but the true benefits of &rcs; are seen by investing in regular use of &rcs;.</para>
   <para>Stand-alone version control utilities like &rcs; have largely been disregarded by group development projects favoring other version repository systems.  These other tools often provide network available repositories allowing individuals to submit versions of files over a network (like the Internet<indexterm><primary>Internet</primary></indexterm>).  Some version control systems (which actually utilize &rcs; for low-level operations) also are complicated with numerous features that make learning impossible and small common tasks difficult.  &rcs; however provides a stable and well accepted system for versioning your computer work.  Individuals who have smaller-scale independent tasks can benefit from using &rcs;.</para>
  </section>
  <section id="rcs.background.uses">
   <sectioninfo>
    <itermset>
     <indexterm>
      <primary>Version Control Systems</primary>
      <secondary>applications</secondary>
     </indexterm>
     <indexterm>
      <primary>Version Control Systems</primary>
      <secondary>uses</secondary>
     </indexterm>
     <indexterm>
      <primary>Version Control Systems</primary>
      <secondary>purposes</secondary>
     </indexterm>
    </itermset>
   </sectioninfo>
    <title>Uses of Version Control Systems</title>
   <para>The original intended purpose of version control systems was to benefit software developers.  A tool written by software developers to benefit software developers.  The primary purpose being to help diffuse complications that arise from software projects of greater scope and with teams of expanding size.  Therefore, software development is one of the primary beneficiaries of version control systems.  However, there are other applications of version control.</para>
   <para>The place of version control systems in computer systems, as was presented previously, allows them to be extended to a variety of purposes.  This includes any software application or task that uses files.</para>
   <para>Beyond computer programming, writers, authors and word processor users could use version control systems.  Like software projects, authoring books and documentation projects can expand in size.  Certain writing tasks can require maintaining versions of a piece.  Writers often experiment and benefit from doing so in their work.  Also maintaining editions of books is another common task of publishing that requires maintaining version information for files.</para>
   <para>Another technically-inclined group of individuals besides software programmers, are system administrators.  This is another group of individuals who, early on, found benefits for version control systems.  One of the tasks they found a purpose for their systems was their backup file systems.  Rather than having to maintain multiple separate volumes for nightly backups of their systems, version control systems could instead store backup versions of files in a single volume and provide recovery by pulling a desired backup version stored at a particular date.  These backup systems proved to be some of the most rigorous tests of version control software, but were an important addition to backup systems.</para>
   <para>As truly <quote>paperless</quote> electronic publishing system expands via the <firstterm>World Wide Web</firstterm> (web), the number of documents to maintain, and the constant modifications made to these documents grow enormously.  Version control systems offer a tool for maintaing the chaos of web documents, scripts and applications.  Most web servers offer their content by having access to selections of a file system.  Therefore, web services that are file-based can be tied to version control systems.</para>
   <para>Version control systems are also designed for <firstterm>compilation<indexterm><primary>compilation</primary></indexterm></firstterm> tasks.  This is another consequence of version control systems being used initially by software programmers.  In computer programming and in advanced publishing applications, source files are compiled into <firstterm>target files<indexterm><primary>files</primary><secondary>target</secondary></indexterm><indexterm><primary>target files</primary><see>files</see></indexterm></firstterm>.  For instance, computer program source code is compiled into binary executables<indexterm><primary>executables</primary></indexterm>.  Document source files are converted into printer-ready files.</para>
   <para>Version control systems, including &rcs;, can remove the source files for successfully compiled files.  This feature is requested less frequently because storage space concerns are also infrequent.  However, removing files in a <firstterm>working directory<indexterm><primary>working directory</primary></indexterm></firstterm> can remove files that have been rendered inconsequential by compilation.</para>
   <para>Since version control systems were originally for software development, they lend themselves easily to file-based projects that are released intermittently and modified in the mean time.  Much of the design was towards releasing specific versions of the files.  But this can carry over to any computer task that requires releasing files to the world, but maintaining information about the version of each release.</para>
  </section>
  <section id="rcs.background.skills_needed">
   <sectioninfo>
    <itermset>
     <indexterm>
      <primary>Version Control Systems</primary>
      <secondary>skills to learn</secondary>
    </indexterm>
     <indexterm>
      <primary>Version Control Systems</primary>
      <secondary>learn, skills to</secondary>
    </indexterm>
     <indexterm>
      <primary>&rcs;</primary>
      <secondary>skills to learn</secondary>
    </indexterm>
     <indexterm>
      <primary>&rcs;</primary>
      <secondary>learn, skills to</secondary>
    </indexterm>
   </itermset>
   </sectioninfo>
    <title>Skills Needed to Use a Version Control System</title>
   <para>Learning to use the Revision Control System (&rcs;) requires minimal previous knowledge.  Since &rcs; is largely an extension of the file system, users are expected to be familiar with the working with file systems.  &rcs; is a <firstterm>command line<indexterm><primary>command line</primary></indexterm></firstterm> tool, therefore familiarity with using the command line, also referred to as the <firstterm>shell<indexterm><primary>shell</primary></indexterm></firstterm> is a skill necessary for learning &rcs;.  So &rcs; requires a moderate amount of ability to work with the file system from the command line.</para>
   <para>&gnu; &rcs; is not available by the use of a graphical user interface (<acronym>GUI</acronym>).  There are proprietary version control systems with <acronym>GUI</acronym>s, and people have even created ones for &rcs;.  Currently, a free software <acronym>GUI</acronym> for &rcs; has not been created, but one need only be developed.</para>
  </section>
 </chapter>
 <chapter id="rcs.introduction">
  <chapterinfo>
   <abstract>
    <para>The origins and purposes of version control and some of the first tools.</para>
   </abstract>
  </chapterinfo>
   <title>History of Version Control</title>
  <section id="rcs.introduction.origins">
    <title>Origins of Version Control</title>
   <para>Version control systems originate from tools that were for software development management.  The software was not originally designed for general use in a variety of tasks.  </para>
  </section>
  <section>
   <title>Notable Version Control Tools</title>
   <section>
    <sectioninfo>
     <itermset>
      <indexterm><primary>&sccs;</primary></indexterm>
      <indexterm><primary>Source Code Control System</primary><see>&sccs;</see></indexterm>
      <indexterm><primary>&cssc;</primary></indexterm>
      <indexterm><primary>Compatibly Stupid Source Control</primary><see>&cssc;</see></indexterm>
     </itermset>
    </sectioninfo>
     <title>Source Code Control System (&sccs;)</title>
    <para>The Source Code Control System (&sccs;) was written by Marc Rochkind at AT&amp;T Bell Labs.  &sccs; has been uses since the 1970s and is still found and used on many systems.</para>
    <para>&sccs; was the first notable program to offer version control.  It was originally written for developers.  The major features were versioning and the ability for multiple developers to work on the same system.</para>
    <para>&sccs; is different from &rcs; by its interface and its implementation.  &rcs; improved from &sccs; with an easier interface for users and a few more features.  One notable feature of &sccs; is missing from &rcs;.  &sccs; has the ability to display each line and the most recent revision responsible for the line.</para>
    <para>The &gnu; system needed a free software<indexterm><primary>free software</primary></indexterm> implementation of &sccs;.  The name of this application is the Compatibly Stupid Source Control (&cssc;).</para>
    </section>
   <section>
    <sectioninfo>
     <itermset>
      <indexterm><primary>&rcs;</primary><secondary>history</secondary></indexterm>
     </itermset>
    </sectioninfo>
     <title>History of &rcs;</title>
    <para><remark>This section needs to be finished.</remark></para>
    <para>The Revision Control System (&rcs;) was designed by &wft;.  &rcs; was developed at the Department of Computer Science at Purdue University.  It was implemented in 1982, and has been used ever since.  In 1991, &rcs; was licensed under the &gnu; General Public License (&gpl;) and adopted as a &gnu; package.</para>
    <para>&rcs; was at the time a major improvement as a tool for version control.  It was originally written for software developers, but had other users in mind.  The major features were versioning and the ability for multiple developers on a single system to work together.</para>
   </section>
   <section>
    <sectioninfo>
     <itermset>
      <indexterm><primary>&cvs;</primary></indexterm>
      <indexterm><primary>Concurrent Version Control</primary><see>&cvs;</see></indexterm>
     </itermset>
    </sectioninfo>
     <title>Concurrent Version Control (&cvs;)</title>
    <para><remark>This section needs to be finished.</remark></para>
    <para>&cvs; was written by <remark>somebody</remark>.  It was originally developed at <remark>someplace</remark> in <remark>some year</remark>.  It has been used since <remark>some year</remark>.</para>
    <para>&cvs; was the first notable program to offer network-capable version control.  It was originally written for developers.  The major features were versioning and the ability for multiple developers to work on the same system.  It originally started out as shell scripts which utilized &rcs;.</para>
    <para>&cvs; and &rcs; are consequently similar in use.  &cvs; can be used over a network, like the Internet,  between multiple developers.  Today, &cvs; is no longer dependent on &rcs;.  &rcs; is an easier system for version control than &cvs;, and is helpful for single user or single system scenarios.</para>
   </section>
  </section>
 </chapter>
 <chapter id="rcs.introduction.choosercs">
   <title>When to Still Use &rcs;</title>
  <para>At the time, the Revision Control System (&rcs;) was an improvement upon previous version control utilities.  &rcs; proved easier to use and provided powerful features including reverse-deltas, faster retrievals, locking systems, complex branches, improved keywords, multiple-user support and a well developed archive file format.  It has become a predominant version control system.  And a free software implementation is available.</para>
  <para>When available, &rcs; should be used in most all routine computer work.  With practice and increased familiarity, the applications and benefits of using &rcs; with your work will become more apparent.</para>
  <para>No need for multiple repositories</para>
  <para>Multi-user development on a single system</para>
  <para>&rcs; and file format well acceptance</para>
  <para>Day-to-day work</para>
 </chapter>
 <chapter id="rcs.introduction.concepts">
   <title>Concepts in Version Control</title>
  <section id="rcs.introduction.concepts.fundamentals">
   <sectioninfo>
    <abstract>
     <para>As version control systems extend the possibilities of file systems, they also expand the concepts necessary to use the new facilities they provide.  Those who recognize the purpose and benefits of version control tools should have no trouble understanding the foundation concepts.  However, there is necessity of a certain amount of synthesized jargon with subtle and distinctive meanings.  The following terminology provides skills to understand version control and not become confused by it.  Learning these concepts will also better your chances of fully leveraging the features of version control.</para>
    </abstract>
   </sectioninfo>
    <title>Fundamentals of Version Control</title>
   <variablelist>
    <title>Version Control Terms</title>
    <varlistentry><term>Version
    <indexterm><primary>version</primary></indexterm>
    <indexterm><primary>revision</primary><seealso>version</seealso></indexterm></term>
<listitem>
    <para>A <firstterm>version</firstterm> is a full copy of a file which represents the state, or composition, of a file at a certain point in time.  Files change over time.  When being edited users are encouraged to save their changes as they work.  However, every save that modifies the file overwrites and loses the previous copy.  Like saving, version control systems allows one to save copies of the file, allowing one to keep track of versions of the file that is edited.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
    <term>Revision
    <indexterm><primary>revision</primary></indexterm></term>
    <listitem>
    <para>A <firstterm>revision</firstterm> is formally defined as a change, correction or improvement.  This is different from versions (see section on versions) because revisions are the products of <emphasis>revising</emphasis> while the products of revisions are <emphasis>versions</emphasis>.</para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>Delta
    <indexterm><primary>delta</primary></indexterm>
    <indexterm><primary>delta</primary><seealso>revision</seealso></indexterm></term>
    <listitem>
    <para>A <firstterm>delta</firstterm> is a computer representation of the difference between two versions (see section on version) of a file; a computer usable revision (see section on revision).  The delta is the literal representation of a revision.  The delta usually isolates what differed in the file from what remained unchanged in the file.  The unix<indexterm><primary>unix</primary></indexterm> operating system popularized, and the &gnu; System<indexterm><primary>&gnu; System</primary></indexterm> the use of text files on a line-by-line basis.  Deltas are thus represented by the lines added, deleted or replaced.</para>
    <para>In computer systems, the representation of a delta can be manifested in numerous ways.  A representation may benefit humans by being easily readable.  A delta representation may be designed to be stored efficiently by minimizing size.  Or a delta representation may place priority in precision by emphasizing deltas that can be reliable or secure for application to other versions.  Fortunately, the different advantages to delta types are not so much an issue to users of version control.  Deltas give version control systems the ability to maintain revisionsof of a file.  Deltas allow any previous version of a file.  <remark>This should be redone, reorganized and verified.</remark></para>
    </listitem>
   </varlistentry>
   <varlistentry>
    <term>Branches
    <indexterm><primary>Branches</primary></indexterm></term>
    <listitem>
    <para>Version control systems are well versed in storing the linear progression of changes to a file.  They are also endowed to maintain disparate or different developments to a file.  The ability for the changes to a file to pursue multiple <emphasis>paths</emphasis> is termed <firstterm>branching</firstterm>.  The terminology of <firstterm>branches</firstterm> is obviously derived from trees of the plant kingdom whose limbs split and span into space in multiple directions.   The same would be the case for thinking about a tree of versions for a file.</para>
    <para>The ability to maintain branches in file revisions aids experimentation and allows multiple ways of editing a file.  Branches also help with files that are released to or edited by multiple people.  If two people make subsequent changes to the file, branches are necessary to track the revisions made.</para>
    <para>In the case of distribution and file release of versions of a file, 
edts by others that are are put into version control should be added as a branch when the original author had continued making edits.  These revisions submitted to the original author will need to be added as </para>
   </listitem>
   </varlistentry>
   <varlistentry>
    <term>Trunk
    <indexterm><primary>Trunk</primary></indexterm></term>
    <listitem>
    <para>Branches (see section on branches) represent versions that develop separately from the main line of versions.  This main line of versions are called <firstterm>trunk</firstterm> versions.</para>
    <para><remark>More could be added here</remark></para>
    </listitem>
   </varlistentry>
   </variablelist>
  </section>
  <section>
   <sectioninfo>
    <indexterm><primary>files</primary></indexterm>
    <abstract>
     <para>&rcs;'s design relies on files.  &rcs; is able to take files and store versions for them, and also uses files to actually store the versions.  The following is terminology to differentiate between these two types of files.</para>
    </abstract>
   </sectioninfo>
    <title>Files in Version Control</title>
    <section>
    <sectioninfo>
    <indexterm><primary>working file</primary><see>file</see></indexterm>
    <indexterm><primary>file</primary><secondary>working</secondary></indexterm>
     </sectioninfo>
    <title>Working File</title>
    <para>A <firstterm>working file</firstterm> is a complete copy of some version of the file that is available.  This file need not necessarily be the latest or current version, it can be any past version.  The need for the terminology to differentiate <emphasis>working files</emphasis> from other files, is because &rcs; creates files to store versions to and operate with.  Working files are no different from all the files you were previously familiar with working one.</para>
    </section>
   <section>
   <sectioninfo>
    <indexterm><primary>version file</primary></indexterm>
    <indexterm><primary>library file</primary><see>version file</see></indexterm>
    <indexterm><primary>&rcs; file</primary><see>version file</see></indexterm>
    <indexterm><primary>archive file</primary><see>version file</see></indexterm>
    <indexterm><primary>version archive</primary><see>version file</see></indexterm>
    <indexterm><primary>file</primary><secondary>version file</secondary><see>version file</see></indexterm>
    </sectioninfo>
    <title>Version File</title>
    <para>A <firstterm>version file</firstterm> is used by &rcs; to store version information.  These files are the same name as the working file except they end in a suffix, which is by default <literal>,v</literal>.  For example, if you wanted version to keep track of a working file named <filename>freedom.txt</filename> &rcs; would create and use a version file named <filename>freedom.txt,v</filename>.  The extension <literal>,v</literal> stands for version file (see section on file naming).  Which extension &rcs; should recognize as version files can be modified with a command-line option.</para>
    <para>Version files<indexterm><primary>version file</primary></indexterm> contain all the information necessary to retrieve any version.  Besides storing past versions these files also contain the information related to each version, including date, version number and your notes.</para>
    <para>The existence of version files<indexterm><primary>version file</primary></indexterm> is necessary for all &rcs; operations.  These files must be available in the current directory or a subdirectory named <filename>RCS</filename> (see section on file naming).</para>
   </section>
  </section>
  <section>
   <sectioninfo>
    <indexterm><primary>Version Numbers</primary></indexterm>
    <abstract>
     <para>Each submitted version of a file to &rcs; is given a <firstterm>version number</firstterm>.  Each version is given more information than just an arbitrary version number.  Descriptive notes about versions should be added to each version by the individual submitting the changes.  However, version numbers are used as a numerical shorthand to represent versions.</para>
     <para>Version numbers are strings composed of numerical digits and periods (<literal>.</literal>), examples include <literal>1.1</literal>, <literal>1.2</literal>, <literal>1.23</literal>, <literal>2.3.1.1</literal> and <literal>4.271.4.3</literal>.  These numbers obviously specify the number of versions but also have other implied meanings about a version.  The periods separating the numbers break up the different components of a version number.  Each of these numbers gives hints about a version of a file or the file's history.</para>
    </abstract>
   </sectioninfo>
    <title>Version Numbers</title>
   <section>
    <sectioninfo>
    <indexterm><primary>Release Numbers</primary></indexterm>
    </sectioninfo>
    <title>Release Numbers</title>
    <para>The first number in a version number is always the <firstterm>release number</firstterm>.  For example, for the version number <literal>1.2</literal>, the release number is <literal>1</literal>.  The release number for the version number <literal>21.16.3.1</literal> is <literal>21</literal>.</para>
    <para>The release number is largely arbitrary.  The initial release number of a file committed to &rcs; is one, resulting in an initial version number of <literal>1.1</literal>.  Incrementing the release number is decided by the user at their discretion.  If a number of changes to a file results in what the author concludes is a different or new file, then they could increment the release number to separate future edits from past edits.</para>
    <para>This notation is a legacy of software development and their projects and products which are released with version numbers.  Examples of software project versions include <application>Gnu Emacs</application> <literal>19</literal>, <application>&rcs;</application> <literal>5.7</literal> or <application>Linux</application> <literal>2.0.36</literal>.  Changes from version like <literal>4</literal> to <literal>5</literal>, or from <literal>3.23</literal> to <literal>3.24</literal> represent major or minor changes based on the judgment of the author or authors.  This philosophy should similarly by applied to files in &rcs;.</para>
    <para>Numerous changes to a file that are logged with &rcs; will fail to separate major changes from minor ones.  Changing the release number at well judged states of the file can help with retrieving older versions.  Changing the release number too willingly can result in too numerous release numbers that can also hide where the substantial changes are.</para>
   </section>
   <section>
    <sectioninfo>
    <indexterm><primary>Revision Numbers</primary></indexterm>
    </sectioninfo>
    <title>Revision Numbers</title>
    <para>The last number in a version number is a <firstterm>revision number</firstterm>.  The revision number for the version number <literal>1.1</literal> is <literal>1</literal>.  The release number for the version number <literal>2.34.1.3</literal> is <literal>3</literal>.</para>
    <para>The revision number represents how many different versions have been made to a file.  &rcs; automatically increases the revision number when a new version of a file is submitted, or can be specified by the user but must be a number greater than the current version.</para>
    <para>Similar to release numbers (see section on release numbers), numerous revisions to a file should be submitted often to &rcs;.  Increasing the number of revisions along with notes that describe the changes made in the revision help better separate the changes made to a file over time.  A large number of submitted changes to &rcs; resulting in large revision numbers will fail to make it clear which were groups of changes that made a major difference and which were only minor ones.  This is where the feature of release numbers allows one to categorize major groups of changes as a release number.  For example, after starting a file with version <literal>1.1</literal> then making dozens of changes until version <literal>1.27</literal> the author could decide to have these versions be part of release <literal>1</literal> and begin release <literal>2</literal> with version <literal>2.1</literal>.</para> 
   </section>
   <section>
    <sectioninfo>
    <indexterm><primary>Branch Numbers</primary></indexterm>
    </sectioninfo>
    <title>Branch Numbers</title>
    <para>A <firstterm>branch number</firstterm> is a number appended to a version number (see section on version number), representing a branch (see section on branch) in revisions (see section on revision) to a version of the file.   The version number <literal>2.3</literal> would have its first branch number be <literal>2.3.1</literal>.  Now <literal>2.3.1</literal> is not a full version number.  It says that revision number <literal>3</literal> of release number <literal>2</literal> was branched once.  What about revisions to the branch?  The first revision number on this branch is <literal>1</literal> resulting in the version number <literal>2.3.1.1</literal>.  To review, the branch number on the version number <literal>1.7.3.5</literal> is <literal>3</literal>.</para>
    <para>The branch number represents how many branches have occurred to a version.  &rcs; does not require the first branch to be <literal>1</literal>.  When a branch to a version is desired, choose a branch number.  Good practice would have branch numbers represent the actual number of branches.</para>
    <para><remark>More could be added here</remark></para>
   </section>
   <section>
    <sectioninfo>
    <indexterm><primary>Tree Numbers</primary></indexterm>
    </sectioninfo>
    <title>Tree Numbers</title>
    <para>Like branch numbers (see section on branch numbers), <firstterm>tree numbers</firstterm> are version numbers with a specific format.  Branch numbers are version numbers (see section on version numbers) with a branch number.  Tree numbers take the form of a version number (see section on version numbers) without a branch number.</para>
    <para>Of course this is a logical corollary, but is a necessary point because a revision is only located on the main tree only if it has a tree version number.  The version number <literal>1.1</literal> and <literal>19.84</literal> are examples of tree numbers.  All other number formats are branch numbers.  Branch numbers can never represent versions on the trunk.</para>
   </section>
  </section>
  <section>
     <sectioninfo>
    <indexterm><primary>Locking</primary></indexterm>
    <abstract>
     <para>Maintaining version information for files is a primary purpose of version control systems.  But with a design purpose serving software development, access to files by multiple people is a fundamental feature.   Version control systems like &rcs; were a requirement for larger software development teams writing massive computer applications.</para>
     <para>One powerful feature of file systems on multiple-user systems is sharing files.  Along with multi-user systems file permissions provide a system of ownership and access privileges for users who wish to read and edit files.  A situation arises where individuals could be editing the same file at the same time.  This creates a scenario where the modifications of one person could overwrite the modifications of another.  &rcs; provides the <firstterm>locking</firstterm> mechanism, to avoid this situation.</para>
     <para><remark>Need to redo some of this.</remark></para>
    </abstract>
   </sectioninfo>
  <title>Locking</title>
   <section>
    <sectioninfo>
    <indexterm><primary>Locked</primary></indexterm>
    </sectioninfo>
    <title>Locked</title>
    <para>A file is <firstterm>locked</firstterm> in &rcs; when one person checks-out (see section on check-out) a file giving them exclusive rights to editing the file.  The individual having the lock is considered the <quote>locker</quote>.</para>
    <para>Since &rcs; is a version control system, <emphasis>files</emphasis> are not the unit that are locked.  Versions of files are what are cable of being locked.  Multiple people (or the same person) can check-out and lock multiple versions of the same file, so long as they are not locking the same versions.</para>
    <para>Locks are enforced by denying attempts to check-out a locked version.  These can however be circumvented by <quote>breaking</quote> the lock.  The <quote>breaking</quote> of a lock is usually followed with a message to the </para>
   </section>
   <section>
    <sectioninfo>
    <indexterm><primary>Unocked</primary></indexterm>
    </sectioninfo>
    <title>Unlocked</title>
    <para>A file is <firstterm>unlocked</firstterm> in &rcs; when no person has checked-out (see section on check-out) a file as locked (see section on locked).  Checking-out a file only as unlocked is necessary when the file only needs to be read but not edited.  This can be the case when the file needs to be available for processing by an application or simply for human review.</para>
    <para><remark>Anything else to mention here?</remark></para>
   </section>
   <section>
    <sectioninfo>
    <indexterm><primary>Locking</primary><secondary>Strict</secondary></indexterm>
    </sectioninfo>
    <title>Strict Locking</title>
    <para>In order to keep two or more individuals from simultenously editing the same file in &rcs;, <firstterm>strict locking</firstterm> enforces that only one person has the ability to edit a file.  &rcs; enforces locking by ensuring that only one person can check-out (see section on checking-out) a version (see section on versions) of a file can be made at a time.  Other versions of a file can be checked-out at one time</para>
    <para><remark>Need to explain strictness.</remark></para>
    <para><remark>Need to explain details of how it works.</remark></para>
    <para><remark>Need to explain details of how to turn on or off strict locking (could be put somewhere else, though, perhaps a more advanced place).</remark></para>
   </section>
  </section> 
  <section>
   <sectioninfo>
    <indexterm><primary>Keywords</primary></indexterm>
    <abstract>
     <para>Version control <firstterm>keywords</firstterm> are another release-related feature providing a mechanism for finding version information about a released working file (see section on working file).  When files under version control are released, it can become necessary to know the version of a released file.  This is common in scenarios where software bugs, problems, questions or even a suggestion relative are made relative to source code file of a software release.  Without keywords, there is a great amount of difficulty finding which version of a released file.  The alternative without version control is comparisons with every past version of the file.  Fortunately, version control systems provide keywords which can be placed in files and updated automatically by version control.</para>
    </abstract>
   </sectioninfo>
   <title>Keywords</title>
   <para>Keyword in &rcs; are unique strings which are substituted with values related to the file's revision, including revision number, revision date and author.  In &rcs;, keywords are inserted into working files as recognized terms between two dollar-symbols (<literal>$</literal>).  Some of these recognized terms are the strings <literal>Revision</literal>, <literal>Author</literal>, <literal>Date</literal>, <literal>Log</literal> and <literal>Id</literal>.</para>
  </section>
 </chapter>
 <chapter id="rcs.quick_introduction">
   <title>Quick Introduction to Using RCS</title>
  <abstract>
   <title>Preface</title>
   <para>The following is a quick tutorial on using RCS starting with
new files never previously combined in RCS.  The tutorial will be short and
quick.  Important concepts will be overlooked and some fo the useful and
powerful features of &rcs; will not be introduced.  Instead, the general
use of &rcs; is introdued to generate familiarity with the operations of &rcs; and the skills of version control.</para>
  </abstract>
  <section>
    <title>Introduction</title>
   <para>The following examples will use the file <filename>our_file.txt</filename>.  The commands assume <filename>our_file.txt</filename> is in the current directory, meaning the commands are run in the same directory the file <filename>our_file.txt</filename> is located in.</para>
  </section>
  <section>
    <title>&rcs; Subdirectory</title>
   <para>By default, when a file is initially checked-in (see section on checking-in), the respective version file<indexterm><primary>version file</primary></indexterm> (see section on version files) is placed in the same directory as the file.  To avoid cluttering the directory, an <filename>RCS</filename> subdirectory can be created to collect the &rcs; files.  If the subdirectory already exists, &rcs; will store all &rcs; files there rather than in the same directory as the working file<indexterm><primary>version file</primary><secondary>directory location</secondary></indexterm> (see section on working file).</para>
   <para>Create an <filename>RCS</filename> subdirectory with the following command:</para>
   <screen><prompt>$</prompt> <userinput><command>mkdir</command> <filename>RCS</filename></userinput></screen>
  </section>
  <section>
   <sectioninfo>
    <itermset>
     <indexterm>
      <primary>check-in</primary>
      <secondary>tutorial</secondary>
     </indexterm>
    </itermset>
   </sectioninfo>
    <title>Checking-in a File</title>
   <para>To check-in our file to &rcs;, you would issue the command:</para>
   <screen><prompt>$</prompt> <userinput><command>ci</command> <filename>our_file.txt</filename></userinput></screen>
   <para>&rcs; will respond with:</para>
<screen><computeroutput>RCS/our_file.txt,v  &lt;--  our_file.txt
enter description, terminated with single '.' or end of file:
NOTE: This is NOT the log message!
&gt;&gt; </computeroutput></screen>
   <para>&rcs; displays the locations of the working file and the &rcs; file, and the prompts for a description.  The default check-in behavior deletes the working file from the current directory if it is successfully checked-in.  In this example, the location of the &rcs; file is in the <filename>RCS</filename> subdirectory with the name of the working file with a comma and the lowercase letter <literal>v</literal> (<literal>,v</literal>) appended to the filename.  A <literal>,v</literal> is the default extension to &rcs; files.  There are few reasons to change this behavior, but this behavior can be modified so &rcs; looks for a different extension for &rcs; files (see section on extension option).  If the current directory does not have an <filename>RCS</filename> subdirectory, then the &rcs; file is placed in the same directory as the working file.</para>
   <para>After displaying the files in consideration, &rcs; gives directions on how to submit a file description (see section on file description).  After these directions an interactive prompt expects a description to be inputed.</para>
  </section>
  <section>
   <sectioninfo>
    <itermset>
     <indexterm>
      <primary>file description</primary>
      <secondary>entering</secondary>
     </indexterm>
     <indexterm>
      <primary>description</primary>
      <secondary>file</secondary>
      <see>file description</see>
     </indexterm>
    </itermset>
   </sectioninfo>
   <title>Entering File Descriptions</title>
   <para>With the initial check-in (see section on check-in) of a file, &rcs; requests a file description.  The request is not for a revision log message, so do not describe the changes made or the current state of the initial revision.  Instead, this is a request for a description (see section on file descriptions)  of the file.  The description has no functional purpose in &rcs;.  The description serves only to describe the file to you and others.  This can be helpful when files are given obscure, non-descriptive file names, or impractical and vague names like the one used in this example.  So names should describe what the purpose of the file is and what type a file is that is more expressive than the file name extension.  In the example, the extension is <literal>.txt</literal>.</para>   <para>Descriptions, as &rcs; requests, must end with a single period (<literal>.</literal>), or an <quote>end of file</quote> character.  An <quote>end of file</quote> character is issued on most systems by typing <userinput>Ctrl D</userinput> (<userinput>^D</userinput>).  By <quote>single</quote>, &rcs; requests the period or end of file should be the only single-only character on the line.  After entering the period a carriage return (on most systems <userinput>enter</userinput> or <userinput>return</userinput>) must be entered.  A carriage return is not necessary after terminating the description with an <quote>end of file</quote>.</para>
   <para>Here is a description entry for the initial revision of the example:</para>
<screen><computeroutput>
RCS/our_file.txt,v  &lt;--  our_file.txt
enter description, terminated with single '.' or end of file:
NOTE: This is NOT the log message!
&gt;&gt; <userinput>Our Example RCS Text File</userinput>
&gt;&gt; <userinput>.</userinput>
initial revision: 1.1
done</computeroutput></screen>
   <para>Descriptions can also be provided as a command-line argument (see section on file description option), rather than taken from standard input<indexterm><primary>standard input</primary><secondary>file descriptions</secondary></indexterm>.</para>
  </section>
  <section>
   <sectioninfo>
    <itermset>
     <indexterm>
      <primary>check-out</primary>
      <secondary>tutorial</secondary>
     </indexterm>
     <indexterm>
      <primary>check-out</primary>
      <secondary>unlocked</secondary>
     </indexterm>
     <indexterm>
      <primary>check-out</primary>
      <secondary>for reading</secondary>
     </indexterm>
    </itermset>
   </sectioninfo>
    <title>Checking-out a File</title>
   <para>Upon checking-in a file, &rcs; by default deletes the working copy (see section on working file) of the file.  To view, compile or distribute the file enter the following to make a working copy of the file available:</para>
   <screen><prompt>$</prompt> <userinput><command>co</command> <filename>our_file.txt</filename></userinput>
<computeroutput>RCS/our_file.txt,v  --&gt;  our_file.txt
revision 1.1 (unlocked)
done</computeroutput></screen>
   <para>The file is now available in the current working directory but is unlocked (see section on unlocked) and therefore read-only.  The file is read-only because the revision of the file would need to be locked (see section on locking).  The file is actually unlocked, as &rcs; outputs above.  It could have been checked-out with the more explicit check-out command specifying the <literal>-u</literal> option:</para>
   <screen><prompt>$</prompt> <userinput><command>co</command> <option>-u</option> <filename>our_file.txt</filename></userinput>
<computeroutput>RCS/our_file.txt,v  --&gt;  our_file.txt
revision 1.1 (unlocked)
done</computeroutput></screen>
  </section>
  <section>
   <sectioninfo>
    <itermset>
     <indexterm>
      <primary>check-out</primary>
      <secondary>tutorial</secondary>
     </indexterm>
     <indexterm>
      <primary>check-out</primary>
      <secondary>locked</secondary>
     </indexterm>
     <indexterm>
      <primary>check-out</primary>
      <secondary>for editing</secondary>
     </indexterm>
    </itermset>
   </sectioninfo>
    <title>Checking-out a File for Editing</title>
   <para>To check-out the file for editing, a request for a lock and a request for retrieval of a version can be made with:</para>
   <screen><prompt>$</prompt> <userinput><command>co</command> <option>-l</option> <filename>our_file.txt</filename></userinput>
<computeroutput>RCS/our_file.txt,v  --&gt;  our_file.txt
revision 1.1 (locked)
done</computeroutput></screen>
   <para>The checking-in, checking-out and locking of a file can be done with a single check-in.  This is more efficient for actively editing and checking-in revisions of a file, and is used often.  The single checking-in command is:</para>
   <screen><prompt>$</prompt> <userinput><command>ci</command> <option>-l</option> <filename>our_file.txt</filename></userinput>
<computeroutput>RCS/our_file.txt,v  &lt;--  our_file.txt
new revision: 1.2; previous revision: 1.1
enter log message, terminated with single '.' or end of file:
&gt;&gt; <userinput>Added another question.</userinput>
&gt;&gt; <userinput>^D</userinput>
done</computeroutput></screen>
  </section>
  <section>
   <sectioninfo>
    <itermset>
     <indexterm>
      <primary>check-out</primary>
      <secondary>previous revisions</secondary>
     </indexterm>
    </itermset>
   </sectioninfo>
    <title>Checking-out a Previous Revision</title>
   <para>In the examples so far, we have been checking-out, editing, checking-in and locking only the most recent version of the file in &rcs;.  These are adequate skills for gaining familiarity and habit in using version control.  However, the benefits of version control comes from being able to access previous revisions of a file.</para>
   <para>Retrieving revisions is done directly and simply by providing the revision number with the revision command-line option (<option>-r</option>).  In the examples above, the revision was not specified in the &rcs; command but instead implied as a request for the latest revision.  After checking-in the file the first time, the latest revision of the file could have been retrieved by specifying the revision with the following revision option:</para>
   <screen><prompt>$</prompt> <userinput><command>co</command> <option>-r<literal>1.1</literal></option> <filename>our_file.txt</filename></userinput></screen>
   <para>The revision command-line option can be combined with the check-out's locking option.  The checking-out and locking of the example's first revision
could have been accomplished by combining the revision option with the lock option:</para>
   <screen><prompt>$</prompt> <userinput><command>co</command> <option>-r<literal>1.1</literal></option> <option>-l</option> <filename>our_file.txt</filename></userinput></screen>
   <para>The lock option is actually able to take an argument in the same format as the revision option, allowing the above command to be abbreviated:</para>
   <screen><prompt>$</prompt> <userinput><command>co</command> <option>-l<literal>1.1</literal></option> <filename>our_file.txt</filename></userinput></screen>
   <para>The above options are also recognized by the check-in command for combining the checking-in, checking-out and locking of a file and simulatenously specifying a specific revision.  To check-in, check-out and lock the second revision:</para>
   <screen><prompt>$</prompt> <userinput><command>ci</command> <option>-l<literal>1.2</literal></option> <filename>our_file.txt</filename></userinput></screen>
  </section>
  <section>
   <sectioninfo>
    <itermset>
     <indexterm>
      <primary>differences</primary>
     </indexterm>
     <indexterm>
      <primary>revision</primary>
      <secondary>differences</secondary>
      <see>differences</see>
     </indexterm>
    </itermset>
   </sectioninfo>
    <title>Displaying Differences</title>
   <para>After making edits to the file, &rcs; can display the difference between the working file and the latest version.  This is helpful when a file has been edited since you last checked it out and see the specific changes made to a file.</para>
   <para>The name of the command is <command>rcsdiff</command>.  <command>rcsdiff</command> takes the same options as the <command>diff</command> command (see manual on diff).  The general form of such a command is:</para>
   <screen><prompt>$</prompt> <userinput><command>rcsdiff</command> <filename>our_file.txt</filename></userinput>
<computeroutput>===================================================================
RCS file: RCS/our_file.txt,v
retrieving revision 1.1
diff -r1.1 our_file.txt
1a2
&gt; Which of it is ours?
</computeroutput></screen>
   <para>The output of <command>rcsdiff</command> is the default output for the system's <command>diff</command> command.  For this example, the output is the <command>ed</command> format.</para>
  </section>
  <section>
   <title>Inserting Keywords</title>
   <para>Another feature desired by users of &rcs; besides basic version control is file keywords.  To utilize &rcs; keywords (see section on keywords) simply insert the keywords into the file.  For example, placing the well-known <literal>Id</literal> keyword at the end of the file is accomplished by this shell command:</para>
   <screen><prompt>$</prompt> <userinput><command>echo</command> <literal>'$&empty;Id$'</literal> &gt;&gt; <filename>our_file.txt</filename></userinput></screen>
   <para>When the file is checked-in and out, &rcs; will replace the keywords with their respective values:</para>
   <screen><prompt>$</prompt> <userinput><command>ci</command> <option>-l</option> <filename>our_file.txt</filename></userinput>
<computeroutput>RCS/our_file.txt,v  &lt;--  our_file.txt
new revision: 1.3; previous revision: 1.2
enter log message, terminated with single '.' or end of file:
&gt;&gt; <userinput>Added Id keyword.</userinput>
&gt;&gt; <userinput>^D</userinput>
done</computeroutput></screen>
   <para>Here are the contents of the file:</para>
   <screen><prompt>$</prompt> <userinput><command>cat</command> <filename>our_file.txt</filename></userinput>
<computeroutput>This is our file.
Which of it is ours?
Do we agree to it?
$&empty;Id: our_file.txt,v 1.3 2003-05-27 03:11:54-04 ashawley Exp $</computeroutput>
   </screen>
  </section>
  <section>
   <title>Retrieving Files</title>
   <para>In the case of our example, checking the values of keywords is a simple task given the short length of the file.  In the case of large files, finding keywords can become a painful task.  Fortunately, an &rcs; command is able to retrieve the keywords from a file and display them:</para>
<screen><prompt>$</prompt> <userinput><command>ident</command> <filename>our_file.txt</filename></userinput>
<computeroutput>our_file.txt:
     $&empty;Id: our_file.txt,v 1.3 2003-05-27 03:11:54-04 ashawley Exp $</computeroutput></screen>
   <para>A comparable result to this command is accomplished with the <command>grep</command> command:</para>
<screen><prompt>$</prompt> <userinput><command>grep</command> <option>-e</option> <literal>'\$Id: rcs.xml,v 1.8 2005/04/05 19:06:10 ashawley Exp $'</literal> <filename>our_file.txt</filename></userinput>
<computeroutput>$&empty;Id: our_file.txt,v 1.3 2003-05-27 03:11:54-04 ashawley Exp $</computeroutput></screen>
   <para>Using <command>ident</command> is more predictable than using <command>grep</command>.  The <command>grep</command> command will display any other text that is on the same line as an &rcs; variable.  Besides being easier to run than <command>grep</command>, <command>ident</command> innately knows which &rcs; variables while <command>grep</command> requires they all be specified</para>
  </section>
  <section>
   <title>Viewing the Log</title>
   <para>The &rcs; log command can retrieve and display meta-information about versions of a file.  Here is information of what we have done to the example text file in &rcs;:</para>
<screen><prompt>$</prompt> <userinput><command>rlog</command> <filename>our_file.txt</filename></userinput>
<computeroutput>
RCS file: RCS/our_file.txt,v
Working file: our_file.txt
head: 1.3
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;     selected revisions: 3
description:
Our Example RCS Text File
----------------------------
revision 1.3
date: 2003-05-27 03:11:54-04;  author: ashawley;  state: Exp;  lines: +1 -0
Added Id keyword.
----------------------------
revision 1.2
date: 2003-05-27 03:08:56-04;  author: ashawley;  state: Exp;  lines: +1 -0
Added another question.
----------------------------
revision 1.1
date: 2003-05-27 03:07:51-04;  author: ashawley;  state: Exp;
Initial revision
=============================================================================</computeroutput></screen>
   <para>The response of the &rcs; log command highlights the file's information including the path of the RCS file (see section on RCS file), the path of the working file, the description (see section on file description), the number of revisions (see section on revisions) and information about revisions including check-in date, author and the log submitted for the revision.</para>
  </section>
  <section>
   <title>After the Basics</title>
   <para>This tutorial covered the fundamental operations of version control with &rcs;.  The total functionality offered by &rcs; far surpasses the coverage of the introduction offered in this section.  However, familiarity with just these routine version control tasks leverages many of the critical benefits of version control.  The advanced features of &rcs; are still available for future use.  From here, other concepts and features of &rcs; can be learned and understood.</para>
   <para>Other features and concepts skipped include branches, merges, keyword substitution options, version names, file initialization options, localizations and the realm of multiple author usage and administration.  However, these operations are so rarely used or needed for so few tasks that they need not complicate an introductory tutorial.</para>
  </section>
 </chapter>
 <!-- chapter id="rcs.command_usage">
   <title>Command Usage</title>
&ci1manpage;
 </chapter -->
 <appendix>
   <title>Copying This Manual</title>
  &appendixgfdl;
 </appendix>
</book>
