Code

git-rebase--interactive.sh: comparision with == is bashism
[git.git] / git-repack.sh
index 7220635c96a75a17634297b33bac8322647b8270..d39eb6cea6174ac65f1cc13c98e4abeab3a90903 100755 (executable)
@@ -3,11 +3,27 @@
 # Copyright (c) 2005 Linus Torvalds
 #
 
-USAGE='[-a|-A] [-d] [-f] [-l] [-n] [-q] [--max-pack-size=N] [--window=N] [--window-memory=N] [--depth=N]'
+OPTIONS_KEEPDASHDASH=
+OPTIONS_SPEC="\
+git repack [options]
+--
+a               pack everything in a single pack
+A               same as -a, and turn unreachable objects loose
+d               remove redundant packs, and run git-prune-packed
+f               pass --no-reuse-object to git-pack-objects
+n               do not run git-update-server-info
+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= keep_unreachable=
+no_update_info= all_into_one= remove_redundant= unpack_unreachable=
 local= quiet= no_reuse= extra=
 while test $# != 0
 do
@@ -15,25 +31,20 @@ do
        -n)     no_update_info=t ;;
        -a)     all_into_one=t ;;
        -A)     all_into_one=t
-               keep_unreachable=--keep-unreachable ;;
+               unpack_unreachable=--unpack-unreachable ;;
        -d)     remove_redundant=t ;;
        -q)     quiet=-q ;;
        -f)     no_reuse=--no-reuse-object ;;
        -l)     local=--local ;;
-       --max-pack-size=*) extra="$extra $1" ;;
-       --window=*) extra="$extra $1" ;;
-       --window-memory=*) extra="$extra $1" ;;
-       --depth=*) extra="$extra $1" ;;
+       --max-pack-size|--window|--window-memory|--depth)
+               extra="$extra $1=$2"; shift ;;
+       --) shift; break;;
        *)      usage ;;
        esac
        shift
 done
 
-# Later we will default repack.UseDeltaBaseOffset to true
-default_dbo=false
-
-case "`git config --bool repack.usedeltabaseoffset ||
-       echo $default_dbo`" in
+case "`git config --bool repack.usedeltabaseoffset || echo true`" in
 true)
        extra="$extra --delta-base-offset" ;;
 esac
@@ -64,9 +75,9 @@ case ",$all_into_one," in
        if test -z "$args"
        then
                args='--unpacked --incremental'
-       elif test -n "$keep_unreachable"
+       elif test -n "$unpack_unreachable"
        then
-               args="$args $keep_unreachable"
+               args="$args $unpack_unreachable"
        fi
        ;;
 esac
@@ -110,7 +121,6 @@ then
        # We know $existing are all redundant.
        if [ -n "$existing" ]
        then
-               sync
                ( cd "$PACKDIR" &&
                  for e in $existing
                  do