On Tue, Aug 25, 2020 at 02:18:24PM +0200, Jakub Narębski wrote: > Abhishek Kumar <abhishekkumar8222@xxxxxxxxx> writes: > > ... > > However, as I wrote, handling GENERATION_NUMBER_V2_OFFSET_MAX is > difficult. As far as I can see, we can choose one of the *three* > solutions (the third one is _new_): > > a. store 64-bit corrected commit date in the GDAT chunk > all possible values are able to be stored, no need for > GENERATION_NUMBER_V2_MAX, > > b. store 32-bit corrected commit date offset in the GDAT chunk, > if its value is larger than GENERATION_NUMBER_V2_OFFSET_MAX, > do not write GDAT chunk at all (like for backward compatibility > with mixed-version chains of split commit-graph layers), > > c. store 32-bit corrected commit date offset in the GDAT chunk, > using some kind of overflow handling scheme; for example if > the most significant bit of 32-bit value is 1, then the > rest 31-bits are position in GDOV chunk, which uses 64-bit > to store those corrected commit date offsets that do not > fit in 32 bits. > Alright, so the third solution leverages the fact that in practice, very few offsets would overflow the 32-bit limit. Using 64-bits for all offsets would be wasteful, we can trade off a miniscule amount of computation to save large amounts of disk space. > > This type of schema is used in other places in Git code, if I remember > it correctly. > Yes, it's a similar idea to the extra edge list chunk, where the most significant bit of second parent indicates whether they are more than two parents. It's definitely feasible, albeit a little complex. What's the overall consensus on the third solution? > > >> The commit message says nothing about the new symbolic constant > >> GENERATION_NUMBER_V1_INFINITY, though. > >> > >> I'm not sure it is even needed (see comments below). > > > > Yes, you are correct. I tried it out with your suggestions and it wasn't > > really needed. > > > > Thanks for catching this! > > Mistakes can happen when changig how the series is split into commits. > > Best, > -- > Jakub Narębski Thanks - Abhishek