summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-01-12 23:33:39 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-01-12 23:33:39 -0800
commitc4a01a3cbbd8b642a3ffc6bc550b68ac63d500ed (patch)
tree29ba467aeb81889053419a311a88ac89915f7e7b
parentMerge branch 'maint' (diff)
parentUpdate draft release notes to 1.7.8.4 (diff)
downloadtgif-c4a01a3cbbd8b642a3ffc6bc550b68ac63d500ed.tar.xz
Merge branch 'maint'
* maint: Update draft release notes to 1.7.8.4 Update draft release notes to 1.7.7.6 Update draft release notes to 1.7.6.6 thin-pack: try harder to use preferred base objects as base
-rw-r--r--Documentation/RelNotes/1.7.6.6.txt5
-rw-r--r--Documentation/RelNotes/1.7.7.6.txt5
-rw-r--r--Documentation/RelNotes/1.7.8.4.txt5
-rw-r--r--builtin/pack-objects.c9
4 files changed, 22 insertions, 2 deletions
diff --git a/Documentation/RelNotes/1.7.6.6.txt b/Documentation/RelNotes/1.7.6.6.txt
index 13ce2dc2d7..5343e00400 100644
--- a/Documentation/RelNotes/1.7.6.6.txt
+++ b/Documentation/RelNotes/1.7.6.6.txt
@@ -8,4 +8,9 @@ Fixes since v1.7.6.5
directory when two paths in question are in adjacent directories and
the name of the one directory is a prefix of the other.
+ * When producing a "thin pack" (primarily used in bundles and smart
+ HTTP transfers) out of a fully packed repository, we unnecessarily
+ avoided sending recent objects as a delta against objects we know
+ the other side has.
+
Also contains minor fixes and documentation updates.
diff --git a/Documentation/RelNotes/1.7.7.6.txt b/Documentation/RelNotes/1.7.7.6.txt
index 065ed2ad6c..b8b86ebc61 100644
--- a/Documentation/RelNotes/1.7.7.6.txt
+++ b/Documentation/RelNotes/1.7.7.6.txt
@@ -8,4 +8,9 @@ Fixes since v1.7.7.5
directory when two paths in question are in adjacent directories and
the name of the one directory is a prefix of the other.
+ * When producing a "thin pack" (primarily used in bundles and smart
+ HTTP transfers) out of a fully packed repository, we unnecessarily
+ avoided sending recent objects as a delta against objects we know
+ the other side has.
+
Also contains minor fixes and documentation updates.
diff --git a/Documentation/RelNotes/1.7.8.4.txt b/Documentation/RelNotes/1.7.8.4.txt
index 3172f1cb31..c21fc99bdb 100644
--- a/Documentation/RelNotes/1.7.8.4.txt
+++ b/Documentation/RelNotes/1.7.8.4.txt
@@ -8,6 +8,11 @@ Fixes since v1.7.8.3
directory when two paths in question are in adjacent directories and
the name of the one directory is a prefix of the other.
+ * When producing a "thin pack" (primarily used in bundles and smart
+ HTTP transfers) out of a fully packed repository, we unnecessarily
+ avoided sending recent objects as a delta against objects we know
+ the other side has.
+
* "git send-email" did not properly treat sendemail.multiedit as a
boolean (e.g. setting it to "false" did not turn it off).
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 96c1680976..0f2e7b8f5c 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -1434,11 +1434,16 @@ static int try_delta(struct unpacked *trg, struct unpacked *src,
return -1;
/*
- * We do not bother to try a delta that we discarded
- * on an earlier try, but only when reusing delta data.
+ * We do not bother to try a delta that we discarded on an
+ * earlier try, but only when reusing delta data. Note that
+ * src_entry that is marked as the preferred_base should always
+ * be considered, as even if we produce a suboptimal delta against
+ * it, we will still save the transfer cost, as we already know
+ * the other side has it and we won't send src_entry at all.
*/
if (reuse_delta && trg_entry->in_pack &&
trg_entry->in_pack == src_entry->in_pack &&
+ !src_entry->preferred_base &&
trg_entry->in_pack_type != OBJ_REF_DELTA &&
trg_entry->in_pack_type != OBJ_OFS_DELTA)
return 0;