From 22f2a7f092e121689c60a666c3993da5d77b427a Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Fri, 7 Oct 2016 17:34:30 -0700 Subject: [PATCH] bitmaps: include a bitmap hash cache by default When generating deltas to send data to clients, having a hash cache in the bitmap can improve the quality of the deltas that are generated thereby reducing the amount of data that needs to be sent to clients. Turn on bitmap hash caches by default but add another tunable option to disable them in case the generated bitmaps need to be used by JGit (which does not understand the hash cache info). Signed-off-by: Kyle J. McKay --- Girocco/Config.pm | 15 +++++++++++++++ jailsetup.sh | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/Girocco/Config.pm b/Girocco/Config.pm index 5cd0b5e..0c7e47c 100644 --- a/Girocco/Config.pm +++ b/Girocco/Config.pm @@ -836,6 +836,20 @@ our $reflogs_lifetime = 1; # RECOMMENDED VALUE: undef or 5 our $upload_pack_window = undef; +# When using pack bitmaps and computing data to send to clients over a fetch, +# having pack.writeBitmapHashCache set to true produces better deltas (thereby +# potentially reducing the amount of data that needs to be sent). However, +# JGit does not understand this extra data, so if JGit needs to use the bitmaps +# generated when Girocco runs Git, this setting needs to be set to a true value +# so that the hash cache is excluded when Git generates the bitmaps thereby +# making them compatible with JGit. +# Note that changes to this setting will not take effect until the next time +# gc is scheduled to run on a project and then only if gc actually takes place. +# Use the $basedir/toolbox/make-all-gc-eligible.sh script to force all projects +# to actually do a gc the next time they are scheduled for one. +# RECOMMENDED VAALUE: undef or 0 +our $jgit_compatible_bitmaps = 0; + # ## ------------------------ @@ -892,6 +906,7 @@ our $httpsdnsname = ($httpspushurl =~ m,https://([A-Za-z0-9.-]+),i) ? lc($1) : u !$delay_gfi_redelta and $delay_gfi_redelta = undef; !$git_no_mmap and $git_no_mmap = undef; !$suppress_x_girocco and $suppress_x_girocco = undef; +!$jgit_compatible_bitmaps and $jgit_compatible_bitmaps = undef; (not $reflogs_lifetime or $reflogs_lifetime !~ /^[1-9][0-9]*$/) and $reflogs_lifetime = 1; $reflogs_lifetime = 0 + $reflogs_lifetime; $reflogs_lifetime >= 0 or $reflogs_lifetime = 1; diff --git a/jailsetup.sh b/jailsetup.sh index e36c270..1ea0dd9 100755 --- a/jailsetup.sh +++ b/jailsetup.sh @@ -156,6 +156,11 @@ fi if [ -n "$var_window_memory" ]; then update_config_item pack.windowMemory "$var_window_memory" 1 fi +if [ -n "$cfg_jgit_compatible_bitmaps" ]; then + update_config_item pack.writeBitmapHashCache false 1 +else + update_config_item pack.writeBitmapHashCache true 1 +fi update_config_item http.lowSpeedLimit 1 update_config_item http.lowSpeedTime 600 [ -z "$didchmod" ] || chmod a-w etc/girocco -- 2.11.4.GIT