Re: git: how the pack-objects.c find the object's delta
From: Duy Nguyen <hidden>
Date: 2016-06-15 22:56:25
Hi, I can't say from a first glance. Maybe git@vger can help? On Sun, Mar 17, 2013 at 10:08 PM, 方栋 [off-list ref] wrote:
hello
i don't understand this:
src in builtin/pack-objects.c find_deltas() function, line 1800:
static void find_deltas(struct object_entry **list, unsigned *list_size,
int window, int depth, unsigned *processed)
{
......
/*
* Move the best delta base up in the window, after the
* currently deltified object, to keep it longer. It will
* be the first base object to be attempted next.
*/
if (entry->delta) {
struct unpacked swap = array[best_base];
int dist = (window + idx - best_base) % window;
int dst = best_base;
while (dist--) {
int src = (dst + 1) % window;
array[dst] = array[src];
dst = src;
}
array[dst] = swap;
}
......
}
what this code block use for?
thx
------------------
祝好
--方(tyut)-- Duy