From e853954d897db23a7e8caa29a525eaf4c356e571 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Tue, 9 Jun 2020 20:57:48 -0700 Subject: [PATCH] gc-git-svn.sh: pack up lotsa loose objects If there are `lotsa_loose_objects` then pack them up into a pack incrementally (i.e. don't pack any loose objects that are already in a pack) and then prune the loose objects. Signed-off-by: Kyle J. McKay --- jobd/gc-git-svn.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/jobd/gc-git-svn.sh b/jobd/gc-git-svn.sh index 80c5e0d..982350c 100755 --- a/jobd/gc-git-svn.sh +++ b/jobd/gc-git-svn.sh @@ -20,7 +20,37 @@ # a `git-svn` mirror. . @basedir@/shlib.sh +. @basedir@/jobd/gc-util-functions.sh set -e +[ -d objects ] || exit 1 + +v_get_proj_from_dir proj +proj="${proj%.git}" + +# packing options +packopts="--depth=50 --window=50 --window-memory=${var_window_memory:-1g}" +quiet="-q"; [ "${show_progress:-0}" = "0" ] || quiet= + +# pack any existing, non-packed loose objects into a new _l.pack file then run prune-packed +# note that prune-packed is NOT run beforehand -- the caller must do that if needed +# loose objects need not be part of complete commits/trees as --weak-naming is used +pack_incremental_loose_objects() { + _lpacks="$(run_combine_packs