-
-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
integrate gix-negotiate
#861
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Byron
force-pushed
the
integrate-gix-negotiate
branch
3 times, most recently
from
May 26, 2023 08:53
46a1e86
to
3256523
Compare
Closed
1 task
Byron
force-pushed
the
integrate-gix-negotiate
branch
2 times, most recently
from
June 1, 2023 19:49
ce26df5
to
1c135e8
Compare
Byron
force-pushed
the
integrate-gix-negotiate
branch
13 times, most recently
from
June 6, 2023 08:30
ca2c746
to
4289f20
Compare
It seems homebrew `tree` keeps messing up directory counts, which may make it incompatible with CI and generaly makes it impossible to use in a cross-platform manner. Thus it was replaced with `find`.
Right now we don't handle them at all, which might lead to issues in huge repos.
…eplace`. The gitoxide specific variable wasn't needed in the first place.
This renames `graph::Commit` to `graph::LazyCommit` to make space for `graph::Commit` to be a fully owned. `LazyCommit::to_owned()` was added to obtain fully owned `Commit` instances. Rename `Graph::try_lookup_and_insert()` to `Graph::try_lookup_or_insert()` and `Graph::try_lookup_and_insert_default()` to `Graph::try_lookup_or_insert_default()` Additionally, add the `peek()` and `iter_unordered()` method to the `PriorityQueue`, along with an implementation for `Clone` Rename `PriorityQueue::iter_random()` to `::iter_unordered()`.
This makes the graph used in `gix-negotiate` shareable by callers, which can do their own traversal and store their own flags. The knowlege of this traversal can be kept using such shared flags, like the `PARSED` bit which should be set whenever parents are traversed. That way we are able to emulate the algorithms git uses perfectly, as we keep exactly the same state.
Provides a way to learn about loose database paths that are provided by git alternates.
This special protocol kicks in when `git` serves `file://` directly and no version number is specified. Then it doesn't advertise capabilities at all, but shows 0000 right away. Make sure we can parse it, and show it by adding `Version::V0` as well.
…uments. When arguments are used, haves are reset every round in stateless protocols, while everything else is repeated. However, this also means that previously confirmed common commits aren't repeated unless this is specifically implemented by the user of `Arguments`. That caller can now easily determine if negotiations have to be compensated for. Please note that `Arguments` explicitly doesn't implement repeating of all prior arguments, which would also repeat a lot of *in-vain* haves.
Previously it would be added like it's V2 arguments, which makes using it in V1 impossible.
This is done by working around another V1 negotiation oddity by exploiting client-side knowledge. For very old servers, we probably wouldn't be able to do multi-rounds without dead-locking, but with recent-enough (probably 10 years or so) old git servers all should work fine. All this to not actually have to implement the V1 strangeness, allowing our code to work smoothly with all permutations of stateless/stateful connections and V1/V2 interactions, with a single high-level implementation essentially.
Byron
force-pushed
the
integrate-gix-negotiate
branch
from
June 6, 2023 13:48
4289f20
to
022e9d8
Compare
Thanks to it we are finally able to do pack negotiations just like git can, as many rounds as it takes and with all available algorithms. Works for V1 and V2 and for stateless and stateful transports.
Byron
force-pushed
the
integrate-gix-negotiate
branch
from
June 6, 2023 15:03
022e9d8
to
7983f6f
Compare
This was referenced Jun 7, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow-up of #855
Tasks
.parsed
check equivalents where feasible.&mut
to each trait methodsupport for replacement objects in commit-graph lookups.- this is implicitly implemented, at least so I think.ref-in-want
, useref-in-want
to better handle busy HTTP reposprotocol.version
as part of config tree, use hereArguments
work as we think - I think haves have to be re-added each time, which means we can remove the crate-status comment if we re-add acks only on every trip.Out of scope (for follow-up PR)
Research
Naive
is really the first part of the 'common' algorithm which sends most of the refs as specified by the refspec. What's sent next is implemented by the algorithm, which we don't really implement at all.git fetch --negotiate-only
it's possible to setup baseline expectations as we see the common commits produced by an algorithm, given a specific input of--negotiation-tips
, which is equivalent to controlling the starting point of the negotiationnoop
truly does nothing and is supposed to be used for refetching certain objects if a filter was used previously. It by itself wouldn't even trigger a full pack to be fetched as it also won't put anywant
line.mark_complete_and_common_ref
,mark_tips
andfor_each_cached_alternate
(add tips of alternates) is the same sequence both in V1 and V2, then it senseHAVE
lines as produced by the negotiator, feedACK
lines to it.--negotiate-only
does its very own negotiation and thus isn't comparable - probably for V1 compatibility, we want to packet line tracing. However,negotiate_using_fetch
provides a clean overview of what negotiation should be.HAVE
lines starts at 16, and is then increased with each round according to the rules innext_flush
.GIT_TRACE_PACKET=1
output shows a failure mode with multi-round negotiation. We hang because we keep reading acknowledgements past theNAK