Thread (6 messages) flat view 6 messages, 4 authors, 2016-06-15
STALE3726d

[PATCH] consider previous pack undeltified object state only when reusing delta data

From: Nicolas Pitre <hidden>
Date: 2016-06-15 22:42:31
Subsystem: the rest · Maintainer: Linus Torvalds

Without this there would never be a chance to improve packing for 
previously undeltified objects.

Signed-off-by: Nicolas Pitre <redacted>

---

On Thu, 29 Jun 2006, Junio C Hamano wrote:
Nicolas Pitre [off-list ref] writes:
quoted
On Thu, 29 Jun 2006, Linus Torvalds wrote:
quoted

On Thu, 29 Jun 2006, Nicolas Pitre wrote:
quoted
On Thu, 29 Jun 2006, Linus Torvalds wrote:
quoted
Instead of having a separate cache, wouldn't it be much better to just 
take the hint from the previous pack-file?
DOH!  ;-)
Btw, I think this could do with a flag to turn it on/off (but probably 
default to on).
I think it should simply be coupled with the --no-reuse-delta flag.
I agree that makes sense.
So here it is.
diff --git a/pack-objects.c b/pack-objects.c
index 6e17676..47da33b 100644
--- a/pack-objects.c
+++ b/pack-objects.c
@@ -989,9 +989,10 @@ static int try_delta(struct unpacked *tr
 
 	/*
 	 * We do not bother to try a delta that we discarded
-	 * on an earlier try.
+	 * on an earlier try, but only when reusing delta data.
 	 */
-	if (trg_entry->in_pack && trg_entry->in_pack == src_entry->in_pack)
+	if (!no_reuse_delta && trg_entry->in_pack &&
+	    trg_entry->in_pack == src_entry->in_pack)
 		return 0;
 
 	/*
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help