Improve support for 'git config gc.reflogExpire never'
- Date: Fri, 8 Mar 2019 10:27:11 +0200
- From: Mikko Rantalainen <mikko.rantalainen@xxxxxxxx>
- Subject: Improve support for 'git config gc.reflogExpire never'
If I configure bare repo with
git config gc.pruneExpire never
git config gc.reflogExpire never
then git will never garbage collect any commit ever stored in the repo.
This is what I want.
However, all commits referenced only via reflog are kept as loose
objects and will not be included in packs. In long run this will cause
warning: There are too many unreachable loose objects; run 'git prune'
to remove them.
and the performance of the repository will slowly decrease.
If I have understood correctly, git should notice that reflog will keep
referenced commits forever and include all those commits in packs
instead of keeping those as loose forever.
A more generic behavior might be to always compress all loose commits in
(one?) special pack so the performance would stay good even if
gc.reflogExpire is very long instead of "never".
Discussion about this case: