]> source.dussan.org Git - jgit.git/commit
Improve native Git transport when following repository 15/2715/1
authorShawn O. Pearce <spearce@spearce.org>
Mon, 14 Mar 2011 22:36:17 +0000 (15:36 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Mon, 14 Mar 2011 23:57:54 +0000 (16:57 -0700)
commit9b917ac169e8cf33f0fbbec07c0e89cbc180cfd7
treed6ad086926adcd22c0f94b0242c2ac484087c20d
parent317d8e2e8dbda0c9dc625b7fd439f78a60079d09
Improve native Git transport when following repository

If the client is only following the remote repository and has not
created any new non-common commits, the client will wind up sending
a "have %s" line for each tag in the repository.  For some projects
like git.git, this is 339 tags and growing, resulting in more than
16 KiB needing to be POSTed over 12 HTTP requests.

Teach UploadPack (server side) to always execute the okToGiveUp()
logic at least once per negotiation round to determine if the server
can compute a pack right now.  If it can, shove in an "ACK %s ready"
message to tell the client this and try to prevent receiving ancient
tags in future negotiation rounds.

Teach BasePackFetchConnection (client side) to honor a "ACK %s ready"
from the remote and break out of its SEND_HAVE loop once the remote
knows it can create a pack.  This avoids sending the remaining 307
tags of git.git.

These two changes together reduce the number of HTTP RPCs from 13
down to 3 in order to fetch from git.git over smart HTTP.  If either
side is missing the change, the older behavior (and its 13 RPCs)
is used.

Change-Id: I64736318fd0abf9ee5e56bd0b737707adb580b37
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit/src/org/eclipse/jgit/transport/BasePackFetchConnection.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java