| Junio C Hamano | 944ce25 | 2018-05-30 22:25:26 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
| 3 | "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| 4 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 5 | <head> |
| 6 | <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> |
| Junio C Hamano | 944ce25 | 2018-05-30 22:25:26 | [diff] [blame] | 7 | <meta name="generator" content="AsciiDoc 8.6.10" /> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 8 | <title>HTTP transfer protocols</title> |
| 9 | <style type="text/css"> |
| 10 | /* Shared CSS for AsciiDoc xhtml11 and html5 backends */ |
| 11 | |
| 12 | /* Default font. */ |
| 13 | body { |
| 14 | font-family: Georgia,serif; |
| 15 | } |
| 16 | |
| 17 | /* Title font. */ |
| 18 | h1, h2, h3, h4, h5, h6, |
| 19 | div.title, caption.title, |
| 20 | thead, p.table.header, |
| 21 | #toctitle, |
| 22 | #author, #revnumber, #revdate, #revremark, |
| 23 | #footer { |
| 24 | font-family: Arial,Helvetica,sans-serif; |
| 25 | } |
| 26 | |
| 27 | body { |
| 28 | margin: 1em 5% 1em 5%; |
| 29 | } |
| 30 | |
| 31 | a { |
| 32 | color: blue; |
| 33 | text-decoration: underline; |
| 34 | } |
| 35 | a:visited { |
| 36 | color: fuchsia; |
| 37 | } |
| 38 | |
| 39 | em { |
| 40 | font-style: italic; |
| 41 | color: navy; |
| 42 | } |
| 43 | |
| 44 | strong { |
| 45 | font-weight: bold; |
| 46 | color: #083194; |
| 47 | } |
| 48 | |
| 49 | h1, h2, h3, h4, h5, h6 { |
| 50 | color: #527bbd; |
| 51 | margin-top: 1.2em; |
| 52 | margin-bottom: 0.5em; |
| 53 | line-height: 1.3; |
| 54 | } |
| 55 | |
| 56 | h1, h2, h3 { |
| 57 | border-bottom: 2px solid silver; |
| 58 | } |
| 59 | h2 { |
| 60 | padding-top: 0.5em; |
| 61 | } |
| 62 | h3 { |
| 63 | float: left; |
| 64 | } |
| 65 | h3 + * { |
| 66 | clear: left; |
| 67 | } |
| 68 | h5 { |
| 69 | font-size: 1.0em; |
| 70 | } |
| 71 | |
| 72 | div.sectionbody { |
| 73 | margin-left: 0; |
| 74 | } |
| 75 | |
| 76 | hr { |
| 77 | border: 1px solid silver; |
| 78 | } |
| 79 | |
| 80 | p { |
| 81 | margin-top: 0.5em; |
| 82 | margin-bottom: 0.5em; |
| 83 | } |
| 84 | |
| 85 | ul, ol, li > p { |
| 86 | margin-top: 0; |
| 87 | } |
| 88 | ul > li { color: #aaa; } |
| 89 | ul > li > * { color: black; } |
| 90 | |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 91 | .monospaced, code, pre { |
| 92 | font-family: "Courier New", Courier, monospace; |
| 93 | font-size: inherit; |
| 94 | color: navy; |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 95 | padding: 0; |
| 96 | margin: 0; |
| 97 | } |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 98 | pre { |
| 99 | white-space: pre-wrap; |
| 100 | } |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 101 | |
| 102 | #author { |
| 103 | color: #527bbd; |
| 104 | font-weight: bold; |
| 105 | font-size: 1.1em; |
| 106 | } |
| 107 | #email { |
| 108 | } |
| 109 | #revnumber, #revdate, #revremark { |
| 110 | } |
| 111 | |
| 112 | #footer { |
| 113 | font-size: small; |
| 114 | border-top: 2px solid silver; |
| 115 | padding-top: 0.5em; |
| 116 | margin-top: 4.0em; |
| 117 | } |
| 118 | #footer-text { |
| 119 | float: left; |
| 120 | padding-bottom: 0.5em; |
| 121 | } |
| 122 | #footer-badges { |
| 123 | float: right; |
| 124 | padding-bottom: 0.5em; |
| 125 | } |
| 126 | |
| 127 | #preamble { |
| 128 | margin-top: 1.5em; |
| 129 | margin-bottom: 1.5em; |
| 130 | } |
| 131 | div.imageblock, div.exampleblock, div.verseblock, |
| 132 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 133 | div.admonitionblock { |
| 134 | margin-top: 1.0em; |
| 135 | margin-bottom: 1.5em; |
| 136 | } |
| 137 | div.admonitionblock { |
| 138 | margin-top: 2.0em; |
| 139 | margin-bottom: 2.0em; |
| 140 | margin-right: 10%; |
| 141 | color: #606060; |
| 142 | } |
| 143 | |
| 144 | div.content { /* Block element content. */ |
| 145 | padding: 0; |
| 146 | } |
| 147 | |
| 148 | /* Block element titles. */ |
| 149 | div.title, caption.title { |
| 150 | color: #527bbd; |
| 151 | font-weight: bold; |
| 152 | text-align: left; |
| 153 | margin-top: 1.0em; |
| 154 | margin-bottom: 0.5em; |
| 155 | } |
| 156 | div.title + * { |
| 157 | margin-top: 0; |
| 158 | } |
| 159 | |
| 160 | td div.title:first-child { |
| 161 | margin-top: 0.0em; |
| 162 | } |
| 163 | div.content div.title:first-child { |
| 164 | margin-top: 0.0em; |
| 165 | } |
| 166 | div.content + div.title { |
| 167 | margin-top: 0.0em; |
| 168 | } |
| 169 | |
| 170 | div.sidebarblock > div.content { |
| 171 | background: #ffffee; |
| 172 | border: 1px solid #dddddd; |
| 173 | border-left: 4px solid #f0f0f0; |
| 174 | padding: 0.5em; |
| 175 | } |
| 176 | |
| 177 | div.listingblock > div.content { |
| 178 | border: 1px solid #dddddd; |
| 179 | border-left: 5px solid #f0f0f0; |
| 180 | background: #f8f8f8; |
| 181 | padding: 0.5em; |
| 182 | } |
| 183 | |
| 184 | div.quoteblock, div.verseblock { |
| 185 | padding-left: 1.0em; |
| 186 | margin-left: 1.0em; |
| 187 | margin-right: 10%; |
| 188 | border-left: 5px solid #f0f0f0; |
| 189 | color: #888; |
| 190 | } |
| 191 | |
| 192 | div.quoteblock > div.attribution { |
| 193 | padding-top: 0.5em; |
| 194 | text-align: right; |
| 195 | } |
| 196 | |
| 197 | div.verseblock > pre.content { |
| 198 | font-family: inherit; |
| 199 | font-size: inherit; |
| 200 | } |
| 201 | div.verseblock > div.attribution { |
| 202 | padding-top: 0.75em; |
| 203 | text-align: left; |
| 204 | } |
| 205 | /* DEPRECATED: Pre version 8.2.7 verse style literal block. */ |
| 206 | div.verseblock + div.attribution { |
| 207 | text-align: left; |
| 208 | } |
| 209 | |
| 210 | div.admonitionblock .icon { |
| 211 | vertical-align: top; |
| 212 | font-size: 1.1em; |
| 213 | font-weight: bold; |
| 214 | text-decoration: underline; |
| 215 | color: #527bbd; |
| 216 | padding-right: 0.5em; |
| 217 | } |
| 218 | div.admonitionblock td.content { |
| 219 | padding-left: 0.5em; |
| 220 | border-left: 3px solid #dddddd; |
| 221 | } |
| 222 | |
| 223 | div.exampleblock > div.content { |
| 224 | border-left: 3px solid #dddddd; |
| 225 | padding-left: 0.5em; |
| 226 | } |
| 227 | |
| 228 | div.imageblock div.content { padding-left: 0; } |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 229 | span.image img { border-style: none; vertical-align: text-bottom; } |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 230 | a.image:visited { color: white; } |
| 231 | |
| 232 | dl { |
| 233 | margin-top: 0.8em; |
| 234 | margin-bottom: 0.8em; |
| 235 | } |
| 236 | dt { |
| 237 | margin-top: 0.5em; |
| 238 | margin-bottom: 0; |
| 239 | font-style: normal; |
| 240 | color: navy; |
| 241 | } |
| 242 | dd > *:first-child { |
| 243 | margin-top: 0.1em; |
| 244 | } |
| 245 | |
| 246 | ul, ol { |
| 247 | list-style-position: outside; |
| 248 | } |
| 249 | ol.arabic { |
| 250 | list-style-type: decimal; |
| 251 | } |
| 252 | ol.loweralpha { |
| 253 | list-style-type: lower-alpha; |
| 254 | } |
| 255 | ol.upperalpha { |
| 256 | list-style-type: upper-alpha; |
| 257 | } |
| 258 | ol.lowerroman { |
| 259 | list-style-type: lower-roman; |
| 260 | } |
| 261 | ol.upperroman { |
| 262 | list-style-type: upper-roman; |
| 263 | } |
| 264 | |
| 265 | div.compact ul, div.compact ol, |
| 266 | div.compact p, div.compact p, |
| 267 | div.compact div, div.compact div { |
| 268 | margin-top: 0.1em; |
| 269 | margin-bottom: 0.1em; |
| 270 | } |
| 271 | |
| 272 | tfoot { |
| 273 | font-weight: bold; |
| 274 | } |
| 275 | td > div.verse { |
| 276 | white-space: pre; |
| 277 | } |
| 278 | |
| 279 | div.hdlist { |
| 280 | margin-top: 0.8em; |
| 281 | margin-bottom: 0.8em; |
| 282 | } |
| 283 | div.hdlist tr { |
| 284 | padding-bottom: 15px; |
| 285 | } |
| 286 | dt.hdlist1.strong, td.hdlist1.strong { |
| 287 | font-weight: bold; |
| 288 | } |
| 289 | td.hdlist1 { |
| 290 | vertical-align: top; |
| 291 | font-style: normal; |
| 292 | padding-right: 0.8em; |
| 293 | color: navy; |
| 294 | } |
| 295 | td.hdlist2 { |
| 296 | vertical-align: top; |
| 297 | } |
| 298 | div.hdlist.compact tr { |
| 299 | margin: 0; |
| 300 | padding-bottom: 0; |
| 301 | } |
| 302 | |
| 303 | .comment { |
| 304 | background: yellow; |
| 305 | } |
| 306 | |
| 307 | .footnote, .footnoteref { |
| 308 | font-size: 0.8em; |
| 309 | } |
| 310 | |
| 311 | span.footnote, span.footnoteref { |
| 312 | vertical-align: super; |
| 313 | } |
| 314 | |
| 315 | #footnotes { |
| 316 | margin: 20px 0 20px 0; |
| 317 | padding: 7px 0 0 0; |
| 318 | } |
| 319 | |
| 320 | #footnotes div.footnote { |
| 321 | margin: 0 0 5px 0; |
| 322 | } |
| 323 | |
| 324 | #footnotes hr { |
| 325 | border: none; |
| 326 | border-top: 1px solid silver; |
| 327 | height: 1px; |
| 328 | text-align: left; |
| 329 | margin-left: 0; |
| 330 | width: 20%; |
| 331 | min-width: 100px; |
| 332 | } |
| 333 | |
| 334 | div.colist td { |
| 335 | padding-right: 0.5em; |
| 336 | padding-bottom: 0.3em; |
| 337 | vertical-align: top; |
| 338 | } |
| 339 | div.colist td img { |
| 340 | margin-top: 0.3em; |
| 341 | } |
| 342 | |
| 343 | @media print { |
| 344 | #footer-badges { display: none; } |
| 345 | } |
| 346 | |
| 347 | #toc { |
| 348 | margin-bottom: 2.5em; |
| 349 | } |
| 350 | |
| 351 | #toctitle { |
| 352 | color: #527bbd; |
| 353 | font-size: 1.1em; |
| 354 | font-weight: bold; |
| 355 | margin-top: 1.0em; |
| 356 | margin-bottom: 0.1em; |
| 357 | } |
| 358 | |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 359 | div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 360 | margin-top: 0; |
| 361 | margin-bottom: 0; |
| 362 | } |
| 363 | div.toclevel2 { |
| 364 | margin-left: 2em; |
| 365 | font-size: 0.9em; |
| 366 | } |
| 367 | div.toclevel3 { |
| 368 | margin-left: 4em; |
| 369 | font-size: 0.9em; |
| 370 | } |
| 371 | div.toclevel4 { |
| 372 | margin-left: 6em; |
| 373 | font-size: 0.9em; |
| 374 | } |
| 375 | |
| 376 | span.aqua { color: aqua; } |
| 377 | span.black { color: black; } |
| 378 | span.blue { color: blue; } |
| 379 | span.fuchsia { color: fuchsia; } |
| 380 | span.gray { color: gray; } |
| 381 | span.green { color: green; } |
| 382 | span.lime { color: lime; } |
| 383 | span.maroon { color: maroon; } |
| 384 | span.navy { color: navy; } |
| 385 | span.olive { color: olive; } |
| 386 | span.purple { color: purple; } |
| 387 | span.red { color: red; } |
| 388 | span.silver { color: silver; } |
| 389 | span.teal { color: teal; } |
| 390 | span.white { color: white; } |
| 391 | span.yellow { color: yellow; } |
| 392 | |
| 393 | span.aqua-background { background: aqua; } |
| 394 | span.black-background { background: black; } |
| 395 | span.blue-background { background: blue; } |
| 396 | span.fuchsia-background { background: fuchsia; } |
| 397 | span.gray-background { background: gray; } |
| 398 | span.green-background { background: green; } |
| 399 | span.lime-background { background: lime; } |
| 400 | span.maroon-background { background: maroon; } |
| 401 | span.navy-background { background: navy; } |
| 402 | span.olive-background { background: olive; } |
| 403 | span.purple-background { background: purple; } |
| 404 | span.red-background { background: red; } |
| 405 | span.silver-background { background: silver; } |
| 406 | span.teal-background { background: teal; } |
| 407 | span.white-background { background: white; } |
| 408 | span.yellow-background { background: yellow; } |
| 409 | |
| 410 | span.big { font-size: 2em; } |
| 411 | span.small { font-size: 0.6em; } |
| 412 | |
| 413 | span.underline { text-decoration: underline; } |
| 414 | span.overline { text-decoration: overline; } |
| 415 | span.line-through { text-decoration: line-through; } |
| 416 | |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 417 | div.unbreakable { page-break-inside: avoid; } |
| 418 | |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 419 | |
| 420 | /* |
| 421 | * xhtml11 specific |
| 422 | * |
| 423 | * */ |
| 424 | |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 425 | div.tableblock { |
| 426 | margin-top: 1.0em; |
| 427 | margin-bottom: 1.5em; |
| 428 | } |
| 429 | div.tableblock > table { |
| 430 | border: 3px solid #527bbd; |
| 431 | } |
| 432 | thead, p.table.header { |
| 433 | font-weight: bold; |
| 434 | color: #527bbd; |
| 435 | } |
| 436 | p.table { |
| 437 | margin-top: 0; |
| 438 | } |
| 439 | /* Because the table frame attribute is overriden by CSS in most browsers. */ |
| 440 | div.tableblock > table[frame="void"] { |
| 441 | border-style: none; |
| 442 | } |
| 443 | div.tableblock > table[frame="hsides"] { |
| 444 | border-left-style: none; |
| 445 | border-right-style: none; |
| 446 | } |
| 447 | div.tableblock > table[frame="vsides"] { |
| 448 | border-top-style: none; |
| 449 | border-bottom-style: none; |
| 450 | } |
| 451 | |
| 452 | |
| 453 | /* |
| 454 | * html5 specific |
| 455 | * |
| 456 | * */ |
| 457 | |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 458 | table.tableblock { |
| 459 | margin-top: 1.0em; |
| 460 | margin-bottom: 1.5em; |
| 461 | } |
| 462 | thead, p.tableblock.header { |
| 463 | font-weight: bold; |
| 464 | color: #527bbd; |
| 465 | } |
| 466 | p.tableblock { |
| 467 | margin-top: 0; |
| 468 | } |
| 469 | table.tableblock { |
| 470 | border-width: 3px; |
| 471 | border-spacing: 0px; |
| 472 | border-style: solid; |
| 473 | border-color: #527bbd; |
| 474 | border-collapse: collapse; |
| 475 | } |
| 476 | th.tableblock, td.tableblock { |
| 477 | border-width: 1px; |
| 478 | padding: 4px; |
| 479 | border-style: solid; |
| 480 | border-color: #527bbd; |
| 481 | } |
| 482 | |
| 483 | table.tableblock.frame-topbot { |
| 484 | border-left-style: hidden; |
| 485 | border-right-style: hidden; |
| 486 | } |
| 487 | table.tableblock.frame-sides { |
| 488 | border-top-style: hidden; |
| 489 | border-bottom-style: hidden; |
| 490 | } |
| 491 | table.tableblock.frame-none { |
| 492 | border-style: hidden; |
| 493 | } |
| 494 | |
| 495 | th.tableblock.halign-left, td.tableblock.halign-left { |
| 496 | text-align: left; |
| 497 | } |
| 498 | th.tableblock.halign-center, td.tableblock.halign-center { |
| 499 | text-align: center; |
| 500 | } |
| 501 | th.tableblock.halign-right, td.tableblock.halign-right { |
| 502 | text-align: right; |
| 503 | } |
| 504 | |
| 505 | th.tableblock.valign-top, td.tableblock.valign-top { |
| 506 | vertical-align: top; |
| 507 | } |
| 508 | th.tableblock.valign-middle, td.tableblock.valign-middle { |
| 509 | vertical-align: middle; |
| 510 | } |
| 511 | th.tableblock.valign-bottom, td.tableblock.valign-bottom { |
| 512 | vertical-align: bottom; |
| 513 | } |
| 514 | |
| 515 | |
| 516 | /* |
| 517 | * manpage specific |
| 518 | * |
| 519 | * */ |
| 520 | |
| 521 | body.manpage h1 { |
| 522 | padding-top: 0.5em; |
| 523 | padding-bottom: 0.5em; |
| 524 | border-top: 2px solid silver; |
| 525 | border-bottom: 2px solid silver; |
| 526 | } |
| 527 | body.manpage h2 { |
| 528 | border-style: none; |
| 529 | } |
| 530 | body.manpage div.sectionbody { |
| 531 | margin-left: 3em; |
| 532 | } |
| 533 | |
| 534 | @media print { |
| 535 | body.manpage div#toc { display: none; } |
| 536 | } |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 537 | |
| 538 | |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 539 | </style> |
| 540 | <script type="text/javascript"> |
| 541 | /*<![CDATA[*/ |
| 542 | var asciidoc = { // Namespace. |
| 543 | |
| 544 | ///////////////////////////////////////////////////////////////////// |
| 545 | // Table Of Contents generator |
| 546 | ///////////////////////////////////////////////////////////////////// |
| 547 | |
| 548 | /* Author: Mihai Bazon, September 2002 |
| 549 | * http://students.infoiasi.ro/~mishoo |
| 550 | * |
| 551 | * Table Of Content generator |
| 552 | * Version: 0.4 |
| 553 | * |
| 554 | * Feel free to use this script under the terms of the GNU General Public |
| 555 | * License, as long as you do not remove or alter this notice. |
| 556 | */ |
| 557 | |
| 558 | /* modified by Troy D. Hanson, September 2006. License: GPL */ |
| 559 | /* modified by Stuart Rackham, 2006, 2009. License: GPL */ |
| 560 | |
| 561 | // toclevels = 1..4. |
| 562 | toc: function (toclevels) { |
| 563 | |
| 564 | function getText(el) { |
| 565 | var text = ""; |
| 566 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 567 | if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants. |
| 568 | text += i.data; |
| 569 | else if (i.firstChild != null) |
| 570 | text += getText(i); |
| 571 | } |
| 572 | return text; |
| 573 | } |
| 574 | |
| 575 | function TocEntry(el, text, toclevel) { |
| 576 | this.element = el; |
| 577 | this.text = text; |
| 578 | this.toclevel = toclevel; |
| 579 | } |
| 580 | |
| 581 | function tocEntries(el, toclevels) { |
| 582 | var result = new Array; |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 583 | var re = new RegExp('[hH]([1-'+(toclevels+1)+'])'); |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 584 | // Function that scans the DOM tree for header elements (the DOM2 |
| 585 | // nodeIterator API would be a better technique but not supported by all |
| 586 | // browsers). |
| 587 | var iterate = function (el) { |
| 588 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 589 | if (i.nodeType == 1 /* Node.ELEMENT_NODE */) { |
| 590 | var mo = re.exec(i.tagName); |
| 591 | if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") { |
| 592 | result[result.length] = new TocEntry(i, getText(i), mo[1]-1); |
| 593 | } |
| 594 | iterate(i); |
| 595 | } |
| 596 | } |
| 597 | } |
| 598 | iterate(el); |
| 599 | return result; |
| 600 | } |
| 601 | |
| 602 | var toc = document.getElementById("toc"); |
| 603 | if (!toc) { |
| 604 | return; |
| 605 | } |
| 606 | |
| 607 | // Delete existing TOC entries in case we're reloading the TOC. |
| 608 | var tocEntriesToRemove = []; |
| 609 | var i; |
| 610 | for (i = 0; i < toc.childNodes.length; i++) { |
| 611 | var entry = toc.childNodes[i]; |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 612 | if (entry.nodeName.toLowerCase() == 'div' |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 613 | && entry.getAttribute("class") |
| 614 | && entry.getAttribute("class").match(/^toclevel/)) |
| 615 | tocEntriesToRemove.push(entry); |
| 616 | } |
| 617 | for (i = 0; i < tocEntriesToRemove.length; i++) { |
| 618 | toc.removeChild(tocEntriesToRemove[i]); |
| 619 | } |
| 620 | |
| 621 | // Rebuild TOC entries. |
| 622 | var entries = tocEntries(document.getElementById("content"), toclevels); |
| 623 | for (var i = 0; i < entries.length; ++i) { |
| 624 | var entry = entries[i]; |
| 625 | if (entry.element.id == "") |
| 626 | entry.element.id = "_toc_" + i; |
| 627 | var a = document.createElement("a"); |
| 628 | a.href = "#" + entry.element.id; |
| 629 | a.appendChild(document.createTextNode(entry.text)); |
| 630 | var div = document.createElement("div"); |
| 631 | div.appendChild(a); |
| 632 | div.className = "toclevel" + entry.toclevel; |
| 633 | toc.appendChild(div); |
| 634 | } |
| 635 | if (entries.length == 0) |
| 636 | toc.parentNode.removeChild(toc); |
| 637 | }, |
| 638 | |
| 639 | |
| 640 | ///////////////////////////////////////////////////////////////////// |
| 641 | // Footnotes generator |
| 642 | ///////////////////////////////////////////////////////////////////// |
| 643 | |
| 644 | /* Based on footnote generation code from: |
| 645 | * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html |
| 646 | */ |
| 647 | |
| 648 | footnotes: function () { |
| 649 | // Delete existing footnote entries in case we're reloading the footnodes. |
| 650 | var i; |
| 651 | var noteholder = document.getElementById("footnotes"); |
| 652 | if (!noteholder) { |
| 653 | return; |
| 654 | } |
| 655 | var entriesToRemove = []; |
| 656 | for (i = 0; i < noteholder.childNodes.length; i++) { |
| 657 | var entry = noteholder.childNodes[i]; |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 658 | if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote") |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 659 | entriesToRemove.push(entry); |
| 660 | } |
| 661 | for (i = 0; i < entriesToRemove.length; i++) { |
| 662 | noteholder.removeChild(entriesToRemove[i]); |
| 663 | } |
| 664 | |
| 665 | // Rebuild footnote entries. |
| 666 | var cont = document.getElementById("content"); |
| 667 | var spans = cont.getElementsByTagName("span"); |
| 668 | var refs = {}; |
| 669 | var n = 0; |
| 670 | for (i=0; i<spans.length; i++) { |
| 671 | if (spans[i].className == "footnote") { |
| 672 | n++; |
| 673 | var note = spans[i].getAttribute("data-note"); |
| 674 | if (!note) { |
| 675 | // Use [\s\S] in place of . so multi-line matches work. |
| 676 | // Because JavaScript has no s (dotall) regex flag. |
| 677 | note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1]; |
| 678 | spans[i].innerHTML = |
| 679 | "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n + |
| 680 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 681 | spans[i].setAttribute("data-note", note); |
| 682 | } |
| 683 | noteholder.innerHTML += |
| 684 | "<div class='footnote' id='_footnote_" + n + "'>" + |
| 685 | "<a href='#_footnoteref_" + n + "' title='Return to text'>" + |
| 686 | n + "</a>. " + note + "</div>"; |
| 687 | var id =spans[i].getAttribute("id"); |
| 688 | if (id != null) refs["#"+id] = n; |
| 689 | } |
| 690 | } |
| 691 | if (n == 0) |
| 692 | noteholder.parentNode.removeChild(noteholder); |
| 693 | else { |
| 694 | // Process footnoterefs. |
| 695 | for (i=0; i<spans.length; i++) { |
| 696 | if (spans[i].className == "footnoteref") { |
| 697 | var href = spans[i].getElementsByTagName("a")[0].getAttribute("href"); |
| 698 | href = href.match(/#.*/)[0]; // Because IE return full URL. |
| 699 | n = refs[href]; |
| 700 | spans[i].innerHTML = |
| 701 | "[<a href='#_footnote_" + n + |
| 702 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 703 | } |
| 704 | } |
| 705 | } |
| 706 | }, |
| 707 | |
| 708 | install: function(toclevels) { |
| 709 | var timerId; |
| 710 | |
| 711 | function reinstall() { |
| 712 | asciidoc.footnotes(); |
| 713 | if (toclevels) { |
| 714 | asciidoc.toc(toclevels); |
| 715 | } |
| 716 | } |
| 717 | |
| 718 | function reinstallAndRemoveTimer() { |
| 719 | clearInterval(timerId); |
| 720 | reinstall(); |
| 721 | } |
| 722 | |
| 723 | timerId = setInterval(reinstall, 500); |
| 724 | if (document.addEventListener) |
| 725 | document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false); |
| 726 | else |
| 727 | window.onload = reinstallAndRemoveTimer; |
| 728 | } |
| 729 | |
| 730 | } |
| 731 | asciidoc.install(); |
| 732 | /*]]>*/ |
| 733 | </script> |
| 734 | </head> |
| 735 | <body class="article"> |
| 736 | <div id="header"> |
| 737 | <h1>HTTP transfer protocols</h1> |
| 738 | </div> |
| 739 | <div id="content"> |
| 740 | <div id="preamble"> |
| 741 | <div class="sectionbody"> |
| 742 | <div class="paragraph"><p>Git supports two HTTP based transfer protocols. A "dumb" protocol |
| 743 | which requires only a standard HTTP server on the server end of the |
| 744 | connection, and a "smart" protocol which requires a Git aware CGI |
| 745 | (or server module). This document describes both protocols.</p></div> |
| 746 | <div class="paragraph"><p>As a design feature smart clients can automatically upgrade "dumb" |
| 747 | protocol URLs to smart URLs. This permits all users to have the |
| 748 | same published URL, and the peers automatically select the most |
| 749 | efficient transport available to them.</p></div> |
| 750 | </div> |
| 751 | </div> |
| 752 | <div class="sect1"> |
| 753 | <h2 id="_url_format">URL Format</h2> |
| 754 | <div class="sectionbody"> |
| 755 | <div class="paragraph"><p>URLs for Git repositories accessed by HTTP use the standard HTTP |
| 756 | URL syntax documented by RFC 1738, so they are of the form:</p></div> |
| 757 | <div class="literalblock"> |
| 758 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 759 | <pre><code>http://<host>:<port>/<path>?<searchpart></code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 760 | </div></div> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 761 | <div class="paragraph"><p>Within this documentation the placeholder <code>$GIT_URL</code> will stand for |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 762 | the http:// repository URL entered by the end-user.</p></div> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 763 | <div class="paragraph"><p>Servers SHOULD handle all requests to locations matching <code>$GIT_URL</code>, as |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 764 | both the "smart" and "dumb" HTTP protocols used by Git operate |
| 765 | by appending additional path components onto the end of the user |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 766 | supplied <code>$GIT_URL</code> string.</p></div> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 767 | <div class="paragraph"><p>An example of a dumb client requesting for a loose object:</p></div> |
| 768 | <div class="literalblock"> |
| 769 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 770 | <pre><code>$GIT_URL: http://example.com:8080/git/repo.git |
| 771 | URL request: http://example.com:8080/git/repo.git/objects/d0/49f6c27a2244e12041955e262a404c7faba355</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 772 | </div></div> |
| 773 | <div class="paragraph"><p>An example of a smart request to a catch-all gateway:</p></div> |
| 774 | <div class="literalblock"> |
| 775 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 776 | <pre><code>$GIT_URL: http://example.com/daemon.cgi?svc=git&q= |
| 777 | URL request: http://example.com/daemon.cgi?svc=git&q=/info/refs&service=git-receive-pack</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 778 | </div></div> |
| 779 | <div class="paragraph"><p>An example of a request to a submodule:</p></div> |
| 780 | <div class="literalblock"> |
| 781 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 782 | <pre><code>$GIT_URL: http://example.com/git/repo.git/path/submodule.git |
| 783 | URL request: http://example.com/git/repo.git/path/submodule.git/info/refs</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 784 | </div></div> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 785 | <div class="paragraph"><p>Clients MUST strip a trailing <code>/</code>, if present, from the user supplied |
| 786 | <code>$GIT_URL</code> string to prevent empty path tokens (<code>//</code>) from appearing |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 787 | in any URL sent to a server. Compatible clients MUST expand |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 788 | <code>$GIT_URL/info/refs</code> as <code>foo/info/refs</code> and not <code>foo//info/refs</code>.</p></div> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 789 | </div> |
| 790 | </div> |
| 791 | <div class="sect1"> |
| 792 | <h2 id="_authentication">Authentication</h2> |
| 793 | <div class="sectionbody"> |
| 794 | <div class="paragraph"><p>Standard HTTP authentication is used if authentication is required |
| 795 | to access a repository, and MAY be configured and enforced by the |
| 796 | HTTP server software.</p></div> |
| 797 | <div class="paragraph"><p>Because Git repositories are accessed by standard path components |
| 798 | server administrators MAY use directory based permissions within |
| 799 | their HTTP server to control repository access.</p></div> |
| Junio C Hamano | 38d0253 | 2014-06-26 21:48:50 | [diff] [blame] | 800 | <div class="paragraph"><p>Clients SHOULD support Basic authentication as described by RFC 2617. |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 801 | Servers SHOULD support Basic authentication by relying upon the |
| 802 | HTTP server placed in front of the Git server software.</p></div> |
| 803 | <div class="paragraph"><p>Servers SHOULD NOT require HTTP cookies for the purposes of |
| 804 | authentication or access control.</p></div> |
| 805 | <div class="paragraph"><p>Clients and servers MAY support other common forms of HTTP based |
| 806 | authentication, such as Digest authentication.</p></div> |
| 807 | </div> |
| 808 | </div> |
| 809 | <div class="sect1"> |
| 810 | <h2 id="_ssl">SSL</h2> |
| 811 | <div class="sectionbody"> |
| 812 | <div class="paragraph"><p>Clients and servers SHOULD support SSL, particularly to protect |
| 813 | passwords when relying on Basic HTTP authentication.</p></div> |
| 814 | </div> |
| 815 | </div> |
| 816 | <div class="sect1"> |
| 817 | <h2 id="_session_state">Session State</h2> |
| 818 | <div class="sectionbody"> |
| 819 | <div class="paragraph"><p>The Git over HTTP protocol (much like HTTP itself) is stateless |
| 820 | from the perspective of the HTTP server side. All state MUST be |
| 821 | retained and managed by the client process. This permits simple |
| 822 | round-robin load-balancing on the server side, without needing to |
| 823 | worry about state management.</p></div> |
| 824 | <div class="paragraph"><p>Clients MUST NOT require state management on the server side in |
| 825 | order to function correctly.</p></div> |
| 826 | <div class="paragraph"><p>Servers MUST NOT require HTTP cookies in order to function correctly. |
| 827 | Clients MAY store and forward HTTP cookies during request processing |
| 828 | as described by RFC 2616 (HTTP/1.1). Servers SHOULD ignore any |
| 829 | cookies sent by a client.</p></div> |
| 830 | </div> |
| 831 | </div> |
| 832 | <div class="sect1"> |
| 833 | <h2 id="_general_request_processing">General Request Processing</h2> |
| 834 | <div class="sectionbody"> |
| 835 | <div class="paragraph"><p>Except where noted, all standard HTTP behavior SHOULD be assumed |
| 836 | by both client and server. This includes (but is not necessarily |
| 837 | limited to):</p></div> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 838 | <div class="paragraph"><p>If there is no repository at <code>$GIT_URL</code>, or the resource pointed to by a |
| 839 | location matching <code>$GIT_URL</code> does not exist, the server MUST NOT respond |
| 840 | with <code>200 OK</code> response. A server SHOULD respond with |
| 841 | <code>404 Not Found</code>, <code>410 Gone</code>, or any other suitable HTTP status code |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 842 | which does not imply the resource exists as requested.</p></div> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 843 | <div class="paragraph"><p>If there is a repository at <code>$GIT_URL</code>, but access is not currently |
| 844 | permitted, the server MUST respond with the <code>403 Forbidden</code> HTTP |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 845 | status code.</p></div> |
| 846 | <div class="paragraph"><p>Servers SHOULD support both HTTP 1.0 and HTTP 1.1. |
| 847 | Servers SHOULD support chunked encoding for both request and response |
| 848 | bodies.</p></div> |
| 849 | <div class="paragraph"><p>Clients SHOULD support both HTTP 1.0 and HTTP 1.1. |
| 850 | Clients SHOULD support chunked encoding for both request and response |
| 851 | bodies.</p></div> |
| 852 | <div class="paragraph"><p>Servers MAY return ETag and/or Last-Modified headers.</p></div> |
| 853 | <div class="paragraph"><p>Clients MAY revalidate cached entities by including If-Modified-Since |
| 854 | and/or If-None-Match request headers.</p></div> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 855 | <div class="paragraph"><p>Servers MAY return <code>304 Not Modified</code> if the relevant headers appear |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 856 | in the request and the entity has not changed. Clients MUST treat |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 857 | <code>304 Not Modified</code> identical to <code>200 OK</code> by reusing the cached entity.</p></div> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 858 | <div class="paragraph"><p>Clients MAY reuse a cached entity without revalidation if the |
| 859 | Cache-Control and/or Expires header permits caching. Clients and |
| 860 | servers MUST follow RFC 2616 for cache controls.</p></div> |
| 861 | </div> |
| 862 | </div> |
| 863 | <div class="sect1"> |
| 864 | <h2 id="_discovering_references">Discovering References</h2> |
| 865 | <div class="sectionbody"> |
| 866 | <div class="paragraph"><p>All HTTP clients MUST begin either a fetch or a push exchange by |
| 867 | discovering the references available on the remote repository.</p></div> |
| 868 | <div class="sect2"> |
| 869 | <h3 id="_dumb_clients">Dumb Clients</h3> |
| 870 | <div class="paragraph"><p>HTTP clients that only support the "dumb" protocol MUST discover |
| 871 | references by making a request for the special info/refs file of |
| 872 | the repository.</p></div> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 873 | <div class="paragraph"><p>Dumb HTTP clients MUST make a <code>GET</code> request to <code>$GIT_URL/info/refs</code>, |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 874 | without any search/query parameters.</p></div> |
| 875 | <div class="literalblock"> |
| 876 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 877 | <pre><code>C: GET $GIT_URL/info/refs HTTP/1.0</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 878 | </div></div> |
| 879 | <div class="literalblock"> |
| 880 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 881 | <pre><code>S: 200 OK |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 882 | S: |
| 883 | S: 95dcfa3633004da0049d3d0fa03f80589cbcaf31 refs/heads/maint |
| 884 | S: d049f6c27a2244e12041955e262a404c7faba355 refs/heads/master |
| 885 | S: 2cb58b79488a98d2721cea644875a8dd0026b115 refs/tags/v1.0 |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 886 | S: a3c2e2402b99163d1d59756e5f207ae21cccba4c refs/tags/v1.0^{}</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 887 | </div></div> |
| 888 | <div class="paragraph"><p>The Content-Type of the returned info/refs entity SHOULD be |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 889 | <code>text/plain; charset=utf-8</code>, but MAY be any content type. |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 890 | Clients MUST NOT attempt to validate the returned Content-Type. |
| 891 | Dumb servers MUST NOT return a return type starting with |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 892 | <code>application/x-git-</code>.</p></div> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 893 | <div class="paragraph"><p>Cache-Control headers MAY be returned to disable caching of the |
| 894 | returned entity.</p></div> |
| 895 | <div class="paragraph"><p>When examining the response clients SHOULD only examine the HTTP |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 896 | status code. Valid responses are <code>200 OK</code>, or <code>304 Not Modified</code>.</p></div> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 897 | <div class="paragraph"><p>The returned content is a UNIX formatted text file describing |
| 898 | each ref and its known value. The file SHOULD be sorted by name |
| 899 | according to the C locale ordering. The file SHOULD NOT include |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 900 | the default ref named <code>HEAD</code>.</p></div> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 901 | <div class="literalblock"> |
| 902 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 903 | <pre><code>info_refs = *( ref_record ) |
| 904 | ref_record = any_ref / peeled_ref</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 905 | </div></div> |
| 906 | <div class="literalblock"> |
| 907 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 908 | <pre><code>any_ref = obj-id HTAB refname LF |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 909 | peeled_ref = obj-id HTAB refname LF |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 910 | obj-id HTAB refname "^{}" LF</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 911 | </div></div> |
| 912 | </div> |
| 913 | <div class="sect2"> |
| 914 | <h3 id="_smart_clients">Smart Clients</h3> |
| 915 | <div class="paragraph"><p>HTTP clients that support the "smart" protocol (or both the |
| 916 | "smart" and "dumb" protocols) MUST discover references by making |
| 917 | a parameterized request for the info/refs file of the repository.</p></div> |
| 918 | <div class="paragraph"><p>The request MUST contain exactly one query parameter, |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 919 | <code>service=$servicename</code>, where <code>$servicename</code> MUST be the service |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 920 | name the client wishes to contact to complete the operation. |
| 921 | The request MUST NOT contain additional query parameters.</p></div> |
| 922 | <div class="literalblock"> |
| 923 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 924 | <pre><code>C: GET $GIT_URL/info/refs?service=git-upload-pack HTTP/1.0</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 925 | </div></div> |
| 926 | <div class="paragraph"><p>dumb server reply:</p></div> |
| 927 | <div class="literalblock"> |
| 928 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 929 | <pre><code>S: 200 OK |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 930 | S: |
| 931 | S: 95dcfa3633004da0049d3d0fa03f80589cbcaf31 refs/heads/maint |
| 932 | S: d049f6c27a2244e12041955e262a404c7faba355 refs/heads/master |
| 933 | S: 2cb58b79488a98d2721cea644875a8dd0026b115 refs/tags/v1.0 |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 934 | S: a3c2e2402b99163d1d59756e5f207ae21cccba4c refs/tags/v1.0^{}</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 935 | </div></div> |
| 936 | <div class="paragraph"><p>smart server reply:</p></div> |
| 937 | <div class="literalblock"> |
| 938 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 939 | <pre><code>S: 200 OK |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 940 | S: Content-Type: application/x-git-upload-pack-advertisement |
| 941 | S: Cache-Control: no-cache |
| 942 | S: |
| 943 | S: 001e# service=git-upload-pack\n |
| Junio C Hamano | 45badf0 | 2018-03-14 21:56:41 | [diff] [blame] | 944 | S: 0000 |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 945 | S: 004895dcfa3633004da0049d3d0fa03f80589cbcaf31 refs/heads/maint\0multi_ack\n |
| 946 | S: 0042d049f6c27a2244e12041955e262a404c7faba355 refs/heads/master\n |
| 947 | S: 003c2cb58b79488a98d2721cea644875a8dd0026b115 refs/tags/v1.0\n |
| Junio C Hamano | 45badf0 | 2018-03-14 21:56:41 | [diff] [blame] | 948 | S: 003fa3c2e2402b99163d1d59756e5f207ae21cccba4c refs/tags/v1.0^{}\n |
| 949 | S: 0000</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 950 | </div></div> |
| Junio C Hamano | 912712b | 2017-12-06 18:04:01 | [diff] [blame] | 951 | <div class="paragraph"><p>The client may send Extra Parameters (see |
| 952 | Documentation/technical/pack-protocol.txt) as a colon-separated string |
| 953 | in the Git-Protocol HTTP header.</p></div> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 954 | <div class="sect3"> |
| 955 | <h4 id="_dumb_server_response">Dumb Server Response</h4> |
| 956 | <div class="paragraph"><p>Dumb servers MUST respond with the dumb server reply format.</p></div> |
| 957 | <div class="paragraph"><p>See the prior section under dumb clients for a more detailed |
| 958 | description of the dumb server response.</p></div> |
| 959 | </div> |
| 960 | <div class="sect3"> |
| 961 | <h4 id="_smart_server_response">Smart Server Response</h4> |
| 962 | <div class="paragraph"><p>If the server does not recognize the requested service name, or the |
| 963 | requested service name has been disabled by the server administrator, |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 964 | the server MUST respond with the <code>403 Forbidden</code> HTTP status code.</p></div> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 965 | <div class="paragraph"><p>Otherwise, smart servers MUST respond with the smart server reply |
| 966 | format for the requested service name.</p></div> |
| 967 | <div class="paragraph"><p>Cache-Control headers SHOULD be used to disable caching of the |
| 968 | returned entity.</p></div> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 969 | <div class="paragraph"><p>The Content-Type MUST be <code>application/x-$servicename-advertisement</code>. |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 970 | Clients SHOULD fall back to the dumb protocol if another content |
| 971 | type is returned. When falling back to the dumb protocol clients |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 972 | SHOULD NOT make an additional request to <code>$GIT_URL/info/refs</code>, but |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 973 | instead SHOULD use the response already in hand. Clients MUST NOT |
| 974 | continue if they do not support the dumb protocol.</p></div> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 975 | <div class="paragraph"><p>Clients MUST validate the status code is either <code>200 OK</code> or |
| 976 | <code>304 Not Modified</code>.</p></div> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 977 | <div class="paragraph"><p>Clients MUST validate the first five bytes of the response entity |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 978 | matches the regex <code>^[0-9a-f]{4}#</code>. If this test fails, clients |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 979 | MUST NOT continue.</p></div> |
| 980 | <div class="paragraph"><p>Clients MUST parse the entire response as a sequence of pkt-line |
| 981 | records.</p></div> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 982 | <div class="paragraph"><p>Clients MUST verify the first pkt-line is <code># service=$servicename</code>. |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 983 | Servers MUST set $servicename to be the request parameter value. |
| 984 | Servers SHOULD include an LF at the end of this line. |
| 985 | Clients MUST ignore an LF at the end of the line.</p></div> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 986 | <div class="paragraph"><p>Servers MUST terminate the response with the magic <code>0000</code> end |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 987 | pkt-line marker.</p></div> |
| 988 | <div class="paragraph"><p>The returned response is a pkt-line stream describing each ref and |
| 989 | its known value. The stream SHOULD be sorted by name according to |
| 990 | the C locale ordering. The stream SHOULD include the default ref |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 991 | named <code>HEAD</code> as the first ref. The stream MUST include capability |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 992 | declarations behind a NUL on the first ref.</p></div> |
| Junio C Hamano | 912712b | 2017-12-06 18:04:01 | [diff] [blame] | 993 | <div class="paragraph"><p>The returned response contains "version 1" if "version=1" was sent as an |
| 994 | Extra Parameter.</p></div> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 995 | <div class="literalblock"> |
| 996 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 997 | <pre><code>smart_reply = PKT-LINE("# service=$servicename" LF) |
| Junio C Hamano | 45badf0 | 2018-03-14 21:56:41 | [diff] [blame] | 998 | "0000" |
| Junio C Hamano | 912712b | 2017-12-06 18:04:01 | [diff] [blame] | 999 | *1("version 1") |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1000 | ref_list |
| 1001 | "0000" |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1002 | ref_list = empty_list / non_empty_list</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1003 | </div></div> |
| 1004 | <div class="literalblock"> |
| 1005 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1006 | <pre><code>empty_list = PKT-LINE(zero-id SP "capabilities^{}" NUL cap-list LF)</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1007 | </div></div> |
| 1008 | <div class="literalblock"> |
| 1009 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1010 | <pre><code>non_empty_list = PKT-LINE(obj-id SP name NUL cap_list LF) |
| 1011 | *ref_record</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1012 | </div></div> |
| 1013 | <div class="literalblock"> |
| 1014 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1015 | <pre><code>cap-list = capability *(SP capability) |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1016 | capability = 1*(LC_ALPHA / DIGIT / "-" / "_") |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1017 | LC_ALPHA = %x61-7A</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1018 | </div></div> |
| 1019 | <div class="literalblock"> |
| 1020 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1021 | <pre><code>ref_record = any_ref / peeled_ref |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1022 | any_ref = PKT-LINE(obj-id SP name LF) |
| 1023 | peeled_ref = PKT-LINE(obj-id SP name LF) |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1024 | PKT-LINE(obj-id SP name "^{}" LF</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1025 | </div></div> |
| 1026 | </div> |
| 1027 | </div> |
| 1028 | </div> |
| 1029 | </div> |
| 1030 | <div class="sect1"> |
| 1031 | <h2 id="_smart_service_git_upload_pack">Smart Service git-upload-pack</h2> |
| 1032 | <div class="sectionbody"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1033 | <div class="paragraph"><p>This service reads from the repository pointed to by <code>$GIT_URL</code>.</p></div> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1034 | <div class="paragraph"><p>Clients MUST first perform ref discovery with |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1035 | <code>$GIT_URL/info/refs?service=git-upload-pack</code>.</p></div> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1036 | <div class="literalblock"> |
| 1037 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1038 | <pre><code>C: POST $GIT_URL/git-upload-pack HTTP/1.0 |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1039 | C: Content-Type: application/x-git-upload-pack-request |
| 1040 | C: |
| 1041 | C: 0032want 0a53e9ddeaddad63ad106860237bbf53411d11a7\n |
| 1042 | C: 0032have 441b40d833fdfa93eb2908e52742248faf0ee993\n |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1043 | C: 0000</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1044 | </div></div> |
| 1045 | <div class="literalblock"> |
| 1046 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1047 | <pre><code>S: 200 OK |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1048 | S: Content-Type: application/x-git-upload-pack-result |
| 1049 | S: Cache-Control: no-cache |
| 1050 | S: |
| 1051 | S: ....ACK %s, continue |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1052 | S: ....NAK</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1053 | </div></div> |
| 1054 | <div class="paragraph"><p>Clients MUST NOT reuse or revalidate a cached response. |
| 1055 | Servers MUST include sufficient Cache-Control headers |
| 1056 | to prevent caching of the response.</p></div> |
| 1057 | <div class="paragraph"><p>Servers SHOULD support all capabilities defined here.</p></div> |
| 1058 | <div class="paragraph"><p>Clients MUST send at least one "want" command in the request body. |
| 1059 | Clients MUST NOT reference an id in a "want" command which did not |
| 1060 | appear in the response obtained through ref discovery unless the |
| Junio C Hamano | 85f1fde | 2015-06-01 20:37:32 | [diff] [blame] | 1061 | server advertises capability <code>allow-tip-sha1-in-want</code> or |
| 1062 | <code>allow-reachable-sha1-in-want</code>.</p></div> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1063 | <div class="literalblock"> |
| 1064 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1065 | <pre><code>compute_request = want_list |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1066 | have_list |
| 1067 | request_end |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1068 | request_end = "0000" / "done"</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1069 | </div></div> |
| 1070 | <div class="literalblock"> |
| 1071 | <div class="content"> |
| Junio C Hamano | bfd91f4 | 2018-08-17 22:21:16 | [diff] [blame] | 1072 | <pre><code>want_list = PKT-LINE(want SP cap_list LF) |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1073 | *(want_pkt) |
| 1074 | want_pkt = PKT-LINE(want LF) |
| 1075 | want = "want" SP id |
| Junio C Hamano | bfd91f4 | 2018-08-17 22:21:16 | [diff] [blame] | 1076 | cap_list = capability *(SP capability)</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1077 | </div></div> |
| 1078 | <div class="literalblock"> |
| 1079 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1080 | <pre><code>have_list = *PKT-LINE("have" SP id LF)</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1081 | </div></div> |
| 1082 | <div class="paragraph"><p>TODO: Document this further.</p></div> |
| 1083 | <div class="sect2"> |
| 1084 | <h3 id="_the_negotiation_algorithm">The Negotiation Algorithm</h3> |
| 1085 | <div class="paragraph"><p>The computation to select the minimal pack proceeds as follows |
| 1086 | (C = client, S = server):</p></div> |
| 1087 | <div class="paragraph"><p><em>init step:</em></p></div> |
| 1088 | <div class="paragraph"><p>C: Use ref discovery to obtain the advertised refs.</p></div> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1089 | <div class="paragraph"><p>C: Place any object seen into set <code>advertised</code>.</p></div> |
| 1090 | <div class="paragraph"><p>C: Build an empty set, <code>common</code>, to hold the objects that are later |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1091 | determined to be on both ends.</p></div> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1092 | <div class="paragraph"><p>C: Build a set, <code>want</code>, of the objects from <code>advertised</code> the client |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1093 | wants to fetch, based on what it saw during ref discovery.</p></div> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1094 | <div class="paragraph"><p>C: Start a queue, <code>c_pending</code>, ordered by commit time (popping newest |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1095 | first). Add all client refs. When a commit is popped from |
| 1096 | the queue its parents SHOULD be automatically inserted back. |
| 1097 | Commits MUST only enter the queue once.</p></div> |
| 1098 | <div class="paragraph"><p><em>one compute step:</em></p></div> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1099 | <div class="paragraph"><p>C: Send one <code>$GIT_URL/git-upload-pack</code> request:</p></div> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1100 | <div class="literalblock"> |
| 1101 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1102 | <pre><code>C: 0032want <want #1>............................... |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1103 | C: 0032want <want #2>............................... |
| 1104 | .... |
| 1105 | C: 0032have <common #1>............................. |
| 1106 | C: 0032have <common #2>............................. |
| 1107 | .... |
| 1108 | C: 0032have <have #1>............................... |
| 1109 | C: 0032have <have #2>............................... |
| 1110 | .... |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1111 | C: 0000</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1112 | </div></div> |
| 1113 | <div class="paragraph"><p>The stream is organized into "commands", with each command |
| Junio C Hamano | e1aeb5e | 2014-06-06 19:16:29 | [diff] [blame] | 1114 | appearing by itself in a pkt-line. Within a command line, |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1115 | the text leading up to the first space is the command name, |
| 1116 | and the remainder of the line to the first LF is the value. |
| 1117 | Command lines are terminated with an LF as the last byte of |
| 1118 | the pkt-line value.</p></div> |
| 1119 | <div class="paragraph"><p>Commands MUST appear in the following order, if they appear |
| 1120 | at all in the request stream:</p></div> |
| 1121 | <div class="ulist"><ul> |
| 1122 | <li> |
| 1123 | <p> |
| 1124 | "want" |
| 1125 | </p> |
| 1126 | </li> |
| 1127 | <li> |
| 1128 | <p> |
| 1129 | "have" |
| 1130 | </p> |
| 1131 | </li> |
| 1132 | </ul></div> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1133 | <div class="paragraph"><p>The stream is terminated by a pkt-line flush (<code>0000</code>).</p></div> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1134 | <div class="paragraph"><p>A single "want" or "have" command MUST have one hex formatted |
| 1135 | SHA-1 as its value. Multiple SHA-1s MUST be sent by sending |
| 1136 | multiple commands.</p></div> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1137 | <div class="paragraph"><p>The <code>have</code> list is created by popping the first 32 commits |
| 1138 | from <code>c_pending</code>. Less can be supplied if <code>c_pending</code> empties.</p></div> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1139 | <div class="paragraph"><p>If the client has sent 256 "have" commits and has not yet |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1140 | received one of those back from <code>s_common</code>, or the client has |
| 1141 | emptied <code>c_pending</code> it SHOULD include a "done" command to let |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1142 | the server know it won’t proceed:</p></div> |
| 1143 | <div class="literalblock"> |
| 1144 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1145 | <pre><code>C: 0009done</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1146 | </div></div> |
| 1147 | <div class="paragraph"><p>S: Parse the git-upload-pack request:</p></div> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1148 | <div class="paragraph"><p>Verify all objects in <code>want</code> are directly reachable from refs.</p></div> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1149 | <div class="paragraph"><p>The server MAY walk backwards through history or through |
| 1150 | the reflog to permit slightly stale requests.</p></div> |
| 1151 | <div class="paragraph"><p>If no "want" objects are received, send an error: |
| 1152 | TODO: Define error if no "want" lines are requested.</p></div> |
| 1153 | <div class="paragraph"><p>If any "want" object is not reachable, send an error: |
| 1154 | TODO: Define error if an invalid "want" is requested.</p></div> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1155 | <div class="paragraph"><p>Create an empty list, <code>s_common</code>.</p></div> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1156 | <div class="paragraph"><p>If "have" was sent:</p></div> |
| 1157 | <div class="paragraph"><p>Loop through the objects in the order supplied by the client.</p></div> |
| 1158 | <div class="paragraph"><p>For each object, if the server has the object reachable from |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1159 | a ref, add it to <code>s_common</code>. If a commit is added to <code>s_common</code>, |
| 1160 | do not add any ancestors, even if they also appear in <code>have</code>.</p></div> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1161 | <div class="paragraph"><p>S: Send the git-upload-pack response:</p></div> |
| 1162 | <div class="paragraph"><p>If the server has found a closed set of objects to pack or the |
| 1163 | request ends with "done", it replies with the pack. |
| 1164 | TODO: Document the pack based response</p></div> |
| 1165 | <div class="literalblock"> |
| 1166 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1167 | <pre><code>S: PACK...</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1168 | </div></div> |
| 1169 | <div class="paragraph"><p>The returned stream is the side-band-64k protocol supported |
| 1170 | by the git-upload-pack service, and the pack is embedded into |
| 1171 | stream 1. Progress messages from the server side MAY appear |
| 1172 | in stream 2.</p></div> |
| 1173 | <div class="paragraph"><p>Here a "closed set of objects" is defined to have at least |
| 1174 | one path from every "want" to at least one "common" object.</p></div> |
| 1175 | <div class="paragraph"><p>If the server needs more information, it replies with a |
| 1176 | status continue response: |
| 1177 | TODO: Document the non-pack response</p></div> |
| 1178 | <div class="paragraph"><p>C: Parse the upload-pack response: |
| 1179 | TODO: Document parsing response</p></div> |
| 1180 | <div class="paragraph"><p><em>Do another compute step.</em></p></div> |
| 1181 | </div> |
| 1182 | </div> |
| 1183 | </div> |
| 1184 | <div class="sect1"> |
| 1185 | <h2 id="_smart_service_git_receive_pack">Smart Service git-receive-pack</h2> |
| 1186 | <div class="sectionbody"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1187 | <div class="paragraph"><p>This service reads from the repository pointed to by <code>$GIT_URL</code>.</p></div> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1188 | <div class="paragraph"><p>Clients MUST first perform ref discovery with |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1189 | <code>$GIT_URL/info/refs?service=git-receive-pack</code>.</p></div> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1190 | <div class="literalblock"> |
| 1191 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1192 | <pre><code>C: POST $GIT_URL/git-receive-pack HTTP/1.0 |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1193 | C: Content-Type: application/x-git-receive-pack-request |
| 1194 | C: |
| 1195 | C: ....0a53e9ddeaddad63ad106860237bbf53411d11a7 441b40d833fdfa93eb2908e52742248faf0ee993 refs/heads/maint\0 report-status |
| 1196 | C: 0000 |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1197 | C: PACK....</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1198 | </div></div> |
| 1199 | <div class="literalblock"> |
| 1200 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1201 | <pre><code>S: 200 OK |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1202 | S: Content-Type: application/x-git-receive-pack-result |
| 1203 | S: Cache-Control: no-cache |
| 1204 | S: |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1205 | S: ....</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1206 | </div></div> |
| 1207 | <div class="paragraph"><p>Clients MUST NOT reuse or revalidate a cached response. |
| 1208 | Servers MUST include sufficient Cache-Control headers |
| 1209 | to prevent caching of the response.</p></div> |
| 1210 | <div class="paragraph"><p>Servers SHOULD support all capabilities defined here.</p></div> |
| 1211 | <div class="paragraph"><p>Clients MUST send at least one command in the request body. |
| 1212 | Within the command portion of the request body clients SHOULD send |
| 1213 | the id obtained through ref discovery as old_id.</p></div> |
| 1214 | <div class="literalblock"> |
| 1215 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1216 | <pre><code>update_request = command_list |
| 1217 | "PACK" <binary data></code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1218 | </div></div> |
| 1219 | <div class="literalblock"> |
| 1220 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1221 | <pre><code>command_list = PKT-LINE(command NUL cap_list LF) |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1222 | *(command_pkt) |
| 1223 | command_pkt = PKT-LINE(command LF) |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1224 | cap_list = *(SP capability) SP</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1225 | </div></div> |
| 1226 | <div class="literalblock"> |
| 1227 | <div class="content"> |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1228 | <pre><code>command = create / delete / update |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1229 | create = zero-id SP new_id SP name |
| 1230 | delete = old_id SP zero-id SP name |
| Junio C Hamano | c14e6ad | 2014-10-31 20:25:53 | [diff] [blame] | 1231 | update = old_id SP new_id SP name</code></pre> |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1232 | </div></div> |
| 1233 | <div class="paragraph"><p>TODO: Document this further.</p></div> |
| 1234 | </div> |
| 1235 | </div> |
| 1236 | <div class="sect1"> |
| 1237 | <h2 id="_references">References</h2> |
| 1238 | <div class="sectionbody"> |
| 1239 | <div class="paragraph"><p><a href="http://www.ietf.org/rfc/rfc1738.txt">RFC 1738: Uniform Resource Locators (URL)</a> |
| 1240 | <a href="http://www.ietf.org/rfc/rfc2616.txt">RFC 2616: Hypertext Transfer Protocol — HTTP/1.1</a> |
| 1241 | link:technical/pack-protocol.html |
| 1242 | link:technical/protocol-capabilities.html</p></div> |
| 1243 | </div> |
| 1244 | </div> |
| 1245 | </div> |
| 1246 | <div id="footnotes"><hr /></div> |
| 1247 | <div id="footer"> |
| 1248 | <div id="footer-text"> |
| Junio C Hamano | 2ef0ba3 | 2018-01-26 23:13:53 | [diff] [blame] | 1249 | Last updated |
| Junio C Hamano | cf73100 | 2019-01-29 21:19:52 | [diff] [blame^] | 1250 | 2018-08-17 15:20:20 PDT |
| Junio C Hamano | c5bd79e | 2014-01-27 21:31:26 | [diff] [blame] | 1251 | </div> |
| 1252 | </div> |
| 1253 | </body> |
| 1254 | </html> |