commit-graph: simplify compute_generation_numbers()
commit80c928d947c257ef4d9f13c358117d0c1914f71f
authorDerrick Stolee <derrickstolee@github.com>
Mon, 20 Mar 2023 11:26:50 +0000 (20 11:26 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Mar 2023 19:17:33 +0000 (20 12:17 -0700)
tree64609bf78ca018593d48e7b6bd90315147867cc9
parent368d19b0b7fa780d84918cf4ed4a31a410ed865d
commit-graph: simplify compute_generation_numbers()

The previous change introduced the generic algorithm
compute_reachable_generation_numbers() and used it as the core
functionality of compute_topological_levels(). Now, use it as the core
functionality of compute_generation_numbers().

The main difference here is that we use generation version 2, which is
used in to toggle the logic in compute_generation_from_max() for
computing the corrected commit date based on the corrected commit dates
of the parent commits (and the commit date of the current commit). It
also uses different methods for (get|set)_generation in the vtable in
order to store and access the value in the correct places.

Co-authored-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-graph.c