Skip to content
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

fetch pack #539

Merged
merged 115 commits into from
Sep 30, 2022
Merged

fetch pack #539

merged 115 commits into from
Sep 30, 2022

Conversation

Byron
Copy link
Member

@Byron Byron commented Sep 21, 2022

An abstraction to allow fetching a pack into bare and non-bare repositories.

Tasks

  • use ref-prefix argument to reduce list of sent tips for good measure
  • make fetch-negotiations available without delegate in git-protocol
  • sketch API for step-by-step fetch which stays under user control as much as possible
  • negotiate and write a pack naively
  • refactor test to be on-point for fetching (and faster as we need writable versions of it)
  • update heads according to fetch-map and keep information about what worked and what didn't (probably in the error case)
  • worktree aware 'is destination branch currently checked out' check
  • use lock-timeout configuration everywhere
    • support for packed-refs lock time
    • clear caches after config update
  • proper reflog messages

Next

  • fast determination of fast-forward, with the use of dates in the currently loaded 'level' nodes that will be iterated to determine a stop condition: if everything is already older than the commit we look for, stop.
  • use dry-run fetch in gix remote refs to provide more detailed information about what would be done to refs

Out of scope

  • async implementation
  • handling of non-force specs which require fast-forward checks
  • worktree updates
  • merges

Maybe this helps to understand how ls-refs extensions can be used.
…450)

This can greatly reduce the amount of refs sent.
That way, we can still see all remote refs if desired.
The latter could alter the way protocol interactions work, but we might
already do it correctly.
…450)

…that would force it to be 'static, which is something we excplicitly
cannot have. We need references to be contained within, if I remember
correctly.
#450)

It' can't fail, so no need to return `Result<_, Infallible>`.
…450)

After all, this is somewhat optional and the server stops once we
disconnect, and the called function may already have performed that
action.
The overhead required to make it work isn't worth the logic we are
enabling. Instead, it's OK to re-implement custom logic on the consumer
side based on this one.
…ansport_mut().configure()`. (#450)

This eventually will be used for all kinds of http settings and remote
settings, goal being to be zero-conf since everything comes from
git-config.
…he right way. (#450)

This works for all cases were a single program is compiled and there are
no dll boundaries, which I think is the way it will be for quite a
while.
…isition::Fail` instances. (#450)

This allows to configure the file-ref lock failure mode differently from
the packed-refs lock failure mode, which is exactly what `git` does as
well defaulting them to 100ms and 1000ms till lock acquisition gives up.
Previously it picked up the users configuration as it was loading
the standard git configuration, instead of the restricted one.
Unfortunately all tests are now liable to picking up GIT_ environment
variables which will affect those that create commits.
Maybe better control them right away or find another way to set the
time.
…d stability. (#450)

Note that this is only required as we freeze time using environment
variables, so `GIT_` is now allowed when opening repos.

There would be another way, which is controlling exactly what restricted
means.
…o need it. (#450)

This means, other tests are once again isolated by default
This is tested for worktrees as well, including deleted ones, and
validated by hand the git produces the same results.
Conflicts:
	git-transport/src/client/blocking_io/http/mod.rs
Remove spec_index field as it can be derived from the corresponding
mapping.
…lues of references. (#450)

That's more convenient than matching on the enum.
@Byron Byron mentioned this pull request Sep 30, 2022
7 tasks
@Byron Byron merged commit 3c49400 into main Sep 30, 2022
@Byron Byron deleted the fetch-pack branch October 1, 2022 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant