git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git: how the pack-objects.c find the object's delta

From
Duy Nguyen <pclouds@gmail.com>
Date
Mar 18, 2013, 00:54 UTC
Message-ID
<CACsJy8C6pVTUYvU9xkNchfKBXNzT8nMuM+ggD_FQXtGwNU59wA@mail.gmail.com>
In-Reply-To
<tencent_0A91BD9B7F2294EF42EFC942@qq.com>
Hi,
I can't say from a first glance. Maybe git@vger can help?
On Sun, Mar 17, 2013 at 10:08 PM, 方栋 <fangdong@pipul.org> wrote:
Show 41 quoted lines
> 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
Message 1 of 1 in “Re: git: how the pack-objects.c find the object's delta”
  1. Duy NguyenMar 18, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.