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

Re: [PATCH v2] Custom compression levels for objects and packs

From
Nicolas Pitre <nico@cam.org>
Date
May 9, 2007, 01:23 UTC
Message-ID
<alpine.LFD.0.99.0705082106590.24220@xanadu.home>
In-Reply-To
<56b7f5510705081725v655d2ce1j28712507cfa7fa55@mail.gmail.com>
On Tue, 8 May 2007, Dana How wrote:
Show 6 quoted lines
> Since max-pack-size has been out there since April 4 and
> the first acceptable version was May 1 (suggested by 0 comments),
> I didn't realize it was a "questionable series".
> 
> I think it should be straightforward for me to re-submit this
> based on current master.

Since this patch is simpler it could be merged much faster, before the pack limit series.

Show 29 quoted lines
> > > +     /* differing core & pack compression when loose object -> must
> > recompress */
> > > +     if (!entry->in_pack && pack_compression_level !=
> > zlib_compression_level)
> > > +             to_reuse = 0;
> > > +     else
> > I am not sure if that is worth it, as you do not know if the
> > loose object you are looking at were compressed with the current
> > settings.
> You do not know for certain, that is correct.  However, config
> settings setting unequal compression levels signal that you
> care differently about the two cases. (For me,  I want the
> compression investment to correspond to the expected lifetime of the file.)
> Also,  *if* we have the knobs we want in the config file,
> I don't think we're going to be changing these settings all that often.
> 
> If I didn't have this check forcing recompression in the pack,
> then in the absence of deltification each object would enter the pack
> by being copied (in the preceding code block) and pack.compression
> would have little effect.  I actually experienced this the very first
> time I imported a large dataset into git (I was trying to achieve the
> effect of this patch by changing core.compression dynamically,  and
> was a bit mystified for a while by the result).
> 
> Thus,  if core.loosecompression is set to speed up git-add,  I should
> take the time to recompress the object when packing if pack.compression
> is different (of course the hit of not doing so will be lessened by
> deltification
> which forces a new compression).

Right. And this also depends whether or not you have core.legacyheaders set to false or not.

And the whole purpose for setting core.legacyheaders is exactly to allow for loose objects to be copied straight into the pack. This should have priority over mismatched compression levels IMHO.

Also, when repacking, delta reuse does not recompress objects for the same reason, regardless of the compression level used when they were compressed initially. Same argument goes for delta depth.

So if you really want to ensure a compression level on the whole pack, you'll have to use -f with git-repack. Or leave core.legacyheaders unset.

Nicolas
Previous: Dana HowNext: Dana How
Message 9 of 23 in “Custom compression levels for objects and packs”
  1. Custom compression levels for objects and packsDana How, May 8, 2007
  2. Junio C HamanoMay 8, 2007
  3. Nicolas PitreMay 9, 2007
  4. Dana HowMay 9, 2007
  5. Nicolas PitreMay 9, 2007
  6. Dana HowMay 9, 2007
  7. Junio C HamanoMay 9, 2007
  8. Dana HowMay 9, 2007
  9. Nicolas PitreMay 9, 2007
  10. Dana HowMay 9, 2007
  11. Nicolas PitreMay 9, 2007
  12. Junio C HamanoMay 9, 2007
  13. Dana HowMay 9, 2007
  14. make "repack -f" imply "pack-objects --no-reuse-object"Nicolas Pitre, May 9, 2007
  15. deprecate the new loose object header formatNicolas Pitre, May 9, 2007
  16. Dana HowMay 9, 2007
  17. Nicolas PitreMay 9, 2007
  18. Dana HowMay 9, 2007
  19. Junio C HamanoMay 9, 2007
  20. Dana HowMay 9, 2007
  21. Petr BaudisMay 9, 2007
  22. Theodore TsoMay 9, 2007
  23. Dana HowMay 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.