lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] /etc/etckeeper/.git became enormous


From: Greg Chicares
Subject: Re: [lmi] /etc/etckeeper/.git became enormous
Date: Wed, 14 Sep 2022 00:13:05 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0

On 9/13/22 18:16, Vadim Zeitlin wrote:
> On Tue, 13 Sep 2022 15:50:43 +0000 Greg Chicares <gchicares@sbcglobal.net> 
> wrote:
> 
> GC> It seems that etckeeper might never trigger garbage collection.
> 
>  This might well be true, but if you use Git enough times interactively
> (and I often commit using it directly after making some changes in /etc),
> it should still happen. Would you have any non-default gc-related objects
> set by chance, e.g. gc.auto=0 or anything like that?

Configuration is just defaults--nothing exotic.

> Or is it only done
> automatically by the Git versions newer than the one installed on the
> server (I couldn't find quickly what was the first version which started
> running it automatically, but it changed a very long time ago).

This is git-1.8.3.1, which is almost seven years old.

> Or is it
> just due to you never running git directly?

Bingo.

This is a redhat host. I never run git directly in /etc .
I've installed etckeeper only to diagnose breakage caused
by the administrators overseas.

> GC> On a corporate server:
> GC> 
> GC> du -sh /etc/.git/objects/
> GC> 11G     /etc/.git/objects/
> GC> 
> GC> git gc
> GC> 
> GC> du -sh /etc/.git/objects/
> GC> 44M     /etc/.git/objects/
> 
>  Wow. I'm using etckeeper on dozens of machines and I didn't check all of
> them, but I've checked half a dozen and they all were between 10 and 64M
> before running git-gc and went down to between 5 and 40M afterwards. I
> can't even imagine what must have happened in order to have it grow to 11G.

On my debian-stable host, I installed etckeeper three years ago,
and I have 4.9M in that directory: megabytes, not gigabytes.
Running 'git gc' just now reduced it to 2.3M.

> GC> I created a script to automate this, following the advice here:
> GC> 
> GC> 
> https://www.turnkeylinux.org/forum/support/20111111/etckeeper-has-huge-git-repo-how-remove
> GC> 
> GC> #cat /etc/etckeeper/post-install.d/99git-gc
> GC> #!/bin/sh
> GC> exec git gc
> 
>  FWIW running it every time seems a bit wasteful

Sure, but OTOH this fix is minimal and tidy.

>  I'm still more curious how did it end up at 11G and why didn't git-gc run
> automatically anyhow...

I think the answer is that no one has ever run git manually in /etc,
but the administrators run daily scripts that somehow blow up /etc/.git .


reply via email to

[Prev in Thread] Current Thread [Next in Thread]