Thread (31 messages) 31 messages, 8 authors, 2022-07-13

Re: [External] Re: [PATCH v1] commit-graph.c: no lazy fetch in lookup_commit_in_graph()

From: Patrick Steinhardt <hidden>
Date: 2022-06-20 09:05:48

On Mon, Jun 20, 2022 at 04:53:47PM +0800, 欣韩 wrote:
On Mon, Jun 20, 2022 at 3:34 PM Patrick Steinhardt [off-list ref] wrote:
quoted
On Sat, Jun 18, 2022 at 11:01:30AM +0800, Han Xin wrote:
[snip]
quoted
quoted
+test_expect_success 'prepare a repository with a commit-graph contains commit two' '
+     git init source &&
+     echo "$(pwd)/dest.git/objects" >source/.git/objects/info/alternates &&
+     git -C source remote add origin "$(pwd)/dest.git" &&
+     git -C source config remote.origin.promisor true &&
+     git -C source config remote.origin.partialclonefilter blob:none &&
+     # the source repository has the whole refs contains refs/heads/tmp
+     git -C source fetch origin &&
+     (
+             cd source &&
+             test_commit three &&
+             git -c gc.writeCommitGraph=true gc
+     )
+'
+
+test_expect_success 'change the alternates of source to that without commit two' '
+     # now we have a commit-graph in the source repository but without the commit two
+     echo "$(pwd)/alternates/objects" >source/.git/objects/info/alternates
+'
+
+test_expect_success 'fetch the missing commit' '
+     git -C source fetch origin $oid 2>fetch.out &&
+     grep "$oid" fetch.out
+'
This test passes even without your fix, albeit a lot slower compared
to with it. Can we somehow cause it to fail reliably so that the test
becomes effective in catching a regression here?
Could you help me find the reason why this testcase passes even
without the fix.

From the execution of Github Action, it seems that the problem always exist:
https://github.com/chiyutianyi/git/actions/runs/2527421443.

Thanks.
-Han Xin
Hard to say, I'm not sure either. One thing I noticed though is that in
your CI run there's failure in e.g. linux-gcc, but the test run for
linux-musl succeeds. Personally I'm using musl libc on my system, as
well, so maybe it's a discrepancy between musl- and glibc-based systems?

Patrick

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help