commit-graph: compute generation numbers
commit3258c66332abaf6e3e8fd81cab07ae804760cd08
authorDerrick Stolee <dstolee@microsoft.com>
Tue, 1 May 2018 12:47:09 +0000 (1 12:47 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 22 May 2018 03:36:34 +0000 (22 12:36 +0900)
tree73f4ac39d73c78c0d517136f13dba4a83e987591
parent83073cc994cc3cd364f3f213478b9162476e8e44
commit-graph: compute generation numbers

While preparing commits to be written into a commit-graph file, compute
the generation numbers using a depth-first strategy.

The only commits that are walked in this depth-first search are those
without a precomputed generation number. Thus, computation time will be
relative to the number of new commits to the commit-graph file.

If a computed generation number would exceed GENERATION_NUMBER_MAX, then
use GENERATION_NUMBER_MAX instead.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-graph.c