gc: handle a corner case in gc.bigPackThreshold
commit8fc67762471c60ee644e6e100a3a85cf5a8631a0
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sun, 15 Apr 2018 15:36:16 +0000 (15 17:36 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Apr 2018 04:52:29 +0000 (16 13:52 +0900)
treec40440e93fb21d5aabf9a039cc5266c9cf349b8f
parent55dfe13df9bb38809bc45b8d6d5c7f5bf0470c11
gc: handle a corner case in gc.bigPackThreshold

This config allows us to keep <N> packs back if their size is larger
than a limit. But if this N >= gc.autoPackLimit, we may have a
problem. We are supposed to reduce the number of packs after a
threshold because it affects performance.

We could tell the user that they have incompatible gc.bigPackThreshold
and gc.autoPackLimit, but it's kinda hard when 'git gc --auto' runs in
background. Instead let's fall back to the next best stategy: try to
reduce the number of packs anyway, but keep the base pack out. This
reduces the number of packs to two and hopefully won't take up too
much resources to repack (the assumption still is the base pack takes
most resources to handle).

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config.txt
builtin/gc.c