@matheusbsbs / matheus-bagliano / commits / fd194dd56a
Fork 0

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 <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jonathan Tan committed Jun 10, 2020 at 13:57 UTC fd194dd56ad4c21a561bce4182a61c38bdf4588c
1 file changed +8 -10
Documentation/technical/protocol-v2.txt
+8 -10
@@ -325,11 +325,11 @@ included in the client's request:
325
326 The response of `fetch` is broken into a number of sections separated by
327 delimiter packets (0001), with each section beginning with its section
328 -header.
328 +header. Most sections are sent only when the packfile is sent.
329
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
333
334 acknowledgments = PKT-LINE("acknowledgments" LF)
335 (nak | *ack)
@@ -351,9 +351,10 @@ header.
351 *PKT-LINE(%x01-03 *%x00-ff)
352
353 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.
358
359 * Always begins with the section header "acknowledgments"
360
@@ -404,9 +405,6 @@ header.
405 which the client has not indicated was shallow as a part of
406 its request.
407
407 - * This section is only included if a packfile section is also
408 - included in the response.
409 -
408 wanted-refs section
409 * This section is only included if the client has requested a
410 ref using a 'want-ref' line and if a packfile section is also