xref: /openbsd-src/gnu/usr.bin/cvs/doc/cvsclient.info-3 (revision 43c1707e6f6829177cb1974ee6615ce6c1307689)
1e77048c1StholoThis is cvsclient.info, produced by makeinfo version 4.0 from
2*43c1707eStholocvsclient.texi.
38506102dStholo
4e77048c1StholoINFO-DIR-SECTION Programming
5e77048c1StholoSTART-INFO-DIR-ENTRY
6e77048c1Stholo* cvsclient: (cvsclient).      The CVS client/server protocol.
7e77048c1StholoEND-INFO-DIR-ENTRY
8e77048c1Stholo
98506102dStholo
108506102dStholoFile: cvsclient.info,  Node: Responses,  Next: Text tags,  Prev: Response pathnames,  Up: Protocol
118506102dStholo
128506102dStholoResponses
138506102dStholo=========
148506102dStholo
158506102dStholo   Here are the responses:
168506102dStholo
178506102dStholo`Valid-requests REQUEST-LIST \n'
188506102dStholo     Indicate what requests the server will accept.  REQUEST-LIST is a
198506102dStholo     space separated list of tokens.  If the server supports sending
208506102dStholo     patches, it will include `update-patches' in this list.  The
218506102dStholo     `update-patches' request does not actually do anything.
228506102dStholo
238506102dStholo`Checked-in PATHNAME \n'
248506102dStholo     Additional data: New Entries line, \n.  This means a file PATHNAME
258506102dStholo     has been successfully operated on (checked in, added, etc.).  name
268506102dStholo     in the Entries line is the same as the last component of PATHNAME.
278506102dStholo
288506102dStholo`New-entry PATHNAME \n'
298506102dStholo     Additional data: New Entries line, \n.  Like `Checked-in', but the
308506102dStholo     file is not up to date.
318506102dStholo
328506102dStholo`Updated PATHNAME \n'
338506102dStholo     Additional data: New Entries line, \n, mode, \n, file
348506102dStholo     transmission.  A new copy of the file is enclosed.  This is used
358506102dStholo     for a new revision of an existing file, or for a new file, or for
368506102dStholo     any other case in which the local (client-side) copy of the file
378506102dStholo     needs to be updated, and after being updated it will be up to
388506102dStholo     date.  If any directory in pathname does not exist, create it.
398506102dStholo     This response is not used if `Created' and `Update-existing' are
408506102dStholo     supported.
418506102dStholo
428506102dStholo`Created PATHNAME \n'
438506102dStholo     This is just like `Updated' and takes the same additional data, but
448506102dStholo     is used only if no `Entry', `Modified', or `Unchanged' request has
458506102dStholo     been sent for the file in question.  The distinction between
468506102dStholo     `Created' and `Update-existing' is so that the client can give an
478506102dStholo     error message in several cases: (1) there is a file in the working
488506102dStholo     directory, but not one for which `Entry', `Modified', or
498506102dStholo     `Unchanged' was sent (for example, a file which was ignored, or a
508506102dStholo     file for which `Questionable' was sent), (2) there is a file in
518506102dStholo     the working directory whose name differs from the one mentioned in
528506102dStholo     `Created' in ways that the client is unable to use to distinguish
538506102dStholo     files.  For example, the client is case-insensitive and the names
548506102dStholo     differ only in case.
558506102dStholo
568506102dStholo`Update-existing PATHNAME \n'
578506102dStholo     This is just like `Updated' and takes the same additional data, but
588506102dStholo     is used only if a `Entry', `Modified', or `Unchanged' request has
598506102dStholo     been sent for the file in question.
608506102dStholo
618506102dStholo     This response, or `Merged', indicates that the server has
628506102dStholo     determined that it is OK to overwrite the previous contents of the
638506102dStholo     file specified by PATHNAME.  Provided that the client has correctly
648506102dStholo     sent `Modified' or `Is-modified' requests for a modified file, and
658506102dStholo     the file was not modified while CVS was running, the server can
668506102dStholo     ensure that a user's modifications are not lost.
678506102dStholo
688506102dStholo`Merged PATHNAME \n'
698506102dStholo     This is just like `Updated' and takes the same additional data,
708506102dStholo     with the one difference that after the new copy of the file is
718506102dStholo     enclosed, it will still not be up to date.  Used for the results
728506102dStholo     of a merge, with or without conflicts.
738506102dStholo
748506102dStholo     It is useful to preserve an copy of what the file looked like
758506102dStholo     before the merge.  This is basically handled by the server; before
768506102dStholo     sending `Merged' it will send a `Copy-file' response.  For
778506102dStholo     example, if the file is `aa' and it derives from revision 1.3, the
788506102dStholo     `Copy-file' response will tell the client to copy `aa' to
798506102dStholo     `.#aa.1.3'.  It is up to the client to decide how long to keep this
808506102dStholo     file around; traditionally clients have left it around forever,
818506102dStholo     thus letting the user clean it up as desired.  But another answer,
828506102dStholo     such as until the next commit, might be preferable.
838506102dStholo
848506102dStholo`Rcs-diff PATHNAME \n'
858506102dStholo     This is just like `Updated' and takes the same additional data,
868506102dStholo     with the one difference that instead of sending a new copy of the
878506102dStholo     file, the server sends an RCS change text.  This change text is
888506102dStholo     produced by `diff -n' (the GNU diff `-a' option may also be used).
898506102dStholo     The client must apply this change text to the existing file.
908506102dStholo     This will only be used when the client has an exact copy of an
918506102dStholo     earlier revision of a file.  This response is only used if the
928506102dStholo     `update' command is given the `-u' argument.
938506102dStholo
948506102dStholo`Patched PATHNAME \n'
958506102dStholo     This is just like `Rcs-diff' and takes the same additional data,
968506102dStholo     except that it sends a standard patch rather than an RCS change
978506102dStholo     text.  The patch is produced by `diff -c' for CVS 1.6 and later
988506102dStholo     (see POSIX.2 for a description of this format), or `diff -u' for
998506102dStholo     previous versions of CVS; clients are encouraged to accept either
1008506102dStholo     format.  Like `Rcs-diff', this response is only used if the
1018506102dStholo     `update' command is given the `-u' argument.
1028506102dStholo
1038506102dStholo     The `Patched' response is deprecated in favor of the `Rcs-diff'
1048506102dStholo     response.  However, older clients (CVS 1.9 and earlier) only
1058506102dStholo     support `Patched'.
1068506102dStholo
1078506102dStholo`Mode MODE \n'
1088506102dStholo     This MODE applies to the next file mentioned in `Checked-in'.
1098506102dStholo     `Mode' is a file update modifying response as described in *Note
1108506102dStholo     Response intro::.
1118506102dStholo
1128506102dStholo`Mod-time TIME \n'
1138506102dStholo     Set the modification time of the next file sent to TIME.
1148506102dStholo     `Mod-time' is a file update modifying response as described in
1158506102dStholo     *Note Response intro::.  The TIME is in the format specified by
1168506102dStholo     RFC822 as modified by RFC1123.  The server may specify any
1178506102dStholo     timezone it chooses; clients will want to convert that to their
1188506102dStholo     own timezone as appropriate.  An example of this format is:
1198506102dStholo
1208506102dStholo          26 May 1997 13:01:40 -0400
1218506102dStholo
1228506102dStholo     There is no requirement that the client and server clocks be
1238506102dStholo     synchronized.  The server just sends its recommendation for a
1248506102dStholo     timestamp (based on its own clock, presumably), and the client
1258506102dStholo     should just believe it (this means that the time might be in the
1268506102dStholo     future, for example).
1278506102dStholo
1288506102dStholo     If the server does not send `Mod-time' for a given file, the client
1298506102dStholo     should pick a modification time in the usual way (usually, just
1308506102dStholo     let the operating system set the modification time to the time
1318506102dStholo     that the CVS command is running).
1328506102dStholo
1338506102dStholo`Checksum CHECKSUM\n'
1348506102dStholo     The CHECKSUM applies to the next file sent (that is, `Checksum' is
1358506102dStholo     a file update modifying response as described in *Note Response
1368506102dStholo     intro::).  In the case of `Patched', the checksum applies to the
1378506102dStholo     file after being patched, not to the patch itself.  The client
1388506102dStholo     should compute the checksum itself, after receiving the file or
1398506102dStholo     patch, and signal an error if the checksums do not match.  The
1408506102dStholo     checksum is the 128 bit MD5 checksum represented as 32 hex digits
1418506102dStholo     (MD5 is described in RFC1321).  This response is optional, and is
1428506102dStholo     only used if the client supports it (as judged by the
1438506102dStholo     `Valid-responses' request).
1448506102dStholo
1458506102dStholo`Copy-file PATHNAME \n'
1468506102dStholo     Additional data: NEWNAME \n.  Copy file PATHNAME to NEWNAME in the
1478506102dStholo     same directory where it already is.  This does not affect
1488506102dStholo     `CVS/Entries'.
1498506102dStholo
1508506102dStholo     This can optionally be implemented as a rename instead of a copy.
1518506102dStholo     The only use for it which currently has been identified is prior
1528506102dStholo     to a `Merged' response as described under `Merged'.  Clients can
1538506102dStholo     probably assume that is how it is being used, if they want to worry
1548506102dStholo     about things like how long to keep the NEWNAME file around.
1558506102dStholo
1568506102dStholo`Removed PATHNAME \n'
1578506102dStholo     The file has been removed from the repository (this is the case
1588506102dStholo     where cvs prints `file foobar.c is no longer pertinent').
1598506102dStholo
1608506102dStholo`Remove-entry PATHNAME \n'
1618506102dStholo     The file needs its entry removed from `CVS/Entries', but the file
1628506102dStholo     itself is already gone (this happens in response to a `ci' request
1638506102dStholo     which involves committing the removal of a file).
1648506102dStholo
1658506102dStholo`Set-static-directory PATHNAME \n'
1668506102dStholo     This instructs the client to set the `Entries.Static' flag, which
1678506102dStholo     it should then send back to the server in a `Static-directory'
1688506102dStholo     request whenever the directory is operated on.  PATHNAME ends in a
1698506102dStholo     slash; its purpose is to specify a directory, not a file within a
1708506102dStholo     directory.
1718506102dStholo
1728506102dStholo`Clear-static-directory PATHNAME \n'
1738506102dStholo     Like `Set-static-directory', but clear, not set, the flag.
1748506102dStholo
1758506102dStholo`Set-sticky PATHNAME \n'
1768506102dStholo     Additional data: TAGSPEC \n.  Tell the client to set a sticky tag
1778506102dStholo     or date, which should be supplied with the `Sticky' request for
1788506102dStholo     future operations.  PATHNAME ends in a slash; its purpose is to
1798506102dStholo     specify a directory, not a file within a directory.  The client
1808506102dStholo     should store TAGSPEC and pass it back to the server as-is, to
1818506102dStholo     allow for future expansion.  The first character of TAGSPEC is `T'
1828506102dStholo     for a tag, `D' for a date, or something else for future expansion.
1838506102dStholo     The remainder of TAGSPEC contains the actual tag or date.
1848506102dStholo
1858506102dStholo`Clear-sticky PATHNAME \n'
1868506102dStholo     Clear any sticky tag or date set by `Set-sticky'.
1878506102dStholo
1888506102dStholo`Template PATHNAME \n'
1898506102dStholo     Additional data: file transmission (note: compressed file
1908506102dStholo     transmissions are not supported).  PATHNAME ends in a slash; its
1918506102dStholo     purpose is to specify a directory, not a file within a directory.
1928506102dStholo     Tell the client to store the file transmission as the template log
1938506102dStholo     message, and then use that template in the future when prompting
1948506102dStholo     the user for a log message.
1958506102dStholo
1968506102dStholo`Set-checkin-prog DIR \n'
1978506102dStholo     Additional data: PROG \n.  Tell the client to set a checkin
1988506102dStholo     program, which should be supplied with the `Checkin-prog' request
1998506102dStholo     for future operations.
2008506102dStholo
2018506102dStholo`Set-update-prog DIR \n'
2028506102dStholo     Additional data: PROG \n.  Tell the client to set an update
2038506102dStholo     program, which should be supplied with the `Update-prog' request
2048506102dStholo     for future operations.
2058506102dStholo
2068506102dStholo`Notified PATHNAME \n'
2078506102dStholo     Indicate to the client that the notification for PATHNAME has been
2088506102dStholo     done.  There should be one such response for every `Notify'
2098506102dStholo     request; if there are several `Notify' requests for a single file,
2108506102dStholo     the requests should be processed in order; the first `Notified'
2118506102dStholo     response pertains to the first `Notify' request, etc.
2128506102dStholo
2138506102dStholo`Module-expansion PATHNAME \n'
2148506102dStholo     Return a file or directory which is included in a particular
2158506102dStholo     module.  PATHNAME is relative to cvsroot, unlike most pathnames in
2168506102dStholo     responses.  PATHNAME should be used to look and see whether some
2178506102dStholo     or all of the module exists on the client side; it is not
2188506102dStholo     necessarily suitable for passing as an argument to a `co' request
2198506102dStholo     (for example, if the modules file contains the `-d' option, it
2208506102dStholo     will be the directory specified with `-d', not the name of the
2218506102dStholo     module).
2228506102dStholo
2238506102dStholo`Wrapper-rcsOption PATTERN -k 'OPTION' \n'
2248506102dStholo     Transmit to the client a filename pattern which implies a certain
2258506102dStholo     keyword expansion mode.  The PATTERN is a wildcard pattern (for
2268506102dStholo     example, `*.exe'.  The OPTION is `b' for binary, and so on.  Note
2278506102dStholo     that although the syntax happens to resemble the syntax in certain
2288506102dStholo     CVS configuration files, it is more constrained; there must be
2298506102dStholo     exactly one space between PATTERN and `-k' and exactly one space
2308506102dStholo     between `-k' and `'', and no string is permitted in place of `-k'
2318506102dStholo     (extensions should be done with new responses, not by extending
2328506102dStholo     this one, for graceful handling of `Valid-responses').
2338506102dStholo
2348506102dStholo`M TEXT \n'
2352f9d2fd9Stholo     A one-line message for the user.  Note that the format of TEXT is
2362f9d2fd9Stholo     not designed for machine parsing.  Although sometimes scripts and
2372f9d2fd9Stholo     clients will have little choice, the exact text which is output is
2382f9d2fd9Stholo     subject to vary at the discretion of the server and the example
2392f9d2fd9Stholo     output given in this document is just that, example output.
2402f9d2fd9Stholo     Servers are encouraged to use the `MT' response, and future
2412f9d2fd9Stholo     versions of this document will hopefully standardize more of the
2422f9d2fd9Stholo     `MT' tags; see *Note Text tags::.
2438506102dStholo
2448506102dStholo`Mbinary \n'
2458506102dStholo     Additional data: file transmission (note: compressed file
2468506102dStholo     transmissions are not supported).  This is like `M', except the
2478506102dStholo     contents of the file transmission are binary and should be copied
2488506102dStholo     to standard output without translation to local text file
2498506102dStholo     conventions.  To transmit a text file to standard output, servers
2508506102dStholo     should use a series of `M' requests.
2518506102dStholo
2528506102dStholo`E TEXT \n'
2538506102dStholo     Same as `M' but send to stderr not stdout.
2548506102dStholo
2558506102dStholo`F \n'
2568506102dStholo     Flush stderr.  That is, make it possible for the user to see what
2578506102dStholo     has been written to stderr (it is up to the implementation to
2588506102dStholo     decide exactly how far it should go to ensure this).
2598506102dStholo
2608506102dStholo`MT TAGNAME DATA \n'
2618506102dStholo     This response provides for tagged text.  It is similar to
2628506102dStholo     SGML/HTML/XML in that the data is structured and a naive
2638506102dStholo     application can also make some sense of it without understanding
2648506102dStholo     the structure.  The syntax is not SGML-like, however, in order to
2658506102dStholo     fit into the CVS protocol better and (more importantly) to make it
2668506102dStholo     easier to parse, especially in a language like perl or awk.
2678506102dStholo
2688506102dStholo     The TAGNAME can have several forms.  If it starts with `a' to `z'
2698506102dStholo     or `A' to `Z', then it represents tagged text.  If the
2708506102dStholo     implementation recognizes TAGNAME, then it may interpret DATA in
2718506102dStholo     some particular fashion.  If the implementation does not recognize
2728506102dStholo     TAGNAME, then it should simply treat DATA as text to be sent to
2738506102dStholo     the user (similar to an `M' response).  There are two tags which
2748506102dStholo     are general purpose.  The `text' tag is similar to an unrecognized
2758506102dStholo     tag in that it provides text which will ordinarily be sent to the
2768506102dStholo     user.  The `newline' tag is used without DATA and indicates that a
2778506102dStholo     newline will ordinarily be sent to the user (there is no provision
2788506102dStholo     for embedding newlines in the DATA of other tagged text responses).
2798506102dStholo
2808506102dStholo     If TAGNAME starts with `+' it indicates a start tag and if it
2818506102dStholo     starts with `-' it indicates an end tag.  The remainder of TAGNAME
2828506102dStholo     should be the same for matching start and end tags, and tags
2838506102dStholo     should be nested (for example one could have tags in the following
2848506102dStholo     order `+bold' `+italic' `text' `-italic' `-bold' but not `+bold'
2858506102dStholo     `+italic' `text' `-bold' `-italic').  A particular start and end
2868506102dStholo     tag may be documented to constrain the tagged text responses which
2878506102dStholo     are valid between them.
2888506102dStholo
2898506102dStholo     Note that if DATA is present there will always be exactly one
2908506102dStholo     space between TAGNAME and DATA; if there is more than one space,
2918506102dStholo     then the spaces beyond the first are part of DATA.
2928506102dStholo
2938506102dStholo     Here is an example of some tagged text responses.  Note that there
2948506102dStholo     is a trailing space after `Checking in' and `initial revision:'
2958506102dStholo     and there are two trailing spaces after `<--'.  Such trailing
2968506102dStholo     spaces are, of course, part of DATA.
2978506102dStholo
2988506102dStholo          MT +checking-in
2998506102dStholo          MT text Checking in
3008506102dStholo          MT fname gz.tst
3018506102dStholo          MT text ;
3028506102dStholo          MT newline
3038506102dStholo          MT rcsfile /home/kingdon/zwork/cvsroot/foo/gz.tst,v
3048506102dStholo          MT text   <--
3058506102dStholo          MT fname gz.tst
3068506102dStholo          MT newline
3078506102dStholo          MT text initial revision:
3088506102dStholo          MT init-rev 1.1
3098506102dStholo          MT newline
3108506102dStholo          MT text done
3118506102dStholo          MT newline
3128506102dStholo          MT -checking-in
3138506102dStholo
3148506102dStholo     If the client does not support the `MT' response, the same
3158506102dStholo     responses might be sent as:
3168506102dStholo
3178506102dStholo          M Checking in gz.tst;
3188506102dStholo          M /home/kingdon/zwork/cvsroot/foo/gz.tst,v  <--  gz.tst
3198506102dStholo          M initial revision: 1.1
3208506102dStholo          M done
3218506102dStholo
3228506102dStholo     For a list of specific tags, see *Note Text tags::.
3238506102dStholo
3248506102dStholo`error ERRNO-CODE ` ' TEXT \n'
3258506102dStholo     The command completed with an error.  ERRNO-CODE is a symbolic
3268506102dStholo     error code (e.g. `ENOENT'); if the server doesn't support this
3278506102dStholo     feature, or if it's not appropriate for this particular message,
3288506102dStholo     it just omits the errno-code (in that case there are two spaces
3298506102dStholo     after `error').  Text is an error message such as that provided by
3302f9d2fd9Stholo     strerror(), or any other message the server wants to use.  The
3312f9d2fd9Stholo     TEXT is like the `M' response, in the sense that it is not
3322f9d2fd9Stholo     particularly intended to be machine-parsed; servers may wish to
3332f9d2fd9Stholo     print an error message with `MT' responses, and then issue a
3342f9d2fd9Stholo     `error' response without TEXT (although it should be noted that
3352f9d2fd9Stholo     `MT' currently has no way of flagging the output as intended for
3362f9d2fd9Stholo     standard error, the way that the `E' response does).
3378506102dStholo
3388506102dStholo`ok \n'
3398506102dStholo     The command completed successfully.
3408506102dStholo
3418506102dStholo
3428506102dStholoFile: cvsclient.info,  Node: Text tags,  Next: Example,  Prev: Responses,  Up: Protocol
3438506102dStholo
3448506102dStholoTags for the MT tagged text response
3458506102dStholo====================================
3468506102dStholo
3478506102dStholo   The `MT' response, as described in *Note Responses::, offers a way
3488506102dStholofor the server to send tagged text to the client.  This section
3498506102dStholodescribes specific tags.  The intention is to update this section as
3508506102dStholoservers add new tags.
3518506102dStholo
3528506102dStholo   In the following descriptions, `text' and `newline' tags are
3538506102dStholoomitted.  Such tags contain information which is intended for users (or
3548506102dStholoto be discarded), and are subject to change at the whim of the server.
3558506102dStholoTo avoid being vulnerable to such whim, clients should look for the tags
3568506102dSthololisted here, not `text', `newline', or other tags.
3578506102dStholo
3588506102dStholo   The following tag means to indicate to the user that a file has been
3598506102dStholoupdated.  It is more or less redundant with the `Created' and
3608506102dStholo`Update-existing' responses, but we don't try to specify here whether
3618506102dStholoit occurs in exactly the same circumstances as `Created' and
3628506102dStholo`Update-existing'.  The NAME is the pathname of the file being updated
3638506102dStholorelative to the directory in which the command is occurring (that is,
3648506102dStholothe last `Directory' request which is sent before the command).
3658506102dStholo
3668506102dStholo     MT +updated
3678506102dStholo     MT fname NAME
3688506102dStholo     MT -updated
3698506102dStholo
3708506102dStholo   The `importmergecmd' tag is used when doing an import which has
3718506102dStholoconflicts.  The client can use it to report how to merge in the newly
3728506102dStholoimported changes.  The COUNT is the number of conflicts.  The newly
3738506102dStholoimported changes can be merged by running the following command:
3748506102dStholo     cvs checkout -j TAG1 -j TAG2 REPOSITORY
3758506102dStholo
3768506102dStholo     MT +importmergecmd
3778506102dStholo     MT conflicts COUNT
3788506102dStholo     MT mergetag1 TAG1
3798506102dStholo     MT mergetag2 TAG2
3808506102dStholo     MT repository REPOSITORY
3818506102dStholo     MT -importmergecmd
3826407bc5bStholo
3836407bc5bStholo
3846407bc5bStholoFile: cvsclient.info,  Node: Example,  Next: Requirements,  Prev: Text tags,  Up: Protocol
3856407bc5bStholo
3866407bc5bStholoExample
3876407bc5bStholo=======
3886407bc5bStholo
3896407bc5bStholo   Here is an example; lines are prefixed by `C: ' to indicate the
3906407bc5bStholoclient sends them or `S: ' to indicate the server sends them.
3916407bc5bStholo
3926407bc5bStholo   The client starts by connecting, sending the root, and completing the
3936407bc5bStholoprotocol negotiation.  In actual practice the lists of valid responses
3946407bc5bStholoand requests would be longer.
3956407bc5bStholo
3966407bc5bStholo     C: Root /u/cvsroot
3976407bc5bStholo     C: Valid-responses ok error Checked-in M E
3986407bc5bStholo     C: valid-requests
3996407bc5bStholo     S: Valid-requests Root Directory Entry Modified Argument Argumentx ci co
4006407bc5bStholo     S: ok
4016407bc5bStholo     C: UseUnchanged
4026407bc5bStholo
4036407bc5bStholo   The client wants to check out the `supermunger' module into a fresh
4046407bc5bStholoworking directory.  Therefore it first expands the `supermunger'
4056407bc5bStholomodule; this step would be omitted if the client was operating on a
4066407bc5bStholodirectory rather than a module.
4076407bc5bStholo
4086407bc5bStholo     C: Argument supermunger
4096407bc5bStholo     C: Directory .
4106407bc5bStholo     C: /u/cvsroot
4116407bc5bStholo     C: expand-modules
4126407bc5bStholo
4136407bc5bStholo   The server replies that the `supermunger' module expands to the
4146407bc5bStholodirectory `supermunger' (the simplest case):
4156407bc5bStholo
4166407bc5bStholo     S: Module-expansion supermunger
4176407bc5bStholo     S: ok
4186407bc5bStholo
4196407bc5bStholo   The client then proceeds to check out the directory.  The fact that
4206407bc5bStholoit sends only a single `Directory' request which specifies `.' for the
4216407bc5bStholoworking directory means that there is not already a `supermunger'
4226407bc5bStholodirectory on the client.
4236407bc5bStholo
4246407bc5bStholo     C: Argument -N
4256407bc5bStholo     C: Argument supermunger
4266407bc5bStholo     C: Directory .
4276407bc5bStholo     C: /u/cvsroot
4286407bc5bStholo     C: co
4296407bc5bStholo
4306407bc5bStholo   The server replies with the requested files.  In this example, there
4316407bc5bStholois only one file, `mungeall.c'.  The `Clear-sticky' and
4326407bc5bStholo`Clear-static-directory' requests are sent by the current
4336407bc5bStholoimplementation but they have no effect because the default is for those
4346407bc5bStholosettings to be clear when a directory is newly created.
4356407bc5bStholo
4366407bc5bStholo     S: Clear-sticky supermunger/
4376407bc5bStholo     S: /u/cvsroot/supermunger/
4386407bc5bStholo     S: Clear-static-directory supermunger/
4396407bc5bStholo     S: /u/cvsroot/supermunger/
4406407bc5bStholo     S: E cvs server: Updating supermunger
4416407bc5bStholo     S: M U supermunger/mungeall.c
4426407bc5bStholo     S: Created supermunger/
4436407bc5bStholo     S: /u/cvsroot/supermunger/mungeall.c
4446407bc5bStholo     S: /mungeall.c/1.1///
4456407bc5bStholo     S: u=rw,g=r,o=r
4466407bc5bStholo     S: 26
4476407bc5bStholo     S: int mein () { abort (); }
4486407bc5bStholo     S: ok
4496407bc5bStholo
4506407bc5bStholo   The current client implementation would break the connection here
4516407bc5bStholoand make a new connection for the next command.  However, the protocol
4526407bc5bStholoallows it to keep the connection open and continue, which is what we
4536407bc5bStholoshow here.
4546407bc5bStholo
4556407bc5bStholo   After the user modifies the file and instructs the client to check it
4566407bc5bStholoback in.  The client sends arguments to specify the log message and file
4576407bc5bStholoto check in:
4586407bc5bStholo
4596407bc5bStholo     C: Argument -m
4606407bc5bStholo     C: Argument Well, you see, it took me hours and hours to find
4616407bc5bStholo     C: Argumentx this typo and I searched and searched and eventually
4626407bc5bStholo     C: Argumentx had to ask John for help.
4636407bc5bStholo     C: Argument mungeall.c
4646407bc5bStholo
4656407bc5bStholo   It also sends information about the contents of the working
4666407bc5bStholodirectory, including the new contents of the modified file.  Note that
4676407bc5bStholothe user has changed into the `supermunger' directory before executing
4686407bc5bStholothis command; the top level directory is a user-visible concept because
4696407bc5bStholothe server should print filenames in `M' and `E' responses relative to
4706407bc5bStholothat directory.
4716407bc5bStholo
4726407bc5bStholo     C: Directory .
4736407bc5bStholo     C: /u/cvsroot/supermunger
4746407bc5bStholo     C: Entry /mungeall.c/1.1///
4756407bc5bStholo     C: Modified mungeall.c
4766407bc5bStholo     C: u=rw,g=r,o=r
4776407bc5bStholo     C: 26
4786407bc5bStholo     C: int main () { abort (); }
4796407bc5bStholo
4806407bc5bStholo   And finally, the client issues the checkin command (which makes use
4816407bc5bStholoof the data just sent):
4826407bc5bStholo
4836407bc5bStholo     C: ci
4846407bc5bStholo
4856407bc5bStholo   And the server tells the client that the checkin succeeded:
4866407bc5bStholo
4876407bc5bStholo     S: M Checking in mungeall.c;
4886407bc5bStholo     S: E /u/cvsroot/supermunger/mungeall.c,v  <--  mungeall.c
4896407bc5bStholo     S: E new revision: 1.2; previous revision: 1.1
4906407bc5bStholo     S: E done
4916407bc5bStholo     S: Mode u=rw,g=r,o=r
4926407bc5bStholo     S: Checked-in ./
4936407bc5bStholo     S: /u/cvsroot/supermunger/mungeall.c
4946407bc5bStholo     S: /mungeall.c/1.2///
4956407bc5bStholo     S: ok
4966407bc5bStholo
4976407bc5bStholo
4986407bc5bStholoFile: cvsclient.info,  Node: Requirements,  Next: Obsolete,  Prev: Example,  Up: Protocol
4996407bc5bStholo
5006407bc5bStholoRequired versus optional parts of the protocol
5016407bc5bStholo==============================================
5026407bc5bStholo
5036407bc5bStholo   The following are part of every known implementation of the CVS
5046407bc5bStholoprotocol (except obsolete, pre-1.5, versions of CVS) and it is
5056407bc5bStholoconsidered reasonable behavior to completely fail to work if you are
5066407bc5bStholoconnected with an implementation which attempts to not support them.
5076407bc5bStholoRequests: `Root', `Valid-responses', `valid-requests', `Directory',
5086407bc5bStholo`Entry', `Modified', `Unchanged', `Argument', `Argumentx', `ci', `co',
5096407bc5bStholo`update'.  Responses: `ok', `error', `Valid-requests', `Checked-in',
5106407bc5bStholo`Updated', `Merged', `Removed', `M', `E'.
5116407bc5bStholo
5126407bc5bStholo   A server need not implement `Repository', but in order to
5136407bc5bStholointeroperate with CVS 1.5 through 1.9 it must claim to implement it (in
5146407bc5bStholo`Valid-requests').  The client will not actually send the request.
5156407bc5bStholo
5166407bc5bStholo
5176407bc5bStholoFile: cvsclient.info,  Node: Obsolete,  Prev: Requirements,  Up: Protocol
5186407bc5bStholo
5196407bc5bStholoObsolete protocol elements
5206407bc5bStholo==========================
5216407bc5bStholo
5226407bc5bStholo   This section briefly describes protocol elements which are obsolete.
5236407bc5bStholoThere is no attempt to document them in full detail.
5246407bc5bStholo
5256407bc5bStholo   There was a `Repository' request which was like `Directory' except
5266407bc5bStholoit only provided REPOSITORY, and the local directory was assumed to be
5276407bc5bStholosimilarly named.
5286407bc5bStholo
5296407bc5bStholo   If the `UseUnchanged' request was not sent, there was a `Lost'
5306407bc5bStholorequest which was sent to indicate that a file did not exist in the
5316407bc5bStholoworking directory, and the meaning of sending `Entries' without `Lost'
5326407bc5bStholoor `Modified' was different.  All current clients (CVS 1.5 and later)
5336407bc5bStholowill send `UseUnchanged' if it is supported.
5346407bc5bStholo
5356407bc5bStholo
5366407bc5bStholoFile: cvsclient.info,  Node: Protocol Notes,  Prev: Protocol,  Up: Top
5376407bc5bStholo
5386407bc5bStholoNotes on the Protocol
5396407bc5bStholo*********************
5406407bc5bStholo
5416407bc5bStholo   A number of enhancements are possible.  Also see the file TODO in
5426407bc5bStholothe CVS source distribution, which has further ideas concerning various
5438506102dStholoaspects of CVS, some of which impact the protocol.  Similarly, the
544e77048c1Stholo`http://www.cvshome.org' site, in particular the `Development' pages.
5456407bc5bStholo
5466407bc5bStholo   * The `Modified' request could be speeded up by sending diffs rather
5476407bc5bStholo     than entire files.  The client would need some way to keep the
5486407bc5bStholo     version of the file which was originally checked out; probably
5496407bc5bStholo     requiring the use of "cvs edit" in this case is the most sensible
5506407bc5bStholo     course (the "cvs edit" could be handled by a package like VC for
5516407bc5bStholo     emacs).  This would also allow local operation of `cvs diff'
5526407bc5bStholo     without arguments.
5536407bc5bStholo
5546407bc5bStholo   * The fact that `pserver' requires an extra network turnaround in
5556407bc5bStholo     order to perform authentication would be nice to avoid.  This
5566407bc5bStholo     relates to the issue of reporting errors; probably the clean
5576407bc5bStholo     solution is to defer the error until the client has issued a
5586407bc5bStholo     request which expects a response.  To some extent this might
5596407bc5bStholo     relate to the next item (in terms of how easy it is to skip a
5606407bc5bStholo     whole bunch of requests until we get to one that expects a
5616407bc5bStholo     response).  I know that the kerberos code doesn't wait in this
5626407bc5bStholo     fashion, but that probably can cause network deadlocks and perhaps
5636407bc5bStholo     future problems running over a transport which is more transaction
5646407bc5bStholo     oriented than TCP.  On the other hand I'm not sure it is wise to
5656407bc5bStholo     make the client conduct a lengthy upload only to find there is an
5666407bc5bStholo     authentication failure.
5676407bc5bStholo
5686407bc5bStholo   * The protocol uses an extra network turnaround for protocol
5696407bc5bStholo     negotiation (`valid-requests').  It might be nice to avoid this by
5706407bc5bStholo     having the client be able to send requests and tell the server to
5716407bc5bStholo     ignore them if they are unrecognized (different requests could
5726407bc5bStholo     produce a fatal error if unrecognized).  To do this there should
5736407bc5bStholo     be a standard syntax for requests.  For example, perhaps all
5746407bc5bStholo     future requests should be a single line, with mechanisms analogous
5756407bc5bStholo     to `Argumentx', or several requests working together, to provide
5766407bc5bStholo     greater amounts of information.  Or there might be a standard
5776407bc5bStholo     mechanism for counted data (analogous to that used by `Modified')
5786407bc5bStholo     or continuation lines (like a generalized `Argumentx').  It would
5796407bc5bStholo     be useful to compare what HTTP is planning in this area; last I
5806407bc5bStholo     looked they were contemplating something called Protocol Extension
5816407bc5bStholo     Protocol but I haven't looked at the relevant IETF documents in
5826407bc5bStholo     any detail.  Obviously, we want something as simple as possible
5836407bc5bStholo     (but no simpler).
5846407bc5bStholo
5856407bc5bStholo   * The scrambling algorithm in the CVS client and server actually
5866407bc5bStholo     support more characters than those documented in *Note Password
5876407bc5bStholo     scrambling::.  Someday we are going to either have to document
5886407bc5bStholo     them all (but this is not as easy as it may look, see below), or
5896407bc5bStholo     (gradually and with adequate process) phase out the support for
5906407bc5bStholo     other characters in the CVS implementation.  This business of
5916407bc5bStholo     having the feature partly undocumented isn't a desirable state
5926407bc5bStholo     long-term.
5936407bc5bStholo
5946407bc5bStholo     The problem with documenting other characters is that unless we
5956407bc5bStholo     know what character set is in use, there is no way to make a
5966407bc5bStholo     password portable from one system to another.  For example, a with
5976407bc5bStholo     a circle on top might have different encodings in different
5986407bc5bStholo     character sets.
5996407bc5bStholo
6002f9d2fd9Stholo     It _almost_ works to say that the client picks an arbitrary,
6016407bc5bStholo     unknown character set (indeed, having the CVS client know what
6026407bc5bStholo     character set the user has in mind is a hard problem otherwise),
6036407bc5bStholo     and scrambles according to a certain octet<->octet mapping.  There
6046407bc5bStholo     are two problems with this.  One is that the protocol has no way
6056407bc5bStholo     to transmit character 10 decimal (linefeed), and the current
6066407bc5bStholo     server and clients have no way to handle 0 decimal (NUL).  This
6076407bc5bStholo     may cause problems with certain multibyte character sets, in which
6086407bc5bStholo     octets 10 and 0 will appear in the middle of other characters.
6096407bc5bStholo     The other problem, which is more minor and possibly not worth
6106407bc5bStholo     worrying about, is that someone can type a password on one system
6116407bc5bStholo     and then go to another system which uses a different encoding for
6126407bc5bStholo     the same characters, and have their password not work.
6136407bc5bStholo
6146407bc5bStholo     The restriction to the ISO646 invariant subset is the best
6156407bc5bStholo     approach for strings which are not particularly significant to
6166407bc5bStholo     users.  Passwords are visible enough that this is somewhat
6176407bc5bStholo     doubtful as applied here.  ISO646 does, however, have the virtue
6186407bc5bStholo     (!?) of offending everyone.  It is easy to say "But the $ is right
6196407bc5bStholo     on people's keyboards!  Surely we can't forbid that".  From a
6206407bc5bStholo     human factors point of view, that makes quite a bit of sense.  The
6216407bc5bStholo     contrary argument, of course, is that a with a circle on top, or
6226407bc5bStholo     some of the characters poorly handled by Unicode, are on
6232f9d2fd9Stholo     _someone_'s keyboard.
6242f9d2fd9Stholo
6256407bc5bStholo
6266407bc5bStholo
627