Skip to contentSkip to conversation

doc: fix want-capability separator

PATCH In review Masaya Suzuki 2 participants 2 messages Jul 28, 2018 – Jul 30, 2018 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc: fix want-capability separator

Unlike ref advertisement, client capabilities and the first want are separated by SP, not NUL, in the implementation. Fix the documentation to align with the implementation. pack-protocol.txt is already fixed.

---
 Documentation/technical/http-protocol.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/technical/http-protocol.txt +2 -2
index 64f49d0bb..9c5b6f0fa 100644
@@ -338,11 +338,11 @@ server advertises capability `allow-tip-sha1-in-want` or
 		       request_end
   request_end       =  "0000" / "done"
 
-  want_list         =  PKT-LINE(want NUL cap_list LF)
+  want_list         =  PKT-LINE(want SP cap_list LF)
 		       *(want_pkt)
   want_pkt          =  PKT-LINE(want LF)
   want              =  "want" SP id
-  cap_list          =  *(SP capability) SP
+  cap_list          =  capability *(SP capability)
 
   have_list         =  *PKT-LINE("have" SP id LF)
 
Signature · 1 line
2.18.0
#1 lore raw
Quoted 1 line · Masaya Suzuki

The email addresses mismatch?

Quoted 3 lines

Unlike ref advertisement, client capabilities and the first want are separated by SP, not NUL, in the implementation. Fix the documentation to align with the implementation.

Makes sense! Thanks for the fix!

Quoted 1 line

pack-protocol.txt is already fixed.

which has

capability-list = capability *(SP capability)

since b31222cfb7f (Update packfile transfer protocol documentation, 2009-11-03), which is the first to mention the capability line, so I'd claim it was always correct?

Quoted 12 lines
---
 Documentation/technical/http-protocol.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/technical/http-protocol.txt +0 -0
index 64f49d0bb..9c5b6f0fa 100644
@@ -338,11 +338,11 @@ server advertises capability `allow-tip-sha1-in-want` or
                       request_end
   request_end       =  "0000" / "done"

Documentation/technical/http-protocol.txt server advertises capability `allow-tip-sha1-in-want` or · line 347

Quoted 10 lines
Documentation/technical/http-protocol.txt +2 -2
 
-  want_list         =  PKT-LINE(want NUL cap_list LF)
+  want_list         =  PKT-LINE(want SP cap_list LF)
                       *(want_pkt)
   want_pkt          =  PKT-LINE(want LF)
   want              =  "want" SP id
-  cap_list          =  *(SP capability) SP
+  cap_list          =  capability *(SP capability)
 
   have_list         =  *PKT-LINE("have" SP id LF)

Just after these context lines we have

TODO: Document this further.

which is a good hint that the existing documentation can benefit from patches like these.

Thanks,
Stefan