From 39093d6c42e7082bb14dbd425c00b8bd99095b70 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Wed, 11 Feb 2015 13:40:26 -0800 Subject: [PATCH] gc.sh: allow extra arguments to be passed to git-repack Anything following the project name is passed as extra options to the git repack command. This allows, for example, passing -f when running gc.sh manually. --- jobd/gc.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/jobd/gc.sh b/jobd/gc.sh index 281afe6..4a7e9f2 100755 --- a/jobd/gc.sh +++ b/jobd/gc.sh @@ -1,5 +1,9 @@ #!/bin/sh +# NOTE: additional options can be passed to git repack by specifying +# them after the project name, for example: +# gc.sh my-project -f + . @basedir@/shlib.sh set -e @@ -119,6 +123,7 @@ pack_is_complete() { } proj="$1" +shift cd "$cfg_reporoot/$proj.git" # date -R is linux-only, POSIX equivalent is '+%a, %d %b %Y %T %z' @@ -306,7 +311,7 @@ progress "+ [$proj] garbage check (`date`)" # safe pruning: we put all our objects in all forks, then we can # safely get rid of extra ones; repacks in forks will get rid of # the redundant ones again then -forkdir="$1" +forkdir="$proj" if [ -d "../${forkdir##*/}" ]; then # It is enough to copy objects just one level down and get_repo_list # takes a regular expression (which is automatically prefixed with '^') @@ -341,7 +346,7 @@ git pack-refs --all repack_gfi_packs rm -f bundles/* rm -f objects/pack/pack-*.bndl -git repack $packopts -a -d -l $quiet +git repack $packopts -a -d -l $quiet "$@" allpacks="$(echo objects/pack/pack-$octet20.pack)" curhead="$(cat HEAD)" pkrf= -- 2.11.4.GIT