Re: Git network protocol

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



jeffpc@xxxxxxxxxxxxxx (Josef "Jeff" Sipek) writes:

> So, if I understand this correctly, multi_ack allows for multiple branches
> to be fetched using the same connection?

The original protocol without extension already allowed it.
Suppose the global history was like this:

       o-----------------------o---o---o---o---o---o---o---c---c---c
      /
 o---o---o---o---o---o---o---o---s---s---s

where the server side had 's', the client side had 'c', and both
of them had 'o'.  The objective is to update client with three 's'
commits.

The exchange would go like this without multi-ack:

	S: SHA-1 name1 -- for the rightmost 'o' on the top branch
        S: SHA-2 name2 -- for the rightmost 's' on the bottom branch
	C: want SHA-2 -- ask for the second branch tip
	C: have SHA1 -- the rightmost 'c' on the top branch
	C: have SHA1 -- the parent of the above
	C: have SHA1 -- the parent of the above
        C: have SHA1 -- the parent of the above, rightmost 'o' on the top.
        C: ... more have from the top branch.
	S: ACK -- for the rightmost 'o' on the top branch

During this exchange, the server learns that the client and the
server shares the rightmost 'o' on the top branch, but does not
learn about all the 'o' commits on the bottom branch, so it ends
up sending everything from the fork point to complete three 's'
commits.

The multi-ack extension was invented by Johannes to improve this
exchange.  It changes the protocol to let the server ACK with
"ACK continue".  After that, the client is expected to stop
traversing the parents of ACK-continue'd commit -- so it has a
chance to send the rightmost 'o' on the bottom branch.  When the
server sees it, it again gives an ACK, and the client soon runs
out have's to send and says "done".  In this case, the server
would have the rightmost 'o' commits on both branches to work
out the minimum set of objects to complete three 's' commits
that are missing from the client.

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]