This file is indexed.

/usr/share/doc/cvs/cvsclient.html is in cvs 2:1.12.13+real-26.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CVS Client/Server</title>

<meta name="description" content="CVS Client/Server">
<meta name="keywords" content="CVS Client/Server">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="#Top" rel="start" title="Top">
<link href="dir.html#Top" rel="up" title="(dir)">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en">


<a name="Top"></a>
<div class="header">
<p>
Next: <a href="#Introduction" accesskey="n" rel="next">Introduction</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> &nbsp; </p>
</div>
<a name="CVS-Client_002fServer"></a>
<h1 class="top">CVS Client/Server</h1>

<p>This document describes the client/server protocol used by CVS.  It does
not describe how to use or administer client/server CVS; for that,
see <a href="cvs.html#Top">the regular CVS manual</a> in <cite>the regular CVS manual</cite>.
This specification applies to
<small>CVS</small> version 1.12.13-MirOS-0AB8.4 and up.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="#Introduction" accesskey="1">Introduction</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">What is CVS and what is the client/server protocol for?
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Goals" accesskey="2">Goals</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Basic design decisions, requirements, scope, etc.
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Connection-and-Authentication" accesskey="3">Connection and Authentication</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Various ways to connect to the server
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Password-scrambling" accesskey="4">Password scrambling</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Scrambling used by pserver
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Protocol" accesskey="5">Protocol</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Complete description of the protocol
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Protocol-Notes" accesskey="6">Protocol Notes</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Possible enhancements, limitations, etc. of the protocol
</td></tr>
</table>

<hr>
<a name="Introduction"></a>
<div class="header">
<p>
Next: <a href="#Goals" accesskey="n" rel="next">Goals</a>, Previous: <a href="#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
</div>
<a name="Introduction-1"></a>
<h2 class="chapter">1 Introduction</h2>

<p>CVS is a version control system (with some additional configuration
management functionality).  It maintains a central <em>repository</em>
which stores files (often source code), including past versions,
information about who modified them and when, and so on.  People who
wish to look at or modify those files, known as <em>developers</em>, use
CVS to <em>check out</em> a <em>working directory</em> from the repository, to
<em>check in</em> new versions of files to the repository, and other
operations such as viewing the modification history of a file.  If
developers are connected to the repository by a network, particularly a
slow or flaky one, the most efficient way to use the network is with the
CVS-specific protocol described in this document.
</p>
<p>Developers, using the machine on which they store their working
directory, run the CVS <em>client</em> program.  To perform operations
which cannot be done locally, it connects to the CVS <em>server</em>
program, which maintains the repository.  For more information on how
to connect see <a href="#Connection-and-Authentication">Connection and Authentication</a>.
</p>
<p>This document describes the CVS protocol.  Unfortunately, it does not
yet completely document one aspect of the protocol&mdash;the detailed
operation of each CVS command and option&mdash;and one must look at the CVS
user documentation, <samp>cvs.texinfo</samp>, for that information.  The
protocol is non-proprietary (anyone who wants to is encouraged to
implement it) and an implementation, known as CVS, is available under
the GNU General Public License.  The CVS distribution, containing this
implementation, <samp>cvs.texinfo</samp>, and a copy (possibly more or less up
to date than what you are reading now) of this document,
<samp>cvsclient.texi</samp>, can be found at the usual GNU FTP sites, with a
filename such as <samp>cvs-<var>version</var>.tar.gz</samp>.
</p>
<p>This is version 1.12.13 of the protocol specification.  This
version number is intended only to aid in distinguishing different
versions of this specification.  Although the specification is currently
maintained in conjunction with the CVS implementation, and carries the
same version number, it also intends to document what is involved with
interoperating with other implementations (such as other versions of
CVS); see <a href="#Requirements">Requirements</a>.  This version number should not be used
by clients or servers to determine what variant of the protocol to
speak; they should instead use the <code>valid-requests</code> and
<code>Valid-responses</code> mechanism (see <a href="#Protocol">Protocol</a>), which is more
flexible.
</p>
<hr>
<a name="Goals"></a>
<div class="header">
<p>
Next: <a href="#Connection-and-Authentication" accesskey="n" rel="next">Connection and Authentication</a>, Previous: <a href="#Introduction" accesskey="p" rel="prev">Introduction</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
</div>
<a name="Goals-1"></a>
<h2 class="chapter">2 Goals</h2>

<ul>
<li> Do not assume any access to the repository other than via this protocol.
It does not depend on NFS, rdist, etc.

</li><li> Providing a reliable transport is outside this protocol.  The protocol
expects a reliable transport that is transparent (that is, there is no
translation of characters, including characters such as
linefeeds or carriage returns), and can transmit all 256 octets (for
example for proper handling of binary files, compression, and
encryption).  The encoding of characters specified by the protocol (the
names of requests and so on) is the invariant ISO 646 character set (a
subset of most popular character sets including ASCII and others).  For
more details on running the protocol over the TCP reliable transport,
see <a href="#Connection-and-Authentication">Connection and Authentication</a>.

</li><li> Security and authentication are handled outside this protocol (but see
below about &lsquo;<samp>cvs kserver</samp>&rsquo; and &lsquo;<samp>cvs pserver</samp>&rsquo;).

</li><li> The protocol makes it possible for updates to be atomic with respect to
checkins; that is if someone commits changes to several files in one cvs
command, then an update by someone else would either get all the
changes, or none of them.  The current <small>CVS</small> server can&rsquo;t do this,
but that isn&rsquo;t the protocol&rsquo;s fault.

</li><li> The protocol is, with a few exceptions, transaction-based.  That is, the
client sends all its requests (without waiting for server responses),
and then waits for the server to send back all responses (without
waiting for further client requests).  This has the advantage of
minimizing network turnarounds and the disadvantage of sometimes
transferring more data than would be necessary if there were a richer
interaction.  Another, more subtle, advantage is that there is no need
for the protocol to provide locking for features such as making checkins
atomic with respect to updates.  Any such locking can be handled
entirely by the server.  A good server implementation (such as the
current <small>CVS</small> server) will make sure that it does not have any such
locks in place whenever it is waiting for communication with the client;
this prevents one client on a slow or flaky network from interfering
with the work of others.

</li><li> It is a general design goal to provide only one way to do a given
operation (where possible).  For example, implementations have no choice
about whether to terminate lines with linefeeds or some other
character(s), and request and response names are case-sensitive.  This
is to enhance interoperability.  If a protocol allows more than one way
to do something, it is all too easy for some implementations to support
only some of them (perhaps accidentally).
</li></ul>

<hr>
<a name="Connection-and-Authentication"></a>
<div class="header">
<p>
Next: <a href="#Password-scrambling" accesskey="n" rel="next">Password scrambling</a>, Previous: <a href="#Goals" accesskey="p" rel="prev">Goals</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
</div>
<a name="How-to-Connect-to-and-Authenticate-Oneself-to-the-CVS-server"></a>
<h2 class="chapter">3 How to Connect to and Authenticate Oneself to the CVS server</h2>

<p>Connection and authentication occurs before the CVS protocol itself is
started.  There are several ways to connect.
</p>
<dl compact="compact">
<dt>server</dt>
<dd><p>If the client has a way to execute commands on the server, and provide
input to the commands and output from them, then it can connect that
way.  This could be the usual rsh (port 514) protocol, Kerberos rsh,
SSH, or any similar mechanism.  The client may allow the user to specify
the name of the server program; the default is <code>cvs</code>.  It is
invoked with one argument, <code>server</code>.  Once it invokes the server,
the client proceeds to start the cvs protocol.
</p>
</dd>
<dt>kserver</dt>
<dd><p>The kerberised server listens on a port (in the current implementation,
by having inetd call &quot;cvs kserver&quot;) which defaults to 1999.  The client
connects, sends the usual kerberos authentication information, and then
starts the cvs protocol.  Note: port 1999 is officially registered for
another use, and in any event one cannot register more than one port for
CVS, so GSS-API (see below) is recommended instead of kserver as a way
to support kerberos.
</p>
</dd>
<dt>pserver</dt>
<dd><p>The name <em>pserver</em> is somewhat confusing.  It refers to both a
generic framework which allows the CVS protocol to support several
authentication mechanisms, and a name for a specific mechanism which
transfers a username and a cleartext password.  Servers need not support
all mechanisms, and in fact servers will typically want to support only
those mechanisms which meet the relevant security needs.
</p>
<p>The pserver server listens on a port (in the current
implementation, by having inetd call &quot;cvs pserver&quot;) which defaults to
2401 (this port is officially registered).  The client
connects, and sends the following:
</p>
<ul>
<li> the string &lsquo;<samp>BEGIN AUTH REQUEST</samp>&rsquo;, a linefeed, 
</li><li> the cvs root, a linefeed,
</li><li> the username, a linefeed,
</li><li> the password trivially encoded (see <a href="#Password-scrambling">Password scrambling</a>), a
linefeed,
</li><li> the string &lsquo;<samp>END AUTH REQUEST</samp>&rsquo;, and a linefeed.
</li></ul>

<p>The client must send the
identical string for cvs root both here and later in the
<code>Root</code> request of the cvs
protocol itself.  Servers are encouraged to enforce this restriction.
The possible server responses (each of which is followed by a linefeed)
are the following.  Note that although there is a small similarity
between this authentication protocol and the cvs protocol, they are
separate.
</p>
<dl compact="compact">
<dt><code>I LOVE YOU</code></dt>
<dd><p>The authentication is successful.  The client proceeds with the cvs
protocol itself.
</p>
</dd>
<dt><code>I HATE YOU</code></dt>
<dd><p>The authentication fails.  After sending this response, the server may
close the connection.  It is up to the server to decide whether to give
this response, which is generic, or a more specific response using
&lsquo;<samp>E</samp>&rsquo; and/or &lsquo;<samp>error</samp>&rsquo;.
</p>
</dd>
<dt><code>E <var>text</var></code></dt>
<dd><p>Provide a message for the user.  After this reponse, the authentication
protocol continues with another response.  Typically the server will
provide a series of &lsquo;<samp>E</samp>&rsquo; responses followed by &lsquo;<samp>error</samp>&rsquo;.
Compatibility note: <small>CVS</small> 1.9.10 and older clients will print
<code>unrecognized auth response</code> and <var>text</var>, and then exit, upon
receiving this response.
</p>
</dd>
<dt><code>error <var>code</var> <var>text</var></code></dt>
<dd><p>The authentication fails.  After sending this response, the server may
close the connection.  The <var>code</var> is a code describing why it
failed, intended for computer consumption.  The only code currently
defined is &lsquo;<samp>0</samp>&rsquo; which is nonspecific, but clients must silently
treat any unrecognised codes as nonspecific.
The <var>text</var> should be supplied to the
user.  Compatibility note: <small>CVS</small> 1.9.10 and older clients will print
<code>unrecognized auth response</code> and <var>text</var>, and then exit, upon
receiving this response.
Note that <var>text</var> for this response, or the <var>text</var> in an <code>E</code>
response, is not designed for machine parsing.  More vigorous use of
<var>code</var>, or future extensions, will be needed to prove a cleaner
machine-parseable indication of what the error was.
</p></dd>
</dl>

<p>If the client wishes to merely authenticate without starting the cvs
protocol, the procedure is the same, except BEGIN AUTH REQUEST is
replaced with BEGIN VERIFICATION REQUEST, END AUTH REQUEST
is replaced with END VERIFICATION REQUEST, and upon receipt of
I LOVE YOU the connection is closed rather than continuing.
</p>
<p>Another mechanism is GSSAPI authentication.  GSSAPI is a
generic interface to security services such as kerberos.  GSSAPI is
specified in RFC2078 (GSSAPI version 2) and RFC1508 (GSSAPI version 1);
we are not aware of differences between the two which affect the
protocol in incompatible ways, so we make no attempt to specify one
version or the other.
The procedure here is to start with &lsquo;<samp>BEGIN
GSSAPI REQUEST</samp>&rsquo;.  GSSAPI authentication information is then exchanged
between the client and the server.  Each packet of information consists
of a two byte big endian length, followed by that many bytes of data.
After the GSSAPI authentication is complete, the server continues with
the responses described above (&lsquo;<samp>I LOVE YOU</samp>&rsquo;, etc.).
</p>
</dd>
<dt>future possibilities</dt>
<dd><p>There are a nearly unlimited number of ways to connect and authenticate.
One might want to allow access based on IP address (similar to the usual
rsh protocol but with different/no restrictions on ports &lt; 1024), to
adopt mechanisms such as Pluggable Authentication Modules (PAM), to
allow users to run their own servers under their own usernames without
root access, or any number of other possibilities.  The way to add
future mechanisms, for the most part, should be to continue to use port
2401, but to use different strings in place of &lsquo;<samp>BEGIN AUTH
REQUEST</samp>&rsquo;.
</p></dd>
</dl>

<hr>
<a name="Password-scrambling"></a>
<div class="header">
<p>
Next: <a href="#Protocol" accesskey="n" rel="next">Protocol</a>, Previous: <a href="#Connection-and-Authentication" accesskey="p" rel="prev">Connection and Authentication</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
</div>
<a name="Password-scrambling-algorithm"></a>
<h2 class="chapter">4 Password scrambling algorithm</h2>

<p>The pserver authentication protocol, as described in <a href="#Connection-and-Authentication">Connection and Authentication</a>, trivially encodes the passwords.  This is only to
prevent inadvertent compromise; it provides no protection against even a
relatively unsophisticated attacker.  For comparison, HTTP Basic
Authentication (as described in RFC2068) uses BASE64 for a similar
purpose.  CVS uses its own algorithm, described here.
</p>
<p>The scrambled password starts with &lsquo;<samp>A</samp>&rsquo;, which serves to identify
the scrambling algorithm in use.  After that follows a single octet for
each character in the password, according to a fixed encoding.  The
values are shown here, with the encoded values in decimal.  Control
characters, space, and characters outside the invariant ISO 646
character set are not shown; such characters are not recommended for use
in passwords.  There is a long discussion of character set issues in
<a href="#Protocol-Notes">Protocol Notes</a>.
</p>
<div class="example">
<pre class="example">        0 111           P 125           p  58
! 120   1  52   A  57   Q  55   a 121   q 113
&quot;  53   2  75   B  83   R  54   b 117   r  32
        3 119   C  43   S  66   c 104   s  90
        4  49   D  46   T 124   d 101   t  44
% 109   5  34   E 102   U 126   e 100   u  98
&amp;  72   6  82   F  40   V  59   f  69   v  60
' 108   7  81   G  89   W  47   g  73   w  51
(  70   8  95   H  38   X  92   h  99   x  33
)  64   9  65   I 103   Y  71   i  63   y  97
*  76   : 112   J  45   Z 115   j  94   z  62
+  67   ;  86   K  50           k  93
, 116   &lt; 118   L  42           l  39
-  74   = 110   M 123           m  37
.  68   &gt; 122   N  91           n  61
/  87   ? 105   O  35   _  56   o  48
</pre></div>

<hr>
<a name="Protocol"></a>
<div class="header">
<p>
Next: <a href="#Protocol-Notes" accesskey="n" rel="next">Protocol Notes</a>, Previous: <a href="#Password-scrambling" accesskey="p" rel="prev">Password scrambling</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
</div>
<a name="The-CVS-client_002fserver-protocol"></a>
<h2 class="chapter">5 The CVS client/server protocol</h2>

<p>In the following, &lsquo;<samp>\n</samp>&rsquo; refers to a linefeed and &lsquo;<samp>\t</samp>&rsquo; refers to
a horizontal tab; <em>requests</em> are what the client sends and
<em>responses</em> are what the server sends.  In general, the connection is
governed by the client&mdash;the server does not send responses without
first receiving requests to do so; see <a href="#Response-intro">Response intro</a> for more
details of this convention.
</p>
<p>It is typical, early in the connection, for the client to transmit a
<code>Valid-responses</code> request, containing all the responses it
supports, followed by a <code>valid-requests</code> request, which elicits
from the server a <code>Valid-requests</code> response containing all the
requests it understands.  In this way, the client and server each find
out what the other supports before exchanging large amounts of data
(such as file contents).
</p>
<table class="menu" border="0" cellspacing="0">
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">

General protocol conventions:

</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Entries-Lines" accesskey="1">Entries Lines</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Transmitting RCS data
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#File-Modes" accesskey="2">File Modes</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Read, write, execute, and possibly more...
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Filenames" accesskey="3">Filenames</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Conventions regarding filenames
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#File-transmissions" accesskey="4">File transmissions</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">How file contents are transmitted
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Strings" accesskey="5">Strings</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Strings in various requests and responses
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Dates" accesskey="6">Dates</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Times and dates
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">

The protocol itself:

</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Request-intro" accesskey="7">Request intro</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">General conventions relating to requests
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Requests" accesskey="8">Requests</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">List of requests
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Response-intro" accesskey="9">Response intro</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">General conventions relating to responses
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Response-pathnames">Response pathnames</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">The &quot;pathname&quot; in responses
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Responses">Responses</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">List of responses
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Text-tags">Text tags</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">More details about the MT response
</td></tr>
<tr><th colspan="3" align="left" valign="top"><pre class="menu-comment">

An example session, and some further observations:

</pre></th></tr><tr><td align="left" valign="top">&bull; <a href="#Example">Example</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">A conversation between client and server
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Requirements">Requirements</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Things not to omit from an implementation
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="#Obsolete">Obsolete</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">Former protocol features
</td></tr>
</table>

<hr>
<a name="Entries-Lines"></a>
<div class="header">
<p>
Next: <a href="#File-Modes" accesskey="n" rel="next">File Modes</a>, Up: <a href="#Protocol" accesskey="u" rel="up">Protocol</a> &nbsp; </p>
</div>
<a name="Entries-Lines-1"></a>
<h3 class="section">5.1 Entries Lines</h3>

<p>Entries lines are transmitted as:
</p>
<div class="example">
<pre class="example">/ <var>name</var> / <var>version</var> / <var>conflict</var> / <var>options</var> / <var>tag_or_date</var>
</pre></div>

<p><var>tag_or_date</var> is either &lsquo;<samp>T</samp>&rsquo; <var>tag</var> or &lsquo;<samp>D</samp>&rsquo; <var>date</var>
or empty.  If it is followed by a slash, anything after the slash
shall be silently ignored.
</p>
<p><var>version</var> can be empty, or start with &lsquo;<samp>0</samp>&rsquo; or &lsquo;<samp>-</samp>&rsquo;, for no
user file, new user file, or user file to be removed, respectively.
</p>
<p><var>conflict</var>, if it starts with &lsquo;<samp>+</samp>&rsquo;, indicates that the file had
conflicts in it.  The rest of <var>conflict</var> is &lsquo;<samp>=</samp>&rsquo; if the
timestamp matches the file, or anything else if it doesn&rsquo;t.  If
<var>conflict</var> does not start with a &lsquo;<samp>+</samp>&rsquo;, it is silently ignored.
</p>
<p><var>options</var> signifies the keyword expansion options (for example
&lsquo;<samp>-ko</samp>&rsquo;).  In an <code>Entry</code> request, this indicates the options
that were specified with the file from the previous file updating
response (see <a href="#Response-intro">Response intro</a>, for a list of file updating
responses); if the client is specifying the &lsquo;<samp>-k</samp>&rsquo; or &lsquo;<samp>-A</samp>&rsquo;
option to <code>update</code>, then it is the server which figures out what
overrides what.
</p>
<hr>
<a name="File-Modes"></a>
<div class="header">
<p>
Next: <a href="#Filenames" accesskey="n" rel="next">Filenames</a>, Previous: <a href="#Entries-Lines" accesskey="p" rel="prev">Entries Lines</a>, Up: <a href="#Protocol" accesskey="u" rel="up">Protocol</a> &nbsp; </p>
</div>
<a name="File-Modes-1"></a>
<h3 class="section">5.2 File Modes</h3>

<p>A mode is any number of repetitions of
</p>
<div class="example">
<pre class="example"><var>mode-type</var> = <var>data</var>
</pre></div>

<p>separated by &lsquo;<samp>,</samp>&rsquo;.
</p>
<p><var>mode-type</var> is an identifier composed of alphanumeric characters.
Currently specified: &lsquo;<samp>u</samp>&rsquo; for user, &lsquo;<samp>g</samp>&rsquo; for group, &lsquo;<samp>o</samp>&rsquo;
for other (see below for discussion of whether these have their POSIX
meaning or are more loose).  Unrecognised values of <var>mode-type</var>
are silently ignored.
</p>
<p><var>data</var> consists of any data not containing &lsquo;<samp>,</samp>&rsquo;, &lsquo;<samp>\0</samp>&rsquo; or
&lsquo;<samp>\n</samp>&rsquo;.  For &lsquo;<samp>u</samp>&rsquo;, &lsquo;<samp>g</samp>&rsquo;, and &lsquo;<samp>o</samp>&rsquo; mode types, data
consists of alphanumeric characters, where &lsquo;<samp>r</samp>&rsquo; means read, &lsquo;<samp>w</samp>&rsquo;
means write, &lsquo;<samp>x</samp>&rsquo; means execute, and unrecognised letters are
silently ignored.
</p>
<p>The two most obvious ways in which the mode matters are: (1) is it
writeable?  This is used by the developer communication features, and
is implemented even on OS/2 (and could be implemented on DOS), whose
notion of mode is limited to a readonly bit. (2) is it executable?
Unix CVS users need CVS to store this setting (for shell scripts and
the like).  The current CVS implementation on unix does a little bit
more than just maintain these two settings, but it doesn&rsquo;t really have
a nice general facility to store or version control the mode, even on
unix, much less across operating systems with diverse protection
features.  So all the ins and outs of what the mode means across
operating systems haven&rsquo;t really been worked out (e.g. should the VMS
port use ACLs to get POSIX semantics for groups?).
</p>
<hr>
<a name="Filenames"></a>
<div class="header">
<p>
Next: <a href="#File-transmissions" accesskey="n" rel="next">File transmissions</a>, Previous: <a href="#File-Modes" accesskey="p" rel="prev">File Modes</a>, Up: <a href="#Protocol" accesskey="u" rel="up">Protocol</a> &nbsp; </p>
</div>
<a name="Conventions-regarding-transmission-of-file-names"></a>
<h3 class="section">5.3 Conventions regarding transmission of file names</h3>

<p>In most contexts, &lsquo;<samp>/</samp>&rsquo; is used to separate directory and file
names in filenames, and any use of other conventions (for example,
that the user might type on the command line) is converted to that
form.  The only exceptions might be a few cases in which the server
provides a magic cookie which the client then repeats verbatim, but as
the server has not yet been ported beyond unix, the two rules provide
the same answer (and what to do if future server ports are operating
on a repository like e:/foo or CVS_ROOT:[FOO.BAR] has not been
carefully thought out).
</p>
<p>Characters outside the invariant ISO 646 character set should be avoided
in filenames.  This restriction may need to be relaxed to allow for
characters such as &lsquo;<samp>[</samp>&rsquo; and &lsquo;<samp>]</samp>&rsquo; (see above about non-unix
servers); this has not been carefully considered (and currently
implementations probably use whatever character sets that the operating
systems they are running on allow, and/or that users specify).  Of
course the most portable practice is to restrict oneself further, to the
POSIX portable filename character set as specified in POSIX.1.
</p>
<hr>
<a name="File-transmissions"></a>
<div class="header">
<p>
Next: <a href="#Strings" accesskey="n" rel="next">Strings</a>, Previous: <a href="#Filenames" accesskey="p" rel="prev">Filenames</a>, Up: <a href="#Protocol" accesskey="u" rel="up">Protocol</a> &nbsp; </p>
</div>
<a name="File-transmissions-1"></a>
<h3 class="section">5.4 File transmissions</h3>

<p>File contents (noted below as <var>file transmission</var>) can be sent in
one of two forms.  The simpler form is a number of bytes, followed by a
linefeed, followed by the specified number of bytes of file contents.
These are the entire contents of the specified file.  Second, if both
client and server support &lsquo;<samp>gzip-file-contents</samp>&rsquo;, a &lsquo;<samp>z</samp>&rsquo; may
precede the length, and the &lsquo;file contents&rsquo; sent are actually compressed
with &lsquo;<samp>gzip</samp>&rsquo; (RFC1952/1951) compression.  The length specified is
that of the compressed version of the file.
</p>
<p>In neither case are the file content followed by any additional data.
The transmission of a file will end with a linefeed iff that file (or its
compressed form) ends with a linefeed.
</p>
<p>The encoding of file contents depends on the value for the &lsquo;<samp>-k</samp>&rsquo;
option.  If the file is binary (as specified by the &lsquo;<samp>-kb</samp>&rsquo; option in
the appropriate place), then it is just a certain number of octets, and
the protocol contributes nothing towards determining the encoding (using
the file name is one widespread, if not universally popular, mechanism).
If the file is text (not binary), then the file is sent as a series of
lines, separated by linefeeds.  If the keyword expansion is set to
something other than &lsquo;<samp>-ko</samp>&rsquo;, then it is expected that the file
conform to the RCS expectations regarding keyword expansion&mdash;in
particular, that it is in a character set such as ASCII in which 0x24 is
a dollar sign (&lsquo;<samp>$</samp>&rsquo;).
</p>
<hr>
<a name="Strings"></a>
<div class="header">
<p>
Next: <a href="#Dates" accesskey="n" rel="next">Dates</a>, Previous: <a href="#File-transmissions" accesskey="p" rel="prev">File transmissions</a>, Up: <a href="#Protocol" accesskey="u" rel="up">Protocol</a> &nbsp; </p>
</div>
<a name="Strings-1"></a>
<h3 class="section">5.5 Strings</h3>

<p>In various contexts, for example the <code>Argument</code> request and the
<code>M</code> response, one transmits what is essentially an arbitrary
string.  Often this will have been supplied by the user (for example,
the &lsquo;<samp>-m</samp>&rsquo; option to the <code>ci</code> request will show up in the
<code>LOGM</code> response).  The protocol has no mechanism to specify the
character set of such strings; it would have been, initially, fairly
safe to stick to the invariant ISO 646 character set but the existing
practice is probably to just transmit whatever the user specifies,
and hope that everyone involved agrees which character set is in use,
or sticks to a common subset. In modern times, UTF-8 should be used.
</p>
<hr>
<a name="Dates"></a>
<div class="header">
<p>
Next: <a href="#Request-intro" accesskey="n" rel="next">Request intro</a>, Previous: <a href="#Strings" accesskey="p" rel="prev">Strings</a>, Up: <a href="#Protocol" accesskey="u" rel="up">Protocol</a> &nbsp; </p>
</div>
<a name="Dates-1"></a>
<h3 class="section">5.6 Dates</h3>

<p>The protocol contains times and dates in various places.
</p>
<p>For the &lsquo;<samp>-D</samp>&rsquo; option to the <code>annotate</code>, <code>co</code>, <code>diff</code>,
<code>export</code>, <code>history</code>, <code>rannotate</code>, <code>rdiff</code>,
<code>rtag</code>, <code>tag</code>,
and <code>update</code> requests, the server should support two formats:
</p>
<div class="example">
<pre class="example">26 May 1997 13:01:40 -0000  ; <span class="roman">RFC 822 as modified by RFC 1123</span>
5/26/1997 13:01:40 GMT    ; <span class="roman">traditional</span>
</pre></div>

<p>The former format is preferred; the latter however is sent by the CVS
command line client (versions 1.5 through at least 1.9).
</p>
<p>For the &lsquo;<samp>-d</samp>&rsquo; option to the <code>log</code> and <code>rlog</code> requests,
servers should at
least support RFC 822/1123 format.  Clients are encouraged to use this
format too (the command line CVS client, version 1.10 and older, just passed
along the date format specified by the user, however).
</p>
<p>The <code>Mod-time</code> response and <code>Checkin-time</code> request use RFC
822/1123 format (see the descriptions of that response and request for
details).
</p>
<p>For <code>Notify</code>, see the description of that request.
</p>
<hr>
<a name="Request-intro"></a>
<div class="header">
<p>
Next: <a href="#Requests" accesskey="n" rel="next">Requests</a>, Previous: <a href="#Dates" accesskey="p" rel="prev">Dates</a>, Up: <a href="#Protocol" accesskey="u" rel="up">Protocol</a> &nbsp; </p>
</div>
<a name="Request-intro-1"></a>
<h3 class="section">5.7 Request intro</h3>

<p>By convention, requests which begin with a capital letter do not elicit
a response from the server, while all others do &ndash; save one.  The
exception is &lsquo;<samp>gzip-file-contents</samp>&rsquo;.  Unrecognised requests will
always elicit a response from the server, even if that request begins
with a capital letter.
</p>
<p>The term <em>command</em> means a request which expects a response (except
<code>valid-requests</code>).  The general model is that the client transmits
a great number of requests, but nothing happens until the very end when
the client transmits a command.  Although the intention is that
transmitting several commands in one connection should be legal,
existing servers probably have some bugs with some combinations of more
than one command, and so clients may find it necessary to make several
connections in some cases.  This should be thought of as a workaround
rather than a desired attribute of the protocol.
</p>
<hr>
<a name="Requests"></a>
<div class="header">
<p>
Next: <a href="#Response-intro" accesskey="n" rel="next">Response intro</a>, Previous: <a href="#Request-intro" accesskey="p" rel="prev">Request intro</a>, Up: <a href="#Protocol" accesskey="u" rel="up">Protocol</a> &nbsp; </p>
</div>
<a name="Requests-1"></a>
<h3 class="section">5.8 Requests</h3>

<p>Here are the requests:
</p>
<dl compact="compact">
<dt><code>Root <var>pathname</var> \n</code></dt>
<dd><p>Response expected: no.  Tell the server which <code>CVSROOT</code> to use.
Note that <var>pathname</var> is a local directory and <em>not</em> a fully
qualified <code>CVSROOT</code> variable.  <var>pathname</var> must
already exist; if creating a new root, use the <code>init</code> request, not
<code>Root</code>.  <var>pathname</var> does not include the hostname of the
server, how to access the server, etc.; by the time the CVS protocol is
in use, connection, authentication, etc., are already taken care of.
</p>
<p>The <code>Root</code> request must be sent only once, and it must be sent
before any requests other than <code>Valid-responses</code>,
<code>valid-requests</code>, <code>UseUnchanged</code>, <code>Set</code>,
<code>Global_option</code>, <code>init</code>, <code>noop</code>, or <code>version</code>.
</p>
</dd>
<dt><code>Valid-responses <var>request-list</var> \n</code></dt>
<dd><p>Response expected: no.
Tell the server what responses the client will accept.
request-list is a space separated list of tokens.
The <code>Root</code> request need not have been previously sent.
</p>
</dd>
<dt><code>valid-requests \n</code></dt>
<dd><p>Response expected: yes.
Ask the server to send back a <code>Valid-requests</code> response.
The <code>Root</code> request need not have been previously sent.
</p>
</dd>
<dt><code>Command-prep <var>command</var> \n</code></dt>
<dd><p>Response expected: yes.
Notify the server of the command that we are leading up to.  Intended to allow
the server to send a redirect for write operations.  Requires either an
<code>ok</code> or <code>Redirect</code> respnose.
</p>
</dd>
<dt><code>Referrer <var>CVSROOT</var> \n</code></dt>
<dd><p>Response expected: no.
Notify a primary server of a server which referred us.  Intended to allow
a primary (write) server to update the read-only mirror a client is using
for reads to minimise races on any subsequent updates from the client.
</p>
</dd>
<dt><code>Directory <var>local-directory</var> \n</code></dt>
<dt><code>Relative-directory <var>local-directory</var> \n</code></dt>
<dd><p>Additional data: <var>repository</var> \n.  Response expected: no.
Tell the server what directory to use.
</p>
<p>The <var>repository</var> should be a directory name from a previous server
response and may be specified either relative to the <var>pathname</var> provided
with the <code>Root</code> request or absolute.  Relative or absolute, it must
specify a path within <var>pathname</var>.
</p>
<p>Prior to <small>CVS</small> version <strong>FIXME - release number 1.12.10?</strong>,
<var>repository</var> had to be absolute and <code>Relative-directory</code> was not a
valid request.  The <code>Relative-directory</code> request is synonymous with
<code>Directory</code> and is provided to alert modern clients that a relative
<var>repository</var> is acceptable.
</p>
<p>Note that this both gives a default for <code>Entry</code> and <code>Modified</code> and
also for <code>ci</code> and the other commands; normal usage is to send 
<code>Directory</code> for each directory in which there will be an
<code>Entry</code> or <code>Modified</code>, and then a final <code>Directory</code>
for the original directory, then the command.
The <var>local-directory</var> is relative to
the top level at which the command is occurring (i.e. the last
<code>Directory</code> which is sent before the command);
to indicate that top level, &lsquo;<samp>.</samp>&rsquo; should be sent for
<var>local-directory</var>.
</p>
<p>Here is an example of where a client gets <var>repository</var> and
<var>local-directory</var>.  Suppose that there is a module defined by
</p>
<div class="example">
<pre class="example">moddir 1dir
</pre></div>

<p>That is, one can check out <code>moddir</code> and it will take <code>1dir</code> in
the repository and check it out to <code>moddir</code> in the working
directory.  Then an initial check out could proceed like this:
</p>
<div class="example">
<pre class="example">C: Root /home/kingdon/zwork/cvsroot
. . .
C: Argument moddir
C: Directory .
C: .
C: co
S: Clear-sticky moddir/
S: 1dir/
. . .
S: ok
</pre></div>

<p>In this example the response shown is <code>Clear-sticky</code>, but it could
be another response instead.  Note that it returns two pathnames.
The first one, <samp>moddir/</samp>, indicates the working
directory to check out into.  The second one, ending in <samp>1dir/</samp>,
indicates the directory to pass back to the server in a subsequent
<code>Directory</code> request.  For example, a subsequent <code>update</code>
request might look like:
</p>
<div class="example">
<pre class="example">C: Directory moddir
C: 1dir
. . .
C: update
</pre></div>

<p>For a given <var>local-directory</var>, the repository will be the same for
each of the responses, so one can use the repository from whichever
response is most convenient.  Typically a client will store the
repository along with the sources for each <var>local-directory</var>, use
that same setting whenever operating on that <var>local-directory</var>, and
not update the setting as long as the <var>local-directory</var> exists.
</p>
<p>A client is free to rename a <var>local-directory</var> at any time (for
example, in response to an explicit user request).  While it is true
that the server supplies a <var>local-directory</var> to the client, as noted
above, this is only the default place to put the directory.  Of course,
the various <code>Directory</code> requests for a single command (for example,
<code>update</code> or <code>ci</code> request) should name a particular directory
with the same <var>local-directory</var>.
</p>
<p>Each <code>Directory</code> request specifies a brand-new
<var>local-directory</var> and <var>repository</var>; that is,
<var>local-directory</var> and <var>repository</var> are never relative to paths
specified in any previous <code>Directory</code> request.
</p>
<p>Here&rsquo;s a more complex example, in which we request an update of a
working directory which has been checked out from multiple places in the
repository.
</p>
<div class="example">
<pre class="example">C: Argument dir1
C: Directory dir1
C: mod1
. . .
C: Argument dir2
C: Directory dir2
C: mod2
. . .
C: Argument dir3
C: Directory dir3/subdir3
C: mod3
. . .
C: update
</pre></div>

<p>While directories <code>dir1</code> and <code>dir2</code> will be handled in similar
fashion to the other examples given above, <code>dir3</code> is slightly
different from the server&rsquo;s standpoint.  Notice that module <code>mod3</code>
is actually checked out into <code>dir3/subdir3</code>, meaning that directory
<code>dir3</code> is either empty or does not contain data checked out from
this repository.  
</p>
<p>The above example will work correctly in <small>CVS</small> 1.10.1 and later.  The
server will descend the tree starting from all directories mentioned in
<code>Argument</code> requests and update those directories specifically
mentioned in <code>Directory</code> requests.
</p>
<p>Previous versions of <small>CVS</small> (1.10 and earlier) do not behave the same
way.  While the descent of the tree begins at all directories mentioned
in <code>Argument</code> requests, descent into subdirectories only occurs if
a directory has been mentioned in a <code>Directory</code> request.
Therefore, the above example would succeed in updating <code>dir1</code> and
<code>dir2</code>, but would skip <code>dir3</code> because that directory was not
specifically mentioned in a <code>Directory</code> request.  A functional
version of the above that would run on a 1.10 or earlier server is as
follows:
</p>
<div class="example">
<pre class="example">C: Argument dir1
C: Directory dir1
C: mod1
. . .
C: Argument dir2
C: Directory dir2
C: mod2
. . .
C: Argument dir3
C: Directory dir3
C: .
. . .
C: Directory dir3/subdir3
C: mod3
. . .
C: update
</pre></div>

<p>Note the extra <code>Directory dir3</code> request.  It might be better to use
<code>Emptydir</code> as the repository for the <code>dir3</code> directory, but the
above will certainly work.
</p>
<p>One more peculiarity of the 1.10 and earlier protocol is the ordering of
<code>Directory</code> arguments.  In order for a subdirectory to be
registered correctly for descent by the recursion processor, its parent
must be sent first.  For example, the following would not work to update
<code>dir3/subdir3</code>:
</p>
<div class="example">
<pre class="example">. . .
C: Argument dir3
C: Directory dir3/subdir3
C: mod3
. . .
C: Directory dir3
C: .
. . .
C: update
</pre></div>

<p>The implementation of the server in 1.10 and earlier writes the
administration files for a given directory at the time of the
<code>Directory</code> request.  It also tries to register the directory with
its parent to mark it for recursion.  In the above example, at the time
<code>dir3/subdir3</code> is created, the physical directory for <code>dir3</code>
will be created on disk, but the administration files will not have been
created.  Therefore, when the server tries to register
<code>dir3/subdir3</code> for recursion, the operation will silently fail
because the administration files do not yet exist for <code>dir3</code>.
</p>
</dd>
<dt><code>Max-dotdot <var>level</var> \n</code></dt>
<dd><p>Response expected: no.
Tell the server that <var>level</var> levels of directories above the
directory which <code>Directory</code> requests are relative to will be
needed.  For example, if the client is planning to use a
<code>Directory</code> request for <samp>../../foo</samp>, it must send a
<code>Max-dotdot</code> request with a <var>level</var> of at least 2.
<code>Max-dotdot</code> must be sent before the first <code>Directory</code>
request.
</p>
</dd>
<dt><code>Static-directory \n</code></dt>
<dd><p>Response expected: no.  Tell the server that the directory most recently
specified with <code>Directory</code> should not have
additional files checked out unless explicitly requested.  The client
sends this if the <code>Entries.Static</code> flag is set, which is controlled
by the <code>Set-static-directory</code> and <code>Clear-static-directory</code>
responses.
</p>
</dd>
<dt><code>Sticky <var>tagspec</var> \n</code></dt>
<dd><p>Response expected: no.  Tell the server that the directory most recently
specified with <code>Directory</code> has a sticky tag or date <var>tagspec</var>.
The first character of <var>tagspec</var> is &lsquo;<samp>T</samp>&rsquo; for a tag, &lsquo;<samp>D</samp>&rsquo;
for a date, or some other character supplied by a Set-sticky response
from a previous request to the server.  The remainder of <var>tagspec</var>
contains the actual tag or date, again as supplied by Set-sticky.
</p>
<p>The server should remember <code>Static-directory</code> and <code>Sticky</code>
requests for a particular directory; the client need not resend them
each time it sends a <code>Directory</code> request for a given directory.
However, the server is not obliged to remember them beyond the context
of a single command.
</p>
</dd>
<dt><code>Checkin-prog <var>program</var> \n</code></dt>
<dd><p>Response expected: no.  Tell the server that the directory most recently
specified with <code>Directory</code> has a checkin program <var>program</var>.
Such a program would have been previously set with the
<code>Set-checkin-prog</code> response.
</p>
</dd>
<dt><code>Update-prog <var>program</var> \n</code></dt>
<dd><p>Response expected: no.  Tell the server that the directory most recently
specified with <code>Directory</code> has an update program <var>program</var>.
Such a program would have been previously set with the
<code>Set-update-prog</code> response.
</p>
</dd>
<dt><code>Entry <var>entry-line</var> \n</code></dt>
<dd><p>Response expected: no.  Tell the server what version of a file is on the
local machine.  The name in <var>entry-line</var> is a name relative to the
directory most recently specified with <code>Directory</code>.  If the user
is operating on only some files in a directory, <code>Entry</code> requests
for only those files need be included.  If an <code>Entry</code> request is
sent without <code>Modified</code>, <code>Is-modified</code>, or <code>Unchanged</code>,
it means the file is
lost (does not exist in the working directory).  If both <code>Entry</code>
and one of <code>Modified</code>, <code>Is-modified</code>, or <code>Unchanged</code> are
sent for the same file, <code>Entry</code> must be sent first.  For a
given file, one can send <code>Modified</code>, <code>Is-modified</code>, or
<code>Unchanged</code>, but not more than one of these three.
</p>
</dd>
<dt><code>Kopt <var>option</var> \n</code></dt>
<dd><p>This indicates to the server which keyword expansion options to use for
the file specified by the next <code>Modified</code> or <code>Is-modified</code>
request (for example &lsquo;<samp>-kb</samp>&rsquo; for a binary file).  This is similar to
<code>Entry</code>, but is used for a file for which there is no entries line.
Typically this will be a file being added via an <code>add</code> or
<code>import</code> request.  The client may not send both <code>Kopt</code> and
<code>Entry</code> for the same file.
</p>
</dd>
<dt><code>Checkin-time <var>time</var> \n</code></dt>
<dd><p>For the file specified by the next <code>Modified</code> request, use
<var>time</var> as the time of the checkin.  The <var>time</var> is in the format
specified by RFC822 as modified by RFC1123.  The client may specify any
timezone it chooses; servers will want to convert that to their own
timezone as appropriate.  An example of this format is:
</p>
<div class="example">
<pre class="example">26 May 1997 13:01:40 -0400
</pre></div>

<p>There is no requirement that the client and server clocks be
synchronised.  The client just sends its recommendation for a timestamp
(based on file timestamps or whatever), and the server should just believe
it (this means that the time might be in the future, for example).
</p>
<p>Note that this is not a general-purpose way to tell the server about the
timestamp of a file; that would be a separate request (if there are
servers which can maintain timestamp and time of checkin separately).
</p>
<p>This request should affect the <code>import</code> request, and may optionally
affect the <code>ci</code> request or other relevant requests if any.
</p>
</dd>
<dt><code>Modified <var>filename</var> \n</code></dt>
<dd><p>Response expected: no.  Additional data: mode, \n, file transmission.
Send the server a copy of one locally modified file.  <var>filename</var> is
a file within the most recent directory sent with <code>Directory</code>; it
must not contain &lsquo;<samp>/</samp>&rsquo;.  If
the user is operating on only some files in a directory, only those
files need to be included.  This can also be sent without <code>Entry</code>,
if there is no entry for the file.
</p>
</dd>
<dt><code>Is-modified <var>filename</var> \n</code></dt>
<dd><p>Response expected: no.  Additional data: none.  Like <code>Modified</code>,
but used if the server only needs
to know whether the file is modified, not the contents.
</p>
<p>The commands which can take <code>Is-modified</code> instead of
<code>Modified</code> with no known change in behavior are: <code>admin</code>,
<code>diff</code> (if and only if two &lsquo;<samp>-r</samp>&rsquo; or &lsquo;<samp>-D</samp>&rsquo; options are
specified), <code>watch-on</code>, <code>watch-off</code>, <code>watch-add</code>,
<code>watch-remove</code>, <code>watchers</code>, <code>editors</code>,
<code>log</code>, and <code>annotate</code>.
</p>
<p>For the <code>status</code> command, one can send <code>Is-modified</code> but if
the client is using imperfect mechanisms such as timestamps to determine
whether to consider a file modified, then the behavior will be
different.  That is, if one sends <code>Modified</code>, then the server will
actually compare the contents of the file sent and the one it derives
from to determine whether the file is genuinely modified.  But if one
sends <code>Is-modified</code>, then the server takes the client&rsquo;s word for
it.  A similar situation exists for <code>tag</code>, if the &lsquo;<samp>-c</samp>&rsquo; option
is specified.
</p>
<p>Commands for which <code>Modified</code> is necessary are <code>co</code>,
<code>ci</code>, <code>update</code>, and <code>import</code>.
</p>
<p>Commands which do not need to inform the server about a working
directory, and thus should not be sending either <code>Modified</code> or
<code>Is-modified</code>: <code>rdiff</code>, <code>rtag</code>, <code>history</code>,
<code>init</code>, and <code>release</code>.
</p>
<p>Commands for which further investigation is warranted are:
<code>remove</code>, <code>add</code>, and <code>export</code>.  Pending such
investigation, the more conservative course of action is to stick to
<code>Modified</code>.
</p>
</dd>
<dt><code>Unchanged <var>filename</var> \n</code></dt>
<dd><p>Response expected: no.  Tell the server that <var>filename</var> has not been
modified in the checked out directory.  The <var>filename</var> is
a file within the most recent directory sent with <code>Directory</code>; it
must not contain &lsquo;<samp>/</samp>&rsquo;.
</p>
</dd>
<dt><code>UseUnchanged \n</code></dt>
<dd><p>Response expected: no.  To specify the version of the protocol described
in this document, servers must support this request (although it need
not do anything) and clients must issue it.
The <code>Root</code> request need not have been previously sent.
</p>
</dd>
<dt><code>Notify <var>filename</var> \n</code></dt>
<dd><p>Response expected: no.
Tell the server that an <code>edit</code> or <code>unedit</code> command has taken
place.  The server needs to send a <code>Notified</code> response, but such
response is deferred until the next time that the server is sending
responses.
The <var>filename</var> is a file within the most recent directory sent with
<code>Directory</code>; it must not contain &lsquo;<samp>/</samp>&rsquo;.
Additional data:
</p><div class="example">
<pre class="example"><var>notification-type</var> \t <var>time</var> \t <var>clienthost</var> \t
<var>working-dir</var> \t <var>watches</var> \n
</pre></div>
<p>where <var>notification-type</var> is &lsquo;<samp>E</samp>&rsquo; for edit, &lsquo;<samp>U</samp>&rsquo; for
unedit, undefined behavior if &lsquo;<samp>C</samp>&rsquo;, and all other letters should be
silently ignored for future expansion.
<var>time</var> is the time at which the edit or unedit took place, in a
user-readable format of the client&rsquo;s choice (the server should treat the
time as an opaque string rather than interpreting it).
<var>clienthost</var> is the name of the host on which the edit or unedit
took place, and <var>working-dir</var> is the pathname of the working
directory where the edit or unedit took place.  <var>watches</var> are the
temporary watches, zero or more of the following characters in the
following order: &lsquo;<samp>E</samp>&rsquo; for edit, &lsquo;<samp>U</samp>&rsquo; for unedit, &lsquo;<samp>C</samp>&rsquo; for
commit, and all other letters should be silently ignored for future
expansion.  If <var>notification-type</var> is &lsquo;<samp>E</samp>&rsquo; the temporary watches
are set; if it is &lsquo;<samp>U</samp>&rsquo; they are cleared.
If <var>watches</var> is followed by \t then the
\t and the rest of the line should be ignored, for future expansion.
</p>
<p>The <var>time</var>, <var>clienthost</var>, and <var>working-dir</var> fields may not
contain the characters &lsquo;<samp>+</samp>&rsquo;, &lsquo;<samp>,</samp>&rsquo;, &lsquo;<samp>&gt;</samp>&rsquo;, &lsquo;<samp>;</samp>&rsquo;, or &lsquo;<samp>=</samp>&rsquo;.
</p>
<p>Note that a client may be capable of performing an <code>edit</code> or
<code>unedit</code> operation without connecting to the server at that time,
and instead connecting to the server when it is convenient (for example,
when a laptop is on the net again) to send the <code>Notify</code> requests.
Even if a client is capable of deferring notifications, it should
attempt to send them immediately (one can send <code>Notify</code> requests
together with a <code>noop</code> request, for example), unless perhaps if
it can know that a connection would be impossible.
</p>
</dd>
<dt><code>Questionable <var>filename</var> \n</code></dt>
<dd><p>Response expected: no.  Additional data: no.  Tell the server to check
whether <var>filename</var> should be ignored, and if not, next time the
server sends responses, send (in a <code>M</code> response) &lsquo;<samp>?</samp>&rsquo; followed
by the directory and filename.  <var>filename</var> must not contain
&lsquo;<samp>/</samp>&rsquo;; it needs to be a file in the directory named by the most
recent <code>Directory</code> request.
</p>
</dd>
<dt><code>Case \n</code></dt>
<dd><p>Response expected: no.  Tell the server that filenames should be matched
in a case-insensitive fashion.  Note that this is not the primary
mechanism for achieving case-insensitivity; for the most part the client
keeps track of the case which the server wants to use and takes care to
always use that case regardless of what the user specifies.  For example
the filenames given in <code>Entry</code> and <code>Modified</code> requests for the
same file must match in case regardless of whether the <code>Case</code>
request is sent.  The latter mechanism is more general (it could also be
used for 8.3 filenames, VMS filenames with more than one &lsquo;<samp>.</samp>&rsquo;, and
any other situation in which there is a predictable mapping between
filenames in the working directory and filenames in the protocol), but
there are some situations it cannot handle (ignore patterns, or
situations where the user specifies a filename and the client does not
know about that file).
</p>
<p>Though this request will be supported into the forseeable future, it has been
the source of numerous bug reports in the past due to the complexity of testing
this functionality via the test suite and client developers are encouraged not
to use it.  Instead, please consider munging conflicting names and maintaining
a map for communicating with the server.  For example, suppose the server sends
files <samp>case</samp>, <samp>CASE</samp>, and <samp>CaSe</samp>.  The client could write all
three files to names such as, <samp>case</samp>, <samp>case_prefix_case</samp>, and
<samp>case_prefix_2_case</samp> and maintain a mapping between the file names in, for
instance a new <samp>CVS/Map</samp> file.
</p>
</dd>
<dt><code>Argument <var>text</var> \n</code></dt>
<dd><p>Response expected: no.
Save argument for use in a subsequent command.  Arguments
accumulate until an argument-using command is given, at which point
they are forgotten.
</p>
</dd>
<dt><code>Argumentx <var>text</var> \n</code></dt>
<dd><p>Response expected: no.  Append \n followed by text to the current
argument being saved.
</p>
</dd>
<dt><code>Global_option <var>option</var> \n</code></dt>
<dd><p>Response expected: no.
Transmit one of the global options &lsquo;<samp>-q</samp>&rsquo;, &lsquo;<samp>-Q</samp>&rsquo;, &lsquo;<samp>-l</samp>&rsquo;,
&lsquo;<samp>-t</samp>&rsquo;, &lsquo;<samp>-r</samp>&rsquo;, or &lsquo;<samp>-n</samp>&rsquo;.  <var>option</var> must be one of those
strings, no variations (such as combining of options) are allowed.  For
graceful handling of <code>valid-requests</code>, it is probably better to
make new global options separate requests, rather than trying to add
them to this request.
The <code>Root</code> request need not have been previously sent.
</p>
</dd>
<dt><code>Gzip-stream <var>level</var> \n</code></dt>
<dd><p>Response expected: no.
Use zlib (RFC 1950/1951) compression to compress all further communication
between the client and the server.  As of <small>CVS</small> 1.12.13, this request needs
to be sent as the first non-rootless request if the server is configured
with compression level restrictions and <var>level</var> is outside the restricted
range.  After this request is sent, all further communication must be
compressed.  All further data received from the server will also be
compressed.  The <var>level</var> argument suggests to the server the level of
compression that it should apply; it should be an integer between 0 and 9,
inclusive, where &lsquo;<samp>0</samp>&rsquo; means no compression and higher numbers indicate more
compression.
</p>
</dd>
<dt><code>Kerberos-encrypt \n</code></dt>
<dd><p>Response expected: no.
Use Kerberos encryption to encrypt all further communication between the
client and the server.  This will only work if the connection was made
over Kerberos in the first place.  If both the <code>Gzip-stream</code> and
the <code>Kerberos-encrypt</code> requests are used, the
<code>Kerberos-encrypt</code> request should be used first.  This will make
the client and server encrypt the compressed data, as opposed to
compressing the encrypted data.  Encrypted data is generally
incompressible.
</p>
<p>Note that this request does not fully prevent an attacker from hijacking
the connection, in the sense that it does not prevent hijacking the
connection between the initial authentication and the
<code>Kerberos-encrypt</code> request.
</p>
</dd>
<dt><code>Gssapi-encrypt \n</code></dt>
<dd><p>Response expected: no.
Use GSSAPI encryption to encrypt all further communication between the
client and the server.  This will only work if the connection was made
over GSSAPI in the first place.  See <code>Kerberos-encrypt</code>, above, for
the relation between <code>Gssapi-encrypt</code> and <code>Gzip-stream</code>.
</p>
<p>Note that this request does not fully prevent an attacker from hijacking
the connection, in the sense that it does not prevent hijacking the
connection between the initial authentication and the
<code>Gssapi-encrypt</code> request.
</p>
</dd>
<dt><code>Gssapi-authenticate \n</code></dt>
<dd><p>Response expected: no.
Use GSSAPI authentication to authenticate all further communication
between the client and the server.  This will only work if the
connection was made over GSSAPI in the first place.  Encrypted data is
automatically authenticated, so using both <code>Gssapi-authenticate</code>
and <code>Gssapi-encrypt</code> has no effect beyond that of
<code>Gssapi-encrypt</code>.  Unlike encrypted data, it is reasonable to
compress authenticated data.
</p>
<p>Note that this request does not fully prevent an attacker from hijacking
the connection, in the sense that it does not prevent hijacking the
connection between the initial authentication and the
<code>Gssapi-authenticate</code> request.
</p>
</dd>
<dt><code>Set <var>variable</var>=<var>value</var> \n</code></dt>
<dd><p>Response expected: no.
Set a user variable <var>variable</var> to <var>value</var>.
The <code>Root</code> request need not have been previously sent.
</p>
</dd>
<dt><code>Hostname <var>hostname</var> \n</code></dt>
<dd><p>Response expected: no.  Set the client hostname for an upcoming <code>edit</code>
request.
</p>
</dd>
<dt><code>LocalDir <var>hostname</var> \n</code></dt>
<dd><p>Response expected: no.  Set the local client directory name for an upcoming
<code>edit</code> request.
</p>
</dd>
<dt><code>expand-modules \n</code></dt>
<dd><p>Response expected: yes.  Expand the modules which are specified in the
arguments.  Returns the data in <code>Module-expansion</code> responses.  Note
that the server can assume that this is checkout or export, not rtag or
rdiff; the latter do not access the working directory and thus have no
need to expand modules on the client side.
</p>
<p>Expand may not be the best word for what this request does.  It does not
necessarily tell you all the files contained in a module, for example.
Basically it is a way of telling you which working directories the
server needs to know about in order to handle a checkout of the
specified modules.
</p>
<p>For example, suppose that the server has a module defined by
</p>
<div class="example">
<pre class="example">aliasmodule -a 1dir
</pre></div>

<p>That is, one can check out <code>aliasmodule</code> and it will take
<code>1dir</code> in the repository and check it out to <code>1dir</code> in the
working directory.  Now suppose the client already has this module
checked out and is planning on using the <code>co</code> request to update it.
Without using <code>expand-modules</code>, the client would have two bad
choices: it could either send information about <em>all</em> working
directories under the current directory, which could be unnecessarily
slow, or it could be ignorant of the fact that <code>aliasmodule</code> stands
for <code>1dir</code>, and neglect to send information for <code>1dir</code>, which
would lead to incorrect operation.
</p>
<p>With <code>expand-modules</code>, the client would first ask for the module to
be expanded:
</p>
<div class="example">
<pre class="example">C: Root /home/kingdon/zwork/cvsroot
. . .
C: Argument aliasmodule
C: Directory .
C: .
C: expand-modules
S: Module-expansion 1dir
S: ok
</pre></div>

<p>and then it knows to check the <samp>1dir</samp> directory and send
requests such as <code>Entry</code> and <code>Modified</code> for the files in that
directory.
</p>
</dd>
<dt><code>ci \n</code></dt>
<dt><code>diff \n</code></dt>
<dt><code>list \n</code></dt>
<dt><code>tag \n</code></dt>
<dt><code>status \n</code></dt>
<dt><code>admin \n</code></dt>
<dt><code>history \n</code></dt>
<dt><code>watchers \n</code></dt>
<dt><code>editors \n</code></dt>
<dt><code>annotate \n</code></dt>
<dd><p>Response expected: yes.  Actually do a cvs command.  This uses any
previous <code>Argument</code>, <code>Directory</code>, <code>Entry</code>, or
<code>Modified</code> requests, if they have been sent.  The
last <code>Directory</code> sent specifies the working directory at the time
of the operation.  No provision is made for any input from the user.
This means that <code>ci</code> must use a <code>-m</code> argument if it wants to
specify a log message.
</p>
</dd>
<dt><code>log \n</code></dt>
<dd><p>Response expected: yes.  Show information for past revisions.  This uses
any previous <code>Directory</code>, <code>Entry</code>, or <code>Modified</code>
requests, if they have been sent.  The last <code>Directory</code> sent
specifies the working directory at the time of the operation.  Also uses
previous <code>Argument</code>&rsquo;s of which the canonical forms are the
following (<small>CVS</small> 1.10 and older clients sent what the user specified,
but clients are encouraged to use the canonical forms and other forms
are deprecated):
</p>
<dl compact="compact">
<dt><code>-b, -h, -l, -N, -R, -t</code></dt>
<dd><p>These options go by themselves, one option per <code>Argument</code> request.
</p>
</dd>
<dt><code>-d <var>date1</var>&lt;<var>date2</var></code></dt>
<dd><p>Select revisions between <var>date1</var> and <var>date2</var>.  Either date
may be omitted in which case there is no date limit at that end of the
range (clients may specify dates such as 1 Jan 1970 or 1 Jan 2038 for
similar purposes but this is problematic as it makes assumptions about
what dates the server supports).  Dates are in RFC822/1123 format.  The
&lsquo;<samp>-d</samp>&rsquo; is one <code>Argument</code> request and the date range is a second
one.
</p>
</dd>
<dt><code>-d <var>date1</var>&lt;=<var>date2</var></code></dt>
<dd><p>Likewise but compare dates for equality.
</p>
</dd>
<dt><code>-d <var>singledate</var></code></dt>
<dd><p>Select the single, latest revision dated <var>singledate</var> or earlier.
</p>
<p>To include several date ranges and/or singledates, repeat the &lsquo;<samp>-d</samp>&rsquo;
option as many times as necessary.
</p>
</dd>
<dt><code>-r<var>rev1</var>:<var>rev2</var></code></dt>
<dt><code>-r<var>branch</var></code></dt>
<dt><code>-r<var>branch</var>.</code></dt>
<dt><code>-r</code></dt>
<dd><p>Specify revisions (note that <var>rev1</var> or <var>rev2</var> can be omitted, or
can refer to branches).  Send both the &lsquo;<samp>-r</samp>&rsquo; and the revision
information in a single <code>Argument</code> request.  To include several
revision selections, repeat the &lsquo;<samp>-r</samp>&rsquo; option.
</p>
</dd>
<dt><code>-s <var>state</var></code></dt>
<dt><code>-w</code></dt>
<dt><code>-w<var>login</var></code></dt>
<dd><p>Select on states or users.  To include more than one state or user,
repeat the option.  Send the &lsquo;<samp>-s</samp>&rsquo; option as a separate argument
from the state being selected.  Send the &lsquo;<samp>-w</samp>&rsquo; option as part of the
same argument as the user being selected.
</p></dd>
</dl>

</dd>
<dt><code>co \n</code></dt>
<dd><p>Response expected: yes.  Get files from the repository.  This uses any
previous <code>Argument</code>, <code>Directory</code>, <code>Entry</code>, or
<code>Modified</code> requests, if they have been sent.  Arguments to this
command are module names; the client cannot know what directories they
correspond to except by (1) just sending the <code>co</code> request, and then
seeing what directory names the server sends back in its responses, and
(2) the <code>expand-modules</code> request.
</p>
</dd>
<dt><code>export \n</code></dt>
<dd><p>Response expected: yes.  Get files from the repository.  This uses any
previous <code>Argument</code>, <code>Directory</code>, <code>Entry</code>, or
<code>Modified</code> requests, if they have been sent.  Arguments to this
command are module names, as described for the <code>co</code> request.  The
intention behind this command is that a client can get sources from a
server without storing CVS information about those sources.  That is, a
client probably should not count on being able to take the entries line
returned in the <code>Created</code> response from an <code>export</code> request
and send it in a future <code>Entry</code> request.  Note that the entries
line in the <code>Created</code> response must indicate whether the file is
binary or text, so the client can create it correctly.
</p>
</dd>
<dt><code>ls \n</code></dt>
<dt><code>rannotate \n</code></dt>
<dt><code>rdiff \n</code></dt>
<dt><code>rlist \n</code></dt>
<dt><code>rlog \n</code></dt>
<dt><code>rtag \n</code></dt>
<dd><p>Response expected: yes.  Actually do a cvs command.  This uses any
previous <code>Argument</code> requests, if they have been sent.  The client
should not send <code>Directory</code>, <code>Entry</code>, or <code>Modified</code>
requests for these commands; they are not used.  Arguments to these
commands are module names, as described for <code>co</code>.  <code>ls</code> is a
synonym for <code>rlist</code>, for compatibility with CVSNT.
</p>
</dd>
<dt><code>init <var>root-name</var> \n</code></dt>
<dd><p>Response expected: yes.  If it doesn&rsquo;t already exist, create a <small>CVS</small>
repository <var>root-name</var>.  Note that <var>root-name</var> is a local
directory and <em>not</em> a fully qualified <code>CVSROOT</code> variable.
The <code>Root</code> request need not have been previously sent.
</p>
</dd>
<dt><code>suck \n</code></dt>
<dd><p>Response expected: yes.
Actually do a <code>cvs suck</code> command.
This uses a previous <code>Argument</code> request (only one, because the
<code>cvs suck</code> CLI command takes only one).
This is an extension specific to MirBSD, MirPorts and Debian.
</p>
</dd>
<dt><code>update \n</code></dt>
<dd><p>Response expected: yes.  Actually do a <code>cvs update</code> command.  This
uses any previous <code>Argument</code>, <code>Directory</code>, <code>Entry</code>,
or <code>Modified</code> requests, if they have been sent.  The
last <code>Directory</code> sent specifies the working directory at the time
of the operation.  The <code>-I</code> option is not used&ndash;files which the
client can decide whether to ignore are not mentioned and the client
sends the <code>Questionable</code> request for others.
</p>
</dd>
<dt><code>import \n</code></dt>
<dd><p>Response expected: yes.  Actually do a <code>cvs import</code> command.  This
uses any previous <code>Argument</code>, <code>Directory</code>, <code>Entry</code>, or
<code>Modified</code> requests, if they have been sent.  The
last <code>Directory</code> sent specifies the working directory at the time
of the operation - unlike most commands, the repository field of each
<code>Directory</code> request is ignored (it merely must point somewhere
within the root).  The files to be imported are sent in <code>Modified</code>
requests (files which the client knows should be ignored are not sent;
the server must still process the CVSROOT/cvsignore file unless -I ! is
sent).  A log message must have been specified with a <code>-m</code>
argument.
</p>
</dd>
<dt><code>add \n</code></dt>
<dd><p>Response expected: yes.  Add a file or directory.  This uses any
previous <code>Argument</code>, <code>Directory</code>, <code>Entry</code>, or
<code>Modified</code> requests, if they have been sent.  The
last <code>Directory</code> sent specifies the working directory at the time
of the operation.
</p>
<p>To add a directory, send the directory to be added using
<code>Directory</code> and <code>Argument</code> requests.  For example:
</p>
<div class="example">
<pre class="example">C: Root /u/cvsroot
. . .
C: Argument nsdir
C: Directory nsdir
C: 1dir/nsdir
C: Directory .
C: 1dir
C: add
S: M Directory /u/cvsroot/1dir/nsdir put under version control
S: ok
</pre></div>

<p>You will notice that the server does not signal to the client in any
particular way that the directory has been successfully added.  The
client is supposed to just assume that the directory has been added and
update its records accordingly.  Note also that adding a directory is
immediate; it does not wait until a <code>ci</code> request as files do.
</p>
<p>To add a file, send the file to be added using a <code>Modified</code>
request.  For example:
</p>
<div class="example">
<pre class="example">C: Argument nfile
C: Directory .
C: 1dir
C: Modified nfile
C: u=rw,g=r,o=r
C: 6
C: hello
C: add
S: E cvs server: scheduling file `nfile' for addition
S: Mode u=rw,g=r,o=r
S: Checked-in ./
S: /u/cvsroot/1dir/nfile
S: /nfile/0///
S: E cvs server: use 'cvs commit' to add this file permanently
S: ok
</pre></div>

<p>Note that the file has not been added to the repository; the only effect
of a successful <code>add</code> request, for a file, is to supply the client
with a new entries line containing &lsquo;<samp>0</samp>&rsquo; to indicate an added file.
In fact, the client probably could perform this operation without
contacting the server, although using <code>add</code> does cause the server
to perform a few more checks.
</p>
<p>The client sends a subsequent <code>ci</code> to actually add the file to the
repository.
</p>
<p>Another quirk of the <code>add</code> request is that with CVS 1.9 and older,
a pathname specified in
an <code>Argument</code> request cannot contain &lsquo;<samp>/</samp>&rsquo;.  There is no good
reason for this restriction, and in fact more recent CVS servers don&rsquo;t
have it.
But the way to interoperate with the older servers is to ensure that
all <code>Directory</code> requests for <code>add</code> (except those used to add
directories, as described above), use &lsquo;<samp>.</samp>&rsquo; for
<var>local-directory</var>.  Specifying another string for
<var>local-directory</var> may not get an error, but it will get you strange
<code>Checked-in</code> responses from the buggy servers.
</p>
</dd>
<dt><code>remove \n</code></dt>
<dd><p>Response expected: yes.  Remove a file.  This uses any
previous <code>Argument</code>, <code>Directory</code>, <code>Entry</code>, or
<code>Modified</code> requests, if they have been sent.  The
last <code>Directory</code> sent specifies the working directory at the time
of the operation.
</p>
<p>Note that this request does not actually do anything to the repository;
the only effect of a successful <code>remove</code> request is to supply the
client with a new entries line containing &lsquo;<samp>-</samp>&rsquo; to indicate a removed
file.  In fact, the client probably could perform this operation without
contacting the server, although using <code>remove</code> may cause the server
to perform a few more checks.
</p>
<p>The client sends a subsequent <code>ci</code> request to actually record the
removal in the repository.
</p>
</dd>
<dt><code>edit \n</code></dt>
<dd><p>Response expected: yes.  Actually do the <code>cvs edit</code> command.  This uses
any previous <code>Argument</code>, <code>Directory</code>, <code>Entry</code>, <code>LocalDir</code>,
or <code>Hostname</code> requests, if they have been sent.  Unless the user has
requested that edits not be granted unless no one else is editing a file, a
local edit followed by an attempt to send <code>Notify</code> requests to the
server is preferred.
</p>
</dd>
<dt><code>watch-on \n</code></dt>
<dt><code>watch-off \n</code></dt>
<dt><code>watch-add \n</code></dt>
<dt><code>watch-remove \n</code></dt>
<dd><p>Response expected: yes.  Actually do the <code>cvs watch on</code>, <code>cvs
watch off</code>, <code>cvs watch add</code>, and <code>cvs watch remove</code> commands,
respectively.  This uses any previous <code>Argument</code>,
<code>Directory</code>, <code>Entry</code>, or <code>Modified</code>
requests, if they have been sent.  The last <code>Directory</code> sent
specifies the working directory at the time of the operation.
</p>
</dd>
<dt><code>release \n</code></dt>
<dd><p>Response expected: yes.  Note that a <code>cvs release</code> command has
taken place and update the history file accordingly.
</p>
</dd>
<dt><code>global-list-quiet \n</code></dt>
<dd><p>Response expected: yes.  This request is a synonym for noop, but its existance
notifies the client that a <code>-q</code> option to <code>list</code> and <code>rlist</code>
will be rejected.  This, in a reverse-logic sort of way, is here so that when
it <em>isn&rsquo;t</em> received, as for instance from CVSNT, the client will know that
the quiet option has to be sent as a command option rather than a global
option.
</p>
</dd>
<dt><code>noop \n</code></dt>
<dd><p>Response expected: yes.  This request is a null command in the sense
that it doesn&rsquo;t do anything, but merely (as with any other requests
expecting a response) sends back any responses pertaining to pending
errors, pending <code>Notified</code> responses, etc.
The <code>Root</code> request need not have been previously sent.
</p>
</dd>
<dt><code>update-patches \n</code></dt>
<dd><p>Response expected: yes.
This request does not actually do anything.  It is used as a signal that
the server is able to generate patches when given an <code>update</code>
request.  The client must issue the <code>-u</code> argument to <code>update</code>
in order to receive patches.
</p>
</dd>
<dt><code>gzip-file-contents <var>level</var> \n</code></dt>
<dd><p>Response expected: no.  Note that this request does not follow the
response convention stated above.  <code>Gzip-stream</code> is suggested
instead of <code>gzip-file-contents</code> as it gives better compression; the
only reason to implement the latter is to provide compression with
<small>CVS</small> 1.8 and earlier.  The <code>gzip-file-contents</code> request asks
the server to compress files it sends to the client using <code>gzip</code>
(RFC1952/1951) compression, using the specified level of compression.
If this request is not made, the server must not compress files.
</p>
<p>This is only a hint to the server.  It may still decide (for example, in
the case of very small files, or files that already appear to be
compressed) not to do the compression.  Compression is indicated by a
&lsquo;<samp>z</samp>&rsquo; preceding the file length.
</p>
<p>Availability of this request in the server indicates to the client that
it may compress files sent to the server, regardless of whether the
client actually uses this request.
</p>
</dd>
<dt><code>wrapper-sendme-rcsOptions \n</code></dt>
<dd><p>Response expected: yes.
Request that the server transmit mappings from filenames to keyword
expansion modes in <code>Wrapper-rcsOption</code> responses.
</p>
</dd>
<dt><code>version \n</code></dt>
<dd><p>Response expected: yes.
Request that the server transmit its version message.
The <code>Root</code> request need not have been previously sent.
</p>
</dd>
<dt><code><var>other-request</var> <var>text</var> \n</code></dt>
<dd><p>Response expected: yes.
Any unrecognised request expects a response, and does not
contain any additional data.  The response will normally be something like
&lsquo;<samp>error  unrecognized request</samp>&rsquo;, but it could be a different error if
a previous request which doesn&rsquo;t expect a response produced an error.
</p></dd>
</dl>

<p>When the client is done, it drops the connection.
</p>
<hr>
<a name="Response-intro"></a>
<div class="header">
<p>
Next: <a href="#Response-pathnames" accesskey="n" rel="next">Response pathnames</a>, Previous: <a href="#Requests" accesskey="p" rel="prev">Requests</a>, Up: <a href="#Protocol" accesskey="u" rel="up">Protocol</a> &nbsp; </p>
</div>
<a name="Introduction-to-Responses"></a>
<h3 class="section">5.9 Introduction to Responses</h3>

<p>After a command which expects a response, the server sends however many
of the following responses are appropriate.  The server should not send
data at other times (the current implementation may violate this
principle in a few minor places, where the server is printing an error
message and exiting&mdash;this should be investigated further).
</p>
<p>Any set of responses always ends with &lsquo;<samp>error</samp>&rsquo; or &lsquo;<samp>ok</samp>&rsquo;.  This
indicates that the response is over.
</p>
<p>The responses <code>Checked-in</code>, <code>New-entry</code>, <code>Updated</code>,
<code>Created</code>, <code>Update-existing</code>, <code>Merged</code>, and
<code>Patched</code> are refered to as <em>file updating</em> responses, because
they change the status of a file in the working directory in some way.
The responses <code>Mode</code>, <code>Mod-time</code>, and <code>Checksum</code> are
referred to as <em>file update modifying</em> responses because they modify
the next file updating response.  In no case shall a file update
modifying response apply to a file updating response other than the next
one.  Nor can the same file update modifying response occur twice for
a given file updating response (if servers diagnose this problem, it may
aid in detecting the case where clients send an update modifying
response without following it by a file updating response).
</p>
<hr>
<a name="Response-pathnames"></a>
<div class="header">
<p>
Next: <a href="#Responses" accesskey="n" rel="next">Responses</a>, Previous: <a href="#Response-intro" accesskey="p" rel="prev">Response intro</a>, Up: <a href="#Protocol" accesskey="u" rel="up">Protocol</a> &nbsp; </p>
</div>
<a name="The-_0022pathname_0022-in-responses"></a>
<h3 class="section">5.10 The &quot;pathname&quot; in responses</h3>

<p>Many of the responses contain something called <var>pathname</var>.
The name is somewhat misleading; it actually indicates a pair of
pathnames.  First, a local directory name
relative to the directory in which the command was given (i.e. the last
<code>Directory</code> before the command).  Then a linefeed and a repository
name.  Then a slash and the filename (without a &lsquo;<samp>,v</samp>&rsquo; ending).
</p>
<p>The repository name may be absolute or relative to the <var>pathname</var>
sent with the <code>Root</code> request.  If absolute, the repository name must begin
with the <var>pathname</var> sent with the <code>Root</code> request.  Relative or
absolute, the repository name must specify a path underneath the <code>Root</code>
<var>pathname</var>.
</p>
<p>For example, for a file <samp>i386.mh</samp>
which is in the local directory <samp>gas.clean/config</samp> and for which
the repository name is <samp>devo/gas/config</samp>:
</p>
<div class="example">
<pre class="example">gas.clean/config/
devo/gas/config/i386.mh
</pre></div>

<p>If the server wants to tell the client to create a directory, then it
merely uses the directory in any response, as described above, and the
client should create the directory if it does not exist.  Note that this
should only be done one directory at a time, in order to permit the
client to correctly store the repository for each directory.  Servers
can use requests such as <code>Clear-sticky</code>,
<code>Clear-static-directory</code>, or any other requests, to create
directories.
</p>
<p>Some server
implementations may poorly distinguish between a directory which should
not exist and a directory which contains no files; in order to refrain
from creating empty directories a client should both send the &lsquo;<samp>-P</samp>&rsquo;
option to <code>update</code> or <code>co</code>, and should also detect the case in
which the server asks to create a directory but not any files within it
(in that case the client should remove the directory or refrain from
creating it in the first place).  Note that servers could clean this up
greatly by only telling the client to create directories if the
directory in question should exist, but until servers do this, clients
will need to offer the &lsquo;<samp>-P</samp>&rsquo; behavior described above.
</p>
<hr>
<a name="Responses"></a>
<div class="header">
<p>
Next: <a href="#Text-tags" accesskey="n" rel="next">Text tags</a>, Previous: <a href="#Response-pathnames" accesskey="p" rel="prev">Response pathnames</a>, Up: <a href="#Protocol" accesskey="u" rel="up">Protocol</a> &nbsp; </p>
</div>
<a name="Responses-1"></a>
<h3 class="section">5.11 Responses</h3>

<p>Here are the responses:
</p>
<dl compact="compact">
<dt><code>Valid-requests <var>request-list</var> \n</code></dt>
<dd><p>Indicate what requests the server will accept.  <var>request-list</var>
is a space separated list of tokens.  If the server supports sending
patches, it will include &lsquo;<samp>update-patches</samp>&rsquo; in this list.  The
&lsquo;<samp>update-patches</samp>&rsquo; request does not actually do anything.
</p>
</dd>
<dt><code>Force-gzip \n</code></dt>
<dd><p>Response expected: no.
Indicates that the server requires compression.  The client must send a
<code>Gzip-stream</code> request, though the requested <var>level</var> may be &lsquo;<samp>0</samp>&rsquo;.
</p>
</dd>
<dt><code>Referrer <var>CVSROOT</var></code></dt>
<dd><p>Request that the client store <var>CVSROOT</var> as the name of this server and that
this name be passed via a <code>Referrer</code> <em>request</em> to any subsequent
servers contacted as a result of a <code>Redirect</code> response.  This can be
useful to allow the secondary administrator to configure the <code>CVSROOT</code> the
primary should use to update the secondary in case the client uses a
non-standard name or even a name that is unique to the client for some reason.
</p>
</dd>
<dt><code>Redirect <var>CVSROOT</var></code></dt>
<dd><p>Request that the client redirect its connection to <var>CVSROOT</var> and begin
again.  This response is only valid in response to a <code>Command-prep</code>
request.  If a client receives this response, it is expected to notify the
write server it subsequently contacts of the CVSROOT of the server which
redirected it using the &lsquo;<samp>Referrer</samp>&rsquo; request.  This information makes it
possible for primary servers to update the client&rsquo;s mirror first, hopefully
minimizing race conditions on subsequent updates from the same client.
</p>
</dd>
<dt><code>Checked-in <var>pathname</var> \n</code></dt>
<dd><p>Additional data: New Entries line, \n.  This means a file <var>pathname</var>
has been successfully operated on (checked in, added, etc.).  name in
the Entries line is the same as the last component of <var>pathname</var>.
</p>
</dd>
<dt><code>New-entry <var>pathname</var> \n</code></dt>
<dd><p>Additional data: New Entries line, \n.  Like <code>Checked-in</code>, but the
file is not up to date.
</p>
</dd>
<dt><code>Updated <var>pathname</var> \n</code></dt>
<dd><p>Additional data: New Entries line, \n, mode, \n, file transmission.  A
new copy of the file is enclosed.  This is used for a new revision of an
existing file, or for a new file, or for any other case in which the
local (client-side) copy of the file needs to be updated, and after
being updated it will be up to date.  If any directory in pathname does
not exist, create it.  This response is not used if <code>Created</code> and
<code>Update-existing</code> are supported.
</p>
</dd>
<dt><code>Created <var>pathname</var> \n</code></dt>
<dd><p>This is just like <code>Updated</code> and takes the same additional data, but
is used only if no <code>Entry</code>, <code>Modified</code>, or
<code>Unchanged</code> request has been sent for the file in question.  The
distinction between <code>Created</code> and <code>Update-existing</code> is so
that the client can give an error message in several cases: (1) there is
a file in the working directory, but not one for which <code>Entry</code>,
<code>Modified</code>, or <code>Unchanged</code> was sent (for example, a file which
was ignored, or a file for which <code>Questionable</code> was sent), (2)
there is a file in the working directory whose name differs from the one
mentioned in <code>Created</code> in ways that the client is unable to use to
distinguish files.  For example, the client is case-insensitive and the
names differ only in case.
</p>
</dd>
<dt><code>Update-existing <var>pathname</var> \n</code></dt>
<dd><p>This is just like <code>Updated</code> and takes the same additional data, but
is used only if a <code>Entry</code>, <code>Modified</code>, or <code>Unchanged</code>
request has been sent for the file in question.
</p>
<p>This response, or <code>Merged</code>, indicates that the server has
determined that it is OK to overwrite the previous contents of the file
specified by <var>pathname</var>.  Provided that the client has correctly
sent <code>Modified</code> or <code>Is-modified</code> requests for a modified file,
and the file was not modified while CVS was running, the server can
ensure that a user&rsquo;s modifications are not lost.
</p>
</dd>
<dt><code>Merged <var>pathname</var> \n</code></dt>
<dd><p>This is just like <code>Updated</code> and takes the same additional data,
with the one difference that after the new copy of the file is enclosed,
it will still not be up to date.  Used for the results of a merge, with
or without conflicts.
</p>
<p>It is useful to preserve an copy of what the file looked like before the
merge.  This is basically handled by the server; before sending
<code>Merged</code> it will send a <code>Copy-file</code> response.  For example, if
the file is <samp>aa</samp> and it derives from revision 1.3, the
<code>Copy-file</code> response will tell the client to copy <samp>aa</samp> to
<samp>.#aa.1.3</samp>.  It is up to the client to decide how long to keep this
file around; traditionally clients have left it around forever, thus
letting the user clean it up as desired.  But another answer, such as
until the next commit, might be preferable.
</p>
</dd>
<dt><code>Rcs-diff <var>pathname</var> \n</code></dt>
<dd><p>This is just like <code>Updated</code> and takes the same additional data,
with the one difference that instead of sending a new copy of the file,
the server sends an RCS change text.  This change text is produced by
&lsquo;<samp>diff -n</samp>&rsquo; (the GNU diff &lsquo;<samp>-a</samp>&rsquo; option may also be used).  The
client must apply this change text to the existing file.  This will only
be used when the client has an exact copy of an earlier revision of a
file.  This response is only used if the <code>update</code> command is given
the &lsquo;<samp>-u</samp>&rsquo; argument.
</p>
</dd>
<dt><code>Patched <var>pathname</var> \n</code></dt>
<dd><p>This is just like <code>Rcs-diff</code> and takes the same additional data,
except that it sends a standard patch rather than an RCS change text.
The patch is produced by &lsquo;<samp>diff -c</samp>&rsquo; for <small>CVS</small> 1.6 and later (see
POSIX.2 for a description of this format), or &lsquo;<samp>diff -u</samp>&rsquo; for
previous versions of <small>CVS</small>; clients are encouraged to accept either
format.  Like <code>Rcs-diff</code>, this response is only used if the
<code>update</code> command is given the &lsquo;<samp>-u</samp>&rsquo; argument.
</p>
<p>The <code>Patched</code> response is deprecated in favor of the
<code>Rcs-diff</code> response.  However, older clients (CVS 1.9 and earlier)
only support <code>Patched</code>.
</p>
</dd>
<dt><code>Edit-file <var>pathname</var> \n</code></dt>
<dd><p>Do the client-side portion of editing a file.
</p>
</dd>
<dt><code>Mode <var>mode</var> \n</code></dt>
<dd><p>This <var>mode</var> applies to the next file mentioned in
<code>Checked-in</code>.  <code>Mode</code> is a file update modifying response
as described in <a href="#Response-intro">Response intro</a>.
</p>
</dd>
<dt><code>Mod-time <var>time</var> \n</code></dt>
<dd><p>Set the modification time of the next file sent to <var>time</var>.
<code>Mod-time</code> is a file update modifying response
as described in <a href="#Response-intro">Response intro</a>.
The
<var>time</var> is in the format specified by RFC822 as modified by RFC1123.
The server may specify any timezone it chooses; clients will want to
convert that to their own timezone as appropriate.  An example of this
format is:
</p>
<div class="example">
<pre class="example">26 May 1997 13:01:40 -0400
</pre></div>

<p>There is no requirement that the client and server clocks be
synchronised.  The server just sends its recommendation for a timestamp
(based on its own clock, presumably), and the client should just believe
it (this means that the time might be in the future, for example).
</p>
<p>If the server does not send <code>Mod-time</code> for a given file, the client
should pick a modification time in the usual way (usually, just let the
operating system set the modification time to the time that the CVS
command is running).
</p>
</dd>
<dt><code>Checksum <var>checksum</var>\n</code></dt>
<dd><p>The <var>checksum</var> applies to the next file sent (that is,
<code>Checksum</code> is a file update modifying response
as described in <a href="#Response-intro">Response intro</a>).
In the case of
<code>Patched</code>, the checksum applies to the file after being patched,
not to the patch itself.  The client should compute the checksum itself,
after receiving the file or patch, and signal an error if the checksums
do not match.  The checksum is the 128 bit MD5 checksum represented as
32 hex digits (MD5 is described in RFC1321).
This response is optional, and is only used if the
client supports it (as judged by the <code>Valid-responses</code> request).
</p>
</dd>
<dt><code>Copy-file <var>pathname</var> \n</code></dt>
<dd><p>Additional data: <var>newname</var> \n.  Copy file <var>pathname</var> to
<var>newname</var> in the same directory where it already is.  This does not
affect <code>CVS/Entries</code>.
</p>
<p>This can optionally be implemented as a rename instead of a copy.  The
only use for it which currently has been identified is prior to a
<code>Merged</code> response as described under <code>Merged</code>.  Clients can
probably assume that is how it is being used, if they want to worry
about things like how long to keep the <var>newname</var> file around.
</p>
</dd>
<dt><code>Removed <var>pathname</var> \n</code></dt>
<dd><p>The file has been removed from the repository (this is the case where
cvs prints &lsquo;<samp>file foobar.c is no longer pertinent</samp>&rsquo;).
</p>
</dd>
<dt><code>Remove-entry <var>pathname</var> \n</code></dt>
<dd><p>The file needs its entry removed from <code>CVS/Entries</code>, but the file
itself is already gone (this happens in response to a <code>ci</code> request
which involves committing the removal of a file).
</p>
</dd>
<dt><code>Set-static-directory <var>pathname</var> \n</code></dt>
<dd><p>This instructs the client to set the <code>Entries.Static</code> flag, which
it should then send back to the server in a <code>Static-directory</code>
request whenever the directory is operated on.  <var>pathname</var> ends in a
slash; its purpose is to specify a directory, not a file within a
directory.
</p>
</dd>
<dt><code>Clear-static-directory <var>pathname</var> \n</code></dt>
<dd><p>Like <code>Set-static-directory</code>, but clear, not set, the flag.
</p>
</dd>
<dt><code>Set-sticky <var>pathname</var> \n</code></dt>
<dd><p>Additional data: <var>tagspec</var> \n.  Tell the client to set a sticky tag
or date, which should be supplied with the <code>Sticky</code> request for
future operations.  <var>pathname</var> ends in a slash; its purpose is to
specify a directory, not a file within a directory.  The client should
store <var>tagspec</var> and pass it back to the server as-is, to allow for
future expansion.  The first character of <var>tagspec</var> is &lsquo;<samp>T</samp>&rsquo; for
a tag, &lsquo;<samp>D</samp>&rsquo; for a date, or something else for future expansion.  The
remainder of <var>tagspec</var> contains the actual tag or date.
</p>
</dd>
<dt><code>Clear-sticky <var>pathname</var> \n</code></dt>
<dd><p>Clear any sticky tag or date set by <code>Set-sticky</code>.
</p>
</dd>
<dt><code>Template <var>pathname</var> \n</code></dt>
<dd><p>Additional data: file transmission (note: compressed file transmissions
are not supported).  <var>pathname</var> ends in a slash; its purpose is to
specify a directory, not a file within a directory.  Tell the client to
store the file transmission as the template log message, and then use
that template in the future when prompting the user for a log message.
</p>
</dd>
<dt><code>Set-checkin-prog <var>dir</var> \n</code></dt>
<dd><p>Additional data: <var>prog</var> \n.  Tell the client to set a checkin
program, which should be supplied with the <code>Checkin-prog</code> request
for future operations.
</p>
</dd>
<dt><code>Set-update-prog <var>dir</var> \n</code></dt>
<dd><p>Additional data: <var>prog</var> \n.  Tell the client to set an update
program, which should be supplied with the <code>Update-prog</code> request
for future operations.
</p>
</dd>
<dt><code>Notified <var>pathname</var> \n</code></dt>
<dd><p>Indicate to the client that the notification for <var>pathname</var> has been
done.  There should be one such response for every <code>Notify</code>
request; if there are several <code>Notify</code> requests for a single file,
the requests should be processed in order; the first <code>Notified</code>
response pertains to the first <code>Notify</code> request, etc.
</p>
</dd>
<dt><code>Module-expansion <var>pathname</var> \n</code></dt>
<dd><p>Return a file or directory
which is included in a particular module.  <var>pathname</var> is relative
to cvsroot, unlike most pathnames in responses.  <var>pathname</var> should
be used to look and see whether some or all of the module exists on
the client side; it is not necessarily suitable for passing as an
argument to a <code>co</code> request (for example, if the modules file
contains the &lsquo;<samp>-d</samp>&rsquo; option, it will be the directory specified with
&lsquo;<samp>-d</samp>&rsquo;, not the name of the module).
</p>
</dd>
<dt><code>Wrapper-rcsOption <var>pattern</var> -k '<var>option</var>' \n</code></dt>
<dd><p>Transmit to the client a filename pattern which implies a certain
keyword expansion mode.  The <var>pattern</var> is a wildcard pattern (for
example, &lsquo;<samp>*.exe</samp>&rsquo;.  The <var>option</var> is &lsquo;<samp>b</samp>&rsquo; for binary, and so
on.  Note that although the syntax happens to resemble the syntax in
certain CVS configuration files, it is more constrained; there must be
exactly one space between <var>pattern</var> and &lsquo;<samp>-k</samp>&rsquo; and exactly one
space between &lsquo;<samp>-k</samp>&rsquo; and &lsquo;<samp>'</samp>&rsquo;, and no string is permitted in
place of &lsquo;<samp>-k</samp>&rsquo; (extensions should be done with new responses, not by
extending this one, for graceful handling of <code>Valid-responses</code>).
</p>
</dd>
<dt><code>M <var>text</var> \n</code></dt>
<dd><p>A one-line message for the user.
Note that the format of <var>text</var> is not designed for machine parsing.
Although sometimes scripts and clients will have little choice, the
exact text which is output is subject to vary at the discretion of the
server and the example output given in this document is just that,
example output.  Servers are encouraged to use the &lsquo;<samp>MT</samp>&rsquo; response,
and future versions of this document will hopefully standardise more of
the &lsquo;<samp>MT</samp>&rsquo; tags; see <a href="#Text-tags">Text tags</a>.
</p>
</dd>
<dt><code>LOGM <var>text</var> \n</code></dt>
<dd><p>Exactly the same as <code>M</code> but only sent if the client indicates
supporting it via <code>Valid-responses</code>, used exclusively for log
message payload (that is, in <code>cvs log</code> and <code>cvs rlog</code>,
the text body the user originally has entered with the &lsquo;<samp>-m</samp>&rsquo;
option to the <code>ci</code> request).
</p>
</dd>
<dt><code>Mbinary \n</code></dt>
<dd><p>Additional data: file transmission (note: compressed file transmissions
are not supported).  This is like <code>M</code>, except the contents of the
file transmission are binary and should be copied to standard output
without translation to local text file conventions.  To transmit a text
file to standard output, servers should use a series of <code>M</code> requests.
</p>
</dd>
<dt><code>E <var>text</var> \n</code></dt>
<dd><p>Same as <code>M</code> but send to stderr not stdout.
</p>
</dd>
<dt><code>F \n</code></dt>
<dd><p>Flush stderr.  That is, make it possible for the user to see what has
been written to stderr (it is up to the implementation to decide exactly
how far it should go to ensure this).
</p>
</dd>
<dt><code>MT <var>tagname</var> <var>data</var> \n</code></dt>
<dd>
<p>This response provides for tagged text.  It is similar to
SGML/HTML/XML in that the data is structured and a naive application
can also make some sense of it without understanding the structure.
The syntax is not SGML-like, however, in order to fit into the CVS
protocol better and (more importantly) to make it easier to parse,
especially in a language like perl or awk.
</p>
<p>The <var>tagname</var> can have several forms.  If it starts with &lsquo;<samp>a</samp>&rsquo;
to &lsquo;<samp>z</samp>&rsquo; or &lsquo;<samp>A</samp>&rsquo; to &lsquo;<samp>Z</samp>&rsquo;, then it represents tagged text.
If the implementation recognises <var>tagname</var>, then it may interpret
<var>data</var> in some particular fashion.  If the implementation does not
recognise <var>tagname</var>, then it should simply treat <var>data</var> as
text to be sent to the user (similar to an <code>M</code> response).  There
are two tags which are general purpose.  The &lsquo;<samp>text</samp>&rsquo; tag is
similar to an unrecognised tag in that it provides text which will
ordinarily be sent to the user.  The &lsquo;<samp>newline</samp>&rsquo; tag is used
without <var>data</var> and indicates that a newline will ordinarily be
sent to the user (there is no provision for embedding newlines in the
<var>data</var> of other tagged text responses).
</p>
<p>If <var>tagname</var> starts with &lsquo;<samp>+</samp>&rsquo; it indicates a start tag and if
it starts with &lsquo;<samp>-</samp>&rsquo; it indicates an end tag.  The remainder of
<var>tagname</var> should be the same for matching start and end tags, and
tags should be nested (for example one could have tags in the
following order <code>+bold</code> <code>+italic</code> <code>text</code> <code>-italic</code>
<code>-bold</code> but not <code>+bold</code> <code>+italic</code> <code>text</code>
<code>-bold</code> <code>-italic</code>).  A particular start and end tag may be
documented to constrain the tagged text responses which are valid
between them.
</p>
<p>Note that if <var>data</var> is present there will always be exactly one
space between <var>tagname</var> and <var>data</var>; if there is more than one
space, then the spaces beyond the first are part of <var>data</var>.
</p>
<p>Here is an example of some tagged text responses.  Note that there is
a trailing space after &lsquo;<samp>Checking in</samp>&rsquo; and &lsquo;<samp>initial revision:</samp>&rsquo;
and there are two trailing spaces after &lsquo;<samp>&lt;--</samp>&rsquo;.  Such trailing
spaces are, of course, part of <var>data</var>.
</p>
<div class="example">
<pre class="example">MT +checking-in
MT text Checking in 
MT fname gz.tst
MT text ;
MT newline
MT rcsfile /home/kingdon/zwork/cvsroot/foo/gz.tst,v
MT text   &lt;--  
MT fname gz.tst
MT newline
MT text initial revision: 
MT init-rev 1.1
MT newline
MT text done
MT newline
MT -checking-in
</pre></div>

<p>If the client does not support the &lsquo;<samp>MT</samp>&rsquo; response, the same
responses might be sent as:
</p>
<div class="example">
<pre class="example">M Checking in gz.tst;
M /home/kingdon/zwork/cvsroot/foo/gz.tst,v  &lt;--  gz.tst
M initial revision: 1.1
M done
</pre></div>

<p>For a list of specific tags, see <a href="#Text-tags">Text tags</a>.
</p>
</dd>
<dt><code>error <var>errno-code</var> &lsquo;<samp> </samp>&rsquo; <var>text</var> \n</code></dt>
<dd><p>The command completed with an error.  <var>errno-code</var> is a symbolic
error code (e.g. <code>ENOENT</code>); if the server doesn&rsquo;t support this
feature, or if it&rsquo;s not appropriate for this particular message, it just
omits the errno-code (in that case there are two spaces after
&lsquo;<samp>error</samp>&rsquo;).  Text is an error message such as that provided by
strerror(), or any other message the server wants to use.
The <var>text</var> is like the <code>M</code> response, in the sense that it is
not particularly intended to be machine-parsed; servers may wish to
print an error message with <code>MT</code> responses, and then issue a
<code>error</code> response without <var>text</var> (although it should be noted
that <code>MT</code> currently has no way of flagging the output as intended
for standard error, the way that the <code>E</code> response does).
</p>
</dd>
<dt><code>ok \n</code></dt>
<dd><p>The command completed successfully.
</p></dd>
</dl>

<hr>
<a name="Text-tags"></a>
<div class="header">
<p>
Next: <a href="#Example" accesskey="n" rel="next">Example</a>, Previous: <a href="#Responses" accesskey="p" rel="prev">Responses</a>, Up: <a href="#Protocol" accesskey="u" rel="up">Protocol</a> &nbsp; </p>
</div>
<a name="Tags-for-the-MT-tagged-text-response"></a>
<h3 class="section">5.12 Tags for the MT tagged text response</h3>

<p>The <code>MT</code> response, as described in <a href="#Responses">Responses</a>, offers a
way for the server to send tagged text to the client.  This section
describes specific tags.  The intention is to update this section as
servers add new tags.
</p>
<p>In the following descriptions, <code>text</code> and <code>newline</code> tags are
omitted.  Such tags contain information which is intended for users (or
to be discarded), and are subject to change at the whim of the server.
To avoid being vulnerable to such whim, clients should look for the tags
listed here, not <code>text</code>, <code>newline</code>, or other tags.
</p>
<p>The following tag means to indicate to the user that a file has been
updated.  It is more or less redundant with the <code>Created</code> and
<code>Update-existing</code> responses, but we don&rsquo;t try to specify here
whether it occurs in exactly the same circumstances as <code>Created</code>
and <code>Update-existing</code>.  The <var>name</var> is the pathname of the file
being updated relative to the directory in which the command is
occurring (that is, the last <code>Directory</code> request which is sent
before the command).
</p>
<div class="example">
<pre class="example">MT +updated
MT fname <var>name</var>
MT -updated
</pre></div>

<p>The <code>importmergecmd</code> tag is used when doing an import which has
conflicts, or when doing an import with the &lsquo;<samp>-X</samp>&rsquo; flag.
The client can use it to report how to merge in the newly
imported changes.  The <var>count</var> is the number of conflicts, or the
string <code>No</code> if no conflicts occurred.  (The latter will only be
sent for imports run with the &lsquo;<samp>-X</samp>&rsquo; flag.)  The
newly imported changes can be merged by running the following command:
</p><div class="smallexample">
<pre class="smallexample">cvs checkout -j <var>tag1</var> -j <var>tag2</var> <var>repository</var>
</pre></div>

<div class="example">
<pre class="example">MT +importmergecmd
MT conflicts <var>count</var>
MT mergetag1 <var>tag1</var>
MT mergetag2 <var>tag2</var>
MT repository <var>repository</var>
MT -importmergecmd
</pre></div>

<hr>
<a name="Example"></a>
<div class="header">
<p>
Next: <a href="#Requirements" accesskey="n" rel="next">Requirements</a>, Previous: <a href="#Text-tags" accesskey="p" rel="prev">Text tags</a>, Up: <a href="#Protocol" accesskey="u" rel="up">Protocol</a> &nbsp; </p>
</div>
<a name="Example-1"></a>
<h3 class="section">5.13 Example</h3>

<p>Here is an example; lines are prefixed by &lsquo;<samp>C: </samp>&rsquo; to indicate the
client sends them or &lsquo;<samp>S: </samp>&rsquo; to indicate the server sends them.
</p>
<p>The client starts by connecting, sending the root, and completing the
protocol negotiation.  In actual practice the lists of valid responses
and requests would be longer.
</p>
<div class="example">
<pre class="example">C: Root /u/cvsroot
C: Valid-responses ok error Checked-in M E
C: valid-requests
S: Valid-requests Root Directory Entry Modified Argument Argumentx ci co
S: ok
C: UseUnchanged
</pre></div>

<p>The client wants to check out the <code>supermunger</code> module into a fresh
working directory.  Therefore it first expands the <code>supermunger</code>
module; this step would be omitted if the client was operating on a
directory rather than a module.
</p>
<div class="example">
<pre class="example">C: Argument supermunger
C: Directory .
C: .
C: expand-modules
</pre></div>

<p>The server replies that the <code>supermunger</code> module expands to the
directory <code>supermunger</code> (the simplest case):
</p>
<div class="example">
<pre class="example">S: Module-expansion supermunger
S: ok
</pre></div>

<p>The client then proceeds to check out the directory.  The fact that it
sends only a single <code>Directory</code> request which specifies &lsquo;<samp>.</samp>&rsquo;
for the working directory means that there is not already a
<code>supermunger</code> directory on the client.
</p>
<div class="example">
<pre class="example">C: Argument -N
C: Argument supermunger
C: Directory .
C: .
C: co
</pre></div>

<p>The server replies with the requested files.  In this example, there is
only one file, <samp>mungeall.c</samp>.  The <code>Clear-sticky</code> and
<code>Clear-static-directory</code> requests are sent by the current
implementation but they have no effect because the default is for those
settings to be clear when a directory is newly created.
</p>
<div class="example">
<pre class="example">S: Clear-sticky supermunger/
S: /u/cvsroot/supermunger/
S: Clear-static-directory supermunger/
S: /u/cvsroot/supermunger/
S: E cvs server: Updating supermunger
S: M U supermunger/mungeall.c
S: Created supermunger/
S: /u/cvsroot/supermunger/mungeall.c
S: /mungeall.c/1.1///
S: u=rw,g=r,o=r
S: 26
S: int mein () { abort (); }
S: ok
</pre></div>

<p>The current client implementation would break the connection here and make a
new connection for the next command.  However, the protocol allows it
to keep the connection open and continue, which is what we show here.
</p>
<p>After the user modifies the file and instructs the client to check it
back in.  The client sends arguments to specify the log message and file
to check in:
</p>
<div class="example">
<pre class="example">C: Argument -m
C: Argument Well, you see, it took me hours and hours to find
C: Argumentx this typo and I searched and searched and eventually
C: Argumentx had to ask John for help.
C: Argument mungeall.c
</pre></div>

<p>It also sends information about the contents of the working directory,
including the new contents of the modified file.  Note that the user has
changed into the <samp>supermunger</samp> directory before executing this
command; the top level directory is a user-visible concept because the
server should print filenames in <code>M</code> and <code>E</code> responses
relative to that directory.
</p>
<div class="example">
<pre class="example">C: Directory .
C: supermunger
C: Entry /mungeall.c/1.1///
C: Modified mungeall.c
C: u=rw,g=r,o=r
C: 26
C: int main () { abort (); }
</pre></div>

<p>And finally, the client issues the checkin command (which makes use of
the data just sent):
</p>
<div class="example">
<pre class="example">C: ci
</pre></div>

<p>And the server tells the client that the checkin succeeded:
</p>
<div class="example">
<pre class="example">S: M Checking in mungeall.c;
S: E /u/cvsroot/supermunger/mungeall.c,v  &lt;--  mungeall.c
S: E new revision: 1.2; previous revision: 1.1
S: E done
S: Mode u=rw,g=r,o=r
S: Checked-in ./
S: /u/cvsroot/supermunger/mungeall.c
S: /mungeall.c/1.2///
S: ok
</pre></div>

<hr>
<a name="Requirements"></a>
<div class="header">
<p>
Next: <a href="#Obsolete" accesskey="n" rel="next">Obsolete</a>, Previous: <a href="#Example" accesskey="p" rel="prev">Example</a>, Up: <a href="#Protocol" accesskey="u" rel="up">Protocol</a> &nbsp; </p>
</div>
<a name="Required-versus-optional-parts-of-the-protocol"></a>
<h3 class="section">5.14 Required versus optional parts of the protocol</h3>

<p>The following are part of every known implementation of the CVS protocol
(except obsolete, pre-1.5, versions of CVS) and it is considered
reasonable behavior to completely fail to work if you are connected with
an implementation which attempts to not support them.  Requests:
<code>Root</code>, <code>Valid-responses</code>, <code>valid-requests</code>,
<code>Directory</code>, <code>Entry</code>, <code>Modified</code>, <code>Unchanged</code>,
<code>Argument</code>, <code>Argumentx</code>, <code>ci</code>, <code>co</code>, <code>update</code>.
Responses: <code>ok</code>, <code>error</code>, <code>Valid-requests</code>,
<code>Checked-in</code>, <code>Updated</code>, <code>Merged</code>, <code>Removed</code>,
<code>M</code>, <code>E</code>.
</p>
<p>A server need not implement <code>Repository</code>, but in order to interoperate
with CVS 1.5 through 1.9 it must claim to implement it (in
<code>Valid-requests</code>).  The client will not actually send the request.
</p>
<hr>
<a name="Obsolete"></a>
<div class="header">
<p>
Previous: <a href="#Requirements" accesskey="p" rel="prev">Requirements</a>, Up: <a href="#Protocol" accesskey="u" rel="up">Protocol</a> &nbsp; </p>
</div>
<a name="Obsolete-protocol-elements"></a>
<h3 class="section">5.15 Obsolete protocol elements</h3>

<p>This section briefly describes protocol elements which are obsolete.
There is no attempt to document them in full detail.
</p>
<p>There was a <code>Repository</code> request which was like <code>Directory</code>
except it only provided <var>repository</var>, and the local directory was
assumed to be similarly named.
</p>
<p>If the <code>UseUnchanged</code> request was not sent, there was a <code>Lost</code>
request which was sent to indicate that a file did not exist in the
working directory, and the meaning of sending <code>Entries</code> without
<code>Lost</code> or <code>Modified</code> was different.  All current clients (CVS
1.5 and later) will send <code>UseUnchanged</code> if it is supported.
</p>
<hr>
<a name="Protocol-Notes"></a>
<div class="header">
<p>
Previous: <a href="#Protocol" accesskey="p" rel="prev">Protocol</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> &nbsp; </p>
</div>
<a name="Notes-on-the-Protocol"></a>
<h2 class="chapter">6 Notes on the Protocol</h2>

<p>A number of enhancements are possible.  Also see the file <small>TODO</small> in
the <small>CVS</small> source distribution, which has further ideas concerning
various aspects of <small>CVS</small>, some of which impact the protocol.
Similarly, the <a href="http://www.nongnu.org/cvs/">http://www.nongnu.org/cvs/</a> site, in particular the
<cite>Development</cite> pages.
</p>
<ul>
<li> The <code>Modified</code> request could be speeded up by sending diffs rather
than entire files.  The client would need some way to keep the version
of the file which was originally checked out; probably requiring the use
of &quot;cvs edit&quot; in this case is the most sensible course (the &quot;cvs edit&quot;
could be handled by a package like VC for emacs).  This would also allow
local operation of <code>cvs diff</code> without arguments.

</li><li> The fact that <code>pserver</code> requires an extra network turnaround in
order to perform authentication would be nice to avoid.  This relates to
the issue of reporting errors; probably the clean solution is to defer
the error until the client has issued a request which expects a
response.  To some extent this might relate to the next item (in terms
of how easy it is to skip a whole bunch of requests until we get to one
that expects a response).  I know that the kerberos code doesn&rsquo;t wait in
this fashion, but that probably can cause network deadlocks and perhaps
future problems running over a transport which is more transaction
oriented than TCP.  On the other hand I&rsquo;m not sure it is wise to make
the client conduct a lengthy upload only to find there is an
authentication failure.

</li><li> The protocol uses an extra network turnaround for protocol negotiation
(<code>valid-requests</code>).  It might be nice to avoid this by having the
client be able to send requests and tell the server to ignore them if
they are unrecognised (different requests could produce a fatal error if
unrecognised).  To do this there should be a standard syntax for
requests.  For example, perhaps all future requests should be a single
line, with mechanisms analogous to <code>Argumentx</code>, or several requests
working together, to provide greater amounts of information.  Or there
might be a standard mechanism for counted data (analogous to that used
by <code>Modified</code>) or continuation lines (like a generalised
<code>Argumentx</code>).  It would be useful to compare what HTTP is planning
in this area; last I looked they were contemplating something called
Protocol Extension Protocol but I haven&rsquo;t looked at the relevant IETF
documents in any detail.  Obviously, we want something as simple as
possible (but no simpler).

</li><li> The scrambling algorithm in the CVS client and server actually support
more characters than those documented in <a href="#Password-scrambling">Password scrambling</a>.
Someday we are going to either have to document them all (but this is
not as easy as it may look, see below), or (gradually and with adequate
process) phase out the support for other characters in the CVS
implementation.  This business of having the feature partly undocumented
isn&rsquo;t a desirable state long-term.

<p>The problem with documenting other characters is that unless we know
what character set is in use, there is no way to make a password
portable from one system to another.  For example, a with a circle on
top might have different encodings in different character sets.
</p>
<p>It <em>almost</em> works to say that the client picks an arbitrary,
unknown character set (indeed, having the CVS client know what character
set the user has in mind is a hard problem otherwise), and scrambles
according to a certain octet&lt;-&gt;octet mapping.  There are two problems
with this.  One is that the protocol has no way to transmit character 10
decimal (linefeed), and the current server and clients have no way to
handle 0 decimal (NUL).  This may cause problems with certain multibyte
character sets, in which octets 10 and 0 will appear in the middle of
other characters.  The other problem, which is more minor and possibly
not worth worrying about, is that someone can type a password on one
system and then go to another system which uses a different encoding for
the same characters, and have their password not work.
</p>
<p>The restriction to the ISO646 invariant subset is the best approach for
strings which are not particularly significant to users.  Passwords are
visible enough that this is somewhat doubtful as applied here.  ISO646
does, however, have the virtue (!?) of offending everyone.  It is easy
to say &quot;But the $ is right on people&rsquo;s keyboards!  Surely we can&rsquo;t
forbid that&quot;.  From a human factors point of view, that makes quite a
bit of sense.  The contrary argument, of course, is that a with a circle
on top, or some of the characters poorly handled by Unicode, are on
<em>someone</em>&rsquo;s keyboard.
</p>
</li></ul>

<hr>



</body>
</html>