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

Re: Preferring shallower deltas on repack

From
Nicolas Pitre <nico@cam.org>
Date
Jul 9, 2007, 20:22 UTC
Message-ID
<alpine.LFD.0.999.0707091621330.26459@xanadu.home>
In-Reply-To
<20070709194931.GO4087@lavos.net>
On Mon, 9 Jul 2007, Brian Downing wrote:
Show 45 quoted lines
> On Mon, Jul 09, 2007 at 02:24:03PM -0500, Brian Downing wrote:
> > No, I didn't try it on top of mine; sorry.  I'll try that out.
> 
> The results with both your patch and mine are exactly the same as
> yours applied to master (c956395e).  The only thing mine adds on top of
> yours is:
> 
> diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
> index 9a33698..2da78b4 100644
> --- a/builtin-pack-objects.c
> +++ b/builtin-pack-objects.c
> @@ -1373,6 +1373,12 @@ static int try_delta(struct unpacked *trg, struct unpacke
>                 return 0;
> 
>         if (trg_entry->delta_data) {
> +               /* Prefer only shallower same-sized deltas. */
> +               if (delta_size == trg_entry->delta_size &&
> +                   src_entry->depth + 1 >= trg_entry->depth) {
> +                       free(delta_buf);
> +                       return 0;
> +               }
>                 delta_cache_size -= trg_entry->delta_size;
>                 free(trg_entry->delta_data);
>         }
> 
> Which was meant to pick off the cases where I got an equivalently
> sized patch that was as deep or deeper.  This was neccessary due to
> my changing:
> 
> --- a/builtin-pack-objects.c
> +++ b/builtin-pack-objects.c
> @@ -1337,7 +1337,7 @@ static int try_delta(struct unpacked *trg, struct unpacked
>         if (max_size == 0)
>                 return 0;
>         if (trg_entry->delta && trg_entry->delta_size <= max_size)
> -               max_size = trg_entry->delta_size-1;
> +               max_size = trg_entry->delta_size;
>         src_size = src_entry->size;
>         sizediff = src_size < trg_size ? trg_size - src_size : 0;
>         if (sizediff >= max_size)
> 
> 	max_size = trg_entry->delta_size;
> 
> Your patch changed the max_size selection logic, so I'm not sure the
> rest of mine will do anything anymore.
It is still valid nevertheless.
Nicolas
Previous: Brian DowningNext: Brian Downing
Message 14 of 19 in “Preferring shallower deltas on repack”
  1. Brian DowningJul 9, 2007
  2. pack-objects: Prefer shallower deltas if the size is equalBrian Downing, Jul 9, 2007
  3. Junio C HamanoJul 9, 2007
  4. Junio C HamanoJul 9, 2007
  5. Brian DowningJul 9, 2007
  6. Junio C HamanoJul 9, 2007
  7. Brian DowningJul 9, 2007
  8. Nicolas PitreJul 9, 2007
  9. Junio C HamanoJul 9, 2007
  10. Brian DowningJul 9, 2007
  11. Nicolas PitreJul 9, 2007
  12. Brian DowningJul 9, 2007
  13. Brian DowningJul 9, 2007
  14. Nicolas PitreJul 9, 2007
  15. Brian DowningJul 9, 2007
  16. Shoddy pack information toolBrian Downing, Jul 9, 2007
  17. Junio C HamanoJul 11, 2007
  18. Pack information toolBrian Downing, Jul 12, 2007
  19. Linus TorvaldsJul 9, 2007

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.