Skip to content
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

Support shallow fetch through net.git-fetch-with-cli #14956

Open
weihanglo opened this issue Dec 18, 2024 · 0 comments
Open

Support shallow fetch through net.git-fetch-with-cli #14956

weihanglo opened this issue Dec 18, 2024 · 0 comments
Assignees
Labels
A-git Area: anything dealing with git C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review

Comments

@weihanglo
Copy link
Member

weihanglo commented Dec 18, 2024

Problem

#13285 tracks the ability of fetching registry index and git dependencies in “shallow fetch” mode. We have both libgit2 and gitoxide backend supporting this. Our third git backend, the famous "git" CLI, hasn't yet supported the feature.

During the discussion of stabilizing shallow fetch on Zulip, we would like to see net.git-fetch-with-cli have this feature as well, for a better consistency among each git backend.

Proposed Solution

The function drives git CLI is fetch_with_cli. Need to

  • Pass the correct flags to git to replicate what fetch_with_gitoxide and fetch_with_libgit2 have done for shallow fetches.
  • Ensure the cloned/fetched/checkouted repositories be in correct locations.
    Currently they should be under ~/.cargo/git/{db,checkout}/*-shallow, and ~/.cargo/registry/index/*-shallow
  • Shallow cloned repository created from one backend must be usable for other backends.

Notes

No response

@weihanglo weihanglo added A-git Area: anything dealing with git C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review labels Dec 18, 2024
@epage epage self-assigned this Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-git Area: anything dealing with git C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review
Projects
None yet
Development

No branches or pull requests

2 participants