Skip to content

Remote abstraction #475

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

Merged
merged 132 commits into from
Aug 22, 2022
Merged

Remote abstraction #475

merged 132 commits into from
Aug 22, 2022

Conversation

Byron
Copy link
Member

@Byron Byron commented Aug 7, 2022

First steps towards interacting with and using remotes.

Tasks

  • list existing remotes names
  • find remote by name
    • deduplicate ref-specs (by instruction), in a stable way.
  • apply insteadOf urls and use trust based filtering to use or discard values
  • remote by reference
  • Head::into_remote(…)
  • 'anonymous' remotes, those without name
  • remote failure mode from git_url::Url::to_bstring()
  • see if invalid rewrite URLs should rather be ignored instead of erroring - at least be sure there is a workaround (and there is)
  • a way to add refspecs to anonymous remotes (or remotes in general)
  • connect
    • quick-error to thiserror
    • limited async connect (port from gitoxide-core) needs a runtime choice, how to abstract that?
    • differentiate between async and blocking io versions and setup testing accordingly
    • list remote refs - assure V2 based interactions are possible, that is, multiple commands per connection
  • gix remote refs command to dry-run a fetch essentially showing what would be fetched, which branches would be updated, and how many remote references have been ignored due to refspec.
  • correct handling of boolean values in git-config

For follow-up PR

  • consider protocol.*.allow
  • filter remote refs by ref-spec and provide information on which local refs would be updated

Out of scope

  • support for custom credential helper programs and usage of the credential.helper configuration (via git-sec)
  • proxy support
  • mirror support
  • All information related to pushing
  • promisor objects
  • branch.<name>.merge support, as we don't yet merge anything and fetching still fetches the entire refspec of as configured in the remote.

Prepare to free up the remote module for actual remote handling
@Byron Byron mentioned this pull request Aug 7, 2022
27 tasks
Byron added 28 commits August 7, 2022 16:44
Needs more tests to see it actually finds remotes with names.
With many tests still missing.
…heir instruction (#450)

That way, it's possible to treat dissimilar yet effectively equal specs
like they are equal.
… URLs. (#450)

They can contain paths, which is why `String` can't repsent a URL
losslessly.

For HTTP urls these are ultimately UTF-8 strings though.
Byron added 24 commits August 22, 2022 10:46
Prepare for `protocol` configuration.
…i_]value`. (#450)

This makes clear that the method will fail if the value doesn't yet
exist.
…lues, and make the value itself easier to provide. (#450)
…ues in memory. (#450)

It's a first step towards writing changes back to disk, which can work
already, but probably wouldn't as we currently don't localize changes
to only one section type, i.e. Api, but instead may change values
from other sections.
…ue separator. (#450)

These make a difference as those without `=` are considered boolean
true.
Currently pushing onto a section is the only way to write them.
…t. (#450)

This also changes behaviour, but merely removes a hack in `Boolean`
which considered empty strings true, even though they are supposed to be
false.
…fs` (#450)

The functinality is the same, but the latter is built on top of a
repository which is slightly less flexible, but preferable over
maintaining a non-repo version.
… false. (#450)

This is even consistent when no booleans are used, such that `a` has no
value as if it is not present, it's only available for booleans which
must be specified.
@Byron Byron merged commit 39d585d into main Aug 22, 2022
@Byron Byron deleted the remote-ls-refs branch August 22, 2022 11:48
This was referenced Sep 5, 2022
@Byron Byron mentioned this pull request Sep 16, 2022
8 tasks
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