Re: [PATCH] make the pack index version configurable
- From
Nicolas Pitre <nico@cam.org>
- Date
- Nov 2, 2007, 04:01 UTC
- Message-ID
- <alpine.LFD.0.9999.0711012345220.21255@xanadu.home>
- In-Reply-To
- <ee77f5c20711012042r39c6303em2a8140e8348051d@mail.gmail.com>
On Fri, 2 Nov 2007, David Symonds wrote:
Show 15 quoted lines
> On 11/2/07, Nicolas Pitre <nico@cam.org> wrote: > > > > +pack.indexVersion:: > > + Specify the default pack index version. Valid values are 1 for > > + legacy pack index used by Git versions prior to 1.5.2, and 2 for > > + the new pack index with capabilities for packs larger than 4 GB > > + as well as proper protection against the repacking of corrupted > > + packs. Version 2 is selected and this config option ignored > > + whenever the corresponding pack is larger than 2 GB. Otherwise > > + the default is 1. > > If you're trying to force a previous pack version for some reason > (backward compatibility, or whatever), this "feature" of automatic > forcing version 2 for 2 GB packs might come as a nasty suprise. > Wouldn't it be better to fail with an error?
No. The fact is that you don't know in advance what the pack size will be, and reaching that limit might take a long while already if repacking, or even more so if the pack is fetched over a network connection. That would be wasteful to simply throw away all the whole repack/download with an error which would be an even nastier surprise at that point just because you specified index v1.
And such a pack would be impossible to work with using an old Git version anyway, so the old Git version will happily give you the error, suggesting that you upgrade to a later version.
And this has been the implemented behavior for the last 7 months already.
And the idea is to switch the default to version 2 eventually.
Etc.
Nicolas