Skip to content

Commit 7ee4ab7

Browse files
jonathantanmygitster
authored andcommitted
Documentation: order protocol v2 sections
The current C Git implementation expects Git servers to follow a specific order of sections when transmitting protocol v2 responses, but this is not explicit in the documentation. Make the order explicit. Signed-off-by: Jonathan Tan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 472fbef commit 7ee4ab7

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

Documentation/technical/protocol-v2.txt

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -325,11 +325,11 @@ included in the client's request:
325325

326326
The response of `fetch` is broken into a number of sections separated by
327327
delimiter packets (0001), with each section beginning with its section
328-
header.
328+
header. Most sections are sent only when the packfile is sent.
329329

330-
output = *section
331-
section = (acknowledgments | shallow-info | wanted-refs | packfile)
332-
(flush-pkt | delim-pkt)
330+
output = acknowledgements flush-pkt |
331+
[acknowledgments delim-pkt] [shallow-info delim-pkt]
332+
[wanted-refs delim-pkt] packfile flush-pkt
333333

334334
acknowledgments = PKT-LINE("acknowledgments" LF)
335335
(nak | *ack)
@@ -351,9 +351,10 @@ header.
351351
*PKT-LINE(%x01-03 *%x00-ff)
352352

353353
acknowledgments section
354-
* If the client determines that it is finished with negotiations
355-
by sending a "done" line, the acknowledgments sections MUST be
356-
omitted from the server's response.
354+
* If the client determines that it is finished with negotiations by
355+
sending a "done" line (thus requiring the server to send a packfile),
356+
the acknowledgments sections MUST be omitted from the server's
357+
response.
357358

358359
* Always begins with the section header "acknowledgments"
359360

@@ -404,9 +405,6 @@ header.
404405
which the client has not indicated was shallow as a part of
405406
its request.
406407

407-
* This section is only included if a packfile section is also
408-
included in the response.
409-
410408
wanted-refs section
411409
* This section is only included if the client has requested a
412410
ref using a 'want-ref' line and if a packfile section is also

0 commit comments

Comments
 (0)