From: Ramsay Jones Date: Tue, 03 Apr 2018 23:17:06 GMT Subject: Re: [PATCH 2/6] commit: add generation number to struct commmit Message-ID: <08d3c9dd-3589-5c1c-4cea-982e8ed28f3e@ramsayjones.plus.com> In-Reply-To: <20180403182800.GA8377@sigill.intra.peff.net> On 03/04/18 19:28, Jeff King wrote: > On Tue, Apr 03, 2018 at 11:05:36AM -0700, Brandon Williams wrote: > >> On 04/03, Derrick Stolee wrote: >>> The generation number of a commit is defined recursively as follows: >>> >>> * If a commit A has no parents, then the generation number of A is one. >>> * If a commit A has parents, then the generation number of A is one >>> more than the maximum generation number among the parents of A. >>> >>> Add a uint32_t generation field to struct commit so we can pass this >> >> Is there any reason to believe this would be too small of a value in the >> future? Or is a 32 bit unsigned good enough? > > The linux kernel took ~10 years to produce 500k commits. Even assuming > those were all linear (and they're not), that gives us ~80,000 years of > leeway. So even if the pace of development speeds up or we have a > quicker project, it still seems we have a pretty reasonable safety > margin. I didn't read the patches closely, but isn't it ~20,000 years? Given that '#define GENERATION_NUMBER_MAX 0x3FFFFFFF', that is. ;-) ATB, Ramsay Jones