Re: [PATCH v5 09/11] commit-graph: use generation v2 only if entire chain does
flat view
From: Derrick Stolee <hidden>
Date: 2021-01-11 12:44:14
On 1/10/2021 8:13 AM, Abhishek Kumar wrote:
On Tue, Dec 29, 2020 at 10:23:54PM -0500, Derrick Stolee wrote:quoted
Your tests in this patch seem very thorough, covering all the cases I could think to create this strange situation. I even tried creating cases where the overflow would be necessary. The following test actually fails on the "graph_read_expect 6" due to the extra chunk, not the 'write' process I was trying to trick into failure.diff --git a/t/t5324-split-commit-graph.sh b/t/t5324-split-commit-graph.sh index 8e90f3423b..cfef8e52b9 100755 --- a/t/t5324-split-commit-graph.sh +++ b/t/t5324-split-commit-graph.sh@@ -453,6 +453,20 @@ test_expect_success 'prevent regression for duplicate commits across layers' ' git -C dup commit-graph verify ' +test_expect_success 'upgrade to generation data succeeds when there was none' ' + ( + cd dup && + rm -rf .git/objects/info/commit-graph* && + GIT_TEST_COMMIT_GRAPH_NO_GDAT=1 git commit-graph \ + write --reachable && + GIT_COMMITTER_DATE="1980-01-01 00:00" git commit --allow-empty -m one && + GIT_COMMITTER_DATE="2090-01-01 00:00" git commit --allow-empty -m two && + GIT_COMMITTER_DATE="2000-01-01 00:00" git commit --allow-empty -m three && + git commit-graph write --reachable && + graph_read_expect 6 + ) +'I am not sure what this test adds over the existing generation data overflow related tests added in t5318-commit-graph.sh
Good point. -Stolee