# Re: Why gc --auto is called so rarely?

3 messages from 2017-11-19 to 2017-11-20. Participants: Ilya Kantor, Eric Sunshine, Junio C Hamano.
Thread: https://gitlist.dev/t/47243

## Ilya Kantor, 2017-11-19 17:04

Subject: Re: Why gc --auto is called so rarely?
Message-ID: <C47F730C-18AE-411E-AC57-2DA8625451C4@icloud.com>
URL: https://gitlist.dev/e/C47F730C-18AE-411E-AC57-2DA8625451C4%40icloud.com

```
...It seems sane to git gc --auto from command that are expected to take time.

That's probably the reason why it's not called on commits and called on receive-pack. 

But then why call it on merges? Especially on those that have no conflicts and should run fast.
Also, merges are not supposed to introduce unreachable objects.

P.S. The old gmane discussion referenced by some previous posts on this subject is lost.


```

## Eric Sunshine, 2017-11-19 18:12

Subject: Re: Why gc --auto is called so rarely?
Message-ID: <CAPig+cRxB5xiyeCWKTB3O1zeH50pobjBH8oyQt75FkC09_4_dw@mail.gmail.com>
URL: https://gitlist.dev/e/CAPig%2BcRxB5xiyeCWKTB3O1zeH50pobjBH8oyQt75FkC09_4_dw%40mail.gmail.com
In-Reply-To: <C47F730C-18AE-411E-AC57-2DA8625451C4@icloud.com>

```
On Sun, Nov 19, 2017 at 12:04 PM, Ilya Kantor <ilya.a.kantor@icloud.com> wrote:
> P.S. The old gmane discussion referenced by some previous posts on this subject is lost.

You can find old gmane conversations at https://public-inbox.org/git/
by searching for "gmane:<id>" in the search field, where <id> is the
gmane ID number of the message.

```

## Junio C Hamano, 2017-11-20 00:46

Subject: Re: Why gc --auto is called so rarely?
Message-ID: <xmqqa7zhojyv.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqa7zhojyv.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <C47F730C-18AE-411E-AC57-2DA8625451C4@icloud.com>

```
Ilya Kantor <ilya.a.kantor@icloud.com> writes:

> ...It seems sane to git gc --auto from command that are expected to take time.
>
> That's probably the reason why it's not called on commits and
> called on receive-pack.
>
> But then why call it on merges? Especially on those that have no
> conflicts and should run fast.  Also, merges are not supposed to
> introduce unreachable objects.

The primary thing we want the users get out of running "gc --auto"
during these operations are not the removal of unreachable garbage.
It is primarily run to reduce the number of loose objects and
prevent great many numbers of tiny packfiles from being accumulated,
so the places you see calls to it tend to be after creating new
objects in the repository.



```
