@@ -14,6 +14,14 @@ data. The protocol functions to have a server tell a client what is
14
14
currently on the server, then for the two to negotiate the smallest amount
15
15
of data to send in order to fully update one or the other.
16
16
17
+ pkt-line Format
18
+ ---------------
19
+
20
+ The descriptions below build on the pkt-line format described in
21
+ protocol-common.txt. When the grammar indicate `PKT-LINE(...)`, unless
22
+ otherwise noted the usual pkt-line LF rules apply: the sender SHOULD
23
+ include a LF, but the receiver MUST NOT complain if it is not present.
24
+
17
25
Transports
18
26
----------
19
27
There are three transports over which the packfile protocol is
@@ -143,9 +151,6 @@ with the object name that each reference currently points to.
143
151
003fe92df48743b7bc7d26bcaabfddde0a1e20cae47c refs/tags/v1.0^{}
144
152
0000
145
153
146
- Server SHOULD terminate each non-flush line using LF ("\n") terminator;
147
- client MUST NOT complain if there is no terminator.
148
-
149
154
The returned response is a pkt-line stream describing each ref and
150
155
its current value. The stream MUST be sorted by name according to
151
156
the C locale ordering.
@@ -165,15 +170,15 @@ MUST peel the ref if it's an annotated tag.
165
170
flush-pkt
166
171
167
172
no-refs = PKT-LINE(zero-id SP "capabilities^{}"
168
- NUL capability-list LF )
173
+ NUL capability-list)
169
174
170
175
list-of-refs = first-ref *other-ref
171
176
first-ref = PKT-LINE(obj-id SP refname
172
- NUL capability-list LF )
177
+ NUL capability-list)
173
178
174
179
other-ref = PKT-LINE(other-tip / other-peeled)
175
- other-tip = obj-id SP refname LF
176
- other-peeled = obj-id SP refname "^{}" LF
180
+ other-tip = obj-id SP refname
181
+ other-peeled = obj-id SP refname "^{}"
177
182
178
183
shallow = PKT-LINE("shallow" SP obj-id)
179
184
@@ -216,8 +221,8 @@ out of what the server said it could do with the first 'want' line.
216
221
217
222
depth-request = PKT-LINE("deepen" SP depth)
218
223
219
- first-want = PKT-LINE("want" SP obj-id SP capability-list LF )
220
- additional-want = PKT-LINE("want" SP obj-id LF )
224
+ first-want = PKT-LINE("want" SP obj-id SP capability-list)
225
+ additional-want = PKT-LINE("want" SP obj-id)
221
226
222
227
depth = 1*DIGIT
223
228
----
@@ -284,7 +289,7 @@ so that there is always a block of 32 "in-flight on the wire" at a time.
284
289
compute-end
285
290
286
291
have-list = *have-line
287
- have-line = PKT-LINE("have" SP obj-id LF )
292
+ have-line = PKT-LINE("have" SP obj-id)
288
293
compute-end = flush-pkt / PKT-LINE("done")
289
294
----
290
295
@@ -348,10 +353,10 @@ Then the server will start sending its packfile data.
348
353
349
354
----
350
355
server-response = *ack_multi ack / nak
351
- ack_multi = PKT-LINE("ACK" SP obj-id ack_status LF )
356
+ ack_multi = PKT-LINE("ACK" SP obj-id ack_status)
352
357
ack_status = "continue" / "common" / "ready"
353
- ack = PKT-LINE("ACK SP obj-id LF )
354
- nak = PKT-LINE("NAK" LF )
358
+ ack = PKT-LINE("ACK" SP obj-id)
359
+ nak = PKT-LINE("NAK")
355
360
----
356
361
357
362
A simple clone may look like this (with no 'have' lines):
@@ -467,10 +472,10 @@ references.
467
472
----
468
473
update-request = *shallow ( command-list | push-cert ) [packfile]
469
474
470
- shallow = PKT-LINE("shallow" SP obj-id LF )
475
+ shallow = PKT-LINE("shallow" SP obj-id)
471
476
472
- command-list = PKT-LINE(command NUL capability-list LF )
473
- *PKT-LINE(command LF )
477
+ command-list = PKT-LINE(command NUL capability-list)
478
+ *PKT-LINE(command)
474
479
flush-pkt
475
480
476
481
command = create / delete / update
@@ -521,7 +526,8 @@ Push Certificate
521
526
522
527
A push certificate begins with a set of header lines. After the
523
528
header and an empty line, the protocol commands follow, one per
524
- line.
529
+ line. Note that the the trailing LF in push-cert PKT-LINEs is _not_
530
+ optional; it must be present.
525
531
526
532
Currently, the following header fields are defined:
527
533
@@ -560,12 +566,12 @@ update was successful, or 'ng [refname] [error]' if the update was not.
560
566
1*(command-status)
561
567
flush-pkt
562
568
563
- unpack-status = PKT-LINE("unpack" SP unpack-result LF )
569
+ unpack-status = PKT-LINE("unpack" SP unpack-result)
564
570
unpack-result = "ok" / error-msg
565
571
566
572
command-status = command-ok / command-fail
567
- command-ok = PKT-LINE("ok" SP refname LF )
568
- command-fail = PKT-LINE("ng" SP refname SP error-msg LF )
573
+ command-ok = PKT-LINE("ok" SP refname)
574
+ command-fail = PKT-LINE("ng" SP refname SP error-msg)
569
575
570
576
error-msg = 1*(OCTECT) ; where not "ok"
571
577
----
0 commit comments