Skip to content

Conversation

@alilleybrinker
Copy link
Member

This commits adds a new Finder struct which matches different sources of GitOids against a known set of GitOids, returning both an identifier and the matching GitOid itself, along with reporting any errors that arise when resolving the new GitOids.

The docs for the Finder struct spell it out the clearest. This design is centered around the new IntoIdentifiedGitOid trait, which is implemented for a variety of existing types. The goal of this is to allow the Finder to be generic over things which produce GitOids, so that, for example, someone could add a mechanism to resolve GitOids from a Url without changing any existing code.

Signed-off-by: Andrew Lilley Brinker alilleybrinker@gmail.com

@alilleybrinker alilleybrinker added type: feature New feature or request crate: gitoid Relating to the gitoid crate labels Dec 8, 2022
@alilleybrinker
Copy link
Member Author

@nellshamrell what do you think? This involves changes to the trait bounds for GitOid construction, requiring Seek for new_from_reader. I think this is the right call, but I'd love another pair of eyes.

@nellshamrell
Copy link
Collaborator

This looks outstanding! Looks like there are some merge conflicts, just let me know when those are resolved.

Since we are pre 1.0, I am fine with changing the trait bounds for GitOid construction.

This commits adds a new `Finder` struct which matches different
sources of `GitOid`s against a known set of `GitOid`s, returning
both an identifier and the matching `GitOid` itself, along with
reporting any errors that arise when resolving the new `GitOid`s.

The docs for the `Finder` struct spell it out the clearest. This
design is centered around the new `IntoIdentifiedGitOid` trait,
which is implemented for a variety of existing types. The goal of
this is to allow the `Finder` to be generic over things which
produce `GitOid`s, so that, for example, someone could add a
mechanism to resolve `GitOid`s from a `Url` without changing any
existing code.

Signed-off-by: Andrew Lilley Brinker <alilleybrinker@gmail.com>
Copy link
Collaborator

@nellshamrell nellshamrell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay!

@nellshamrell nellshamrell merged commit b7748cf into omnibor:main Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

crate: gitoid Relating to the gitoid crate type: feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants