-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Tracking Issue for -Zgitoxide
#11813
Comments
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Is it possible to enable this through environment variables somehow? I wasn't able to figure out any syntax that didn't run into this error:
(it may also be useful for this usecase to support an explicit |
I think I did that with the following, on stable:
|
It doesn't, it gives the same error message. The By actually trying to set it in [unstable.gitoxide]
fetch = true
shallow_index = true
shallow_deps = true
checkout = true
internal_use_git2 = false and > CARGO_UNSTABLE_GITOXIDE_FETCH=true CARGO_UNSTABLE_GITOXIDE_SHALLOW_INDEX=true CARGO_UNSTABLE_GITOXIDE_SHALLOW_DEPS=true CARGO_UNSTABLE_GITOXIDE_CHECKOUT=true CARGO_UNSTABLE_GITOXIDE_INTERNAL_USE_GIT2=false cargo build I do think it would be good to override the toml parser for this variable too so that you don't have to specify every single field. |
How is shallow cloning dependencies different than specifying the refspec (e.g. |
A refspec reduces the heads that you're requesting, so you don't get other unneeded branches being pulled down. But you still request the entire history from that head back to initial commit(s) of the repo. A shallow clone allows you to limit how much of the history you request, presumably for cargo's usecase it only needs to pull down the current commit of the requested head and can ignore the history entirely (though technically this is visible to |
Allows the default git/gitoxide configuration to be obtained from the ENV and config ### What does this PR try to resolve? The default git/gitoxide feautures config can be obtained througt `-Zgit` and `-Zgitoxide`. However, it cannot be obtained from environment variables or configurations. It's not very ergonomic. ### How should we test and review this PR? The previous commit explained the staus quo, the next commit addressed the problem. ### Additional information Inspired by #11813 (comment) See also #13285 (comment) ### Change of usage 1. Mirror Zgit/Zgitoxide when they parsed as string Specify the feature you like ``` CARGO_UNSABLE_GIT='shallow-deps' cargo fetch cargo fetch --config "unstable.git='shallow-deps'" cargo fetch -Zgit="shallow-deps" ``` 2. Specify partial fields when parsed as table ``` CARGO_UNSTABLE_GITOXIDE_FETCH=true cargo fetch ``` The rest fields will use Rust default value. That said, checkout and internal_use_git2 will be false. Besides, you can pass true to the whole feature to specify the pre-defined features. ``` CARGO_UNSTABLE_GITOXIDE=true cargo fetch ```
Summary
RFC: NoneNightly: gitoxide integration
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#gitoxide
Issues: Z-gitoxide
Original issue:
file://
Cargo-update: exceedingly slow progress on update when local registry/index is used and git-fetch-with-cli is false #9167.DS_Store
cargo-package: list of dirty files contains ignored files #8407With the ‘gitoxide’ unstable feature, all of the specified git operations will be performed by the
gitoxide
crate instead ofgit2
. This allowsgit2
to be replaced in full.Steps
Unstable feature sub-categories:
fetch
: all fetches are done with gitxide (gitoxide integration: fetch #11448)shallow_index
: the crates index will be a shallow clone (support for shallow clones and fetches withgitoxide
#11840)shallow_deps
: git dependencies will be a shallow clone (support for shallow clones and fetches withgitoxide
#11840)checkout
: plain checkouts with gitoxide (including submodule handling)package
: status checks, untracked files, excluded filesFurther tasks
gix_hash::Prefix
.cargo
actually uses.rev
but nothing found, cargo with shallow fetch should fetch full history as a fallback.Unresolved Issues
gitoxide
tracking issue to be able to replacegit2
in fullfile://
protocol without relying on thegit
binaryssh://
protocol without relying on thessh
binarygit2
or if unfeasible, assure users have a migration path. How to deal with this correctly is still to be determined.tempfile
is pinned to~3.3.0
temporarily (see gix-tempfile@4.1.1)gitoxide
itselfFuture Extensions
Some features not in libgit2 are good candidates for future extensions
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Implementation history
gitoxide
runs them #11830gix
to v0.41 to fix flaky auth tests. #11831gitoxide
#11840The text was updated successfully, but these errors were encountered: