Re: [PATCH] Recommend "git gc --auto" instead of "git prune"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 7, 2020, 17:10 UTC
- Message-ID
- <xmqq8sgyn6o4.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20200607162556.GJ6569@camp.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 16 quoted lines
>> diff --git a/builtin/gc.c b/builtin/gc.c
>> index 8e0b9cf41b3..3833a3de332 100644
>> --- a/builtin/gc.c
>> +++ b/builtin/gc.c
>> @@ -692,7 +692,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
>>
>> if (auto_gc && too_many_loose_objects())
>> warning(_("There are too many unreachable loose objects; "
>> - "run 'git prune' to remove them."));
>> + "run 'git gc --auto' to remove them."));
>
> I'm not sure this is correct. If we have just expelled a large number
> of objects from a pack into loose objects because they're no longer
> referenced, it's possible we may trigger another git gc --auto on the
> next time we run a command. If so, no amount of git gc --auto is going
> to help here; you really have to run git prune.Correct. When running manually, after noticing the need to do a GC, it is a mental bug to add "--auto" to it, I would think.