Use a streaming indexer when fetching #628

Closed
wants to merge 12 commits into
from

Conversation

Projects
None yet
2 participants
Owner

carlosmn commented Apr 13, 2012

This is the streaming indexer work and its integration in the current fetch code, which makes it work again on non-Windows systems and makes the git_remote_download() API a lot less stupid.

@nulltoken is this something you can wrap in the bindings easily?

src/mwindow.c
@@ -89,6 +89,7 @@ void git_mwindow_scan_lru(
{
git_mwindow *w, *w_l;
+ puts("LRU");
src/mwindow.c
@@ -246,6 +249,7 @@ static int git_mwindow_close_lru(git_mwindow_file *mwf)
if (left)
*left = (unsigned int)(w->window_map.len - offset);
+ fflush(stdout);
Owner

carlosmn commented Apr 14, 2012

Damn, I was sure the fixes had taken care of that

carlosmn added some commits Apr 11, 2012

indexer: Add git_indexer_stream_finalize()
Resolve any lingering deltas, write out the index file and rename the
packfile.
indexer: start writing the stream indexer
This will allow us to index a packfile as soon as we receive it from
the network as well as storing it with its final name so we don't need
to pass temporary file names around.
filebuf: add option not to buffer the contents at all
The new indexer needs to be able to bypass any kind of buffering, as
it's trying to map data that it has just written to disk.
fetch: use the streaming indexer when downloading a pack
This changes the git_remote_download() API, but the existing one is
silly, so you don't get to complain.

The new API allows to know how much data has been downloaded, how many
objects we expect in total and how many we've processed.
examples: run fetch in a background thread
This allows us to give updates on how it's doing
transports: buffer the git requests before sending them
Trying to send every single line immediately won't give us any speed
improvement and duplicates the code we need for other transports. Make
the git transport use the same buffer functions as HTTP.
revwalk: return GIT_EREVWALKER earlier if no references were pushed
In the case that walk->one is NULL, we know that we have no positive
references, so we already know that the revwalk is over.
Owner

carlosmn commented Apr 16, 2012

It turns out I had broken clone for a bit, but now it works just fine.

@carlosmn carlosmn referenced this pull request Apr 17, 2012

Closed

RFC: fetch fixes #631

Owner

vmg commented Apr 19, 2012

Merged manually.

@vmg vmg closed this Apr 19, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment