# git gc/prune runs again and again

3 messages from 2015-11-03 to 2015-11-03. Participants: Andreas Krey, Duy Nguyen.
Thread: https://gitlist.dev/t/40717

## Andreas Krey, 2015-11-03 12:44

Subject: git gc/prune runs again and again
Message-ID: <20151103124420.GA10946@inner.h.apk.li>
URL: https://gitlist.dev/e/20151103124420.GA10946%40inner.h.apk.li

```
Hi all,

I have a bit of an annoying behaviour in git gc;
there is a repo I regularly do a fetch in, and
this kicks off a gc/prune every time. I remember
there being a heuristic with being that many files
in .git/objects/17 as the gc trigger.

Which is unfortunate if the gc does not actually
reduce the number of files there because they
aren't old enough => gc comes right back.

What can I do there? (This git is a bit old, 2.2.2)

Andreas


-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800

```

## Duy Nguyen, 2015-11-03 15:01

Subject: Re: git gc/prune runs again and again
Message-ID: <CACsJy8DMyjaZ_jKz4B93e6gSgV7ensORqxD-WYOYL9=9SV5tLw@mail.gmail.com>
URL: https://gitlist.dev/e/CACsJy8DMyjaZ_jKz4B93e6gSgV7ensORqxD-WYOYL9%3D9SV5tLw%40mail.gmail.com
In-Reply-To: <20151103124420.GA10946@inner.h.apk.li>

```
On Tue, Nov 3, 2015 at 1:44 PM, Andreas Krey <a.krey@gmx.de> wrote:
> Hi all,
>
> I have a bit of an annoying behaviour in git gc;
> there is a repo I regularly do a fetch in, and
> this kicks off a gc/prune every time. I remember
> there being a heuristic with being that many files
> in .git/objects/17 as the gc trigger.
>
> Which is unfortunate if the gc does not actually
> reduce the number of files there because they
> aren't old enough => gc comes right back.
>
> What can I do there? (This git is a bit old, 2.2.2)

Run "git prune". 2.2.2 hides this suggestion to run git-prune in this
case. The next git version will show it back.


-- 
Duy

```

## Andreas Krey, 2015-11-03 15:21

Subject: Re: git gc/prune runs again and again
Message-ID: <20151103152109.GA15036@inner.h.apk.li>
URL: https://gitlist.dev/e/20151103152109.GA15036%40inner.h.apk.li
In-Reply-To: <CACsJy8DMyjaZ_jKz4B93e6gSgV7ensORqxD-WYOYL9=9SV5tLw@mail.gmail.com>

```
On Tue, 03 Nov 2015 16:01:24 +0000, Duy Nguyen wrote:
....
> > I have a bit of an annoying behaviour in git gc;
> > there is a repo I regularly do a fetch in, and
> > this kicks off a gc/prune every time. I remember
> > there being a heuristic with being that many files
> > in .git/objects/17 as the gc trigger.

(It might be a good idea to use a random slot here.)

...
> > What can I do there? (This git is a bit old, 2.2.2)
> 
> Run "git prune". 2.2.2 hides this suggestion to run git-prune in this
> case. The next git version will show it back.

Actually, there is a 'git prune --expire 2.weeks.ago --no-progress'
running under the 'git gc --auto --quiet', and I don't want to drop
the expiry time lightly.

Andreas

-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800

```
