git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Improve support for 'git config gc.reflogExpire never'

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Mar 19, 2019, 09:30 UTC
Message-ID
<87a7hrdxee.fsf@evledraar.gmail.com>
In-Reply-To
<39a0796a-7220-1e81-e7fe-3bf7329ed7de@peda.net>
On Fri, Mar 08 2019, Mikko Rantalainen wrote:
Show 29 quoted lines
> 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:
> https://stackoverflow.com/questions/28092485/how-to-prevent-garbage-collection-in-git
> https://stackoverflow.com/questions/55043693/is-it-possible-to-get-git-gc-to-pack-reflog-objects

Just to add to Jeff's E-Mail, the case he's describing is something I wrote a stand-alone test case for here: https://public-inbox.org/git/87fu6bmr0j.fsf@evledraar.gmail.com/

Try to run it, it's probably the same behavior you're seeing, and it has nothing per-se to do with reflogs.

Previous: Jeff King
Message 3 of 3 in “Improve support for 'git config gc.reflogExpire never'”
  1. Mikko RantalainenMar 8, 2019
  2. Jeff KingMar 19, 2019
  3. Ævar Arnfjörð BjarmasonMar 19, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.