fix(git)!: Default to net.git-fetch-with-cli if git is present - #17329
Open
epage wants to merge 2 commits into
Open
fix(git)!: Default to net.git-fetch-with-cli if git is present#17329epage wants to merge 2 commits into
epage wants to merge 2 commits into
Conversation
This changes the default for how we fetch to use the git CLI if present for better conformity and performance without breaking people (yet) who don't have it. Part of rust-lang#17227
Collaborator
|
r? @weihanglo rustbot has assigned @weihanglo. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Member
A possible upstream fix: libgit2/libgit2#7346 |
weihanglo
reviewed
Aug 16, 2026
| } | ||
|
|
||
| fn is_git_cli_present() -> bool { | ||
| #[tracing::instrument(skip_all)] |
Member
There was a problem hiding this comment.
I think before making it default, we may want to make sure:
- What the minimum required Git CLI version we depend on.
- This doesn't need to be precise, but at least we figure out an approximate.
- What Git CLI v3 would ship and whether it would be hard to keep our compatibility story: https://git-scm.com/docs/BreakingChanges#_git_3_0.
- Looked over the proposed change, refutable and sha256 may require a bit more attention, as old Git may not be able to read the new index format.
- If there is any more defaults we need to make explicit and opt-out, it is better to as early as possible. (e.g.
safe.bareRepositorythough we already setGIT_DIRexplicitly for fetch in git-fetch-with-cli: SetGIT_DIRfor bare repository compatibility #14860).
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR try to resolve?
This changes the default for how we fetch to use the git CLI if present for better conformity and performance without breaking people (yet) who don't have it.
Part of #17227
How to test and review this PR?
I have triaged open issues related to
git-fetch-with-cli.corrupt_git.rsis an interesting case. From what an agent told me that sounds reasonable, we hit an infinite loop in libgit2. We should report that but not feeling it is bad enough to be a blocker for merging this, especially since people are using a sparse index.Future goals:
Future steps:
gitcheck, always defaulting to git-cli