]> source.dussan.org Git - jgit.git/commit
DfsGarbageCollector: Add setter for reflog expiration time. 18/1203218/10
authorSaril Sudhakaran <saril.ks@gmail.com>
Tue, 29 Oct 2024 05:17:01 +0000 (00:17 -0500)
committerIvan Frade <ifrade@google.com>
Thu, 31 Oct 2024 17:33:31 +0000 (17:33 +0000)
commit7c092ab66e27b3ae68c7fed6d300b8645f7e4173
treef85d0003fd61904b1b726ae219327528689890fc
parent52e3e75953582221fb10733a7a5d67c9d673cf75
DfsGarbageCollector: Add setter for reflog expiration time.

JGit reftable writer/compator knows how to prune the history, but the
DfsGarbageCollector doesn't expose the time limit.

Add a method to DfsGarbageCollector to set the reflog time limit.
This value is then passed to the reftable compactor. Callers usually
pass here the value from gc.reflogExpire.

The reflog block length is stored in 24 bits [1], limiting the size to
16MB. I have observed that in repositories with frequent commits,
reflogs hit that size in 6-12 months.

[1] https://git-scm.com/docs/reftable

Bug: jgit-96

Change-Id: I8b32d6d2b2e1d8af8fb7d9f86225d75f1877eb2f
org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollectorTest.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsGarbageCollector.java