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

reason for not using/supporting --aggressive with git gc? #639

Open
kmyali opened this issue Jan 31, 2025 · 0 comments
Open

reason for not using/supporting --aggressive with git gc? #639

kmyali opened this issue Jan 31, 2025 · 0 comments

Comments

@kmyali
Copy link

kmyali commented Jan 31, 2025

I have a 20-year-old 15G repo that filter-repo brings down to 1.9G. When i run git gc --agressive after git filter-repo, the repo goes down to 1.5G, which is a 21% decrease in size. This is a one-time operation. I plan to create a new repo out of this and have my team clone the new repo.

git gc docs mention some concerns about --aggressive:

This will throw away any existing deltas and re-compute them, at the expense of spending much more time on the repacking.

The effects of this are mostly persistent, e.g. when packs and loose objects are coalesced into one another pack the existing deltas in that pack might get re-used, but there are also various cases where we might pick a sub-optimal delta from a newer pack instead.

It seems in my case the time spent is not significant, and the effect of possibly picking a sub-optimal delta do not matter much since there is an overall reduction in size.

They also mention:

It’s probably not worth it to use this option on a given repository without running tailored performance benchmarks on it. It takes a lot more time, and the resulting space/delta optimization may or may not be worth it. Not using this at all is the right trade-off for most users and their repositories.

I am not sure what they mean by "tailored performance benchmarks", but I understand there were some issues in the past with --aggressive using a --depth of 250 affecting the performance of future git operations, but it's now defaulting to 50 similar to the non-aggressive gc.


What I am looking to know is if there is some other reason git filter-repo doesn't support the --aggressive option in git gc ?

I searched previous issues and looked at the history of the repo all the way back to the commit where git gc was added to filter-repo but couldn't find context around it.

As i mentioned, this is a one-time operation my team is doing and having that extra bit of reduction in size will be beneficial in the long-term, so i would like to be aware of any additional pit-falls to using --aggressive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant