Skip to content

filter refs by spec #532

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 68 commits into from
Sep 16, 2022
Merged

filter refs by spec #532

merged 68 commits into from
Sep 16, 2022

Conversation

Byron
Copy link
Member

@Byron Byron commented Sep 12, 2022

Tasks

  • fetchhead parsing not actually needed for baseline
  • baseline test using git fetch with a local remote and output
  • sketch an API for fetch-based matching
  • handle partial refs using standard precedence rules
  • glob based matching
  • multi-matching and exclusions
  • validation
  • assure glob destinations are full ref names
  • determine ambiguity by weak and strong matches, i.e. those who are partial and thus ambiguous with those who are not.
  • deletions in fetches == HEAD
  • find a way to get rid of todo()
  • assure to skip local symbolic refs done by caller
  • actually use the gitoxide credentials helper in Remote

Next

  • integrate mappings with git-repository
  • gix remote sub-command to display information about what would be done

Predecessor

It's wrong though, and it turns out that for proper matching, it would
need probably need a normalization step to turn partial ref-specs into
full names, and from there the matching must also provide tracking
branch information or generally, the other side of the spec for later
updates.
Both differ as pattern on the command-line of ls-remote are just that,
without needing to be parsed as ref-spec. Thus many pattenrs there
seem to work when they should fail (if they were a ref-spec).

It's worth noting though that patterns which are source-only can
technically work just like a pattern, which would certainly make
them more flexible.
Even though not immediately required for baselines, it will be useful
to have fetchhead related types and writing capabilities.
Turns out that `tail +2` or channel redirection may reorder lines, or
the timing is very different to cause certain output to end up at
the end of the stream.

Maibe `tail +2` just works differently.
…`MatchGroup` (#450)

The group can handle things like ambiguity which can later lead to
rejection and error message generation.
These are single-refspec matches without anything added to them. We
might just go straight to matchgroups actually as it it make handling
types easier. Let's see.
…450)

It's also a way to normalize input strings as there is only one way
to serialize instructions, which themselves are already normalized
towards what's possible.
still need to check expectations though.
The new data model makes it easier to apply negations and handle a set
of edges prior to dealing with conflicts.
This makes it easier to test and cleaner as well.
And most importantly, it seems to integrate nicely with everything
that's already there.
Now it seems en-par with the git implementation, which also manages
without `git-glob`.
Our matching is too broad in case of negations, which requires full ref
names.

This is something we could reject early actually.
Git is more lenient, but will then fail to match against such patterns
which seems like avoidable surprising behaviour.
Just have to figure out a decent API for that.
however, it's not actually correct as git ignores these entirely.
Still we don't handle (or trigger) any santiization.
…it. (#450)

Looked for
"warning: refs/remotes/origin/branch1 usually tracks refs/heads/branch1, not refs/heads/branch2""

but it seems to take more to get it. Ultimately it's about multiple
destinations, and that's caught either way.
@Byron Byron merged commit fd14489 into main Sep 16, 2022
@Byron Byron deleted the filter-refs branch September 16, 2022 08:47
@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