Re: p2000 failure due to empty reflog
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Oct 4, 2021, 19:55 UTC
- Message-ID
- <30df5e39-3f2a-00d8-541b-347c43f36b38@gmail.com>
- In-Reply-To
- <b25ac1cc-8e77-17e6-602a-b289c1e1cfeb@web.de>
On 10/2/2021 1:37 PM, René Scharfe wrote:
Show 21 quoted lines
> 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?
Show 13 quoted lines
> @@ -109,6 +110,14 @@ test_perf_on_all git status > test_perf_on_all git add -A > test_perf_on_all git add . > test_perf_on_all git commit -a -m A > + > +test_expect_success 'add reflog entry' ' > + for repo in full-v3 full-v4 sparse-v3 sparse-v4 > + do > + git -C $repo checkout $OLD_COMMIT > + done > +' > + > test_perf_on_all git checkout -f -
While I believe this will fix the situation, it might only be a band-aid on the real problem of losing the reflog during the test.
Thanks, -Stolee