Re: p2000 failure due to empty reflog
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Oct 5, 2021, 21:38 UTC
- Message-ID
- <8735pfjg47.fsf@evledraar.gmail.com>
- In-Reply-To
- <30df5e39-3f2a-00d8-541b-347c43f36b38@gmail.com>
On Mon, Oct 04 2021, Derrick Stolee wrote:
Show 26 quoted lines
> On 10/2/2021 1:37 PM, René Scharfe wrote: >> p2000 fails for me and reports: >> >> perf 18 - git checkout -f - (full-v3): >> running: >> ( >> cd full-v3 && >> echo >>f2/f4/a && >> git checkout -f - >> ) >> >> error: pathspec '-' did not match any file(s) known to git >> >> checkout fails because the reflog is empty, so the "-" can't be >> resolved. The pathspec error message is confusing, though. >> >> The patch below adds a reflog entry and allows the script to >> succeed. >> >> Before the "test_perf_on_all git commit -a -m A", there are two >> reflog entries in each of the five clones, after it there are >> none. How is that even possible? > > That is certainly confusing. Is there something about your global > (or local to your test repo) GC settings that cause an auto-GC to > prune the reflog aggressively?
Perhaps something to do with certain parts of the code doing a time(NULL), and other parts faking up times to be 2005-something?
I have some WIP patches that run concurrent "git gc --auto" with a detach across the whole test suite, and IIRC I had to search/replace all time(NULL) with my own time() that faked up (looks it up) an epoch of 1113465166 to avoid this exact issue.
If you try doing that across our tests I think you'll find that the @{-1} syntax (reflog-powered) will start failing.
But that's from vague memory, but perhaps it'll point you in the right direction...