commit-graph: return 64-bit generation number

In a preparatory step for introducing corrected commit dates, let's
return timestamp_t values from commit_graph_generation(), use
timestamp_t for local variables and define GENERATION_NUMBER_INFINITY
as (2 ^ 63 - 1) instead.

We rename GENERATION_NUMBER_MAX to GENERATION_NUMBER_V1_MAX to
represent the largest topological level we can store in the commit data
chunk.

With corrected commit dates implemented, we will have two such *_MAX
variables to denote the largest offset and largest topological level
that can be stored.

Signed-off-by: Abhishek Kumar <abhishekkumar8222@gmail.com>
Reviewed-by: Taylor Blau <me@ttaylorr.com>
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Abhishek Kumar
2021-01-16 18:11:13 +00:00
committed by Junio C Hamano
parent 72a2bfcaf0
commit d7f92784c6
8 changed files with 42 additions and 42 deletions

View File

@ -731,8 +731,8 @@ int compare_commits_by_author_date(const void *a_, const void *b_,
int compare_commits_by_gen_then_commit_date(const void *a_, const void *b_, void *unused)
{
const struct commit *a = a_, *b = b_;
const uint32_t generation_a = commit_graph_generation(a),
generation_b = commit_graph_generation(b);
const timestamp_t generation_a = commit_graph_generation(a),
generation_b = commit_graph_generation(b);
/* newer commits first */
if (generation_a < generation_b)