Skip to content

Commit 9c96c7f

Browse files
tacker66gitster
authored andcommitted
http-protocol.txt: don't use uppercase for variable names in "The Negotiation Algorithm"
Signed-off-by: Thomas Ackermann <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 43cc5ce commit 9c96c7f

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

Documentation/technical/http-protocol.txt

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,6 @@ server advertises capability `allow-tip-sha1-in-want`.
335335
have_list = *PKT-LINE("have" SP id LF)
336336

337337
TODO: Document this further.
338-
TODO: Don't use uppercase for variable names below.
339338

340339
The Negotiation Algorithm
341340
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -346,15 +345,15 @@ The computation to select the minimal pack proceeds as follows
346345

347346
C: Use ref discovery to obtain the advertised refs.
348347

349-
C: Place any object seen into set ADVERTISED.
348+
C: Place any object seen into set `advertised`.
350349

351-
C: Build an empty set, COMMON, to hold the objects that are later
350+
C: Build an empty set, `common`, to hold the objects that are later
352351
determined to be on both ends.
353352

354-
C: Build a set, WANT, of the objects from ADVERTISED the client
353+
C: Build a set, `want`, of the objects from `advertised` the client
355354
wants to fetch, based on what it saw during ref discovery.
356355

357-
C: Start a queue, C_PENDING, ordered by commit time (popping newest
356+
C: Start a queue, `c_pending`, ordered by commit time (popping newest
358357
first). Add all client refs. When a commit is popped from
359358
the queue its parents SHOULD be automatically inserted back.
360359
Commits MUST only enter the queue once.
@@ -363,14 +362,14 @@ C: Start a queue, C_PENDING, ordered by commit time (popping newest
363362

364363
C: Send one `$GIT_URL/git-upload-pack` request:
365364

366-
C: 0032want <WANT #1>...............................
367-
C: 0032want <WANT #2>...............................
365+
C: 0032want <want #1>...............................
366+
C: 0032want <want #2>...............................
368367
....
369-
C: 0032have <COMMON #1>.............................
370-
C: 0032have <COMMON #2>.............................
368+
C: 0032have <common #1>.............................
369+
C: 0032have <common #2>.............................
371370
....
372-
C: 0032have <HAVE #1>...............................
373-
C: 0032have <HAVE #2>...............................
371+
C: 0032have <have #1>...............................
372+
C: 0032have <have #2>...............................
374373
....
375374
C: 0000
376375

@@ -393,38 +392,38 @@ A single "want" or "have" command MUST have one hex formatted
393392
SHA-1 as its value. Multiple SHA-1s MUST be sent by sending
394393
multiple commands.
395394

396-
The HAVE list is created by popping the first 32 commits
397-
from C_PENDING. Less can be supplied if C_PENDING empties.
395+
The `have` list is created by popping the first 32 commits
396+
from `c_pending`. Less can be supplied if `c_pending` empties.
398397

399-
If the client has sent 256 HAVE commits and has not yet
400-
received one of those back from S_COMMON, or the client has
401-
emptied C_PENDING it SHOULD include a "done" command to let
398+
If the client has sent 256 "have" commits and has not yet
399+
received one of those back from `s_common`, or the client has
400+
emptied `c_pending` it SHOULD include a "done" command to let
402401
the server know it won't proceed:
403402

404403
C: 0009done
405404

406405
S: Parse the git-upload-pack request:
407406

408-
Verify all objects in WANT are directly reachable from refs.
407+
Verify all objects in `want` are directly reachable from refs.
409408

410409
The server MAY walk backwards through history or through
411410
the reflog to permit slightly stale requests.
412411

413-
If no WANT objects are received, send an error:
412+
If no "want" objects are received, send an error:
414413
TODO: Define error if no "want" lines are requested.
415414

416-
If any WANT object is not reachable, send an error:
415+
If any "want" object is not reachable, send an error:
417416
TODO: Define error if an invalid "want" is requested.
418417

419-
Create an empty list, S_COMMON.
418+
Create an empty list, `s_common`.
420419

421420
If "have" was sent:
422421

423422
Loop through the objects in the order supplied by the client.
424423

425424
For each object, if the server has the object reachable from
426-
a ref, add it to S_COMMON. If a commit is added to S_COMMON,
427-
do not add any ancestors, even if they also appear in HAVE.
425+
a ref, add it to `s_common`. If a commit is added to `s_common`,
426+
do not add any ancestors, even if they also appear in `have`.
428427

429428
S: Send the git-upload-pack response:
430429

@@ -440,7 +439,7 @@ stream 1. Progress messages from the server side MAY appear
440439
in stream 2.
441440

442441
Here a "closed set of objects" is defined to have at least
443-
one path from every WANT to at least one COMMON object.
442+
one path from every "want" to at least one "common" object.
444443

445444
If the server needs more information, it replies with a
446445
status continue response:

0 commit comments

Comments
 (0)