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

let git decide when to run gc #4495

Open
matthiaskrgr opened this issue Sep 15, 2017 · 3 comments
Open

let git decide when to run gc #4495

matthiaskrgr opened this issue Sep 15, 2017 · 3 comments
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

@matthiaskrgr
Copy link
Member

fe5a5c7 added some logic to look into .git and run git gc if needed.

However git already has this implemented, there is a git gc --auto.
tl;dr: it checks some threshold and if it's exceeded, runs the gc, otherwise not.
Docs:

git gc --auto
With this option, git gc checks whether any housekeeping is required; if not, it exits without performing any work.
Some git commands run git gc --auto after performing operations that could create many loose objects.

Housekeeping is required if there are too many loose objects or too many packs in the repository. 
If the number of loose objects exceeds the value of the gc.auto configuration variable,
then all loose objects are combined into a single pack using git repack -d -l.
Setting the value of gc.auto to 0 disables automatic packing of loose objects.

If the number of packs exceeds the value of gc.autoPackLimit, 
then existing packs (except those marked with a .keep file) are consolidated into a single pack by using the -A option of git repack. 
Setting gc.autoPackLimit to 0 disables automatic consolidation of packs.

https://git-scm.com/docs/git-gc#git-gc---auto

I can have a look at making it use git gc --auto instead.

As for compatibility I don't think there will be any issues since gc --auto was added in 2007:
git/git@2c3c439

@alexcrichton
Copy link
Member

Sounds good to me!

@carols10cents carols10cents 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` labels Oct 3, 2017
matthiaskrgr added a commit to matthiaskrgr/cargo that referenced this issue Nov 22, 2017
This will allow git to decide when to run gc by itself and will honor userside settings.
Implements rust-lang#4495
@dwijnand
Copy link
Member

Perhaps once (and if) we switch off of AppVeyor to Travis CI Windows (#6346) we could fix this.

@epage epage added the S-accepted Status: Issue or feature is accepted, and has a team member available to help mentor or review label Oct 17, 2023
@epage
Copy link
Contributor

epage commented Oct 17, 2023

If someone picks this up, be sure to check out #4656, particularly around the discussions of

  • Testing and cross-platform coverage
  • Configuration
  • Performance

It might be a viable solution to suggest that we reject this.

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

5 participants