All of lore.kernel.org
 help / color / mirror / Atom feed
* p2000 failure due to empty reflog
@ 2021-10-02 17:37 René Scharfe
  2021-10-04 19:55 ` Derrick Stolee
  0 siblings, 1 reply; 10+ messages in thread
From: René Scharfe @ 2021-10-02 17:37 UTC (permalink / raw)
  To: Derrick Stolee via GitGitGadget, Git List

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?


---
 t/perf/p2000-sparse-operations.sh | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/t/perf/p2000-sparse-operations.sh b/t/perf/p2000-sparse-operations.sh
index 597626276f..8529e3d295 100755
--- a/t/perf/p2000-sparse-operations.sh
+++ b/t/perf/p2000-sparse-operations.sh
@@ -25,6 +25,7 @@ test_expect_success 'setup repo and indexes' '
 	git commit -m "level 0" &&
 	BLOB=$(git rev-parse HEAD:a) &&
 	OLD_COMMIT=$(git rev-parse HEAD) &&
+	test_export OLD_COMMIT &&
 	OLD_TREE=$(git rev-parse HEAD^{tree}) &&

 	for i in $(test_seq 1 3)
@@ -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 -

 test_done
--
2.33.0

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-10-11 16:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-02 17:37 p2000 failure due to empty reflog René Scharfe
2021-10-04 19:55 ` Derrick Stolee
2021-10-05 20:28   ` René Scharfe
2021-10-06 16:59     ` Junio C Hamano
2021-10-09 14:39       ` [PATCH] perf: disable automatic housekeeping René Scharfe
2021-10-09 14:57         ` "git reflog expire" blindly trusting timestamps in reflogs Ævar Arnfjörð Bjarmason
2021-10-09 17:50           ` Junio C Hamano
2021-10-11 16:32           ` Jeff King
2021-10-05 21:38   ` p2000 failure due to empty reflog Ævar Arnfjörð Bjarmason
2021-10-09 14:39     ` René Scharfe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.