diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2021-02-02 03:01:22 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-02-01 21:03:36 -0800 |
commit | fde55b0906552537c8cbcbf654f8e9dd64414637 (patch) | |
tree | 495174c91dc78a480a2abc0b3bdd8b37c36156cf /grep.h | |
parent | commit-graph: compute generations separately (diff) | |
download | tgif-fde55b0906552537c8cbcbf654f8e9dd64414637.tar.xz |
commit-graph: be extra careful about mixed generations
When upgrading to a commit-graph with corrected commit dates from
one without, there are a few things that need to be considered.
When computing generation numbers for the new commit-graph file that
expects to add the generation_data chunk with corrected commit
dates, we need to ensure that the 'generation' member of the
commit_graph_data struct is set to zero for these commits.
Unfortunately, the fallback to use topological level for generation
number when corrected commit dates are not available are causing us
harm here: parsing commits notices that read_generation_data is
false and populates 'generation' with the topological level.
The solution is to iterate through the commits, parse the commits
to populate initial values, then reset the generation values to
zero to trigger recalculation. This loop only occurs when the
existing commit-graph data has no corrected commit dates.
While this improves our situation somewhat, we have not completely
solved the issue for correctly computing generation numbers for mixed
layers. That follows in the next change.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Reviewed-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'grep.h')
0 files changed, 0 insertions, 0 deletions