Index: use a bare repository rather than a non-bare repository without checkout
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 15.5k
- Forks
- 3k
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 51
Description
Ever since https://github.com/rust-lang/cargo/issues/4015 , Cargo avoids checking out the index as a working directory; however, cargo still creates the repository as a non-bare repository with a working directory that just doesn't have any files checked out.
Ideally, I'd love to store this as a bare repository instead, where git doesn't expect to have a working directory.
This would have a few advantages:
- Git tools would understand the repository better, making it easier to explore and understand and debug.
- Tools that want to check
.cargointo git (for caching or testing or other purposes) would be able to do so; git can track arepo.gitbare repository, but cannot track a.gitdirectory.
(This was discussed briefly in a Cargo team meeting; I'm filing this issue as a follow-up.)
If we don't worry about a one-time re-download of the index, we could solve this by just switching to a bare repository.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating Cargo's index repository creation and checkout logic, then inspect any existing tests around index initialization. Compare the current non-bare setup with the bare-repository behavior described here, including the one-time re-download tradeoff. Done means the index is stored as a bare repository and relevant behavior is covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, rust
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100