Re: [PATCH v2] Custom compression levels for objects and packs
- From
- Dana How <danahow@gmail.com>
- Date
- May 9, 2007, 00:29 UTC
- Message-ID
- <56b7f5510705081729t34a585c6y9ca9e2f9963d24a2@mail.gmail.com>
- In-Reply-To
- <alpine.LFD.0.99.0705082010230.24220@xanadu.home>
On 5/8/07, Nicolas Pitre <nico@cam.org> wrote:
Show 10 quoted lines
> On Tue, 8 May 2007, Junio C Hamano wrote: > > Dana How <danahow@gmail.com> writes: > > > + /* 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. > I was about to make the same comment.
I was bitten by *not* doing this. Please see the more verbose reply to Junio's comment.
Show 9 quoted lines
> > Could we somehow remove _seen? Perhaps by initializing the > > _level to -1? > > -1 is a valid value for compression. Actually it is equivalent to > Z_DEFAULT_COMPRESSION. > > If we want the fallback logic to work, at some point we must remember if > the current value is the default or if it is the result of an explicit > config option.
I can leave as-is, or use a magic value like -99 and depend on it not colliding with values in zlib.h.
Thanks,
-- Dana L. How danahow@gmail.com +1 650 804 5991 cell