Replies: 3 comments 3 replies
-
Thanks for sharing and for the detailed description of the feature - I think I have a pretty good understanding of what you are trying to achieve.
On protocol level, you should be able to specify filter options already.
Generally, I am going by the documentation mostly and what's observable when looking at git traffic, and it's not always entirely clear to me how the protocol is supposed to work. Thus, some assertions are mostly a test of my current understanding, and running into them would mean my understanding was wrong. Thanks to your work, this should be smoothened out over time, as the code is run under different conditions. With that in mind, all I needed this code to do is to do typical fetches as described. Doing multiple fetches in a row should work with V2 due to the command architecture, even though some APIs might still be geared towards a certain use-case. This can be considered a shortcoming that you are invited to fix as you see fit (while providing test-cases that motivate these fixes). My recommendation is to make it work in your fork and then we see how these changes can be integrated.
This operation is already fully streaming and step-wise, so progress reporting is granular and interruption work as well. That said, it does need access to disk space to write the pack to disk while streaming for later mapping and lookup during the resolution stage. If this should be in memory too you would have to take the parts of the I hope that helps. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your prompt feedback! I think I can fix the assertion and fetch loop with relatively simple changes. |
Beta Was this translation helpful? Give feedback.
-
It turns out that no code change is needed!
|
Beta Was this translation helpful? Give feedback.
-
Hi, I'm trying to implement something like
git cat-file --batch
but talks to the remote server.More specifically, I'd like to:
want
s,filter("tree:0")
to avoid sub-tree traversal, andshallow
to prevent commit traversal.The gix crates are pleasant to use and mostly just work. But I run into some issues. I wonder if they are designed as expected:
gix-protocol/src/fetch/arguments/blocking_io.rs
. It hasassert!(add_done_argument, "If there are no haves, is_done must be true.");
. In my case there are a fewwant
s but nohave
. I have to remove this assertion. Should this assertion be changed somehow?gix_protocol::fetch
expectsreceive_pack
to be called once and exits the'negotiation
loop. In my case I'd like to try multiple round-trips - somewant
s followed byreceive_pack
, then repeatwant
s andreceive_pack
. Should thefetch
API be changed to support multiplereceive_pack
somehow? Or am I expected to callfetch
multiple times on a same transport (in this case shouldfetch
take a reference totransport
instead of consuming it)?There is another minor issue. It's not blocking, though:
receive_pack
'sinput: impl BufRead
togix_pack::Bundle::write_to_directory
then useBundle::at(path)
to read it. It'd be nice if theinput
can be parsed in-memory or even better in a streaming fashion (so memory usage is bounded).The test script I use can be found here. I'm using gixtoxide at a3c283f. Note I removed this
assert!
for it to run.Beta Was this translation helpful? Give feedback.
All reactions