From 7c838c0fcd13220c2574e227ab105efcd3c7bffa Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Tue, 12 Jul 2016 07:08:59 -0700 Subject: [PATCH] gc.sh: force a single small pack to redelta before a full gc When combine_small_packs is run immediately before a full gc (either because there are more than $var_redelta_threshold objects or because there are forks that need to receive the more optimally repacked pack(s)), force a single small pack to undergo redeltification to avoid carrying forward suboptimal deltas. Signed-off-by: Kyle J. McKay --- jobd/gc.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jobd/gc.sh b/jobd/gc.sh index 29aa95c..04c9751 100755 --- a/jobd/gc.sh +++ b/jobd/gc.sh @@ -98,12 +98,15 @@ repack_gfi_packs() { # combine small packs into larger pack(s) # we avoid any keep, bndl or bitmap packs +# if the optional argument is non-empty even a single small pack will be redeltad combine_small_packs() { + _minsmallpacks=2 + [ -z "$1" ] || _minsmallpacks=1 _lpo="--exclude-no-idx --exclude-keep --exclude-bitmap --exclude-bndl --quiet" _lpo="$_lpo --object-limit $var_redelta_threshold objects/pack" while _cnt="$(list_packs --count $_lpo || :)" - test "${_cnt:-0}" -ge 2 + test "${_cnt:-0}" -ge $_minsmallpacks do _newp="$(list_packs $_lpo | combine_packs --names --no-reuse-delta)" _newc="$(echo $(echo "$_newp" | LC_ALL=C wc -w))" @@ -490,7 +493,7 @@ if [ -z "$newdeltas" ] || has_forks "$proj"; then # recomputing all deltas, in order to avoid having suboptimal packs in the forks. make_svn_pack repack_gfi_packs - combine_small_packs + combine_small_packs 1 fi # safe pruning: we put all our objects in all forks, then we can -- 2.11.4.GIT