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.
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
feat: Support install directly from git repo #1162
feat: Support install directly from git repo #1162
Changes from all commits
89351df
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be for a future improvement, but would be useful to consider supporting some syntax or options for:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can support that by using fragment, e.g.
or maybe using query:
Not sure which one is more compatible with git url, I need more advice on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think doing whatever cargo and/or npm does is a good default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah and that will be compatible with
cargo-install
:so we would have to at least support
--branch
/--tag
/--rev
just likecargo-install
.I think
cargo-install
finds theCargo.toml
by the package name, so we can also do that incargo-binstall
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Byron I tried searching for how to checkout branch in gitoxide but only found this GitoxideLabs/gitoxide#358 which uses low-level APIs.
I also checked
gix::Repository
but I also failed to find one, seems like only way is to dive into the low-level APIs ofgix
to do this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, indeed, the combination of choosing a refspec that fetches the desired branch and checking out its tree afterwards is how
--branch
would be implemented. The question of how to deal with the implementation's limitations would still have to be answered though.I don't know what
filter
means in this context. Feel free to ignore if everything is clear to you though.cargo
still performs checkouts usinggit2
, and it's what I will be working to change from now on.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for confirmation of this!
Well that's unfortunate.
Our goal here is to have the same behavior as
cargo-install
when--git
is passed.I'm not sure whether it clones submodules though.
Thanks for the info, I will keep track of the adoption of
gitoxide
incargo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried
but somehow it still clones main.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be too hard to get everything done in one PR, while
gix
doesn't support checking out specific branch/tag/rev at clone.I will open a new tracking issue for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened tracking issue #1165 for this.