From 717145346113acd4696766ca882dda1ee4402d14 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Sat, 24 Feb 2018 16:37:42 -0800 Subject: [PATCH] gc.sh: pack all refs at mini gc time If we're generating a lot of packs for some reason there's a possibility we've also generated a lot of new refs. When "mini" gc actually decides to do repacking (other than .needspack or forced gfi_packs early redeltaing), go ahead and pack all refs too. Some repositories notoriously generate a lot of new refs on every fetch. Waiting until the next full gc to pack up all those loose refs makes access to the repository much less efficient than it needs to be. For other repositories that haven't added any new refs or have only added a few, the pack-refs command will be very, very fast. Even in a repository with a lot of new loose refs it will still be faster than the time spent doing the rest of the "mini" gc and is time well spent. Signed-off-by: Kyle J. McKay --- jobd/gc.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jobd/gc.sh b/jobd/gc.sh index dbe4666..da9c88a 100755 --- a/jobd/gc.sh +++ b/jobd/gc.sh @@ -858,6 +858,8 @@ if [ -n "$isminigc" ]; then miniactive=1 progress "+ [$proj] mini garbage check ($(date))" fi + # if we have at least 10 packs go ahead and pack all refs now too + git pack-refs --all --prune if [ -n "$gfi_mirror" ]; then repack_gfi_packs packcnt="$(list_packs --count $lpo objects/pack)" || : -- 2.11.4.GIT