home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / info / cvsclient.info < prev    next >
Encoding:
GNU Info File  |  1996-10-13  |  40.3 KB  |  913 lines

  1. This is Info file cvsclient.info, produced by Makeinfo-1.64 from the
  2. input file /ade-source/fsf/cvs/doc/cvsclient.texi.
  3.  
  4. 
  5. File: cvsclient.info,  Node: Top,  Next: Introduction,  Up: (dir)
  6.  
  7. CVS Client/Server
  8. *****************
  9.  
  10.    This document describes the client/server protocol used by CVS.  It
  11. does not describe how to use or administer client/server CVS; see the
  12. regular CVS manual for that.  This is version 1.9 of the protocol
  13. specification--*Note Introduction::, for more on what this version
  14. number means.
  15.  
  16. * Menu:
  17.  
  18. * Introduction::      What is CVS and what is the client/server protocol for?
  19. * Goals::             Basic design decisions, requirements, scope, etc.
  20. * Notes::             Notes on the current implementation
  21. * Protocol Notes::    Possible enhancements, limitations, etc. of the protocol
  22. * Connection and Authentication::  Various ways to connect to the server
  23. * Protocol::          Complete description of the protocol
  24.  
  25. 
  26. File: cvsclient.info,  Node: Introduction,  Next: Goals,  Prev: Top,  Up: Top
  27.  
  28. Introduction
  29. ************
  30.  
  31.    CVS is a version control system (with some additional configuration
  32. management functionality).  It maintains a central "repository" which
  33. stores files (often source code), including past versions, information
  34. about who modified them and when, and so on.  People who wish to look
  35. at or modify those files, known as "developers", use CVS to "check out"
  36. a "working directory" from the repository, to "check in" new versions
  37. of files to the repository, and other operations such as viewing the
  38. modification history of a file.  If developers are connected to the
  39. repository by a network, particularly a slow or flaky one, the most
  40. efficient way to use the network is with the CVS-specific protocol
  41. described in this document.
  42.  
  43.    Developers, using the machine on which they store their working
  44. directory, run the CVS "client" program.  To perform operations which
  45. cannot be done locally, it connects to the CVS "server" program, which
  46. maintains the repository.  For more information on how to connect see
  47. *Note Connection and Authentication::.
  48.  
  49.    This document describes the CVS protocol.  Unfortunately, it does not
  50. yet completely document one aspect of the protocol--the detailed
  51. operation of each CVS command and option--and one must look at the CVS
  52. user documentation, `cvs.texinfo', for that information.  The protocol
  53. is non-proprietary (anyone who wants to is encouraged to implement it)
  54. and an implementation, known as CVS, is available under the GNU Public
  55. License.  The CVS distribution, containing this implementation,
  56. `cvs.texinfo', and a copy (possibly more or less up to date than what
  57. you are reading now) of this document, `cvsclient.texi', can be found
  58. at the usual GNU FTP sites, with a filename such as
  59. `cvs-VERSION.tar.gz'.
  60.  
  61.    This is version 1.9 of the protocol specification.  This version
  62. number is intended only to aid in distinguishing different versions of
  63. this specification.  Although the specification is currently maintained
  64. in conjunction with the CVS implementation, and carries the same
  65. version number, it also intends to document what is involved with
  66. interoperating with other implementations (such as other versions of
  67. CVS); see *Note Requirements::.  This version number should not be used
  68. by clients or servers to determine what variant of the protocol to
  69. speak; they should instead use the `valid-requests' and
  70. `Valid-responses' mechanism (*note Protocol::.), which is more flexible.
  71.  
  72. 
  73. File: cvsclient.info,  Node: Goals,  Next: Notes,  Prev: Introduction,  Up: Top
  74.  
  75. Goals
  76. *****
  77.  
  78.    * Do not assume any access to the repository other than via this
  79.      protocol.  It does not depend on NFS, rdist, etc.
  80.  
  81.    * Providing a reliable transport is outside this protocol.  It is
  82.      expected that it runs over TCP, UUCP, etc.
  83.  
  84.    * Security and authentication are handled outside this protocol (but
  85.      see below about `cvs kserver' and `cvs pserver').
  86.  
  87.    * This might be a first step towards adding transactions to CVS
  88.      (i.e. a set of operations is either executed atomically or none of
  89.      them is executed), improving the locking, or other features.  The
  90.      current server implementation is a long way from being able to do
  91.      any of these things.  The protocol, however, is not known to
  92.      contain any defects which would preclude them.
  93.  
  94.    * The server never has to have any CVS locks in place while it is
  95.      waiting for communication with the client.  This makes things
  96.      robust in the face of flaky networks.
  97.  
  98.    * Data is transferred in large chunks, which is necessary for good
  99.      performance.  In fact, currently the client uploads all the data
  100.      (without waiting for server responses), and then waits for one
  101.      server response (which consists of a massive download of all the
  102.      data).  There may be cases in which it is better to have a richer
  103.      interraction, but the need for the server to release all locks
  104.      whenever it waits for the client makes it complicated.
  105.  
  106. 
  107. File: cvsclient.info,  Node: Notes,  Next: Protocol Notes,  Prev: Goals,  Up: Top
  108.  
  109. Notes on the Current Implementation
  110. ***********************************
  111.  
  112.    The client is built in to the normal `cvs' program, triggered by a
  113. specially-formatted `CVSROOT' variable, for example
  114. `:server:cygnus.com:/rel/cvsfiles'.
  115.  
  116.    The client stores what is stored in checked-out directories
  117. (including `CVS').  The way these are stored is totally compatible with
  118. standard CVS.  The server requires no storage other than the repository,
  119. which also is totally compatible with standard CVS.
  120.  
  121.    The current server implementation can use up huge amounts of memory
  122. when transmitting a lot of data over a slow link (i.e. the network is
  123. slower than the server can generate the data).  There is some
  124. experimental code (see `SERVER_FLOWCONTROL' in options.h) which should
  125. help significantly.
  126.  
  127. 
  128. File: cvsclient.info,  Node: Protocol Notes,  Next: Connection and Authentication,  Prev: Notes,  Up: Top
  129.  
  130. Notes on the Protocol
  131. *********************
  132.  
  133.    A number of enhancements are possible:
  134.  
  135.    * The `Modified' request could be speeded up by sending diffs rather
  136.      than entire files.  The client would need some way to keep the
  137.      version of the file which was originally checked out; probably
  138.      requiring the use of "cvs edit" in this case is the most sensible
  139.      course (the "cvs edit" could be handled by a package like VC for
  140.      emacs).  This would also allow local operation of `cvs diff'
  141.      without arguments.
  142.  
  143.    * Have the client keep a copy of some part of the repository.  This
  144.      allows all of `cvs diff' and large parts of `cvs update' and `cvs
  145.      ci' to be local.  The local copy could be made consistent with the
  146.      master copy at night (but if the master copy has been updated since
  147.      the latest nightly re-sync, then it would read what it needs to
  148.      from the master).
  149.  
  150.    * The current procedure for `cvs update' is highly sub-optimal if
  151.      there are many modified files.  One possible alternative would be
  152.      to have the client send a first request without the contents of
  153.      every modified file, then have the server tell it what files it
  154.      needs.  Note the server needs to do the what-needs-to-be-updated
  155.      check twice (or more, if changes in the repository mean it has to
  156.      ask the client for more files), because it can't keep locks open
  157.      while waiting for the network.  Perhaps this whole thing is
  158.      irrelevant if client-side repositories are implemented, and the
  159.      rcsmerge is done by the client.
  160.  
  161. 
  162. File: cvsclient.info,  Node: Connection and Authentication,  Next: Protocol,  Prev: Protocol Notes,  Up: Top
  163.  
  164. How to Connect to and Authenticate Oneself to the CVS server
  165. ************************************************************
  166.  
  167.    Connection and authentication occurs before the CVS protocol itself
  168. is started.  There are several ways to connect.
  169.  
  170. server
  171.      If the client has a way to execute commands on the server, and
  172.      provide input to the commands and output from them, then it can
  173.      connect that way.  This could be the usual rsh (port 514)
  174.      protocol, Kerberos rsh, SSH, or any similar mechanism.  The client
  175.      may allow the user to specify the name of the server program; the
  176.      default is `cvs'.  It is invoked with one argument, `server'.
  177.      Once it invokes the server, the client proceeds to start the cvs
  178.      protocol.
  179.  
  180. kserver
  181.      The kerberized server listens on a port (in the current
  182.      implementation, by having inetd call "cvs kserver") which defaults
  183.      to 1999.  The client connects, sends the usual kerberos
  184.      authentication information, and then starts the cvs protocol.
  185.      Note: port 1999 is officially registered for another use, and in
  186.      any event one cannot register more than one port for CVS, so the
  187.      kerberized client and server should be changed to use port 2401
  188.      (see below), and send a different string in place of `BEGIN AUTH
  189.      REQUEST' to identify the authentication method in use.  However,
  190.      noone has yet gotten around to implementing this.
  191.  
  192. pserver
  193.      The password authenticated server listens on a port (in the current
  194.      implementation, by having inetd call "cvs pserver") which defaults
  195.      to 2401 (this port is officially registered).  The client
  196.      connects, sends the string `BEGIN AUTH REQUEST', a linefeed, the
  197.      cvs root, a linefeed, the username, a linefeed, the password
  198.      trivially encoded (see scramble.c in the cvs sources), a linefeed,
  199.      the string `END AUTH REQUEST', and a linefeed.  The server
  200.      responds with `I LOVE YOU' and a linefeed if the authentication is
  201.      successful or `I HATE YOU' and a linefeed if the authentication
  202.      fails.  After receiving `I LOVE YOU', the client proceeds with the
  203.      cvs protocol.  If the client wishes to merely authenticate without
  204.      starting the cvs protocol, the procedure is the same, except
  205.      `BEGIN AUTH REQUEST' is replaced with `BEGIN VERIFICATION
  206.      REQUEST', `END AUTH REQUEST' is replaced with `END VERIFICATION
  207.      REQUEST', and upon receipt of `I LOVE YOU' the connection is
  208.      closed rather than continuing.
  209.  
  210. 
  211. File: cvsclient.info,  Node: Protocol,  Prev: Connection and Authentication,  Up: Top
  212.  
  213. The CVS client/server protocol
  214. ******************************
  215.  
  216.    In the following, `\n' refers to a linefeed and `\t' refers to a
  217. horizontal tab.
  218.  
  219. * Menu:
  220.  
  221. * Entries Lines::
  222. * Modes::
  223. * Filenames::                       Conventions regarding filenames
  224. * Requests::
  225. * Responses::
  226. * Example::
  227. * Requirements::
  228.  
  229. 
  230. File: cvsclient.info,  Node: Entries Lines,  Next: Modes,  Up: Protocol
  231.  
  232. Entries Lines
  233. =============
  234.  
  235.    Entries lines are transmitted as:
  236.  
  237.      / NAME / VERSION / CONFLICT / OPTIONS / TAG_OR_DATE
  238.  
  239.    TAG_OR_DATE is either `T' TAG or `D' DATE or empty.  If it is
  240. followed by a slash, anything after the slash shall be silently ignored.
  241.  
  242.    VERSION can be empty, or start with `0' or `-', for no user file,
  243. new user file, or user file to be removed, respectively.
  244.  
  245.    CONFLICT, if it starts with `+', indicates that the file had
  246. conflicts in it.  The rest of CONFLICT is `=' if the timestamp matches
  247. the file, or anything else if it doesn't.  If CONFLICT does not start
  248. with a `+', it is silently ignored.
  249.  
  250. 
  251. File: cvsclient.info,  Node: Modes,  Next: Filenames,  Prev: Entries Lines,  Up: Protocol
  252.  
  253. Modes
  254. =====
  255.  
  256.    A mode is any number of repetitions of
  257.  
  258.      MODE-TYPE = DATA
  259.  
  260.    separated by `,'.
  261.  
  262.    MODE-TYPE is an identifier composed of alphanumeric characters.
  263. Currently specified: `u' for user, `g' for group, `o' for other (see
  264. below for discussion of whether these have their POSIX meaning or are
  265. more loose).  Unrecognized values of MODE-TYPE are silently ignored.
  266.  
  267.    DATA consists of any data not containing `,', `\0' or `\n'.  For
  268. `u', `g', and `o' mode types, data consists of alphanumeric characters,
  269. where `r' means read, `w' means write, `x' means execute, and
  270. unrecognized letters are silently ignored.
  271.  
  272.    The two most obvious ways in which the mode matters are: (1) is it
  273. writeable?  This is used by the developer communication features, and
  274. is implemented even on OS/2 (and could be implemented on DOS), whose
  275. notion of mode is limited to a readonly bit. (2) is it executable?
  276. Unix CVS users need CVS to store this setting (for shell scripts and
  277. the like).  The current CVS implementation on unix does a little bit
  278. more than just maintain these two settings, but it doesn't really have
  279. a nice general facility to store or version control the mode, even on
  280. unix, much less across operating systems with diverse protection
  281. features.  So all the ins and outs of what the mode means across
  282. operating systems haven't really been worked out (e.g. should the VMS
  283. port use ACLs to get POSIX semantics for groups?).
  284.  
  285. 
  286. File: cvsclient.info,  Node: Filenames,  Next: Requests,  Prev: Modes,  Up: Protocol
  287.  
  288. Conventions regarding transmission of file names
  289. ================================================
  290.  
  291.    In most contexts, `/' is used to separate directory and file names
  292. in filenames, and any use of other conventions (for example, that the
  293. user might type on the command line) is converted to that form.  The
  294. only exceptions might be a few cases in which the server provides a
  295. magic cookie which the client then repeats verbatim, but as the server
  296. has not yet been ported beyond unix, the two rules provide the same
  297. answer (and what to do if future server ports are operating on a
  298. repository like e:/foo or CVS_ROOT:[FOO.BAR] has not been carefully
  299. thought out).
  300.  
  301. 
  302. File: cvsclient.info,  Node: Requests,  Next: Responses,  Prev: Filenames,  Up: Protocol
  303.  
  304. Requests
  305. ========
  306.  
  307.    By convention, requests which begin with a capital letter do not
  308. elicit a response from the server, while all others do - save one.  The
  309. exception is `gzip-file-contents'.  Unrecognized requests will always
  310. elicit a response from the server, even if that request begins with a
  311. capital letter.
  312.  
  313.    File contents (noted below as FILE TRANSMISSION) can be sent in one
  314. of two forms.  The simpler form is a number of bytes, followed by a
  315. newline, followed by the specified number of bytes of file contents.
  316. These are the entire contents of the specified file.  Second, if both
  317. client and server support `gzip-file-contents', a `z' may precede the
  318. length, and the `file contents' sent are actually compressed with
  319. `gzip' (RFC1952/1951) compression.  The length specified is that of the
  320. compressed version of the file.
  321.  
  322.    In neither case are the file content followed by any additional data.
  323. The transmission of a file will end with a newline iff that file (or its
  324. compressed form) ends with a newline.
  325.  
  326. `Root PATHNAME \n'
  327.      Response expected: no.  Tell the server which `CVSROOT' to use.
  328.      Note that PATHNAME is a local directory and *not* a fully
  329.      qualified `CVSROOT' variable.  PATHNAME must already exist; if
  330.      creating a new root, use the `init' request, not `Root'.  PATHNAME
  331.      does not include the hostname of the server, how to access the
  332.      server, etc.; by the time the CVS protocol is in use, connection,
  333.      authentication, etc., are already taken care of.
  334.  
  335. `Valid-responses REQUEST-LIST \n'
  336.      Response expected: no.  Tell the server what responses the client
  337.      will accept.  request-list is a space separated list of tokens.
  338.  
  339. `valid-requests \n'
  340.      Response expected: yes.  Ask the server to send back a
  341.      `Valid-requests' response.
  342.  
  343. `Repository REPOSITORY \n'
  344.      Response expected: no.  Tell the server what repository to use.
  345.      This should be a directory name from a previous server response.
  346.      Note that this both gives a default for `Entry ' and `Modified '
  347.      and also for `ci' and the other commands; normal usage is to send a
  348.      `Repository ' for each directory in which there will be an `Entry
  349.      ' or `Modified ', and then a final `Repository ' for the original
  350.      directory, then the command.
  351.  
  352. `Directory LOCAL-DIRECTORY \n'
  353.      Additional data: REPOSITORY \n.  Response expected: no.  This is
  354.      like `Repository', but the local name of the directory may differ
  355.      from the repository name.  If the client uses this request, it
  356.      affects the way the server returns pathnames; see *Note
  357.      Responses::.  LOCAL-DIRECTORY is relative to the top level at
  358.      which the command is occurring (i.e. the last `Directory' or
  359.      `Repository' which is sent before the command); to indicate that
  360.      top level, `.' should be send for LOCAL-DIRECTORY.
  361.  
  362. `Max-dotdot LEVEL \n'
  363.      Response expected: no.  Tell the server that LEVEL levels of
  364.      directories above the directory which `Directory' requests are
  365.      relative to will be needed.  For example, if the client is
  366.      planning to use a `Directory' request for `../../foo', it must
  367.      send a `Max-dotdot' request with a LEVEL of at least 2.
  368.      `Max-dotdot' must be sent before the first `Directory' request.
  369.  
  370. `Static-directory \n'
  371.      Response expected: no.  Tell the server that the directory most
  372.      recently specified with `Repository' or `Directory' should not have
  373.      additional files checked out unless explicitly requested.  The
  374.      client sends this if the `Entries.Static' flag is set, which is
  375.      controlled by the `Set-static-directory' and
  376.      `Clear-static-directory' responses.
  377.  
  378. `Sticky TAGSPEC \n'
  379.      Response expected: no.  Tell the server that the directory most
  380.      recently specified with `Repository' has a sticky tag or date
  381.      TAGSPEC.  The first character of TAGSPEC is `T' for a tag, or `D'
  382.      for a date.  The remainder of TAGSPEC contains the actual tag or
  383.      date.
  384.  
  385. `Checkin-prog PROGRAM \n'
  386.      Response expected: no.  Tell the server that the directory most
  387.      recently specified with `Directory' has a checkin program PROGRAM.
  388.      Such a program would have been previously set with the
  389.      `Set-checkin-prog' response.
  390.  
  391. `Update-prog PROGRAM \n'
  392.      Response expected: no.  Tell the server that the directory most
  393.      recently specified with `Directory' has an update program PROGRAM.
  394.      Such a program would have been previously set with the
  395.      `Set-update-prog' response.
  396.  
  397. `Entry ENTRY-LINE \n'
  398.      Response expected: no.  Tell the server what version of a file is
  399.      on the local machine.  The name in ENTRY-LINE is a name relative
  400.      to the directory most recently specified with `Repository'.  If
  401.      the user is operating on only some files in a directory, `Entry'
  402.      requests for only those files need be included.  If an `Entry'
  403.      request is sent without `Modified', `Unchanged', or `Lost' for that
  404.      file the meaning depends on whether `UseUnchanged' has been sent;
  405.      if it has been it means the file is lost, if not it means the file
  406.      is unchanged.
  407.  
  408. `Modified FILENAME \n'
  409.      Response expected: no.  Additional data: mode, \n, file
  410.      transmission.  Send the server a copy of one locally modified
  411.      file.  FILENAME is relative to the most recent repository sent
  412.      with `Repository'.  If the user is operating on only some files in
  413.      a directory, only those files need to be included.  This can also
  414.      be sent without `Entry', if there is no entry for the file.
  415.  
  416. `Lost FILENAME \n'
  417.      Response expected: no.  Tell the server that FILENAME no longer
  418.      exists.  The name is relative to the most recent repository sent
  419.      with `Repository'.  This is used for any case in which `Entry' is
  420.      being sent but the file no longer exists.  If the client has
  421.      issued the `UseUnchanged' request, then this request is not used.
  422.  
  423. `Unchanged FILENAME \n'
  424.      Response expected: no.  Tell the server that FILENAME has not been
  425.      modified in the checked out directory.  The name is relative to
  426.      the most recent repository sent with `Repository'.  This request
  427.      can only be issued if `UseUnchanged' has been sent.
  428.  
  429. `UseUnchanged \n'
  430.      Response expected: no.  Tell the server that the client will be
  431.      indicating unmodified files with `Unchanged', and that files for
  432.      which no information is sent are nonexistent on the client side,
  433.      not unchanged.  This is necessary for correct behavior since only
  434.      the server knows what possible files may exist, and thus what
  435.      files are nonexistent.
  436.  
  437. `Notify FILENAME \n'
  438.      Response expected: no.  Tell the server that a `edit' or `unedit'
  439.      command has taken place.  The server needs to send a `Notified'
  440.      response, but such response is deferred until the next time that
  441.      the server is sending responses.  Response expected: no.
  442.      Additional data:
  443.           NOTIFICATION-TYPE \t TIME \t CLIENTHOST \t
  444.           WORKING-DIR \t WATCHES \n
  445.      where NOTIFICATION-TYPE is `E' for edit or `U' for unedit, TIME is
  446.      the time at which the edit or unedit took place, CLIENTHOST is the
  447.      name of the host on which the edit or unedit took place, and
  448.      WORKING-DIR is the pathname of the working directory where the
  449.      edit or unedit took place.  WATCHES are the temporary watches to
  450.      set; if it is followed by \t then the tab and the rest of the line
  451.      are ignored.
  452.  
  453. `Questionable FILENAME \n'
  454.      Response expected: no.  Additional data: no.  Tell the server to
  455.      check whether FILENAME should be ignored, and if not, next time the
  456.      server sends responses, send (in a `M' response) `?' followed by
  457.      the directory and filename.  FILENAME must not contain `/'; it
  458.      needs to be a file in the directory named by the most recent
  459.      `Directory' request.
  460.  
  461. `Case \n'
  462.      Response expected: no.  Tell the server that filenames should be
  463.      matched against ignore patterns in a case-insensitive fashion.
  464.      Note that this does not apply to other comparisons--for example
  465.      the filenames given in `Entry' and `Modified' requests for the
  466.      same file must match in case regardless of whether the `Case'
  467.      request is sent.
  468.  
  469. `Argument TEXT \n'
  470.      Response expected: no.  Save argument for use in a subsequent
  471.      command.  Arguments accumulate until an argument-using command is
  472.      given, at which point they are forgotten.
  473.  
  474. `Argumentx TEXT \n'
  475.      Response expected: no.  Append \n followed by text to the current
  476.      argument being saved.
  477.  
  478. `Global_option OPTION \n'
  479.      Response expected: no.  Transmit one of the global options `-q',
  480.      `-Q', `-l', `-t', `-r', or `-n'.  OPTION must be one of those
  481.      strings, no variations (such as combining of options) are allowed.
  482.      For graceful handling of `valid-requests', it is probably better
  483.      to make new global options separate requests, rather than trying
  484.      to add them to this request.
  485.  
  486. `Gzip-stream LEVEL \n'
  487.      Response expected: no.  Use zlib (RFC 1950/1951) compression to
  488.      compress all further communication between the client and the
  489.      server.  After this request is sent, all further communication
  490.      must be compressed.  All further data received from the server
  491.      will also be compressed.  The LEVEL argument suggests to the
  492.      server the level of compression that it should apply; it should be
  493.      an integer between 1 and 9, inclusive, where a higher number
  494.      indicates more compression.
  495.  
  496. `Kerberos-encrypt \n'
  497.      Response expected: no.  Use Kerberos encryption to encrypt all
  498.      further communication between the client and the server.  This
  499.      will only work if the connection was made over Kerberos in the
  500.      first place.  If both the `Gzip-stream' and the `Kerberos-encrypt'
  501.      requests are used, the `Kerberos-encrypt' request should be used
  502.      first.  This will make the client and server encrypt the
  503.      compressed data, as opposed to compressing the encrypted data.
  504.      Encrypted data is generally incompressible.
  505.  
  506. `Set VARIABLE=VALUE \n'
  507.      Response expected: no.  Set a user variable VARIABLE to VALUE.
  508.  
  509. `expand-modules \n'
  510.      Response expected: yes.  Expand the modules which are specified in
  511.      the arguments.  Returns the data in `Module-expansion' responses.
  512.      Note that the server can assume that this is checkout or export,
  513.      not rtag or rdiff; the latter do not access the working directory
  514.      and thus have no need to expand modules on the client side.
  515.  
  516. `co \n'
  517. `ci \n'
  518. `diff \n'
  519. `tag \n'
  520. `status \n'
  521. `log \n'
  522. `add \n'
  523. `remove \n'
  524. `rdiff \n'
  525. `rtag \n'
  526. `admin \n'
  527. `export \n'
  528. `history \n'
  529. `watchers \n'
  530. `editors \n'
  531. `annotate \n'
  532.      Response expected: yes.  Actually do a cvs command.  This uses any
  533.      previous `Argument', `Repository', `Entry', `Modified', or `Lost'
  534.      requests, if they have been sent.  The last `Repository' sent
  535.      specifies the working directory at the time of the operation.  No
  536.      provision is made for any input from the user.  This means that
  537.      `ci' must use a `-m' argument if it wants to specify a log message.
  538.  
  539. `init ROOT-NAME \n'
  540.      Response expected: yes.  If it doesn't already exist, create a CVS
  541.      repository ROOT-NAME.  Note that ROOT-NAME is a local directory
  542.      and *not* a fully qualified `CVSROOT' variable.  The `Root'
  543.      request need not have been previously sent.
  544.  
  545. `update \n'
  546.      Response expected: yes.  Actually do a `cvs update' command.  This
  547.      uses any previous `Argument', `Repository', `Entry', `Modified',
  548.      or `Lost' requests, if they have been sent.  The last `Repository'
  549.      sent specifies the working directory at the time of the operation.
  550.      The `-I' option is not used-files which the client can decide
  551.      whether to ignore are not mentioned and the client sends the
  552.      `Questionable' request for others.
  553.  
  554. `import \n'
  555.      Response expected: yes.  Actually do a `cvs import' command.  This
  556.      uses any previous `Argument', `Repository', `Entry', `Modified',
  557.      or `Lost' requests, if they have been sent.  The last `Repository'
  558.      sent specifies the working directory at the time of the operation.
  559.      The files to be imported are sent in `Modified' requests (files
  560.      which the client knows should be ignored are not sent; the server
  561.      must still process the CVSROOT/cvsignore file unless -I ! is
  562.      sent).  A log message must have been specified with a `-m'
  563.      argument.
  564.  
  565. `watch-on \n'
  566. `watch-off \n'
  567. `watch-add \n'
  568. `watch-remove \n'
  569.      Response expected: yes.  Actually do the `cvs watch on', `cvs
  570.      watch off', `cvs watch add', and `cvs watch remove' commands,
  571.      respectively.  This uses any previous `Argument', `Repository',
  572.      `Entry', `Modified', or `Lost' requests, if they have been sent.
  573.      The last `Repository' sent specifies the working directory at the
  574.      time of the operation.
  575.  
  576. `release \n'
  577.      Response expected: yes.  Note that a `cvs release' command has
  578.      taken place and update the history file accordingly.
  579.  
  580. `noop \n'
  581.      Response expected: yes.  This request is a null command in the
  582.      sense that it doesn't do anything, but merely (as with any other
  583.      requests expecting a response) sends back any responses pertaining
  584.      to pending errors, pending `Notified' responses, etc.
  585.  
  586. `update-patches \n'
  587.      Response expected: yes.  This request does not actually do
  588.      anything.  It is used as a signal that the server is able to
  589.      generate patches when given an `update' request.  The client must
  590.      issue the `-u' argument to `update' in order to receive patches.
  591.  
  592. `gzip-file-contents LEVEL \n'
  593.      Response expected: no.  Note that this request does not follow the
  594.      response convention stated above.  `Gzip-stream' is suggested
  595.      instead of `gzip-file-contents' as it gives better compression; the
  596.      only reason to implement the latter is to provide compression with
  597.      CVS 1.8 and earlier.  The `gzip-file-contents' request asks the
  598.      server to compress files it sends to the client using `gzip'
  599.      (RFC1952/1951) compression, using the specified level of
  600.      compression.  If this request is not made, the server must not
  601.      compress files.
  602.  
  603.      This is only a hint to the server.  It may still decide (for
  604.      example, in the case of very small files, or files that already
  605.      appear to be compressed) not to do the compression.  Compression
  606.      is indicated by a `z' preceding the file length.
  607.  
  608.      Availability of this request in the server indicates to the client
  609.      that it may compress files sent to the server, regardless of
  610.      whether the client actually uses this request.
  611.  
  612. `OTHER-REQUEST TEXT \n'
  613.      Response expected: yes.  Any unrecognized request expects a
  614.      response, and does not contain any additional data.  The response
  615.      will normally be something like `error  unrecognized request', but
  616.      it could be a different error if a previous command which doesn't
  617.      expect a response produced an error.
  618.  
  619.    When the client is done, it drops the connection.
  620.  
  621. 
  622. File: cvsclient.info,  Node: Responses,  Next: Example,  Prev: Requests,  Up: Protocol
  623.  
  624. Responses
  625. =========
  626.  
  627.    After a command which expects a response, the server sends however
  628. many of the following responses are appropriate.  The server should not
  629. send data at other times (the current implementation may violate this
  630. principle in a few minor places, where the server is printing an error
  631. message and exiting--this should be investigated further).
  632.  
  633.    Pathnames are of the actual files operated on (i.e. they do not
  634. contain `,v' endings), and are suitable for use in a subsequent
  635. `Repository' request.  However, if the client has used the `Directory'
  636. request, then it is instead a local directory name relative to the
  637. directory in which the command was given (i.e. the last `Directory'
  638. before the command).  Then a newline and a repository name (the
  639. pathname which is sent if `Directory' is not used).  Then the slash and
  640. the filename.  For example, for a file `i386.mh' which is in the local
  641. directory `gas.clean/config' and for which the repository is
  642. `/rel/cvsfiles/devo/gas/config':
  643.  
  644.      gas.clean/config/
  645.      /rel/cvsfiles/devo/gas/config/i386.mh
  646.  
  647.    Any response always ends with `error' or `ok'.  This indicates that
  648. the response is over.
  649.  
  650. `Valid-requests REQUEST-LIST \n'
  651.      Indicate what requests the server will accept.  REQUEST-LIST is a
  652.      space separated list of tokens.  If the server supports sending
  653.      patches, it will include `update-patches' in this list.  The
  654.      `update-patches' request does not actually do anything.
  655.  
  656. `Checked-in PATHNAME \n'
  657.      Additional data: New Entries line, \n.  This means a file PATHNAME
  658.      has been successfully operated on (checked in, added, etc.).  name
  659.      in the Entries line is the same as the last component of PATHNAME.
  660.  
  661. `New-entry PATHNAME \n'
  662.      Additional data: New Entries line, \n.  Like `Checked-in', but the
  663.      file is not up to date.
  664.  
  665. `Updated PATHNAME \n'
  666.      Additional data: New Entries line, \n, mode, \n, file
  667.      transmission.  A new copy of the file is enclosed.  This is used
  668.      for a new revision of an existing file, or for a new file, or for
  669.      any other case in which the local (client-side) copy of the file
  670.      needs to be updated, and after being updated it will be up to
  671.      date.  If any directory in pathname does not exist, create it.
  672.      This response is not used if `Created' and `Update-existing' are
  673.      supported.
  674.  
  675. `Created PATHNAME \n'
  676.      This is just like `Updated' and takes the same additional data, but
  677.      is used only if no `Entry', `Modified', or `Unchanged' request has
  678.      been sent for the file in question.  The distinction between
  679.      `Created' and `Update-existing' is so that the client can give an
  680.      error message in several cases: (1) there is a file in the working
  681.      directory, but not one for which `Entry', `Modified', or
  682.      `Unchanged' was sent (for example, a file which was ignored, or a
  683.      file for which `Questionable' was sent), (2) there is a file in
  684.      the working directory whose name differs from the one mentioned in
  685.      `Created' in ways that the client is unable to use to distinguish
  686.      files.  For example, the client is case-insensitive and the names
  687.      differ only in case.
  688.  
  689. `Update-existing PATHNAME \n'
  690.      This is just like `Updated' and takes the same additional data, but
  691.      is used only if a `Entry', `Modified', or `Unchanged' request has
  692.      been sent for the file in question.
  693.  
  694. `Merged PATHNAME \n'
  695.      This is just like `Updated' and takes the same additional data,
  696.      with the one difference that after the new copy of the file is
  697.      enclosed, it will still not be up to date.  Used for the results
  698.      of a merge, with or without conflicts.
  699.  
  700. `Patched PATHNAME \n'
  701.      This is just like `Updated' and takes the same additional data,
  702.      with the one difference that instead of sending a new copy of the
  703.      file, the server sends a patch.  This patch is produced by `diff
  704.      -c' for CVS 1.6 and later (see POSIX.2 for a description of this
  705.      format), or `diff -u' for previous versions of CVS; clients are
  706.      encouraged to accept either format.  The client must apply this
  707.      patch to the existing file.  This will only be used when the
  708.      client has an exact copy of an earlier revision of a file.  This
  709.      response is only used if the `update' command is given the `-u'
  710.      argument.
  711.  
  712. `Mode MODE \n'
  713.      This MODE applies to the next file mentioned in `Checked-in'.  It
  714.      does not apply to any request which follows a `Checked-in',
  715.      `New-entry', `Updated', `Merged', or `Patched' response.
  716.  
  717. `Checksum CHECKSUM\n'
  718.      The CHECKSUM applies to the next file sent over via `Updated',
  719.      `Merged', or `Patched'.  In the case of `Patched', the checksum
  720.      applies to the file after being patched, not to the patch itself.
  721.      The client should compute the checksum itself, after receiving the
  722.      file or patch, and signal an error if the checksums do not match.
  723.      The checksum is the 128 bit MD5 checksum represented as 32 hex
  724.      digits.  This response is optional, and is only used if the client
  725.      supports it (as judged by the `Valid-responses' request).
  726.  
  727. `Copy-file PATHNAME \n'
  728.      Additional data: NEWNAME \n.  Copy file PATHNAME to NEWNAME in the
  729.      same directory where it already is.  This does not affect
  730.      `CVS/Entries'.
  731.  
  732. `Removed PATHNAME \n'
  733.      The file has been removed from the repository (this is the case
  734.      where cvs prints `file foobar.c is no longer pertinent').
  735.  
  736. `Remove-entry PATHNAME \n'
  737.      The file needs its entry removed from `CVS/Entries', but the file
  738.      itself is already gone (this happens in response to a `ci' request
  739.      which involves committing the removal of a file).
  740.  
  741. `Set-static-directory PATHNAME \n'
  742.      This instructs the client to set the `Entries.Static' flag, which
  743.      it should then send back to the server in a `Static-directory'
  744.      request whenever the directory is operated on.  PATHNAME ends in a
  745.      slash; its purpose is to specify a directory, not a file within a
  746.      directory.
  747.  
  748. `Clear-static-directory PATHNAME \n'
  749.      Like `Set-static-directory', but clear, not set, the flag.
  750.  
  751. `Set-sticky PATHNAME \n'
  752.      Additional data: TAGSPEC \n.  Tell the client to set a sticky tag
  753.      or date, which should be supplied with the `Sticky' request for
  754.      future operations.  PATHNAME ends in a slash; its purpose is to
  755.      specify a directory, not a file within a directory.  The first
  756.      character of TAGSPEC is `T' for a tag, or `D' for a date.  The
  757.      remainder of TAGSPEC contains the actual tag or date.
  758.  
  759. `Clear-sticky PATHNAME \n'
  760.      Clear any sticky tag or date set by `Set-sticky'.
  761.  
  762. `Template PATHNAME \n'
  763.      Additional data: file transmission (note: compressed file
  764.      transmissions are not supported).  PATHNAME ends in a slash; its
  765.      purpose is to specify a directory, not a file within a directory.
  766.      Tell the client to store the file transmission as the template log
  767.      message, and then use that template in the future when prompting
  768.      the user for a log message.
  769.  
  770. `Set-checkin-prog DIR \n'
  771.      Additional data: PROG \n.  Tell the client to set a checkin
  772.      program, which should be supplied with the `Checkin-prog' request
  773.      for future operations.
  774.  
  775. `Set-update-prog DIR \n'
  776.      Additional data: PROG \n.  Tell the client to set an update
  777.      program, which should be supplied with the `Update-prog' request
  778.      for future operations.
  779.  
  780. `Notified PATHNAME \n'
  781.      Indicate to the client that the notification for PATHNAME has been
  782.      done.  There should be one such response for every `Notify'
  783.      request; if there are several `Notify' requests for a single file,
  784.      the requests should be processed in order; the first `Notified'
  785.      response pertains to the first `Notify' request, etc.
  786.  
  787. `Module-expansion PATHNAME \n Return a file or directory'
  788.      which is included in a particular module.  PATHNAME is relative to
  789.      cvsroot, unlike most pathnames in responses.  PATHNAME should be
  790.      used to look and see whether some or all of the module exists on
  791.      the client side; it is not necessarily suitable for passing as an
  792.      argument to a `co' request (for example, if the modules file
  793.      contains the `-d' option, it will be the directory specified with
  794.      `-d', not the name of the module).
  795.  
  796. `M TEXT \n'
  797.      A one-line message for the user.
  798.  
  799. `E TEXT \n'
  800.      Same as `M' but send to stderr not stdout.
  801.  
  802. `F \n'
  803.      Flush stderr.  That is, make it possible for the user to see what
  804.      has been written to stderr (it is up to the implementation to
  805.      decide exactly how far it should go to ensure this).
  806.  
  807. `error ERRNO-CODE ` ' TEXT \n'
  808.      The command completed with an error.  ERRNO-CODE is a symbolic
  809.      error code (e.g. `ENOENT'); if the server doesn't support this
  810.      feature, or if it's not appropriate for this particular message,
  811.      it just omits the errno-code (in that case there are two spaces
  812.      after `error').  Text is an error message such as that provided by
  813.      strerror(), or any other message the server wants to use.
  814.  
  815. `ok \n'
  816.      The command completed successfully.
  817.  
  818. 
  819. File: cvsclient.info,  Node: Example,  Next: Requirements,  Prev: Responses,  Up: Protocol
  820.  
  821. Example
  822. =======
  823.  
  824.    Lines beginning with `c>' are sent by the client; lines beginning
  825. with `s>' are sent by the server; lines beginning with `#' are not part
  826. of the actual exchange.
  827.  
  828.      c> Root /rel/cvsfiles
  829.      # In actual practice the lists of valid responses and requests would
  830.      # be longer
  831.      c> Valid-responses Updated Checked-in M ok error
  832.      c> valid-requests
  833.      s> Valid-requests Root co Modified Entry Repository ci Argument Argumentx
  834.      s> ok
  835.      # cvs co devo/foo
  836.      c> Argument devo/foo
  837.      c> co
  838.      s> Updated /rel/cvsfiles/devo/foo/foo.c
  839.      s> /foo.c/1.4/Mon Apr 19 15:36:47 1993 Mon Apr 19 15:36:47 1993//
  840.      s> 26
  841.      s> int mein () { abort (); }
  842.      s> Updated /rel/cvsfiles/devo/foo/Makefile
  843.      s> /Makefile/1.2/Mon Apr 19 15:36:47 1993 Mon Apr 19 15:36:47 1993//
  844.      s> 28
  845.      s> foo: foo.c
  846.      s>         $(CC) -o foo $<
  847.      s> ok
  848.      # The current implementation would break the connection here and make a
  849.      # new connection for the next command.  However, the protocol allows it
  850.      # to keep the connection open and continue, which is what we show here.
  851.      c> Repository /rel/cvsfiles/devo/foo
  852.      # foo.c relative to devo/foo just set as Repository.
  853.      c> Entry /foo.c/1.4/Mon Apr 19 15:36:47 1993 Mon Apr 19 15:36:47 1993//
  854.      c> Entry /Makefile/1.2/Mon Apr 19 15:36:47 1993 Mon Apr 19 15:36:47 1993//
  855.      c> Modified foo.c
  856.      c> 26
  857.      c> int main () { abort (); }
  858.      # cvs ci -m <log message> foo.c
  859.      c> Argument -m
  860.      c> Argument Well, you see, it took me hours and hours to find this typo and I
  861.      c> Argumentx searched and searched and eventually had to ask John for help.
  862.      c> Argument foo.c
  863.      c> ci
  864.      s> Checked-in /rel/cvsfiles/devo/foo/foo.c
  865.      s> /foo.c/1.5/ Mon Apr 19 15:54:22 CDT 1993//
  866.      s> M Checking in foo.c;
  867.      s> M /cygint/rel/cvsfiles/devo/foo/foo.c,v  <--  foo.c
  868.      s> M new revision: 1.5; previous revision: 1.4
  869.      s> M done
  870.      s> ok
  871.  
  872. 
  873. File: cvsclient.info,  Node: Requirements,  Prev: Example,  Up: Protocol
  874.  
  875. Required versus optional parts of the protocol
  876. ==============================================
  877.  
  878.    The following are part of every known implementation of the CVS
  879. protocol and it is considered reasonable behavior to completely fail to
  880. work if you are connected with an implementation which attempts to not
  881. support them.  Requests: Root, Valid-responses, valid-requests,
  882. Repository, Entry, Modified, Argument, Argumentx, ci, co, update.
  883. Responses: ok, error, Valid-requests, Checked-in, Updated, Merged,
  884. Removed, M, E.
  885.  
  886.    Failure to support the Directory, UseUnchanged, and Unchanged
  887. requests is deprecated.  CVS 1.5 and later have supported these
  888. requests and in the future it will be considered reasonable behavior to
  889. completely fail to work with an implementation which attempts to not
  890. support them.  Support for the Repository and Lost requests is
  891. deprecated; CVS clients 1.5 and later will not use them if
  892. communicating with a server which supports Directory and UseUnchanged.
  893.  
  894.  
  895. 
  896. Tag Table:
  897. Node: Top121
  898. Node: Introduction945
  899. Node: Goals3477
  900. Node: Notes5001
  901. Node: Protocol Notes5874
  902. Node: Connection and Authentication7552
  903. Node: Protocol10158
  904. Node: Entries Lines10557
  905. Node: Modes11265
  906. Node: Filenames12788
  907. Node: Requests13539
  908. Node: Responses28629
  909. Node: Example37807
  910. Node: Requirements39863
  911. 
  912. End Tag Table
  913.