X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-repack.sh;h=e18eb3f5dcf42abfbd125594877ececf92c3d9b6;hb=97b88dd58cad9d60427af9a956f90f7803f55db8;hp=ddfa8b44a17f1ea7ff039bca1d6132ba07e5cf12;hpb=5f5dbd719d0d8ec136f32a0a56674902bd85f72f;p=git.git diff --git a/git-repack.sh b/git-repack.sh index ddfa8b44a..e18eb3f5d 100755 --- a/git-repack.sh +++ b/git-repack.sh @@ -3,23 +3,41 @@ # Copyright (c) 2005 Linus Torvalds # -USAGE='[-a] [-d] [-f] [-l] [-n] [-q] [--window=N] [--depth=N]' +OPTIONS_KEEPDASHDASH= +OPTIONS_SPEC="\ +git-repack [options] +-- +a pack everything in a single pack +A same as -a, and keep unreachable objects too +d remove redundant packs, and run git-prune-packed +f pass --no-reuse-delta to git-pack-objects +q,quiet be quiet +l pass --local to git-pack-objects + Packing constraints +window= size of the window used for delta compression +window-memory= same as the above, but limit memory size instead of entries count +depth= limits the maximum delta depth +max-pack-size= maximum size of each packfile +" SUBDIRECTORY_OK='Yes' . git-sh-setup -no_update_info= all_into_one= remove_redundant= -local= quiet= no_reuse_delta= extra= -while case "$#" in 0) break ;; esac +no_update_info= all_into_one= remove_redundant= keep_unreachable= +local= quiet= no_reuse= extra= +while test $# != 0 do case "$1" in -n) no_update_info=t ;; -a) all_into_one=t ;; + -A) all_into_one=t + keep_unreachable=--keep-unreachable ;; -d) remove_redundant=t ;; -q) quiet=-q ;; - -f) no_reuse_delta=--no-reuse-delta ;; + -f) no_reuse=--no-reuse-object ;; -l) local=--local ;; - --window=*) extra="$extra $1" ;; - --depth=*) extra="$extra $1" ;; + --max-pack-size|--window|--window-memory|--depth) + extra="$extra $1=$2"; shift ;; + --) shift; break;; *) usage ;; esac shift @@ -35,7 +53,7 @@ true) esac PACKDIR="$GIT_OBJECT_DIRECTORY/pack" -PACKTMP="$GIT_DIR/.tmp-$$-pack" +PACKTMP="$GIT_OBJECT_DIRECTORY/.tmp-$$-pack" rm -f "$PACKTMP"-* trap 'rm -f "$PACKTMP"-*' 0 1 2 3 15 @@ -57,21 +75,28 @@ case ",$all_into_one," in fi done fi - [ -z "$args" ] && args='--unpacked --incremental' + if test -z "$args" + then + args='--unpacked --incremental' + elif test -n "$keep_unreachable" + then + args="$args $keep_unreachable" + fi ;; esac -args="$args $local $quiet $no_reuse_delta$extra" -name=$(git-pack-objects --non-empty --all --reflog $args