git-repack: repo.usedeltabaseoffset
authorJunio C Hamano <junkio@cox.net>
Sat, 14 Oct 2006 04:28:58 +0000 (21:28 -0700)
committerJunio C Hamano <junkio@cox.net>
Sat, 14 Oct 2006 04:28:58 +0000 (21:28 -0700)
When configuration variable `repack.UseDeltaBaseOffset` is set
for the repository, the command passes `--delta-base-offset`
option to `git-pack-objects`; this typically results in slightly
smaller packs, but the generated packs are incompatible with
versions of git older than (and including) v1.4.3.

We will make it default to true sometime in the future, but not
for a while.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/config.txt
Documentation/git-repack.txt
git-repack.sh
index 98c1f3e2e32e71047d6f0f6cf982e207117c64e2..88e0bf00c2bd1dd1d57aa3ac91dfb004c4e2a4b3 100644 (file)
@@ -224,6 +224,10 @@ pull.octopus::
 pull.twohead::
        The default merge strategy to use when pulling a single branch.
 
+repack.usedeltabaseoffset::
+       Allow gitlink:git-repack[1] to create packs that uses
+       delta-base offset.  Defaults to false.
+
 show.difftree::
        The default gitlink:git-diff-tree[1] arguments to be used
        for gitlink:git-show[1].
index 49f7e0a4a446b8e393b76f39136f28c74c085dff..4e6631a27fd10344984026949f990e36cb45e6bf 100644 (file)
@@ -66,6 +66,20 @@ OPTIONS
        to be applied that many times to get to the necessary object.
 
 
+Configuration
+-------------
+
+When configuration variable `repack.UseDeltaBaseOffset` is set
+for the repository, the command passes `--delta-base-offset`
+option to `git-pack-objects`; this typically results in slightly
+smaller packs, but the generated packs are incompatible with
+versions of git older than (and including) v1.4.3; do not set
+the variable in a repository that older version of git needs to
+be able to read (this includes repositories from which packs can
+be copied out over http or rsync, and people who obtained packs
+that way can try to use older git with it).
+
+
 Author
 ------
 Written by Linus Torvalds <torvalds@osdl.org>
index b525fc5dfd9053a6fb63a4d38517e25e75341199..2a214891a8d8ddbf11dcce2d655d3cab0614e064 100755 (executable)
@@ -3,7 +3,7 @@
 # Copyright (c) 2005 Linus Torvalds
 #
 
-USAGE='[-a] [-d] [-f] [-l] [-n] [-q]'
+USAGE='[-a] [-d] [-f] [-l] [-n] [-q] [--window=N] [--depth=N]'
 . git-sh-setup
 
 no_update_info= all_into_one= remove_redundant=
@@ -24,6 +24,15 @@ do
        shift
 done
 
+# Later we will default repack.UseDeltaBaseOffset to true
+default_dbo=false
+
+case "`git repo-config --bool repack.usedeltabaseoffset ||
+       echo $default_dbo`" in
+true)
+       extra="$extra --delta-base-offset" ;;
+esac
+
 PACKDIR="$GIT_OBJECT_DIRECTORY/pack"
 PACKTMP="$GIT_DIR/.tmp-$$-pack"
 rm -f "$PACKTMP"-*