-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #13687 - linyihai:git-features-env, r=weihanglo
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 ```
- Loading branch information
Showing
3 changed files
with
345 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.