home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cvs110.zip / cvs / book / cvs-client.INF (.txt) next >
OS/2 Help File  |  1998-08-21  |  63KB  |  1,623 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. CVS Client/Server ΓòÉΓòÉΓòÉ
  3.  
  4.  This document describes the client/server protocol used by CVS.  It does not 
  5.  describe how to use or administer client/server CVS; see the regular CVS 
  6.  manual for that.  This is version 1.10 of the protocol specification---See 
  7.  Introduction, for more on what this version number means. 
  8.  
  9.  Introduction                  What is CVS and what is the client/server 
  10.                                protocol for? 
  11.  Goals                         Basic design decisions, requirements, scope, 
  12.                                etc. 
  13.  Connection and Authentication Various ways to connect to the server 
  14.  Password scrambling           Scrambling used by pserver 
  15.  Protocol                      Complete description of the protocol 
  16.  Protocol Notes                Possible enhancements, limitations, etc. of the 
  17.                                protocol 
  18.  
  19.  
  20. ΓòÉΓòÉΓòÉ 2. Introduction ΓòÉΓòÉΓòÉ
  21.  
  22.  CVS is a version control system (with some additional configuration management 
  23.  functionality).  It maintains a central repository which stores files (often 
  24.  source code), including past versions, information about who modified them and 
  25.  when, and so on.  People who wish to look at or modify those files, known as 
  26.  developers, use CVS to check out a working directory from the repository, to 
  27.  check in new versions of files to the repository, and other operations such as 
  28.  viewing the modification history of a file.  If developers are connected to 
  29.  the repository by a network, particularly a slow or flaky one, the most 
  30.  efficient way to use the network is with the CVS-specific protocol described 
  31.  in this document. 
  32.  
  33.  Developers, using the machine on which they store their working directory, run 
  34.  the CVS client program.  To perform operations which cannot be done locally, 
  35.  it connects to the CVS server program, which maintains the repository.  For 
  36.  more information on how to connect see Connection and Authentication. 
  37.  
  38.  This document describes the CVS protocol.  Unfortunately, it does not yet 
  39.  completely document one aspect of the protocol---the detailed operation of 
  40.  each CVS command and option---and one must look at the CVS user documentation, 
  41.  'cvs.texinfo', for that information.  The protocol is non-proprietary (anyone 
  42.  who wants to is encouraged to implement it) and an implementation, known as 
  43.  CVS, is available under the GNU Public License.  The CVS distribution, 
  44.  containing this implementation, 'cvs.texinfo', and a copy (possibly more or 
  45.  less up to date than what you are reading now) of this document, 
  46.  'cvsclient.texi', can be found at the usual GNU FTP sites, with a filename 
  47.  such as 'cvs-version.tar.gz'. 
  48.  
  49.  This is version 1.10 of the protocol specification.  This version number is 
  50.  intended only to aid in distinguishing different versions of this 
  51.  specification.  Although the specification is currently maintained in 
  52.  conjunction with the CVS implementation, and carries the same version number, 
  53.  it also intends to document what is involved with interoperating with other 
  54.  implementations (such as other versions of CVS); see Requirements.  This 
  55.  version number should not be used by clients or servers to determine what 
  56.  variant of the protocol to speak; they should instead use the valid-requests 
  57.  and Valid-responses mechanism (see Protocol), which is more flexible. 
  58.  
  59.  
  60. ΓòÉΓòÉΓòÉ 3. Goals ΓòÉΓòÉΓòÉ
  61.  
  62.      Do not assume any access to the repository other than via this protocol. 
  63.       It does not depend on NFS, rdist, etc. 
  64.  
  65.      Providing a reliable transport is outside this protocol.  The protocol 
  66.       expects a reliable transport that is transparent (that is, there is no 
  67.       translation of characters, including characters such as such as linefeeds 
  68.       or carriage returns), and can transmit all 256 octets (for example for 
  69.       proper handling of binary files, compression, and encryption).  The 
  70.       encoding of characters specified by the protocol (the names of requests 
  71.       and so on) is the invariant ISO 646 character set (a subset of most 
  72.       popular character sets including ASCII and others).  For more details on 
  73.       running the protocol over the TCP reliable transport, see Connection and 
  74.       Authentication. 
  75.  
  76.      Security and authentication are handled outside this protocol (but see 
  77.       below about 'cvs kserver' and 'cvs pserver'). 
  78.  
  79.      The protocol makes it possible for updates to be atomic with respect to 
  80.       checkins; that is if someone commits changes to several files in one cvs 
  81.       command, then an update by someone else would either get all the changes, 
  82.       or none of them.  The current CVS server can't do this, but that isn't 
  83.       the protocol's fault. 
  84.  
  85.      The protocol is, with a few exceptions, transaction-based.  That is, the 
  86.       client sends all its requests (without waiting for server responses), and 
  87.       then waits for the server to send back all responses (without waiting for 
  88.       further client requests).  This has the advantage of minimizing network 
  89.       turnarounds and the disadvantage of sometimes transferring more data than 
  90.       would be necessary if there were a richer interaction.  Another, more 
  91.       subtle, advantage is that there is no need for the protocol to provide 
  92.       locking for features such as making checkins atomic with respect to 
  93.       updates.  Any such locking can be handled entirely by the server.  A good 
  94.       server implementation (such as the current CVS server) will make sure 
  95.       that it does not have any such locks in place whenever it is waiting for 
  96.       communication with the client; this prevents one client on a slow or 
  97.       flaky network from interfering with the work of others. 
  98.  
  99.      It is a general design goal to provide only one way to do a given 
  100.       operation (where possible).  For example, implementations have no choice 
  101.       about whether to terminate lines with linefeeds or some other 
  102.       character(s), and request and response names are case-sensitive.  This is 
  103.       to enhance interoperability.  If a protocol allows more than one way to 
  104.       do something, it is all too easy for some implementations to support only 
  105.       some of them (perhaps accidentally). 
  106.  
  107.  
  108. ΓòÉΓòÉΓòÉ 4. How to Connect to and Authenticate Oneself to the CVS server ΓòÉΓòÉΓòÉ
  109.  
  110.  Connection and authentication occurs before the CVS protocol itself is 
  111.  started.  There are several ways to connect. 
  112.  
  113.  server 
  114.            If the client has a way to execute commands on the server, and 
  115.            provide input to the commands and output from them, then it can 
  116.            connect that way.  This could be the usual rsh (port 514) protocol, 
  117.            Kerberos rsh, SSH, or any similar mechanism.  The client may allow 
  118.            the user to specify the name of the server program; the default is 
  119.            cvs.  It is invoked with one argument, server.  Once it invokes the 
  120.            server, the client proceeds to start the cvs protocol. 
  121.  
  122.  kserver 
  123.            The kerberized server listens on a port (in the current 
  124.            implementation, by having inetd call "cvs kserver") which defaults 
  125.            to 1999.  The client connects, sends the usual kerberos 
  126.            authentication information, and then starts the cvs protocol.  Note: 
  127.            port 1999 is officially registered for another use, and in any event 
  128.            one cannot register more than one port for CVS, so GSS-API (see 
  129.            below) is recommended instead of kserver as a way to support 
  130.            kerberos. 
  131.  
  132.  pserver 
  133.            The name pserver is somewhat confusing.  It refers to both a generic 
  134.            framework which allows the CVS protocol to support several 
  135.            authentication mechanisms, and a name for a specific mechanism which 
  136.            transfers a username and a cleartext password.  Servers need not 
  137.            support all mechanisms, and in fact servers will typically want to 
  138.            support only those mechanisms which meet the relevant security 
  139.            needs. 
  140.  
  141.            The pserver server listens on a port (in the current implementation, 
  142.            by having inetd call "cvs pserver") which defaults to 2401 (this 
  143.            port is officially registered).  The client connects, and sends the 
  144.            following: 
  145.  
  146.                1. the string 'BEGIN AUTH REQUEST', a linefeed, 
  147.  
  148.                2. the cvs root, a linefeed, 
  149.  
  150.                3. the username, a linefeed, 
  151.  
  152.                4. the password trivially encoded (see Password scrambling), a 
  153.                   linefeed, 
  154.  
  155.                5. the string 'END AUTH REQUEST', and a linefeed. 
  156.  
  157.              The client must send the identical string for cvs root both here 
  158.              and later in the Root request of the cvs protocol itself.  Servers 
  159.              are encouraged to enforce this restriction. The possible server 
  160.              responses (each of which is followed by a linefeed) are the 
  161.              following.  Note that although there is a small similarity between 
  162.              this authentication protocol and the cvs protocol, they are 
  163.              separate. 
  164.  
  165.              I LOVE YOU 
  166.                          The authentication is successful.  The client proceeds 
  167.                          with the cvs protocol itself. 
  168.  
  169.              I HATE YOU 
  170.                          The authentication fails.  After sending this 
  171.                          response, the server may close the connection.  It is 
  172.                          up to the server to decide whether to give this 
  173.                          response, which is generic, or a more specific 
  174.                          response using 'E' and/or 'error'. 
  175.  
  176.              E text 
  177.                          Provide a message for the user.  After this reponse, 
  178.                          the authentication protocol continues with another 
  179.                          response.  Typically the server will provide a series 
  180.                          of 'E' responses followed by 'error'. Compatibility 
  181.                          note: CVS 1.9.10 and older clients will print 
  182.                          unrecognized auth response and text, and then exit, 
  183.                          upon receiving this response. 
  184.  
  185.              error code text 
  186.                          The authentication fails.  After sending this 
  187.                          response, the server may close the connection.  The 
  188.                          code is a code describing why it failed, intended for 
  189.                          computer consumption.  The only code currently defined 
  190.                          is '0' which is nonspecific, but clients must silently 
  191.                          treat any unrecognized codes as nonspecific. The text 
  192.                          should be supplied to the user.  Compatibility note: 
  193.                          CVS 1.9.10 and older clients will print unrecognized 
  194.                          auth response and text, and then exit, upon receiving 
  195.                          this response. 
  196.  
  197.              If the client wishes to merely authenticate without starting the 
  198.              cvs protocol, the procedure is the same, except BEGIN AUTH REQUEST 
  199.              is replaced with BEGIN VERIFICATION REQUEST, END AUTH REQUEST is 
  200.              replaced with END VERIFICATION REQUEST, and upon receipt of I LOVE 
  201.              YOU the connection is closed rather than continuing. 
  202.  
  203.              Another mechanism is GSSAPI authentication.  GSSAPI is a generic 
  204.              interface to security services such as kerberos.  GSSAPI is 
  205.              specified in RFC2078 (GSSAPI version 2) and RFC1508 (GSSAPI 
  206.              version 1); we are not aware of differences between the two which 
  207.              affect the protocol in incompatible ways, so we make no attempt to 
  208.              specify one version or the other. The procedure here is to start 
  209.              with 'BEGIN GSSAPI REQUEST'.  GSSAPI authentication information is 
  210.              then exchanged between the client and the server.  Each packet of 
  211.              information consists of a two byte big endian length, followed by 
  212.              that many bytes of data. After the GSSAPI authentication is 
  213.              complete, the server continues with the responses described above 
  214.              ('I LOVE YOU', etc.). 
  215.  
  216.  future possibilities 
  217.            There are a nearly unlimited number of ways to connect and 
  218.            authenticate. One might want to allow access based on IP address 
  219.            (similar to the usual rsh protocol but with different/no 
  220.            restrictions on ports < 1024), to adopt mechanisms such as Pluggable 
  221.            Authentication Modules (PAM), to allow users to run their own 
  222.            servers under their own usernames without root access, or any number 
  223.            of other possibilities.  The way to add future mechanisms, for the 
  224.            most part, should be to continue to use port 2401, but to use 
  225.            different strings in place of 'BEGIN AUTH REQUEST'. 
  226.  
  227.  
  228. ΓòÉΓòÉΓòÉ 5. Password scrambling algorithm ΓòÉΓòÉΓòÉ
  229.  
  230.  The pserver authentication protocol, as described in Connection and 
  231.  Authentication, trivially encodes the passwords.  This is only to prevent 
  232.  inadvertent compromise; it provides no protection against even a relatively 
  233.  unsophisticated attacker.  For comparison, HTTP Basic Authentication (as 
  234.  described in RFC2068) uses BASE64 for a similar purpose.  CVS uses its own 
  235.  algorithm, described here. 
  236.  
  237.  The scrambled password starts with 'A', which serves to identify the 
  238.  scrambling algorithm in use.  After that follows a single octet for each 
  239.  character in the password, according to a fixed encoding.  The values are 
  240.  shown here, with the encoded values in decimal.  Control characters, space, 
  241.  and characters outside the invariant ISO 646 character set are not shown; such 
  242.  characters are not recommended for use in passwords.  There is a long 
  243.  discussion of character set issues in Protocol Notes. 
  244.  
  245.                           0 111      P 125      p  58
  246.                       ! 120  1  52  A  57  Q  55  a 121  q 113
  247.                       "  53  2  75  B  83  R  54  b 117  r  32
  248.                           3 119  C  43  S  66  c 104  s  90
  249.                           4  49  D  46  T 124  d 101  t  44
  250.                       % 109  5  34  E 102  U 126  e 100  u  98
  251.                       &  72  6  82  F  40  V  59  f  69  v  60
  252.                       ' 108  7  81  G  89  W  47  g  73  w  51
  253.                       (  70  8  95  H  38  X  92  h  99  x  33
  254.                       )  64  9  65  I 103  Y  71  i  63  y  97
  255.                       *  76  : 112  J  45  Z 115  j  94  z  62
  256.                       +  67  ;  86  K  50      k  93
  257.                       , 116  < 118  L  42      l  39
  258.                       -  74  = 110  M 123      m  37
  259.                       ┬╖  68  > 122  N  91      n  61
  260.                       /  87  ? 105  O  35  _  56  o  48
  261.  
  262.  
  263. ΓòÉΓòÉΓòÉ 6. The CVS client/server protocol ΓòÉΓòÉΓòÉ
  264.  
  265.  In the following, '\n' refers to a linefeed and '\t' refers to a horizontal 
  266.  tab; requests are what the client sends and responses are what the server 
  267.  sends.  In general, the connection is governed by the client---the server does 
  268.  not send responses without first receiving requests to do so; see Response 
  269.  intro for more details of this convention. 
  270.  
  271.  It is typical, early in the connection, for the client to transmit a 
  272.  Valid-responses request, containing all the responses it supports, followed by 
  273.  a valid-requests request, which elicits from the server a Valid-requests 
  274.  response containing all the requests it understands.  In this way, the client 
  275.  and server each find out what the other supports before exchanging large 
  276.  amounts of data (such as file contents). 
  277.  
  278.  General protocol conventions: 
  279.  
  280.  Entries Lines                 Transmitting RCS data 
  281.  File Modes                    Read, write, execute, and possibly more┬╖┬╖┬╖ 
  282.  Filenames                     Conventions regarding filenames 
  283.  File transmissions            How file contents are transmitted 
  284.  Strings                       Strings in various requests and responses 
  285.  Dates                         Times and dates The protocol itself: 
  286.  Request intro                 General conventions relating to requests 
  287.  Requests                      List of requests 
  288.  Response intro                General conventions relating to responses 
  289.  Response pathnames            The "pathname" in responses 
  290.  Responses                     List of responses 
  291.  Text tags                     More details about the MT response An example 
  292.                                session, and some further observations: 
  293.  Example                       A conversation between client and server 
  294.  Requirements                  Things not to omit from an implementation 
  295.  Obsolete                      Former protocol features 
  296.  
  297.  
  298. ΓòÉΓòÉΓòÉ 6.1. Entries Lines ΓòÉΓòÉΓòÉ
  299.  
  300.  Entries lines are transmitted as: 
  301.  
  302.                       / name / version / conflict / options / tag_or_date
  303.  
  304.  tag_or_date is either 'T' tag or 'D' date or empty.  If it is followed by a 
  305.  slash, anything after the slash shall be silently ignored. 
  306.  
  307.  version can be empty, or start with '0' or '-', for no user file, new user 
  308.  file, or user file to be removed, respectively. 
  309.  
  310.  conflict, if it starts with '+', indicates that the file had conflicts in it. 
  311.  The rest of conflict is '=' if the timestamp matches the file, or anything 
  312.  else if it doesn't.  If conflict does not start with a '+', it is silently 
  313.  ignored. 
  314.  
  315.  options signifies the keyword expansion options (for example '-ko').  In an 
  316.  Entry request, this indicates the options that were specified with the file 
  317.  from the previous file updating response (see Response intro, for a list of 
  318.  file updating responses); if the client is specifying the '-k' or '-A' option 
  319.  to update, then it is the server which figures out what overrides what. 
  320.  
  321.  
  322. ΓòÉΓòÉΓòÉ 6.2. File Modes ΓòÉΓòÉΓòÉ
  323.  
  324.  A mode is any number of repetitions of 
  325.  
  326.                       mode-type = data
  327.  
  328.  separated by ','. 
  329.  
  330.  mode-type is an identifier composed of alphanumeric characters. Currently 
  331.  specified: 'u' for user, 'g' for group, 'o' for other (see below for 
  332.  discussion of whether these have their POSIX meaning or are more loose). 
  333.  Unrecognized values of mode-type are silently ignored. 
  334.  
  335.  data consists of any data not containing ',', '\0' or '\n'.  For 'u', 'g', and 
  336.  'o' mode types, data consists of alphanumeric characters, where 'r' means 
  337.  read, 'w' means write, 'x' means execute, and unrecognized letters are 
  338.  silently ignored. 
  339.  
  340.  The two most obvious ways in which the mode matters are: (1) is it writeable? 
  341.  This is used by the developer communication features, and is implemented even 
  342.  on OS/2 (and could be implemented on DOS), whose notion of mode is limited to 
  343.  a readonly bit. (2) is it executable? Unix CVS users need CVS to store this 
  344.  setting (for shell scripts and the like).  The current CVS implementation on 
  345.  unix does a little bit more than just maintain these two settings, but it 
  346.  doesn't really have a nice general facility to store or version control the 
  347.  mode, even on unix, much less across operating systems with diverse protection 
  348.  features.  So all the ins and outs of what the mode means across operating 
  349.  systems haven't really been worked out (e.g. should the VMS port use ACLs to 
  350.  get POSIX semantics for groups?). 
  351.  
  352.  
  353. ΓòÉΓòÉΓòÉ 6.3. Conventions regarding transmission of file names ΓòÉΓòÉΓòÉ
  354.  
  355.  In most contexts, '/' is used to separate directory and file names in 
  356.  filenames, and any use of other conventions (for example, that the user might 
  357.  type on the command line) is converted to that form.  The only exceptions 
  358.  might be a few cases in which the server provides a magic cookie which the 
  359.  client then repeats verbatim, but as the server has not yet been ported beyond 
  360.  unix, the two rules provide the same answer (and what to do if future server 
  361.  ports are operating on a repository like e:/foo or CVS_ROOT:[FOO.BAR] has not 
  362.  been carefully thought out). 
  363.  
  364.  Characters outside the invariant ISO 646 character set should be avoided in 
  365.  filenames.  This restriction may need to be relaxed to allow for characters 
  366.  such as '[' and ']' (see above about non-unix servers); this has not been 
  367.  carefully considered (and currently implementations probably use whatever 
  368.  character sets that the operating systems they are running on allow, and/or 
  369.  that users specify).  Of course the most portable practice is to restrict 
  370.  oneself further, to the POSIX portable filename character set as specified in 
  371.  POSIX.1. 
  372.  
  373.  
  374. ΓòÉΓòÉΓòÉ 6.4. File transmissions ΓòÉΓòÉΓòÉ
  375.  
  376.  File contents (noted below as file transmission) can be sent in one of two 
  377.  forms.  The simpler form is a number of bytes, followed by a linefeed, 
  378.  followed by the specified number of bytes of file contents. These are the 
  379.  entire contents of the specified file.  Second, if both client and server 
  380.  support 'gzip-file-contents', a 'z' may precede the length, and the `file 
  381.  contents' sent are actually compressed with 'gzip' (RFC1952/1951) compression. 
  382.  The length specified is that of the compressed version of the file. 
  383.  
  384.  In neither case are the file content followed by any additional data. The 
  385.  transmission of a file will end with a linefeed iff that file (or its 
  386.  compressed form) ends with a linefeed. 
  387.  
  388.  The encoding of file contents depends on the value for the '-k' option.  If 
  389.  the file is binary (as specified by the '-kb' option in the appropriate 
  390.  place), then it is just a certain number of octets, and the protocol 
  391.  contributes nothing towards determining the encoding (using the file name is 
  392.  one widespread, if not universally popular, mechanism). If the file is text 
  393.  (not binary), then the file is sent as a series of lines, separated by 
  394.  linefeeds.  If the keyword expansion is set to something other than '-ko', 
  395.  then it is expected that the file conform to the RCS expectations regarding 
  396.  keyword expansion---in particular, that it is in a character set such as ASCII 
  397.  in which 0x24 is a dollar sign ('$'). 
  398.  
  399.  
  400. ΓòÉΓòÉΓòÉ 6.5. Strings ΓòÉΓòÉΓòÉ
  401.  
  402.  In various contexts, for example the Argument request and the M response, one 
  403.  transmits what is essentially an arbitrary string.  Often this will have been 
  404.  supplied by the user (for example, the '-m' option to the ci request).  The 
  405.  protocol has no mechanism to specify the character set of such strings; it 
  406.  would be fairly safe to stick to the invariant ISO 646 character set but the 
  407.  existing practice is probably to just transmit whatever the user specifies, 
  408.  and hope that everyone involved agrees which character set is in use, or 
  409.  sticks to a common subset. 
  410.  
  411.  
  412. ΓòÉΓòÉΓòÉ 6.6. Dates ΓòÉΓòÉΓòÉ
  413.  
  414.  The protocol contains times and dates in various places. 
  415.  
  416.  For the '-D' option to the annotate, co, diff, export, history, rdiff, rtag, 
  417.  tag, and update requests, the server should support two formats: 
  418.  
  419.                       26 May 1997 13:01:40 GMT  ; RFC 822 as modified by RFC 1123
  420.                       5/26/1997 13:01:40 GMT   ; traditional
  421.  
  422.  The former format is preferred; the latter however is sent by the CVS command 
  423.  line client (versions 1.5 through at least 1.9). 
  424.  
  425.  For the '-d' option to the log request, servers should at least support RFC 
  426.  822/1123 format.  Clients are encouraged to use this format too (traditionally 
  427.  the command line CVS client has just passed along the date format specified by 
  428.  the user, however). 
  429.  
  430.  For Mod-time, see the description of that response. 
  431.  
  432.  For Notify, see the description of that request. 
  433.  
  434.  
  435. ΓòÉΓòÉΓòÉ 6.7. Request intro ΓòÉΓòÉΓòÉ
  436.  
  437.  By convention, requests which begin with a capital letter do not elicit a 
  438.  response from the server, while all others do -- save one.  The exception is 
  439.  'gzip-file-contents'.  Unrecognized requests will always elicit a response 
  440.  from the server, even if that request begins with a capital letter. 
  441.  
  442.  
  443. ΓòÉΓòÉΓòÉ 6.8. Requests ΓòÉΓòÉΓòÉ
  444.  
  445.  Here are the requests: 
  446.  
  447.  Root pathname \n 
  448.            Response expected: no.  Tell the server which CVSROOT to use. Note 
  449.            that pathname is a local directory and not a fully qualified CVSROOT 
  450.            variable.  pathname must already exist; if creating a new root, use 
  451.            the init request, not Root.  pathname does not include the hostname 
  452.            of the server, how to access the server, etc.; by the time the CVS 
  453.            protocol is in use, connection, authentication, etc., are already 
  454.            taken care of. 
  455.  
  456.            The Root request must be sent only once, and it must be sent before 
  457.            any requests other than Valid-responses, valid-requests, 
  458.            UseUnchanged, or init. 
  459.  
  460.  Valid-responses request-list \n 
  461.            Response expected: no. Tell the server what responses the client 
  462.            will accept. request-list is a space separated list of tokens. 
  463.  
  464.  valid-requests \n 
  465.            Response expected: yes. Ask the server to send back a Valid-requests 
  466.            response. 
  467.  
  468.  Directory local-directory \n 
  469.            Additional data: repository \n.  Response expected: no. Tell the 
  470.            server what directory to use.  The repository should be a directory 
  471.            name from a previous server response.  Note that this both gives a 
  472.            default for Entry and Modified and also for ci and the other 
  473.            commands; normal usage is to send Directory for each directory in 
  474.            which there will be an Entry or Modified, and then a final Directory 
  475.            for the original directory, then the command. The local-directory is 
  476.            relative to the top level at which the command is occurring (i.e. 
  477.            the last Directory which is sent before the command); to indicate 
  478.            that top level, '.' should be sent for local-directory. 
  479.  
  480.            Here is an example of where a client gets repository and 
  481.            local-directory.  Suppose that there is a module defined by 
  482.  
  483.                       moddir 1dir
  484.  
  485.  That is, one can check out moddir and it will take 1dir in the repository and 
  486.  check it out to moddir in the working directory.  Then an initial check out 
  487.  could proceed like this: 
  488.  
  489.                       C: Root /home/kingdon/zwork/cvsroot
  490.                       ┬╖ . .
  491.                       C: Argument moddir
  492.                       C: Directory .
  493.                       C: /home/kingdon/zwork/cvsroot
  494.                       C: co
  495.                       S: Clear-sticky moddir/
  496.                       S: /home/kingdon/zwork/cvsroot/1dir/
  497.                       ┬╖ . .
  498.                       S: ok
  499.  
  500.  In this example the response shown is Clear-sticky, but it could be another 
  501.  response instead.  Note that it returns two pathnames. The first one, 
  502.  'moddir/', indicates the working directory to check out into.  The second one, 
  503.  ending in '1dir/', indicates the directory to pass back to the server in a 
  504.  subsequent Directory request.  For example, a subsequent update request might 
  505.  look like: 
  506.  
  507.                       C: Directory moddir
  508.                       C: /home/kingdon/zwork/cvsroot/1dir
  509.                       ┬╖ . .
  510.                       C: update
  511.  
  512.  For a given local-directory, the repository will be the same for each of the 
  513.  responses, so one can use the repository from whichever response is most 
  514.  convenient.  Typically a client will store the repository along with the 
  515.  sources for each local-directory, use that same setting whenever operating on 
  516.  that local-directory, and not update the setting as long as the 
  517.  local-directory exists. 
  518.  
  519.  A client is free to rename a local-directory at any time (for example, in 
  520.  response to an explicit user request).  While it is true that the server 
  521.  supplies a local-directory to the client, as noted above, this is only the 
  522.  default place to put the directory.  Of course, the various Directory requests 
  523.  for a single command (for example, update or ci request) should name a 
  524.  particular directory with the same local-directory. 
  525.  
  526.  Each Directory request specifies a brand-new local-directory and repository; 
  527.  that is, local-directory and repository are never relative to paths specified 
  528.  in any previous Directory request. 
  529.  
  530.  Max-dotdot level \n 
  531.            Response expected: no. Tell the server that level levels of 
  532.            directories above the directory which Directory requests are 
  533.            relative to will be needed.  For example, if the client is planning 
  534.            to use a Directory request for '┬╖┬╖/┬╖┬╖/foo', it must send a 
  535.            Max-dotdot request with a level of at least 2. Max-dotdot must be 
  536.            sent before the first Directory request. 
  537.  
  538.  Static-directory \n 
  539.            Response expected: no.  Tell the server that the directory most 
  540.            recently specified with Directory should not have additional files 
  541.            checked out unless explicitly requested.  The client sends this if 
  542.            the Entries.Static flag is set, which is controlled by the 
  543.            Set-static-directory and Clear-static-directory responses. 
  544.  
  545.  Sticky tagspec \n 
  546.            Response expected: no.  Tell the server that the directory most 
  547.            recently specified with Directory has a sticky tag or date tagspec. 
  548.            The first character of tagspec is 'T' for a tag, or 'D' for a date. 
  549.            The remainder of tagspec contains the actual tag or date. 
  550.  
  551.            The server should remember Static-directory and Sticky requests for 
  552.            a particular directory; the client need not resend them each time it 
  553.            sends a Directory request for a given directory. However, the server 
  554.            is not obliged to remember them beyond the context of a single 
  555.            command. 
  556.  
  557.  Checkin-prog program \n 
  558.            Response expected: no.  Tell the server that the directory most 
  559.            recently specified with Directory has a checkin program program. 
  560.            Such a program would have been previously set with the 
  561.            Set-checkin-prog response. 
  562.  
  563.  Update-prog program \n 
  564.            Response expected: no.  Tell the server that the directory most 
  565.            recently specified with Directory has an update program program. 
  566.            Such a program would have been previously set with the 
  567.            Set-update-prog response. 
  568.  
  569.  Entry entry-line \n 
  570.            Response expected: no.  Tell the server what version of a file is on 
  571.            the local machine.  The name in entry-line is a name relative to the 
  572.            directory most recently specified with Directory.  If the user is 
  573.            operating on only some files in a directory, Entry requests for only 
  574.            those files need be included.  If an Entry request is sent without 
  575.            Modified, Is-modified, or Unchanged, it means the file is lost (does 
  576.            not exist in the working directory).  If both Entry and one of 
  577.            Modified, Is-modified, or Unchanged are sent for the same file, 
  578.            Entry must be sent first.  For a given file, one can send Modified, 
  579.            Is-modified, or Unchanged, but not more than one of these three. 
  580.  
  581.  Kopt option \n 
  582.            This indicates to the server which keyword expansion options to use 
  583.            for the file specified by the next Modified or Is-modified request 
  584.            (for example '-kb' for a binary file).  This is similar to Entry, 
  585.            but is used for a file for which there is no entries line. Typically 
  586.            this will be a file being added via an add or import request.  The 
  587.            client may not send both Kopt and Entry for the same file. 
  588.  
  589.  Modified filename \n 
  590.            Response expected: no.  Additional data: mode, \n, file 
  591.            transmission. Send the server a copy of one locally modified file. 
  592.            filename is relative to the most recent repository sent with 
  593.            Directory.  If the user is operating on only some files in a 
  594.            directory, only those files need to be included.  This can also be 
  595.            sent without Entry, if there is no entry for the file. 
  596.  
  597.  Is-modified filename \n 
  598.            Response expected: no.  Additional data: none.  Like Modified, but 
  599.            used if the server only needs to know whether the file is modified, 
  600.            not the contents. 
  601.  
  602.            The commands which can take Is-modified instead of Modified with no 
  603.            known change in behavior are: admin, diff (if and only if two '-r' 
  604.            or '-D' options are specified), watch-on, watch-off, watch-add, 
  605.            watch-remove, watchers, editors, log, and annotate. 
  606.  
  607.            For the status command, one can send Is-modified but if the client 
  608.            is using imperfect mechanisms such as timestamps to determine 
  609.            whether to consider a file modified, then the behavior will be 
  610.            different.  That is, if one sends Modified, then the server will 
  611.            actually compare the contents of the file sent and the one it 
  612.            derives from to determine whether the file is genuinely modified. 
  613.            But if one sends Is-modified, then the server takes the client's 
  614.            word for it.  A similar situation exists for tag, if the '-c' option 
  615.            is specified. 
  616.  
  617.            Commands for which Modified is necessary are co, ci, update, and 
  618.            import. 
  619.  
  620.            Commands which do not need to inform the server about a working 
  621.            directory, and thus should not be sending either Modified or 
  622.            Is-modified: rdiff, rtag, history, init, and release. 
  623.  
  624.            Commands for which further investigation is warranted are: remove, 
  625.            add, and export.  Pending such investigation, the more conservative 
  626.            course of action is to stick to Modified. 
  627.  
  628.  Unchanged filename \n 
  629.            Response expected: no.  Tell the server that filename has not been 
  630.            modified in the checked out directory.  The name is relative to the 
  631.            most recent repository sent with Directory. 
  632.  
  633.  UseUnchanged \n 
  634.            Response expected: no.  To specify the version of the protocol 
  635.            described in this document, servers must support this request 
  636.            (although it need not do anything) and clients must issue it. 
  637.  
  638.  Notify filename \n 
  639.            Response expected: no. Tell the server that a edit or unedit command 
  640.            has taken place.  The server needs to send a Notified response, but 
  641.            such response is deferred until the next time that the server is 
  642.            sending responses.  Response expected: no.  Additional data: 
  643.  
  644.                       notification-type \t time \t clienthost \t
  645.                       working-dir \t watches \n
  646.  where notification-type is 'E' for edit, 'U' for unedit, undefined behavior if 
  647.  'C', and all other letters should be silently ignored for future expansion. 
  648.  time is the time at which the edit or unedit took place, in a user-readable 
  649.  format of the client's choice (the server should treat the time as an opaque 
  650.  string rather than interpreting it). clienthost is the name of the host on 
  651.  which the edit or unedit took place, and working-dir is the pathname of the 
  652.  working directory where the edit or unedit took place.  watches are the 
  653.  temporary watches to set.  If watches is followed by \t then the \t and the 
  654.  rest of the line should be ignored, for future expansion. 
  655.  
  656.  Note that a client may be capable of performing an edit or unedit operation 
  657.  without connecting to the server at that time, and instead connecting to the 
  658.  server when it is convenient (for example, when a laptop is on the net again) 
  659.  to send the Notify requests. Even if a client is capable of deferring 
  660.  notifications, it should attempt to send them immediately (one can send Notify 
  661.  requests together with a noop request, for example), unless perhaps if it can 
  662.  know that a connection would be impossible. 
  663.  
  664.  Questionable filename \n 
  665.            Response expected: no.  Additional data: no.  Tell the server to 
  666.            check whether filename should be ignored, and if not, next time the 
  667.            server sends responses, send (in a M response) '?' followed by the 
  668.            directory and filename.  filename must not contain '/'; it needs to 
  669.            be a file in the directory named by the most recent Directory 
  670.            request. 
  671.  
  672.  Case \n 
  673.            Response expected: no.  Tell the server that filenames should be 
  674.            matched in a case-insensitive fashion.  Note that this is not the 
  675.            primary mechanism for achieving case-insensitivity; for the most 
  676.            part the client keeps track of the case which the server wants to 
  677.            use and takes care to always use that case regardless of what the 
  678.            user specifies.  For example the filenames given in Entry and 
  679.            Modified requests for the same file must match in case regardless of 
  680.            whether the Case request is sent.  The latter mechanism is more 
  681.            general (it could also be used for 8.3 filenames, VMS filenames with 
  682.            more than one '.', and any other situation in which there is a 
  683.            predictable mapping between filenames in the working directory and 
  684.            filenames in the protocol), but there are some situations it cannot 
  685.            handle (ignore patterns, or situations where the user specifies a 
  686.            filename and the client does not know about that file). 
  687.  
  688.  Argument text \n 
  689.            Response expected: no. Save argument for use in a subsequent 
  690.            command.  Arguments accumulate until an argument-using command is 
  691.            given, at which point they are forgotten. 
  692.  
  693.  Argumentx text \n 
  694.            Response expected: no.  Append \n followed by text to the current 
  695.            argument being saved. 
  696.  
  697.  Global_option option \n 
  698.            Response expected: no. Transmit one of the global options '-q', 
  699.            '-Q', '-l', '-t', '-r', or '-n'.  option must be one of those 
  700.            strings, no variations (such as combining of options) are allowed. 
  701.            For graceful handling of valid-requests, it is probably better to 
  702.            make new global options separate requests, rather than trying to add 
  703.            them to this request. 
  704.  
  705.  Gzip-stream level \n 
  706.            Response expected: no. Use zlib (RFC 1950/1951) compression to 
  707.            compress all further communication between the client and the 
  708.            server.  After this request is sent, all further communication must 
  709.            be compressed.  All further data received from the server will also 
  710.            be compressed.  The level argument suggests to the server the level 
  711.            of compression that it should apply; it should be an integer between 
  712.            1 and 9, inclusive, where a higher number indicates more 
  713.            compression. 
  714.  
  715.  Kerberos-encrypt \n 
  716.            Response expected: no. Use Kerberos encryption to encrypt all 
  717.            further communication between the client and the server.  This will 
  718.            only work if the connection was made over Kerberos in the first 
  719.            place.  If both the Gzip-stream and the Kerberos-encrypt requests 
  720.            are used, the Kerberos-encrypt request should be used first.  This 
  721.            will make the client and server encrypt the compressed data, as 
  722.            opposed to compressing the encrypted data.  Encrypted data is 
  723.            generally incompressible. 
  724.  
  725.            Note that this request does not fully prevent an attacker from 
  726.            hijacking the connection, in the sense that it does not prevent 
  727.            hijacking the connection between the initial authentication and the 
  728.            Kerberos-encrypt request. 
  729.  
  730.  Gssapi-encrypt \n 
  731.            Response expected: no. Use GSSAPI encryption to encrypt all further 
  732.            communication between the client and the server.  This will only 
  733.            work if the connection was made over GSSAPI in the first place.  See 
  734.            Kerberos-encrypt, above, for the relation between Gssapi-encrypt and 
  735.            Gzip-stream. 
  736.  
  737.            Note that this request does not fully prevent an attacker from 
  738.            hijacking the connection, in the sense that it does not prevent 
  739.            hijacking the connection between the initial authentication and the 
  740.            Gssapi-encrypt request. 
  741.  
  742.  Gssapi-authenticate \n 
  743.            Response expected: no. Use GSSAPI authentication to authenticate all 
  744.            further communication between the client and the server.  This will 
  745.            only work if the connection was made over GSSAPI in the first place. 
  746.            Encrypted data is automatically authenticated, so using both 
  747.            Gssapi-authenticate and Gssapi-encrypt has no effect beyond that of 
  748.            Gssapi-encrypt.  Unlike encrypted data, it is reasonable to compress 
  749.            authenticated data. 
  750.  
  751.            Note that this request does not fully prevent an attacker from 
  752.            hijacking the connection, in the sense that it does not prevent 
  753.            hijacking the connection between the initial authentication and the 
  754.            Gssapi-authenticate request. 
  755.  
  756.  Set variable=value \n 
  757.            Response expected: no. Set a user variable variable to value. 
  758.  
  759.  expand-modules \n 
  760.            Response expected: yes.  Expand the modules which are specified in 
  761.            the arguments.  Returns the data in Module-expansion responses. 
  762.            Note that the server can assume that this is checkout or export, not 
  763.            rtag or rdiff; the latter do not access the working directory and 
  764.            thus have no need to expand modules on the client side. 
  765.  
  766.            Expand may not be the best word for what this request does.  It does 
  767.            not necessarily tell you all the files contained in a module, for 
  768.            example. Basically it is a way of telling you which working 
  769.            directories the server needs to know about in order to handle a 
  770.            checkout of the specified modules. 
  771.  
  772.            For example, suppose that the server has a module defined by 
  773.  
  774.                       aliasmodule -a 1dir
  775.  
  776.  That is, one can check out aliasmodule and it will take 1dir in the repository 
  777.  and check it out to 1dir in the working directory.  Now suppose the client 
  778.  already has this module checked out and is planning on using the co request to 
  779.  update it. Without using expand-modules, the client would have two bad 
  780.  choices: it could either send information about all working directories under 
  781.  the current directory, which could be unnecessarily slow, or it could be 
  782.  ignorant of the fact that aliasmodule stands for 1dir, and neglect to send 
  783.  information for 1dir, which would lead to incorrect operation. With 
  784.  expand-modules, the client would first ask for the module to be expanded: 
  785.  
  786.                       C: Root /home/kingdon/zwork/cvsroot
  787.                       ┬╖ . .
  788.                       C: Argument aliasmodule
  789.                       C: Directory .
  790.                       C: /home/kingdon/zwork/cvsroot
  791.                       C: expand-modules
  792.                       S: Module-expansion 1dir
  793.                       S: ok
  794.  
  795.  and then it knows to check the '1dir' directory and send requests such as 
  796.  Entry and Modified for the files in that directory. 
  797.  
  798.  ci \n 
  799.  
  800.  diff \n 
  801.  
  802.  tag \n 
  803.  
  804.  status \n 
  805.  
  806.  log \n 
  807.  
  808.  admin \n 
  809.  
  810.  history \n 
  811.  
  812.  watchers \n 
  813.  
  814.  editors \n 
  815.  
  816.  annotate \n 
  817.            Response expected: yes.  Actually do a cvs command.  This uses any 
  818.            previous Argument, Directory, Entry, or Modified requests, if they 
  819.            have been sent.  The last Directory sent specifies the working 
  820.            directory at the time of the operation.  No provision is made for 
  821.            any input from the user. This means that ci must use a -m argument 
  822.            if it wants to specify a log message. 
  823.  
  824.  co \n 
  825.            Response expected: yes.  Get files from the repository.  This uses 
  826.            any previous Argument, Directory, Entry, or Modified requests, if 
  827.            they have been sent.  Arguments to this command are module names; 
  828.            the client cannot know what directories they correspond to except by 
  829.            (1) just sending the co request, and then seeing what directory 
  830.            names the server sends back in its responses, and (2) the 
  831.            expand-modules request. 
  832.  
  833.  export \n 
  834.            Response expected: yes.  Get files from the repository.  This uses 
  835.            any previous Argument, Directory, Entry, or Modified requests, if 
  836.            they have been sent.  Arguments to this command are module names, as 
  837.            described for the co request.  The intention behind this command is 
  838.            that a client can get sources from a server without storing CVS 
  839.            information about those sources.  That is, a client probably should 
  840.            not count on being able to take the entries line returned in the 
  841.            Created response from an export request and send it in a future 
  842.            Entry request.  Note that the entries line in the Created response 
  843.            must indicate whether the file is binary or text, so the client can 
  844.            create it correctly. 
  845.  
  846.  rdiff \n 
  847.  
  848.  rtag \n 
  849.            Response expected: yes.  Actually do a cvs command.  This uses any 
  850.            previous Argument requests, if they have been sent.  The client 
  851.            should not send Directory, Entry, or Modified requests for this 
  852.            command; they are not used.  Arguments to these commands are module 
  853.            names, as described for co. 
  854.  
  855.  init root-name \n 
  856.            Response expected: yes.  If it doesn't already exist, create a CVS 
  857.            repository root-name.  Note that root-name is a local directory and 
  858.            not a fully qualified CVSROOT variable.  The Root request need not 
  859.            have been previously sent. 
  860.  
  861.  update \n 
  862.            Response expected: yes.  Actually do a cvs update command.  This 
  863.            uses any previous Argument, Directory, Entry, or Modified requests, 
  864.            if they have been sent.  The last Directory sent specifies the 
  865.            working directory at the time of the operation.  The -I option is 
  866.            not used--files which the client can decide whether to ignore are 
  867.            not mentioned and the client sends the Questionable request for 
  868.            others. 
  869.  
  870.  import \n 
  871.            Response expected: yes.  Actually do a cvs import command.  This 
  872.            uses any previous Argument, Directory, Entry, or Modified requests, 
  873.            if they have been sent.  The last Directory sent specifies the 
  874.            working directory at the time of the operation.  The files to be 
  875.            imported are sent in Modified requests (files which the client knows 
  876.            should be ignored are not sent; the server must still process the 
  877.            CVSROOT/cvsignore file unless -I ! is sent).  A log message must 
  878.            have been specified with a -m argument. 
  879.  
  880.  add \n 
  881.            Response expected: yes.  Add a file or directory.  This uses any 
  882.            previous Argument, Directory, Entry, or Modified requests, if they 
  883.            have been sent.  The last Directory sent specifies the working 
  884.            directory at the time of the operation. 
  885.  
  886.            To add a directory, send the directory to be added using Directory 
  887.            and Argument requests.  For example: 
  888.  
  889.                       C: Root /u/cvsroot
  890.                       ┬╖ . .
  891.                       C: Argument nsdir
  892.                       C: Directory nsdir
  893.                       C: /u/cvsroot/1dir/nsdir
  894.                       C: Directory .
  895.                       C: /u/cvsroot/1dir
  896.                       C: add
  897.                       S: M Directory /u/cvsroot/1dir/nsdir added to the repository
  898.                       S: ok
  899.  
  900.  You will notice that the server does not signal to the client in any 
  901.  particular way that the directory has been successfully added.  The client is 
  902.  supposed to just assume that the directory has been added and update its 
  903.  records accordingly.  Note also that adding a directory is immediate; it does 
  904.  not wait until a ci request as files do. 
  905.  
  906.  To add a file, send the file to be added using a Modified request.  For 
  907.  example: 
  908.  
  909.                       C: Argument nfile
  910.                       C: Directory .
  911.                       C: /u/cvsroot/1dir
  912.                       C: Modified nfile
  913.                       C: u=rw,g=r,o=r
  914.                       C: 6
  915.                       C: hello
  916.                       C: add
  917.                       S: E cvs server: scheduling file `nfile' for addition
  918.                       S: Mode u=rw,g=r,o=r
  919.                       S: Checked-in ./
  920.                       S: /u/cvsroot/1dir/nfile
  921.                       S: /nfile/0///
  922.                       S: E cvs server: use 'cvs commit' to add this file permanently
  923.                       S: ok
  924.  
  925.  Note that the file has not been added to the repository; the only effect of a 
  926.  successful add request, for a file, is to supply the client with a new entries 
  927.  line containing '0' to indicate an added file. In fact, the client probably 
  928.  could perform this operation without contacting the server, although using add 
  929.  does cause the server to perform a few more checks. 
  930.  
  931.  The client sends a subsequent ci to actually add the file to the repository. 
  932.  
  933.  Another quirk of the add request is that with CVS 1.9 and older, a pathname 
  934.  specified in an Argument request cannot contain '/'.  There is no good reason 
  935.  for this restriction, and in fact more recent CVS servers don't have it. But 
  936.  the way to interoperate with the older servers is to ensure that all Directory 
  937.  requests for add (except those used to add directories, as described above), 
  938.  use '.' for local-directory.  Specifying another string for local-directory 
  939.  may not get an error, but it will get you strange Checked-in responses from 
  940.  the buggy servers. 
  941.  
  942.  remove \n 
  943.            Response expected: yes.  Remove a file.  This uses any previous 
  944.            Argument, Directory, Entry, or Modified requests, if they have been 
  945.            sent.  The last Directory sent specifies the working directory at 
  946.            the time of the operation. 
  947.  
  948.            Note that this request does not actually do anything to the 
  949.            repository; the only effect of a successful remove request is to 
  950.            supply the client with a new entries line containing '-' to indicate 
  951.            a removed file.  In fact, the client probably could perform this 
  952.            operation without contacting the server, although using remove may 
  953.            cause the server to perform a few more checks. 
  954.  
  955.            The client sends a subsequent ci request to actually record the 
  956.            removal in the repository. 
  957.  
  958.  watch-on \n 
  959.  
  960.  watch-off \n 
  961.  
  962.  watch-add \n 
  963.  
  964.  watch-remove \n 
  965.            Response expected: yes.  Actually do the cvs watch on, cvs watch 
  966.            off, cvs watch add, and cvs watch remove commands, respectively. 
  967.            This uses any previous Argument, Directory, Entry, or Modified 
  968.            requests, if they have been sent.  The last Directory sent specifies 
  969.            the working directory at the time of the operation. 
  970.  
  971.  release \n 
  972.            Response expected: yes.  Note that a cvs release command has taken 
  973.            place and update the history file accordingly. 
  974.  
  975.  noop \n 
  976.            Response expected: yes.  This request is a null command in the sense 
  977.            that it doesn't do anything, but merely (as with any other requests 
  978.            expecting a response) sends back any responses pertaining to pending 
  979.            errors, pending Notified responses, etc. 
  980.  
  981.  update-patches \n 
  982.            Response expected: yes. This request does not actually do anything. 
  983.            It is used as a signal that the server is able to generate patches 
  984.            when given an update request.  The client must issue the -u argument 
  985.            to update in order to receive patches. 
  986.  
  987.  gzip-file-contents level \n 
  988.            Response expected: no.  Note that this request does not follow the 
  989.            response convention stated above.  Gzip-stream is suggested instead 
  990.            of gzip-file-contents as it gives better compression; the only 
  991.            reason to implement the latter is to provide compression with CVS 
  992.            1.8 and earlier.  The gzip-file-contents request asks the server to 
  993.            compress files it sends to the client using gzip (RFC1952/1951) 
  994.            compression, using the specified level of compression. If this 
  995.            request is not made, the server must not compress files. 
  996.  
  997.            This is only a hint to the server.  It may still decide (for 
  998.            example, in the case of very small files, or files that already 
  999.            appear to be compressed) not to do the compression.  Compression is 
  1000.            indicated by a 'z' preceding the file length. 
  1001.  
  1002.            Availability of this request in the server indicates to the client 
  1003.            that it may compress files sent to the server, regardless of whether 
  1004.            the client actually uses this request. 
  1005.  
  1006.  wrapper-sendme-rcsOptions \n 
  1007.            Response expected: yes. Request that the server transmit mappings 
  1008.            from filenames to keyword expansion modes in Wrapper-rcsOption 
  1009.            responses. 
  1010.  
  1011.  other-request text \n 
  1012.            Response expected: yes. Any unrecognized request expects a response, 
  1013.            and does not contain any additional data.  The response will 
  1014.            normally be something like 'error  unrecognized request', but it 
  1015.            could be a different error if a previous command which doesn't 
  1016.            expect a response produced an error. 
  1017.  
  1018.  When the client is done, it drops the connection. 
  1019.  
  1020.  
  1021. ΓòÉΓòÉΓòÉ 6.9. Introduction to Responses ΓòÉΓòÉΓòÉ
  1022.  
  1023.  After a command which expects a response, the server sends however many of the 
  1024.  following responses are appropriate.  The server should not send data at other 
  1025.  times (the current implementation may violate this principle in a few minor 
  1026.  places, where the server is printing an error message and exiting---this 
  1027.  should be investigated further). 
  1028.  
  1029.  Any set of responses always ends with 'error' or 'ok'.  This indicates that 
  1030.  the response is over. 
  1031.  
  1032.  The responses Checked-in, New-entry, Updated, Created, Update-existing, 
  1033.  Merged, and Patched are refered to as file updating responses, because they 
  1034.  change the status of a file in the working directory in some way. The 
  1035.  responses Mode, Mod-time, and Checksum are referred to as file update 
  1036.  modifying responses because they modify the next file updating response.  In 
  1037.  no case shall a file update modifying response apply to a file updating 
  1038.  response other than the next one.  Nor can the same file update modifying 
  1039.  response occur twice for a given file updating response (if servers diagnose 
  1040.  this problem, it may aid in detecting the case where clients send an update 
  1041.  modifying response without following it by a file updating response). 
  1042.  
  1043.  
  1044. ΓòÉΓòÉΓòÉ 6.10. The "pathname" in responses ΓòÉΓòÉΓòÉ
  1045.  
  1046.  Many of the responses contain something called pathname. The name is somewhat 
  1047.  misleading; it actually indicates a pair of pathnames.  First, a local 
  1048.  directory name relative to the directory in which the command was given (i.e. 
  1049.  the last Directory before the command).  Then a linefeed and a repository 
  1050.  name.  Then a slash and the filename (without a ',v' ending). For example, for 
  1051.  a file 'i386.mh' which is in the local directory 'gas.clean/config' and for 
  1052.  which the repository is '/rel/cvsfiles/devo/gas/config': 
  1053.  
  1054.                       gas.clean/config/
  1055.                       /rel/cvsfiles/devo/gas/config/i386.mh
  1056.  
  1057.  If the server wants to tell the client to create a directory, then it merely 
  1058.  uses the directory in any response, as described above, and the client should 
  1059.  create the directory if it does not exist.  Note that this should only be done 
  1060.  one directory at a time, in order to permit the client to correctly store the 
  1061.  repository for each directory.  Servers can use requests such as Clear-sticky, 
  1062.  Clear-static-directory, or any other requests, to create directories. Some 
  1063.  server implementations may poorly distinguish between a directory which should 
  1064.  not exist and a directory which contains no files; in order to refrain from 
  1065.  creating empty directories a client should both send the '-P' option to update 
  1066.  or co, and should also detect the case in which the server asks to create a 
  1067.  directory but not any files within it (in that case the client should remove 
  1068.  the directory or refrain from creating it in the first place).  Note that 
  1069.  servers could clean this up greatly by only telling the client to create 
  1070.  directories if the directory in question should exist, but until servers do 
  1071.  this, clients will need to offer the '-P' behavior described above. 
  1072.  
  1073.  
  1074. ΓòÉΓòÉΓòÉ 6.11. Responses ΓòÉΓòÉΓòÉ
  1075.  
  1076.  Here are the responses: 
  1077.  
  1078.  Valid-requests request-list \n 
  1079.            Indicate what requests the server will accept.  request-list is a 
  1080.            space separated list of tokens.  If the server supports sending 
  1081.            patches, it will include 'update-patches' in this list.  The 
  1082.            'update-patches' request does not actually do anything. 
  1083.  
  1084.  Checked-in pathname \n 
  1085.            Additional data: New Entries line, \n.  This means a file pathname 
  1086.            has been successfully operated on (checked in, added, etc.).  name 
  1087.            in the Entries line is the same as the last component of pathname. 
  1088.  
  1089.  New-entry pathname \n 
  1090.            Additional data: New Entries line, \n.  Like Checked-in, but the 
  1091.            file is not up to date. 
  1092.  
  1093.  Updated pathname \n 
  1094.            Additional data: New Entries line, \n, mode, \n, file transmission. 
  1095.            A new copy of the file is enclosed.  This is used for a new revision 
  1096.            of an existing file, or for a new file, or for any other case in 
  1097.            which the local (client-side) copy of the file needs to be updated, 
  1098.            and after being updated it will be up to date.  If any directory in 
  1099.            pathname does not exist, create it.  This response is not used if 
  1100.            Created and Update-existing are supported. 
  1101.  
  1102.  Created pathname \n 
  1103.            This is just like Updated and takes the same additional data, but is 
  1104.            used only if no Entry, Modified, or Unchanged request has been sent 
  1105.            for the file in question.  The distinction between Created and 
  1106.            Update-existing is so that the client can give an error message in 
  1107.            several cases: (1) there is a file in the working directory, but not 
  1108.            one for which Entry, Modified, or Unchanged was sent (for example, a 
  1109.            file which was ignored, or a file for which Questionable was sent), 
  1110.            (2) there is a file in the working directory whose name differs from 
  1111.            the one mentioned in Created in ways that the client is unable to 
  1112.            use to distinguish files.  For example, the client is 
  1113.            case-insensitive and the names differ only in case. 
  1114.  
  1115.  Update-existing pathname \n 
  1116.            This is just like Updated and takes the same additional data, but is 
  1117.            used only if a Entry, Modified, or Unchanged request has been sent 
  1118.            for the file in question. 
  1119.  
  1120.            This response, or Merged, indicates that the server has determined 
  1121.            that it is OK to overwrite the previous contents of the file 
  1122.            specified by pathname.  Provided that the client has correctly sent 
  1123.            Modified or Is-modified requests for a modified file, and the file 
  1124.            was not modified while CVS was running, the server can ensure that a 
  1125.            user's modifications are not lost. 
  1126.  
  1127.  Merged pathname \n 
  1128.            This is just like Updated and takes the same additional data, with 
  1129.            the one difference that after the new copy of the file is enclosed, 
  1130.            it will still not be up to date.  Used for the results of a merge, 
  1131.            with or without conflicts. 
  1132.  
  1133.            It is useful to preserve an copy of what the file looked like before 
  1134.            the merge.  This is basically handled by the server; before sending 
  1135.            Merged it will send a Copy-file response.  For example, if the file 
  1136.            is 'aa' and it derives from revision 1.3, the Copy-file response 
  1137.            will tell the client to copy 'aa' to '.#aa.1.3'.  It is up to the 
  1138.            client to decide how long to keep this file around; traditionally 
  1139.            clients have left it around forever, thus letting the user clean it 
  1140.            up as desired.  But another answer, such as until the next commit, 
  1141.            might be preferable. 
  1142.  
  1143.  Rcs-diff pathname \n 
  1144.            This is just like Updated and takes the same additional data, with 
  1145.            the one difference that instead of sending a new copy of the file, 
  1146.            the server sends an RCS change text.  This change text is produced 
  1147.            by 'diff -n' (the GNU diff '-a' option may also be used).  The 
  1148.            client must apply this change text to the existing file.  This will 
  1149.            only be used when the client has an exact copy of an earlier 
  1150.            revision of a file.  This response is only used if the update 
  1151.            command is given the '-u' argument. 
  1152.  
  1153.  Patched pathname \n 
  1154.            This is just like Rcs-diff and takes the same additional data, 
  1155.            except that it sends a standard patch rather than an RCS change 
  1156.            text. The patch is produced by 'diff -c' for CVS 1.6 and later (see 
  1157.            POSIX.2 for a description of this format), or 'diff -u' for previous 
  1158.            versions of CVS; clients are encouraged to accept either format. 
  1159.            Like Rcs-diff, this response is only used if the update command is 
  1160.            given the '-u' argument. 
  1161.  
  1162.            The Patched response is deprecated in favor of the Rcs-diff 
  1163.            response.  However, older clients (CVS 1.9 and earlier) only support 
  1164.            Patched. 
  1165.  
  1166.  Mode mode \n 
  1167.            This mode applies to the next file mentioned in Checked-in.  Mode is 
  1168.            a file update modifying response as described in Response intro. 
  1169.  
  1170.  Mod-time time \n 
  1171.            Set the modification time of the next file sent to time. Mod-time is 
  1172.            a file update modifying response as described in Response intro. The 
  1173.            time is in the format specified by RFC822 as modified by RFC1123. 
  1174.            The server may specify any timezone it chooses; clients will want to 
  1175.            convert that to their own timezone as appropriate.  An example of 
  1176.            this format is: 
  1177.  
  1178.                       26 May 1997 13:01:40 -0400
  1179.  
  1180.  There is no requirement that the client and server clocks be synchronized. 
  1181.  The server just sends its recommendation for a timestamp (based on its own 
  1182.  clock, presumably), and the client should just believe it (this means that the 
  1183.  time might be in the future, for example). 
  1184.  
  1185.  Checksum checksum\n 
  1186.            The checksum applies to the next file sent (that is, Checksum is a 
  1187.            file update modifying response as described in Response intro). In 
  1188.            the case of Patched, the checksum applies to the file after being 
  1189.            patched, not to the patch itself.  The client should compute the 
  1190.            checksum itself, after receiving the file or patch, and signal an 
  1191.            error if the checksums do not match.  The checksum is the 128 bit 
  1192.            MD5 checksum represented as 32 hex digits (MD5 is described in 
  1193.            RFC1321). This response is optional, and is only used if the client 
  1194.            supports it (as judged by the Valid-responses request). 
  1195.  
  1196.  Copy-file pathname \n 
  1197.            Additional data: newname \n.  Copy file pathname to newname in the 
  1198.            same directory where it already is.  This does not affect 
  1199.            CVS/Entries. 
  1200.  
  1201.            This can optionally be implemented as a rename instead of a copy. 
  1202.            The only use for it which currently has been identified is prior to 
  1203.            a Merged response as described under Merged.  Clients can probably 
  1204.            assume that is how it is being used, if they want to worry about 
  1205.            things like how long to keep the newname file around. 
  1206.  
  1207.  Removed pathname \n 
  1208.            The file has been removed from the repository (this is the case 
  1209.            where cvs prints 'file foobar.c is no longer pertinent'). 
  1210.  
  1211.  Remove-entry pathname \n 
  1212.            The file needs its entry removed from CVS/Entries, but the file 
  1213.            itself is already gone (this happens in response to a ci request 
  1214.            which involves committing the removal of a file). 
  1215.  
  1216.  Set-static-directory pathname \n 
  1217.            This instructs the client to set the Entries.Static flag, which it 
  1218.            should then send back to the server in a Static-directory request 
  1219.            whenever the directory is operated on.  pathname ends in a slash; 
  1220.            its purpose is to specify a directory, not a file within a 
  1221.            directory. 
  1222.  
  1223.  Clear-static-directory pathname \n 
  1224.            Like Set-static-directory, but clear, not set, the flag. 
  1225.  
  1226.  Set-sticky pathname \n 
  1227.            Additional data: tagspec \n.  Tell the client to set a sticky tag or 
  1228.            date, which should be supplied with the Sticky request for future 
  1229.            operations.  pathname ends in a slash; its purpose is to specify a 
  1230.            directory, not a file within a directory.  The client should store 
  1231.            tagspec and pass it back to the server as-is, to allow for future 
  1232.            expansion.  The first character of tagspec is 'T' for a tag, 'D' for 
  1233.            a date, or something else for future expansion.  The remainder of 
  1234.            tagspec contains the actual tag or date. 
  1235.  
  1236.  Clear-sticky pathname \n 
  1237.            Clear any sticky tag or date set by Set-sticky. 
  1238.  
  1239.  Template pathname \n 
  1240.            Additional data: file transmission (note: compressed file 
  1241.            transmissions are not supported).  pathname ends in a slash; its 
  1242.            purpose is to specify a directory, not a file within a directory. 
  1243.            Tell the client to store the file transmission as the template log 
  1244.            message, and then use that template in the future when prompting the 
  1245.            user for a log message. 
  1246.  
  1247.  Set-checkin-prog dir \n 
  1248.            Additional data: prog \n.  Tell the client to set a checkin program, 
  1249.            which should be supplied with the Checkin-prog request for future 
  1250.            operations. 
  1251.  
  1252.  Set-update-prog dir \n 
  1253.            Additional data: prog \n.  Tell the client to set an update program, 
  1254.            which should be supplied with the Update-prog request for future 
  1255.            operations. 
  1256.  
  1257.  Notified pathname \n 
  1258.            Indicate to the client that the notification for pathname has been 
  1259.            done.  There should be one such response for every Notify request; 
  1260.            if there are several Notify requests for a single file, the requests 
  1261.            should be processed in order; the first Notified response pertains 
  1262.            to the first Notify request, etc. 
  1263.  
  1264.  Module-expansion pathname \n 
  1265.            Return a file or directory which is included in a particular module. 
  1266.            pathname is relative to cvsroot, unlike most pathnames in responses. 
  1267.            pathname should be used to look and see whether some or all of the 
  1268.            module exists on the client side; it is not necessarily suitable for 
  1269.            passing as an argument to a co request (for example, if the modules 
  1270.            file contains the '-d' option, it will be the directory specified 
  1271.            with '-d', not the name of the module). 
  1272.  
  1273.  Wrapper-rcsOption pattern -k 'option' \n 
  1274.            Transmit to the client a filename pattern which implies a certain 
  1275.            keyword expansion mode.  The pattern is a wildcard pattern (for 
  1276.            example, '*.exe'.  The option is 'b' for binary, and so on.  Note 
  1277.            that although the syntax happens to resemble the syntax in certain 
  1278.            CVS configuration files, it is more constrained; there must be 
  1279.            exactly one space between pattern and '-k' and exactly one space 
  1280.            between '-k' and ''', and no string is permitted in place of '-k' 
  1281.            (extensions should be done with new responses, not by extending this 
  1282.            one, for graceful handling of Valid-responses). 
  1283.  
  1284.  M text \n 
  1285.            A one-line message for the user. 
  1286.  
  1287.  Mbinary \n 
  1288.            Additional data: file transmission (note: compressed file 
  1289.            transmissions are not supported).  This is like 'M', except the 
  1290.            contents of the file transmission are binary and should be copied to 
  1291.            standard output without translation to local text file conventions. 
  1292.            To transmit a text file to standard output, servers should use a 
  1293.            series of 'M' requests. 
  1294.  
  1295.  E text \n 
  1296.            Same as M but send to stderr not stdout. 
  1297.  
  1298.  F \n 
  1299.            Flush stderr.  That is, make it possible for the user to see what 
  1300.            has been written to stderr (it is up to the implementation to decide 
  1301.            exactly how far it should go to ensure this). 
  1302.  
  1303.  MT tagname data \n 
  1304.            This response provides for tagged text.  It is similar to 
  1305.            SGML/HTML/XML in that the data is structured and a naive application 
  1306.            can also make some sense of it without understanding the structure. 
  1307.            The syntax is not SGML-like, however, in order to fit into the CVS 
  1308.            protocol better and (more importantly) to make it easier to parse, 
  1309.            especially in a language like perl or awk. 
  1310.  
  1311.            The tagname can have several forms.  If it starts with 'a' to 'z' or 
  1312.            'A' to 'Z', then it represents tagged text. If the implementation 
  1313.            recognizes tagname, then it may interpret data in some particular 
  1314.            fashion.  If the implementation does not recognize tagname, then it 
  1315.            should simply treat data as text to be sent to the user (similar to 
  1316.            an 'M' response).  There are two tags which are general purpose. 
  1317.            The 'text' tag is similar to an unrecognized tag in that it provides 
  1318.            text which will ordinarily be sent to the user.  The 'newline' tag 
  1319.            is used without data and indicates that a newline will ordinarily be 
  1320.            sent to the user (there is no provision for embedding newlines in 
  1321.            the data of other tagged text responses). 
  1322.  
  1323.            If tagname starts with '+' it indicates a start tag and if it starts 
  1324.            with '-' it indicates an end tag.  The remainder of tagname should 
  1325.            be the same for matching start and end tags, and tags should be 
  1326.            nested (for example one could have tags in the following order +bold 
  1327.            +italic text -italic -bold but not +bold +italic text -bold 
  1328.            -italic).  A particular start and end tag may be documented to 
  1329.            constrain the tagged text responses which are valid between them. 
  1330.  
  1331.            Note that if data is present there will always be exactly one space 
  1332.            between tagname and data; if there is more than one space, then the 
  1333.            spaces beyond the first are part of data. 
  1334.  
  1335.            Here is an example of some tagged text responses.  Note that there 
  1336.            is a trailing space after 'Checking in' and 'initial revision:' and 
  1337.            there are two trailing spaces after '<--'.  Such trailing spaces 
  1338.            are, of course, part of data. 
  1339.  
  1340.                       MT +checking-in
  1341.                       MT text Checking in
  1342.                       MT fname gz.tst
  1343.                       MT text ;
  1344.                       MT newline
  1345.                       MT rcsfile /home/kingdon/zwork/cvsroot/foo/gz.tst,v
  1346.                       MT text  <--
  1347.                       MT fname gz.tst
  1348.                       MT newline
  1349.                       MT text initial revision:
  1350.                       MT init-rev 1.1
  1351.                       MT newline
  1352.                       MT text done
  1353.                       MT newline
  1354.                       MT -checking-in
  1355.  
  1356.  If the client does not support the 'MT' response, the same responses might be 
  1357.  sent as: 
  1358.  
  1359.                       M Checking in gz.tst;
  1360.                       M /home/kingdon/zwork/cvsroot/foo/gz.tst,v  <--  gz.tst
  1361.                       M initial revision: 1.1
  1362.                       M done
  1363.  
  1364.  For a list of specific tags, see Text tags. 
  1365.  
  1366.  error errno-code ' ' text \n 
  1367.            The command completed with an error.  errno-code is a symbolic error 
  1368.            code (e.g. ENOENT); if the server doesn't support this feature, or 
  1369.            if it's not appropriate for this particular message, it just omits 
  1370.            the errno-code (in that case there are two spaces after 'error'). 
  1371.            Text is an error message such as that provided by strerror(), or any 
  1372.            other message the server wants to use. 
  1373.  
  1374.  ok \n 
  1375.            The command completed successfully. 
  1376.  
  1377.  
  1378. ΓòÉΓòÉΓòÉ 6.12. Tags for the MT tagged text response ΓòÉΓòÉΓòÉ
  1379.  
  1380.  The MT response, as described in Responses, offers a way for the server to 
  1381.  send tagged text to the client.  This section describes specific tags.  The 
  1382.  intention is to update this section as servers add new tags. 
  1383.  
  1384.  In the following descriptions, text and newline tags are omitted.  Such tags 
  1385.  contain information which is intended for users (or to be discarded), and are 
  1386.  subject to change at the whim of the server. To avoid being vulnerable to such 
  1387.  whim, clients should look for the tags listed here, not text, newline, or 
  1388.  other tags. 
  1389.  
  1390.  The following tag means to indicate to the user that a file has been updated. 
  1391.  It is more or less redundant with the Created and Update-existing responses, 
  1392.  but we don't try to specify here whether it occurs in exactly the same 
  1393.  circumstances as Created and Update-existing.  The name is the pathname of the 
  1394.  file being updated relative to the directory in which the command is occurring 
  1395.  (that is, the last Directory request which is sent before the command). 
  1396.  
  1397.                       MT +updated
  1398.                       MT fname name
  1399.                       MT -updated
  1400.  
  1401.  
  1402. ΓòÉΓòÉΓòÉ 6.13. Example ΓòÉΓòÉΓòÉ
  1403.  
  1404.  Here is an example; lines are prefixed by 'C: ' to indicate the client sends 
  1405.  them or 'S: ' to indicate the server sends them. 
  1406.  
  1407.  The client starts by connecting, sending the root, and completing the protocol 
  1408.  negotiation.  In actual practice the lists of valid responses and requests 
  1409.  would be longer. 
  1410.  
  1411.                       C: Root /u/cvsroot
  1412.                       C: Valid-responses ok error Checked-in M E
  1413.                       C: valid-requests
  1414.                       S: Valid-requests Root Directory Entry Modified Argument Argumentx ci co
  1415.                       S: ok
  1416.                       C: UseUnchanged
  1417.  
  1418.  The client wants to check out the supermunger module into a fresh working 
  1419.  directory.  Therefore it first expands the supermunger module; this step would 
  1420.  be omitted if the client was operating on a directory rather than a module. 
  1421.  
  1422.                       C: Argument supermunger
  1423.                       C: Directory .
  1424.                       C: /u/cvsroot
  1425.                       C: expand-modules
  1426.  
  1427.  The server replies that the supermunger module expands to the directory 
  1428.  supermunger (the simplest case): 
  1429.  
  1430.                       S: Module-expansion supermunger
  1431.                       S: ok
  1432.  
  1433.  The client then proceeds to check out the directory.  The fact that it sends 
  1434.  only a single Directory request which specifies '.' for the working directory 
  1435.  means that there is not already a supermunger directory on the client. 
  1436.  
  1437.                       C: Argument -N
  1438.                       C: Argument supermunger
  1439.                       C: Directory .
  1440.                       C: /u/cvsroot
  1441.                       C: co
  1442.  
  1443.  The server replies with the requested files.  In this example, there is only 
  1444.  one file, 'mungeall.c'.  The Clear-sticky and Clear-static-directory requests 
  1445.  are sent by the current implementation but they have no effect because the 
  1446.  default is for those settings to be clear when a directory is newly created. 
  1447.  
  1448.                       S: Clear-sticky supermunger/
  1449.                       S: /u/cvsroot/supermunger/
  1450.                       S: Clear-static-directory supermunger/
  1451.                       S: /u/cvsroot/supermunger/
  1452.                       S: E cvs server: Updating supermunger
  1453.                       S: M U supermunger/mungeall.c
  1454.                       S: Created supermunger/
  1455.                       S: /u/cvsroot/supermunger/mungeall.c
  1456.                       S: /mungeall.c/1.1///
  1457.                       S: u=rw,g=r,o=r
  1458.                       S: 26
  1459.                       S: int mein () { abort (); }
  1460.                       S: ok
  1461.  
  1462.  The current client implementation would break the connection here and make a 
  1463.  new connection for the next command.  However, the protocol allows it to keep 
  1464.  the connection open and continue, which is what we show here. 
  1465.  
  1466.  After the user modifies the file and instructs the client to check it back in. 
  1467.  The client sends arguments to specify the log message and file to check in: 
  1468.  
  1469.                       C: Argument -m
  1470.                       C: Argument Well, you see, it took me hours and hours to find
  1471.                       C: Argumentx this typo and I searched and searched and eventually
  1472.                       C: Argumentx had to ask John for help.
  1473.                       C: Argument mungeall.c
  1474.  
  1475.  It also sends information about the contents of the working directory, 
  1476.  including the new contents of the modified file.  Note that the user has 
  1477.  changed into the 'supermunger' directory before executing this command; the 
  1478.  top level directory is a user-visible concept because the server should print 
  1479.  filenames in M and E responses relative to that directory. 
  1480.  
  1481.                       C: Directory .
  1482.                       C: /u/cvsroot/supermunger
  1483.                       C: Entry /mungeall.c/1.1///
  1484.                       C: Modified mungeall.c
  1485.                       C: u=rw,g=r,o=r
  1486.                       C: 26
  1487.                       C: int main () { abort (); }
  1488.  
  1489.  And finally, the client issues the checkin command (which makes use of the 
  1490.  data just sent): 
  1491.  
  1492.                       C: ci
  1493.  
  1494.  And the server tells the client that the checkin succeeded: 
  1495.  
  1496.                       S: M Checking in mungeall.c;
  1497.                       S: E /u/cvsroot/supermunger/mungeall.c,v  <--  mungeall.c
  1498.                       S: E new revision: 1.2; previous revision: 1.1
  1499.                       S: E done
  1500.                       S: Mode u=rw,g=r,o=r
  1501.                       S: Checked-in ./
  1502.                       S: /u/cvsroot/supermunger/mungeall.c
  1503.                       S: /mungeall.c/1.2///
  1504.                       S: ok
  1505.  
  1506.  
  1507. ΓòÉΓòÉΓòÉ 6.14. Required versus optional parts of the protocol ΓòÉΓòÉΓòÉ
  1508.  
  1509.  The following are part of every known implementation of the CVS protocol 
  1510.  (except obsolete, pre-1.5, versions of CVS) and it is considered reasonable 
  1511.  behavior to completely fail to work if you are connected with an 
  1512.  implementation which attempts to not support them.  Requests: Root, 
  1513.  Valid-responses, valid-requests, Directory, Entry, Modified, Unchanged, 
  1514.  Argument, Argumentx, ci, co, update. Responses: ok, error, Valid-requests, 
  1515.  Checked-in, Updated, Merged, Removed, M, E. 
  1516.  
  1517.  A server need not implement Repository, but in order to interoperate with CVS 
  1518.  1.5 through 1.9 it must claim to implement it (in Valid-requests).  The client 
  1519.  will not actually send the request. 
  1520.  
  1521.  
  1522. ΓòÉΓòÉΓòÉ 6.15. Obsolete protocol elements ΓòÉΓòÉΓòÉ
  1523.  
  1524.  This section briefly describes protocol elements which are obsolete. There is 
  1525.  no attempt to document them in full detail. 
  1526.  
  1527.  There was a Repository request which was like Directory except it only 
  1528.  provided repository, and the local directory was assumed to be similarly 
  1529.  named. 
  1530.  
  1531.  If the UseUnchanged request was not sent, there was a Lost request which was 
  1532.  sent to indicate that a file did not exist in the working directory, and the 
  1533.  meaning of sending Entries without Lost or Modified was different.  All 
  1534.  current clients (CVS 1.5 and later) will send UseUnchanged if it is supported. 
  1535.  
  1536.  
  1537. ΓòÉΓòÉΓòÉ 7. Notes on the Protocol ΓòÉΓòÉΓòÉ
  1538.  
  1539.  A number of enhancements are possible.  Also see the file TODO in the CVS 
  1540.  source distribution, which has further ideas concerning various aspects of 
  1541.  CVS, some of which impact the protocol. 
  1542.  
  1543.      The Modified request could be speeded up by sending diffs rather than 
  1544.       entire files.  The client would need some way to keep the version of the 
  1545.       file which was originally checked out; probably requiring the use of "cvs 
  1546.       edit" in this case is the most sensible course (the "cvs edit" could be 
  1547.       handled by a package like VC for emacs).  This would also allow local 
  1548.       operation of cvs diff without arguments. 
  1549.  
  1550.      The current procedure for cvs update is highly sub-optimal if there are 
  1551.       many modified files.  One possible alternative would be to have the 
  1552.       client send a first request without the contents of every modified file, 
  1553.       then have the server tell it what files it needs.  Note the server needs 
  1554.       to do the what-needs-to-be-updated check twice (or more, if changes in 
  1555.       the repository mean it has to ask the client for more files), because it 
  1556.       can't keep locks open while waiting for the network.  Perhaps this whole 
  1557.       thing is irrelevant if there is a multisite capability (as noted in 
  1558.       TODO), and therefore the rcsmerge can be done with a repository which is 
  1559.       connected via a fast connection. 
  1560.  
  1561.      The fact that pserver requires an extra network turnaround in order to 
  1562.       perform authentication would be nice to avoid.  This relates to the issue 
  1563.       of reporting errors; probably the clean solution is to defer the error 
  1564.       until the client has issued a request which expects a response.  To some 
  1565.       extent this might relate to the next item (in terms of how easy it is to 
  1566.       skip a whole bunch of requests until we get to one that expects a 
  1567.       response).  I know that the kerberos code doesn't wait in this fashion, 
  1568.       but that probably can cause network deadlocks and perhaps future problems 
  1569.       running over a transport which is more transaction oriented than TCP.  On 
  1570.       the other hand I'm not sure it is wise to make the client conduct a 
  1571.       lengthy upload only to find there is an authentication failure. 
  1572.  
  1573.      The protocol uses an extra network turnaround for protocol negotiation 
  1574.       (valid-requests).  It might be nice to avoid this by having the client be 
  1575.       able to send requests and tell the server to ignore them if they are 
  1576.       unrecognized (different requests could produce a fatal error if 
  1577.       unrecognized).  To do this there should be a standard syntax for 
  1578.       requests.  For example, perhaps all future requests should be a single 
  1579.       line, with mechanisms analogous to Argumentx, or several requests working 
  1580.       together, to provide greater amounts of information.  Or there might be a 
  1581.       standard mechanism for counted data (analogous to that used by Modified) 
  1582.       or continuation lines (like a generalized Argumentx).  It would be useful 
  1583.       to compare what HTTP is planning in this area; last I looked they were 
  1584.       contemplating something called Protocol Extension Protocol but I haven't 
  1585.       looked at the relevant IETF documents in any detail.  Obviously, we want 
  1586.       something as simple as possible (but no simpler). 
  1587.  
  1588.      The scrambling algorithm in the CVS client and server actually support 
  1589.       more characters than those documented in Password scrambling. Someday we 
  1590.       are going to either have to document them all (but this is not as easy as 
  1591.       it may look, see below), or (gradually and with adequate process) phase 
  1592.       out the support for other characters in the CVS implementation.  This 
  1593.       business of having the feature partly undocumented isn't a desirable 
  1594.       state long-term. 
  1595.  
  1596.       The problem with documenting other characters is that unless we know what 
  1597.       character set is in use, there is no way to make a password portable from 
  1598.       one system to another.  For example, a with a circle on top might have 
  1599.       different encodings in different character sets. 
  1600.  
  1601.       It almost works to say that the client picks an arbitrary, unknown 
  1602.       character set (indeed, having the CVS client know what character set the 
  1603.       user has in mind is a hard problem otherwise), and scrambles according to 
  1604.       a certain octet<->octet mapping.  There are two problems with this.  One 
  1605.       is that the protocol has no way to transmit character 10 decimal 
  1606.       (linefeed), and the current server and clients have no way to handle 0 
  1607.       decimal (NUL).  This may cause problems with certain multibyte character 
  1608.       sets, in which octets 10 and 0 will appear in the middle of other 
  1609.       characters.  The other problem, which is more minor and possibly not 
  1610.       worth worrying about, is that someone can type a password on one system 
  1611.       and then go to another system which uses a different encoding for the 
  1612.       same characters, and have their password not work. 
  1613.  
  1614.       The restriction to the ISO646 invariant subset is the best approach for 
  1615.       strings which are not particularly significant to users.  Passwords are 
  1616.       visible enough that this is somewhat doubtful as applied here.  ISO646 
  1617.       does, however, have the virtue (!?) of offending everyone.  It is easy to 
  1618.       say "But the $ is right on people's keyboards!  Surely we can't forbid 
  1619.       that".  From a human factors point of view, that makes quite a bit of 
  1620.       sense.  The contrary argument, of course, is that a with a circle on top, 
  1621.       or some of the characters poorly handled by Unicode, are on someone's 
  1622.       keyboard. 
  1623.