Git Mailing List Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 00/18] Prepare tests for reftable backend
@ 2021-04-19 10:52 Han-Wen Nienhuys via GitGitGadget
  2021-04-19 10:52 ` [PATCH 01/18] t4202: split testcase for invalid HEAD symref and HEAD hash Han-Wen Nienhuys via GitGitGadget
                   ` (18 more replies)
  0 siblings, 19 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-19 10:52 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys

Rewrites some tests to avoid direct filesystem access.

Introduces the test prereq REFFILES to mark other tests that depend on
specifics of the files ref backend.

Han-Wen Nienhuys (18):
  t4202: split testcase for invalid HEAD symref and HEAD hash
  t9300: check ref existence using git-rev-parse rather than FS check
  t5601: read HEAD using rev-parse
  t1401-symbolic-ref: avoid direct filesystem access
  t1413: use tar to save and restore entire .git directory
  t1301: fix typo in error message
  t5000: inspect HEAD using git-rev-parse
  t7003: use rev-parse rather than FS inspection
  t5304: use "reflog expire --all" to clear the reflog
  test-lib: provide test prereq REFFILES
  t1407: require REFFILES for for_each_reflog test
  t1414: mark corruption test with REFFILES
  t2017: mark --orphan/logAllRefUpdates=false test as REFFILES
  t1404: mark tests that muck with .git directly as REFFILES.
  t7900: mark pack-refs tests as REFFILES
  t7003: check reflog existence only for REFFILES
  t4202: mark bogus head hash test with REFFILES
  t1415: set REFFILES for test specific to storage format

 t/t1301-shared-repo.sh        |  2 +-
 t/t1401-symbolic-ref.sh       | 23 +++++++++--------------
 t/t1404-update-ref-errors.sh  | 30 +++++++++++++++---------------
 t/t1407-worktree-ref-store.sh |  2 +-
 t/t1413-reflog-detach.sh      |  5 ++---
 t/t1414-reflog-walk.sh        |  2 +-
 t/t1415-worktree-refs.sh      |  2 +-
 t/t2017-checkout-orphan.sh    |  2 +-
 t/t4202-log.sh                |  9 ++++++---
 t/t5000-tar-tree.sh           |  7 ++++---
 t/t5304-prune.sh              |  9 +++------
 t/t5601-clone.sh              |  3 ++-
 t/t7003-filter-branch.sh      |  6 ++++--
 t/t7900-maintenance.sh        |  2 +-
 t/t9300-fast-import.sh        |  2 +-
 t/test-lib.sh                 |  2 ++
 16 files changed, 54 insertions(+), 54 deletions(-)


base-commit: 54a391711554ed41b4b0792cfef004abc74893bd
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1008%2Fhanwen%2Freffiles-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1008/hanwen/reffiles-v1
Pull-Request: https://github.com/git/git/pull/1008
-- 
gitgitgadget

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

* [PATCH 01/18] t4202: split testcase for invalid HEAD symref and HEAD hash
  2021-04-19 10:52 [PATCH 00/18] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
@ 2021-04-19 10:52 ` Han-Wen Nienhuys via GitGitGadget
  2021-04-19 21:11   ` SZEDER Gábor
  2021-04-19 10:52 ` [PATCH 02/18] t9300: check ref existence using git-rev-parse rather than FS check Han-Wen Nienhuys via GitGitGadget
                   ` (17 subsequent siblings)
  18 siblings, 1 reply; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-19 10:52 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Reftable will prohibit invalid hashes at the storage level, but
git-symbolic-ref can still create branches ending in ".lock".

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t4202-log.sh | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 350cfa35936a..c575deaad4fb 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -1834,14 +1834,17 @@ test_expect_success 'log --graph --no-walk is forbidden' '
 	test_must_fail git log --graph --no-walk
 '
 
-test_expect_success 'log diagnoses bogus HEAD' '
+test_expect_success 'log diagnoses bogus HEAD hash' '
 	git init empty &&
 	test_must_fail git -C empty log 2>stderr &&
 	test_i18ngrep does.not.have.any.commits stderr &&
 	echo 1234abcd >empty/.git/refs/heads/main &&
 	test_must_fail git -C empty log 2>stderr &&
-	test_i18ngrep broken stderr &&
-	echo "ref: refs/heads/invalid.lock" >empty/.git/HEAD &&
+	test_i18ngrep broken stderr'
+
+test_expect_success 'log diagnoses bogus HEAD symref' '
+	git init empty &&
+	git --git-dir empty/.git symbolic-ref HEAD refs/heads/invalid.lock &&
 	test_must_fail git -C empty log 2>stderr &&
 	test_i18ngrep broken stderr &&
 	test_must_fail git -C empty log --default totally-bogus 2>stderr &&
-- 
gitgitgadget


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

* [PATCH 02/18] t9300: check ref existence using git-rev-parse rather than FS check
  2021-04-19 10:52 [PATCH 00/18] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
  2021-04-19 10:52 ` [PATCH 01/18] t4202: split testcase for invalid HEAD symref and HEAD hash Han-Wen Nienhuys via GitGitGadget
@ 2021-04-19 10:52 ` Han-Wen Nienhuys via GitGitGadget
  2021-04-21  6:01   ` Ævar Arnfjörð Bjarmason
  2021-04-19 10:52 ` [PATCH 03/18] t5601: read HEAD using rev-parse Han-Wen Nienhuys via GitGitGadget
                   ` (16 subsequent siblings)
  18 siblings, 1 reply; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-19 10:52 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t9300-fast-import.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 5c47ac4465cb..087ddf097036 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -392,7 +392,7 @@ test_expect_success 'B: accept branch name "TEMP_TAG"' '
 		git gc
 		git prune" &&
 	git fast-import <input &&
-	test -f .git/TEMP_TAG &&
+	git rev-parse TEMP_TAG &&
 	test $(git rev-parse main) = $(git rev-parse TEMP_TAG^)
 '
 
-- 
gitgitgadget


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

* [PATCH 03/18] t5601: read HEAD using rev-parse
  2021-04-19 10:52 [PATCH 00/18] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
  2021-04-19 10:52 ` [PATCH 01/18] t4202: split testcase for invalid HEAD symref and HEAD hash Han-Wen Nienhuys via GitGitGadget
  2021-04-19 10:52 ` [PATCH 02/18] t9300: check ref existence using git-rev-parse rather than FS check Han-Wen Nienhuys via GitGitGadget
@ 2021-04-19 10:52 ` Han-Wen Nienhuys via GitGitGadget
  2021-04-19 10:52 ` [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access Han-Wen Nienhuys via GitGitGadget
                   ` (15 subsequent siblings)
  18 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-19 10:52 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t5601-clone.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 329ae599fd3c..7223372c7660 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -305,7 +305,8 @@ test_expect_success 'clone from original with relative alternate' '
 test_expect_success 'clone checking out a tag' '
 	git clone --branch=some-tag src dst.tag &&
 	GIT_DIR=src/.git git rev-parse some-tag >expected &&
-	test_cmp expected dst.tag/.git/HEAD &&
+	GIT_DIR=dst.tag/.git git rev-parse HEAD >actual &&
+	test_cmp expected actual &&
 	GIT_DIR=dst.tag/.git git config remote.origin.fetch >fetch.actual &&
 	echo "+refs/heads/*:refs/remotes/origin/*" >fetch.expected &&
 	test_cmp fetch.expected fetch.actual
-- 
gitgitgadget


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

* [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access
  2021-04-19 10:52 [PATCH 00/18] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                   ` (2 preceding siblings ...)
  2021-04-19 10:52 ` [PATCH 03/18] t5601: read HEAD using rev-parse Han-Wen Nienhuys via GitGitGadget
@ 2021-04-19 10:52 ` Han-Wen Nienhuys via GitGitGadget
  2021-04-19 20:38   ` SZEDER Gábor
  2021-04-21  6:09   ` Ævar Arnfjörð Bjarmason
  2021-04-19 10:52 ` [PATCH 05/18] t1413: use tar to save and restore entire .git directory Han-Wen Nienhuys via GitGitGadget
                   ` (14 subsequent siblings)
  18 siblings, 2 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-19 10:52 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t1401-symbolic-ref.sh | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh
index a4ebb0b65fec..fd5980d3fb40 100755
--- a/t/t1401-symbolic-ref.sh
+++ b/t/t1401-symbolic-ref.sh
@@ -7,18 +7,13 @@ test_description='basic symbolic-ref tests'
 # the git repo, meaning that further tests will operate on
 # the surrounding git repo instead of the trash directory.
 reset_to_sane() {
-	echo ref: refs/heads/foo >.git/HEAD
+	git --git-dir .git symbolic-ref HEAD refs/heads/foo
 }
 
-test_expect_success 'symbolic-ref writes HEAD' '
-	git symbolic-ref HEAD refs/heads/foo &&
-	echo ref: refs/heads/foo >expect &&
-	test_cmp expect .git/HEAD
-'
-
-test_expect_success 'symbolic-ref reads HEAD' '
-	echo refs/heads/foo >expect &&
-	git symbolic-ref HEAD >actual &&
+test_expect_success 'symbolic-ref read/write roundtrip' '
+	git symbolic-ref HEAD refs/heads/read-write-roundtrip &&
+	echo refs/heads/read-write-roundtrip > expect &&
+	git symbolic-ref HEAD > actual &&
 	test_cmp expect actual
 '
 
@@ -42,16 +37,16 @@ reset_to_sane
 test_expect_success 'symbolic-ref can be deleted' '
 	git symbolic-ref NOTHEAD refs/heads/foo &&
 	git symbolic-ref -d NOTHEAD &&
-	test_path_is_file .git/refs/heads/foo &&
-	test_path_is_missing .git/NOTHEAD
+	git rev-parse refs/heads/foo &&
+	! git symbolic-ref NOTHEAD
 '
 reset_to_sane
 
 test_expect_success 'symbolic-ref can delete dangling symref' '
 	git symbolic-ref NOTHEAD refs/heads/missing &&
 	git symbolic-ref -d NOTHEAD &&
-	test_path_is_missing .git/refs/heads/missing &&
-	test_path_is_missing .git/NOTHEAD
+	! git rev-parse refs/heads/missing &&
+	! git symbolic-ref NOTHEAD
 '
 reset_to_sane
 
-- 
gitgitgadget


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

* [PATCH 05/18] t1413: use tar to save and restore entire .git directory
  2021-04-19 10:52 [PATCH 00/18] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                   ` (3 preceding siblings ...)
  2021-04-19 10:52 ` [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access Han-Wen Nienhuys via GitGitGadget
@ 2021-04-19 10:52 ` Han-Wen Nienhuys via GitGitGadget
  2021-04-20 22:51   ` Junio C Hamano
  2021-04-19 10:52 ` [PATCH 06/18] t1301: fix typo in error message Han-Wen Nienhuys via GitGitGadget
                   ` (13 subsequent siblings)
  18 siblings, 1 reply; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-19 10:52 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

This makes the test independent of the particulars of the storage formats.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t1413-reflog-detach.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/t/t1413-reflog-detach.sh b/t/t1413-reflog-detach.sh
index bde05208ae6a..b699c2bb7c31 100755
--- a/t/t1413-reflog-detach.sh
+++ b/t/t1413-reflog-detach.sh
@@ -7,8 +7,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 . ./test-lib.sh
 
 reset_state () {
-	git checkout main &&
-	cp saved_reflog .git/logs/HEAD
+	rm -rf .git && tar -xf .git-saved.tar
 }
 
 test_expect_success setup '
@@ -17,7 +16,7 @@ test_expect_success setup '
 	git branch side &&
 	test_tick &&
 	git commit --allow-empty -m second &&
-	cat .git/logs/HEAD >saved_reflog
+	tar -cf .git-saved.tar .git
 '
 
 test_expect_success baseline '
-- 
gitgitgadget


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

* [PATCH 06/18] t1301: fix typo in error message
  2021-04-19 10:52 [PATCH 00/18] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                   ` (4 preceding siblings ...)
  2021-04-19 10:52 ` [PATCH 05/18] t1413: use tar to save and restore entire .git directory Han-Wen Nienhuys via GitGitGadget
@ 2021-04-19 10:52 ` Han-Wen Nienhuys via GitGitGadget
  2021-04-19 10:52 ` [PATCH 07/18] t5000: inspect HEAD using git-rev-parse Han-Wen Nienhuys via GitGitGadget
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-19 10:52 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t1301-shared-repo.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh
index ac947bff9fcf..84bf1970d8bf 100755
--- a/t/t1301-shared-repo.sh
+++ b/t/t1301-shared-repo.sh
@@ -124,7 +124,7 @@ test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '
 		: happy
 		;;
 	*)
-		echo Ooops, .git/logs/refs/heads/main is not 0662 [$actual]
+		echo Ooops, .git/logs/refs/heads/main is not 066x [$actual]
 		false
 		;;
 	esac
-- 
gitgitgadget


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

* [PATCH 07/18] t5000: inspect HEAD using git-rev-parse
  2021-04-19 10:52 [PATCH 00/18] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                   ` (5 preceding siblings ...)
  2021-04-19 10:52 ` [PATCH 06/18] t1301: fix typo in error message Han-Wen Nienhuys via GitGitGadget
@ 2021-04-19 10:52 ` Han-Wen Nienhuys via GitGitGadget
  2021-04-21  6:11   ` Ævar Arnfjörð Bjarmason
  2021-04-19 10:52 ` [PATCH 08/18] t7003: use rev-parse rather than FS inspection Han-Wen Nienhuys via GitGitGadget
                   ` (11 subsequent siblings)
  18 siblings, 1 reply; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-19 10:52 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t5000-tar-tree.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index 7204799a0b52..472fec4ee64a 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -233,9 +233,10 @@ test_expect_success \
      test_cmp expected.mtime b.mtime'
 
 test_expect_success \
-    'git get-tar-commit-id' \
-    'git get-tar-commit-id <b.tar >b.commitid &&
-     test_cmp .git/$(git symbolic-ref HEAD) b.commitid'
+	'git get-tar-commit-id' \
+	'git get-tar-commit-id <b.tar >actual &&
+	git rev-parse HEAD > expect &&
+	test_cmp expect actual'
 
 test_expect_success 'git archive with --output, override inferred format' '
 	git archive --format=tar --output=d4.zip HEAD &&
-- 
gitgitgadget


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

* [PATCH 08/18] t7003: use rev-parse rather than FS inspection
  2021-04-19 10:52 [PATCH 00/18] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                   ` (6 preceding siblings ...)
  2021-04-19 10:52 ` [PATCH 07/18] t5000: inspect HEAD using git-rev-parse Han-Wen Nienhuys via GitGitGadget
@ 2021-04-19 10:52 ` Han-Wen Nienhuys via GitGitGadget
  2021-04-19 10:52 ` [PATCH 09/18] t5304: use "reflog expire --all" to clear the reflog Han-Wen Nienhuys via GitGitGadget
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-19 10:52 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t7003-filter-branch.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index 1349e5b2321c..cf30055c88dd 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -395,7 +395,7 @@ test_expect_success '--prune-empty is able to prune root commit' '
 test_expect_success '--prune-empty is able to prune entire branch' '
 	git branch prune-entire B &&
 	git filter-branch -f --prune-empty --index-filter "git update-index --remove A.t B.t" prune-entire &&
-	test_path_is_missing .git/refs/heads/prune-entire &&
+	test_must_fail git rev-parse refs/heads/prune-entire &&
 	test_must_fail git reflog exists refs/heads/prune-entire
 '
 
-- 
gitgitgadget


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

* [PATCH 09/18] t5304: use "reflog expire --all" to clear the reflog
  2021-04-19 10:52 [PATCH 00/18] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                   ` (7 preceding siblings ...)
  2021-04-19 10:52 ` [PATCH 08/18] t7003: use rev-parse rather than FS inspection Han-Wen Nienhuys via GitGitGadget
@ 2021-04-19 10:52 ` Han-Wen Nienhuys via GitGitGadget
  2021-04-21  6:13   ` Ævar Arnfjörð Bjarmason
  2021-04-19 10:52 ` [PATCH 10/18] test-lib: provide test prereq REFFILES Han-Wen Nienhuys via GitGitGadget
                   ` (9 subsequent siblings)
  18 siblings, 1 reply; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-19 10:52 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

This is more explicit, and reduces the depency between test functions. It also
is more amenable to use with reftable, which has no concept of (non)existence of
a reflog

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t5304-prune.sh | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh
index b447ce56a9b2..4ffc0076801e 100755
--- a/t/t5304-prune.sh
+++ b/t/t5304-prune.sh
@@ -94,26 +94,22 @@ test_expect_success 'prune: prune nonsense parameters' '
 '
 
 test_expect_success 'prune: prune unreachable heads' '
-
 	git config core.logAllRefUpdates false &&
-	mv .git/logs .git/logs.old &&
 	: > file2 &&
 	git add file2 &&
 	git commit -m temporary &&
 	tmp_head=$(git rev-list -1 HEAD) &&
 	git reset HEAD^ &&
+	git reflog expire --all &&
 	git prune &&
 	test_must_fail git reset $tmp_head --
-
 '
 
 test_expect_success 'prune: do not prune detached HEAD with no reflog' '
 
 	git checkout --detach --quiet &&
 	git commit --allow-empty -m "detached commit" &&
-	# verify that there is no reflogs
-	# (should be removed and disabled by previous test)
-	test_path_is_missing .git/logs &&
+	git reflog expire --all &&
 	git prune -n >prune_actual &&
 	test_must_be_empty prune_actual
 
@@ -123,6 +119,7 @@ test_expect_success 'prune: prune former HEAD after checking out branch' '
 
 	head_oid=$(git rev-parse HEAD) &&
 	git checkout --quiet main &&
+	git reflog expire --all &&
 	git prune -v >prune_actual &&
 	grep "$head_oid" prune_actual
 
-- 
gitgitgadget


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

* [PATCH 10/18] test-lib: provide test prereq REFFILES
  2021-04-19 10:52 [PATCH 00/18] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                   ` (8 preceding siblings ...)
  2021-04-19 10:52 ` [PATCH 09/18] t5304: use "reflog expire --all" to clear the reflog Han-Wen Nienhuys via GitGitGadget
@ 2021-04-19 10:52 ` Han-Wen Nienhuys via GitGitGadget
  2021-04-20 22:57   ` Junio C Hamano
  2021-04-19 10:52 ` [PATCH 11/18] t1407: require REFFILES for for_each_reflog test Han-Wen Nienhuys via GitGitGadget
                   ` (8 subsequent siblings)
  18 siblings, 1 reply; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-19 10:52 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

REFFILES can be used to mark tests that are specific to the packed/loose ref
storage format and its limitations. Marking such tests is a preparation for
introducing the reftable storage backend.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/test-lib.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index d3f6af6a6545..ea7397c633db 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1481,6 +1481,8 @@ parisc* | hppa*)
 	;;
 esac
 
+test_set_prereq REFFILES
+
 ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1
 test -z "$NO_PERL" && test_set_prereq PERL
 test -z "$NO_PTHREADS" && test_set_prereq PTHREADS
-- 
gitgitgadget


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

* [PATCH 11/18] t1407: require REFFILES for for_each_reflog test
  2021-04-19 10:52 [PATCH 00/18] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                   ` (9 preceding siblings ...)
  2021-04-19 10:52 ` [PATCH 10/18] test-lib: provide test prereq REFFILES Han-Wen Nienhuys via GitGitGadget
@ 2021-04-19 10:52 ` Han-Wen Nienhuys via GitGitGadget
  2021-04-21  6:23   ` Ævar Arnfjörð Bjarmason
  2021-04-19 10:52 ` [PATCH 12/18] t1414: mark corruption test with REFFILES Han-Wen Nienhuys via GitGitGadget
                   ` (7 subsequent siblings)
  18 siblings, 1 reply; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-19 10:52 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

It tries to setup a reflog by catting to .git/logs/

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t1407-worktree-ref-store.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t1407-worktree-ref-store.sh b/t/t1407-worktree-ref-store.sh
index d3fe77751122..27b57f248a94 100755
--- a/t/t1407-worktree-ref-store.sh
+++ b/t/t1407-worktree-ref-store.sh
@@ -52,7 +52,7 @@ test_expect_success 'create_symref(FOO, refs/heads/main)' '
 	test_cmp expected actual
 '
 
-test_expect_success 'for_each_reflog()' '
+test_expect_success REFFILES 'for_each_reflog()' '
 	echo $ZERO_OID > .git/logs/PSEUDO-MAIN &&
 	mkdir -p     .git/logs/refs/bisect &&
 	echo $ZERO_OID > .git/logs/refs/bisect/random &&
-- 
gitgitgadget


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

* [PATCH 12/18] t1414: mark corruption test with REFFILES
  2021-04-19 10:52 [PATCH 00/18] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                   ` (10 preceding siblings ...)
  2021-04-19 10:52 ` [PATCH 11/18] t1407: require REFFILES for for_each_reflog test Han-Wen Nienhuys via GitGitGadget
@ 2021-04-19 10:52 ` Han-Wen Nienhuys via GitGitGadget
  2021-04-19 10:52 ` [PATCH 13/18] t2017: mark --orphan/logAllRefUpdates=false test as REFFILES Han-Wen Nienhuys via GitGitGadget
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-19 10:52 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

The reftable format guarantees that reflog entries are well-formed

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t1414-reflog-walk.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t1414-reflog-walk.sh b/t/t1414-reflog-walk.sh
index 80d94704d012..72a5ac61a520 100755
--- a/t/t1414-reflog-walk.sh
+++ b/t/t1414-reflog-walk.sh
@@ -119,7 +119,7 @@ test_expect_success 'min/max age uses entry date to limit' '
 	test_cmp expect actual
 '
 
-test_expect_success 'walk prefers reflog to ref tip' '
+test_expect_success REFFILES 'walk prefers reflog to ref tip' '
 	head=$(git rev-parse HEAD) &&
 	one=$(git rev-parse one) &&
 	ident="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE" &&
-- 
gitgitgadget


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

* [PATCH 13/18] t2017: mark --orphan/logAllRefUpdates=false test as REFFILES
  2021-04-19 10:52 [PATCH 00/18] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                   ` (11 preceding siblings ...)
  2021-04-19 10:52 ` [PATCH 12/18] t1414: mark corruption test with REFFILES Han-Wen Nienhuys via GitGitGadget
@ 2021-04-19 10:52 ` Han-Wen Nienhuys via GitGitGadget
  2021-04-21  6:39   ` Ævar Arnfjörð Bjarmason
  2021-04-19 10:52 ` [PATCH 14/18] t1404: mark tests that muck with .git directly " Han-Wen Nienhuys via GitGitGadget
                   ` (5 subsequent siblings)
  18 siblings, 1 reply; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-19 10:52 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

In reftable, there is no notion of a per-ref 'existence' of a reflog. Each
reflog entry has its own key, so it is not possible to distinguish between
{reflog doesn't exist,reflog exists but is empty}. This makes the logic
in log_ref_setup() (file refs/files-backend.c), which depends on the existence
of the reflog file infeasible.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t2017-checkout-orphan.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t2017-checkout-orphan.sh b/t/t2017-checkout-orphan.sh
index c7adbdd39ab9..88d6992a5e1f 100755
--- a/t/t2017-checkout-orphan.sh
+++ b/t/t2017-checkout-orphan.sh
@@ -76,7 +76,7 @@ test_expect_success '--orphan makes reflog by default' '
 	git rev-parse --verify delta@{0}
 '
 
-test_expect_success '--orphan does not make reflog when core.logAllRefUpdates = false' '
+test_expect_success REFFILES '--orphan does not make reflog when core.logAllRefUpdates = false' '
 	git checkout main &&
 	git config core.logAllRefUpdates false &&
 	git checkout --orphan epsilon &&
-- 
gitgitgadget


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

* [PATCH 14/18] t1404: mark tests that muck with .git directly as REFFILES.
  2021-04-19 10:52 [PATCH 00/18] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                   ` (12 preceding siblings ...)
  2021-04-19 10:52 ` [PATCH 13/18] t2017: mark --orphan/logAllRefUpdates=false test as REFFILES Han-Wen Nienhuys via GitGitGadget
@ 2021-04-19 10:52 ` Han-Wen Nienhuys via GitGitGadget
  2021-04-21  6:57   ` Ævar Arnfjörð Bjarmason
  2021-04-19 10:53 ` [PATCH 15/18] t7900: mark pack-refs tests " Han-Wen Nienhuys via GitGitGadget
                   ` (4 subsequent siblings)
  18 siblings, 1 reply; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-19 10:52 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t1404-update-ref-errors.sh | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/t/t1404-update-ref-errors.sh b/t/t1404-update-ref-errors.sh
index 8b51c4efc135..b729c1f48030 100755
--- a/t/t1404-update-ref-errors.sh
+++ b/t/t1404-update-ref-errors.sh
@@ -189,7 +189,7 @@ test_expect_success 'one new ref is a simple prefix of another' '
 
 '
 
-test_expect_success 'empty directory should not fool rev-parse' '
+test_expect_success REFFILES 'empty directory should not fool rev-parse' '
 	prefix=refs/e-rev-parse &&
 	git update-ref $prefix/foo $C &&
 	git pack-refs --all &&
@@ -199,7 +199,7 @@ test_expect_success 'empty directory should not fool rev-parse' '
 	test_cmp expected actual
 '
 
-test_expect_success 'empty directory should not fool for-each-ref' '
+test_expect_success REFFILES 'empty directory should not fool for-each-ref' '
 	prefix=refs/e-for-each-ref &&
 	git update-ref $prefix/foo $C &&
 	git for-each-ref $prefix >expected &&
@@ -209,14 +209,14 @@ test_expect_success 'empty directory should not fool for-each-ref' '
 	test_cmp expected actual
 '
 
-test_expect_success 'empty directory should not fool create' '
+test_expect_success REFFILES 'empty directory should not fool create' '
 	prefix=refs/e-create &&
 	mkdir -p .git/$prefix/foo/bar/baz &&
 	printf "create %s $C\n" $prefix/foo |
 	git update-ref --stdin
 '
 
-test_expect_success 'empty directory should not fool verify' '
+test_expect_success REFFILES 'empty directory should not fool verify' '
 	prefix=refs/e-verify &&
 	git update-ref $prefix/foo $C &&
 	git pack-refs --all &&
@@ -225,7 +225,7 @@ test_expect_success 'empty directory should not fool verify' '
 	git update-ref --stdin
 '
 
-test_expect_success 'empty directory should not fool 1-arg update' '
+test_expect_success REFFILES 'empty directory should not fool 1-arg update' '
 	prefix=refs/e-update-1 &&
 	git update-ref $prefix/foo $C &&
 	git pack-refs --all &&
@@ -234,7 +234,7 @@ test_expect_success 'empty directory should not fool 1-arg update' '
 	git update-ref --stdin
 '
 
-test_expect_success 'empty directory should not fool 2-arg update' '
+test_expect_success REFFILES 'empty directory should not fool 2-arg update' '
 	prefix=refs/e-update-2 &&
 	git update-ref $prefix/foo $C &&
 	git pack-refs --all &&
@@ -243,7 +243,7 @@ test_expect_success 'empty directory should not fool 2-arg update' '
 	git update-ref --stdin
 '
 
-test_expect_success 'empty directory should not fool 0-arg delete' '
+test_expect_success REFFILES 'empty directory should not fool 0-arg delete' '
 	prefix=refs/e-delete-0 &&
 	git update-ref $prefix/foo $C &&
 	git pack-refs --all &&
@@ -252,7 +252,7 @@ test_expect_success 'empty directory should not fool 0-arg delete' '
 	git update-ref --stdin
 '
 
-test_expect_success 'empty directory should not fool 1-arg delete' '
+test_expect_success REFFILES 'empty directory should not fool 1-arg delete' '
 	prefix=refs/e-delete-1 &&
 	git update-ref $prefix/foo $C &&
 	git pack-refs --all &&
@@ -466,7 +466,7 @@ test_expect_success 'incorrect old value blocks indirect no-deref delete' '
 	test_cmp expected output.err
 '
 
-test_expect_success 'non-empty directory blocks create' '
+test_expect_success REFFILES 'non-empty directory blocks create' '
 	prefix=refs/ne-create &&
 	mkdir -p .git/$prefix/foo/bar &&
 	: >.git/$prefix/foo/bar/baz.lock &&
@@ -485,7 +485,7 @@ test_expect_success 'non-empty directory blocks create' '
 	test_cmp expected output.err
 '
 
-test_expect_success 'broken reference blocks create' '
+test_expect_success REFFILES 'broken reference blocks create' '
 	prefix=refs/broken-create &&
 	mkdir -p .git/$prefix &&
 	echo "gobbledigook" >.git/$prefix/foo &&
@@ -504,7 +504,7 @@ test_expect_success 'broken reference blocks create' '
 	test_cmp expected output.err
 '
 
-test_expect_success 'non-empty directory blocks indirect create' '
+test_expect_success REFFILES 'non-empty directory blocks indirect create' '
 	prefix=refs/ne-indirect-create &&
 	git symbolic-ref $prefix/symref $prefix/foo &&
 	mkdir -p .git/$prefix/foo/bar &&
@@ -524,7 +524,7 @@ test_expect_success 'non-empty directory blocks indirect create' '
 	test_cmp expected output.err
 '
 
-test_expect_success 'broken reference blocks indirect create' '
+test_expect_success REFFILES 'broken reference blocks indirect create' '
 	prefix=refs/broken-indirect-create &&
 	git symbolic-ref $prefix/symref $prefix/foo &&
 	echo "gobbledigook" >.git/$prefix/foo &&
@@ -543,7 +543,7 @@ test_expect_success 'broken reference blocks indirect create' '
 	test_cmp expected output.err
 '
 
-test_expect_success 'no bogus intermediate values during delete' '
+test_expect_success REFFILES 'no bogus intermediate values during delete' '
 	prefix=refs/slow-transaction &&
 	# Set up a reference with differing loose and packed versions:
 	git update-ref $prefix/foo $C &&
@@ -600,7 +600,7 @@ test_expect_success 'no bogus intermediate values during delete' '
 	test_must_fail git rev-parse --verify --quiet $prefix/foo
 '
 
-test_expect_success 'delete fails cleanly if packed-refs file is locked' '
+test_expect_success REFFILES 'delete fails cleanly if packed-refs file is locked' '
 	prefix=refs/locked-packed-refs &&
 	# Set up a reference with differing loose and packed versions:
 	git update-ref $prefix/foo $C &&
@@ -616,7 +616,7 @@ test_expect_success 'delete fails cleanly if packed-refs file is locked' '
 	test_cmp unchanged actual
 '
 
-test_expect_success 'delete fails cleanly if packed-refs.new write fails' '
+test_expect_success REFFILES 'delete fails cleanly if packed-refs.new write fails' '
 	# Setup and expectations are similar to the test above.
 	prefix=refs/failed-packed-refs &&
 	git update-ref $prefix/foo $C &&
-- 
gitgitgadget


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

* [PATCH 15/18] t7900: mark pack-refs tests as REFFILES
  2021-04-19 10:52 [PATCH 00/18] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                   ` (13 preceding siblings ...)
  2021-04-19 10:52 ` [PATCH 14/18] t1404: mark tests that muck with .git directly " Han-Wen Nienhuys via GitGitGadget
@ 2021-04-19 10:53 ` Han-Wen Nienhuys via GitGitGadget
  2021-04-21  7:00   ` Ævar Arnfjörð Bjarmason
  2021-04-19 10:53 ` [PATCH 16/18] t7003: check reflog existence only for REFFILES Han-Wen Nienhuys via GitGitGadget
                   ` (3 subsequent siblings)
  18 siblings, 1 reply; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-19 10:53 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t7900-maintenance.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh
index 2412d8c5c006..6f2f55a6c51d 100755
--- a/t/t7900-maintenance.sh
+++ b/t/t7900-maintenance.sh
@@ -343,7 +343,7 @@ test_expect_success 'maintenance.incremental-repack.auto' '
 	test_subcommand git multi-pack-index write --no-progress <trace-B
 '
 
-test_expect_success 'pack-refs task' '
+test_expect_success REFFILES 'pack-refs task' '
 	for n in $(test_seq 1 5)
 	do
 		git branch -f to-pack/$n HEAD || return 1
-- 
gitgitgadget


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

* [PATCH 16/18] t7003: check reflog existence only for REFFILES
  2021-04-19 10:52 [PATCH 00/18] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                   ` (14 preceding siblings ...)
  2021-04-19 10:53 ` [PATCH 15/18] t7900: mark pack-refs tests " Han-Wen Nienhuys via GitGitGadget
@ 2021-04-19 10:53 ` Han-Wen Nienhuys via GitGitGadget
  2021-04-20 22:59   ` Junio C Hamano
  2021-04-21  7:02   ` Ævar Arnfjörð Bjarmason
  2021-04-19 10:53 ` [PATCH 17/18] t4202: mark bogus head hash test with REFFILES Han-Wen Nienhuys via GitGitGadget
                   ` (2 subsequent siblings)
  18 siblings, 2 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-19 10:53 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t7003-filter-branch.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index cf30055c88dd..380bdf934317 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -396,7 +396,9 @@ test_expect_success '--prune-empty is able to prune entire branch' '
 	git branch prune-entire B &&
 	git filter-branch -f --prune-empty --index-filter "git update-index --remove A.t B.t" prune-entire &&
 	test_must_fail git rev-parse refs/heads/prune-entire &&
-	test_must_fail git reflog exists refs/heads/prune-entire
+	if test_have_prereq REFFILES ; then
+		test_must_fail git reflog exists refs/heads/prune-entire
+	fi
 '
 
 test_expect_success '--remap-to-ancestor with filename filters' '
-- 
gitgitgadget


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

* [PATCH 17/18] t4202: mark bogus head hash test with REFFILES
  2021-04-19 10:52 [PATCH 00/18] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                   ` (15 preceding siblings ...)
  2021-04-19 10:53 ` [PATCH 16/18] t7003: check reflog existence only for REFFILES Han-Wen Nienhuys via GitGitGadget
@ 2021-04-19 10:53 ` Han-Wen Nienhuys via GitGitGadget
  2021-04-21  7:08   ` Ævar Arnfjörð Bjarmason
  2021-04-19 10:53 ` [PATCH 18/18] t1415: set REFFILES for test specific to storage format Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
  18 siblings, 1 reply; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-19 10:53 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

In reftable, hashes are correctly formed by design

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t4202-log.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index c575deaad4fb..ed6d4ecd3a28 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -1834,7 +1834,7 @@ test_expect_success 'log --graph --no-walk is forbidden' '
 	test_must_fail git log --graph --no-walk
 '
 
-test_expect_success 'log diagnoses bogus HEAD hash' '
+test_expect_success REFFILES 'log diagnoses bogus HEAD hash' '
 	git init empty &&
 	test_must_fail git -C empty log 2>stderr &&
 	test_i18ngrep does.not.have.any.commits stderr &&
-- 
gitgitgadget


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

* [PATCH 18/18] t1415: set REFFILES for test specific to storage format
  2021-04-19 10:52 [PATCH 00/18] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                   ` (16 preceding siblings ...)
  2021-04-19 10:53 ` [PATCH 17/18] t4202: mark bogus head hash test with REFFILES Han-Wen Nienhuys via GitGitGadget
@ 2021-04-19 10:53 ` Han-Wen Nienhuys via GitGitGadget
  2021-04-21  7:15   ` Ævar Arnfjörð Bjarmason
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
  18 siblings, 1 reply; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-19 10:53 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t1415-worktree-refs.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t1415-worktree-refs.sh b/t/t1415-worktree-refs.sh
index 7ab91241ab7c..a8083a0af3af 100755
--- a/t/t1415-worktree-refs.sh
+++ b/t/t1415-worktree-refs.sh
@@ -16,7 +16,7 @@ test_expect_success 'setup' '
 	git -C wt2 update-ref refs/worktree/foo HEAD
 '
 
-test_expect_success 'refs/worktree must not be packed' '
+test_expect_success REFFILES 'refs/worktree must not be packed' '
 	git pack-refs --all &&
 	test_path_is_missing .git/refs/tags/wt1 &&
 	test_path_is_file .git/refs/worktree/foo &&
-- 
gitgitgadget

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

* Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access
  2021-04-19 10:52 ` [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access Han-Wen Nienhuys via GitGitGadget
@ 2021-04-19 20:38   ` SZEDER Gábor
  2021-04-27  9:13     ` Han-Wen Nienhuys
  2021-04-21  6:09   ` Ævar Arnfjörð Bjarmason
  1 sibling, 1 reply; 82+ messages in thread
From: SZEDER Gábor @ 2021-04-19 20:38 UTC (permalink / raw)
  To: Han-Wen Nienhuys via GitGitGadget; +Cc: git, Han-Wen Nienhuys, Han-Wen Nienhuys

On Mon, Apr 19, 2021 at 10:52:49AM +0000, Han-Wen Nienhuys via GitGitGadget wrote:
> From: Han-Wen Nienhuys <hanwen@google.com>
> 
> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> ---
>  t/t1401-symbolic-ref.sh | 23 +++++++++--------------
>  1 file changed, 9 insertions(+), 14 deletions(-)
> 
> diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh
> index a4ebb0b65fec..fd5980d3fb40 100755
> --- a/t/t1401-symbolic-ref.sh
> +++ b/t/t1401-symbolic-ref.sh
> @@ -7,18 +7,13 @@ test_description='basic symbolic-ref tests'
>  # the git repo, meaning that further tests will operate on
>  # the surrounding git repo instead of the trash directory.
>  reset_to_sane() {
> -	echo ref: refs/heads/foo >.git/HEAD
> +	git --git-dir .git symbolic-ref HEAD refs/heads/foo
>  }
>  
> -test_expect_success 'symbolic-ref writes HEAD' '
> -	git symbolic-ref HEAD refs/heads/foo &&
> -	echo ref: refs/heads/foo >expect &&
> -	test_cmp expect .git/HEAD
> -'
> -
> -test_expect_success 'symbolic-ref reads HEAD' '
> -	echo refs/heads/foo >expect &&
> -	git symbolic-ref HEAD >actual &&
> +test_expect_success 'symbolic-ref read/write roundtrip' '
> +	git symbolic-ref HEAD refs/heads/read-write-roundtrip &&
> +	echo refs/heads/read-write-roundtrip > expect &&
> +	git symbolic-ref HEAD > actual &&

Style nit: no space between redirection and filename, i.e. these
should be '>expect' and '>actual'.

>  	test_cmp expect actual
>  '
>  
> @@ -42,16 +37,16 @@ reset_to_sane
>  test_expect_success 'symbolic-ref can be deleted' '
>  	git symbolic-ref NOTHEAD refs/heads/foo &&
>  	git symbolic-ref -d NOTHEAD &&
> -	test_path_is_file .git/refs/heads/foo &&
> -	test_path_is_missing .git/NOTHEAD
> +	git rev-parse refs/heads/foo &&
> +	! git symbolic-ref NOTHEAD

Please use 'test_must_fail git ...', because otherwise a segfault
could go unnoticed.

>  '
>  reset_to_sane
>  
>  test_expect_success 'symbolic-ref can delete dangling symref' '
>  	git symbolic-ref NOTHEAD refs/heads/missing &&
>  	git symbolic-ref -d NOTHEAD &&
> -	test_path_is_missing .git/refs/heads/missing &&
> -	test_path_is_missing .git/NOTHEAD
> +	! git rev-parse refs/heads/missing &&
> +	! git symbolic-ref NOTHEAD
>  '
>  reset_to_sane
>  
> -- 
> gitgitgadget
> 

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

* Re: [PATCH 01/18] t4202: split testcase for invalid HEAD symref and HEAD hash
  2021-04-19 10:52 ` [PATCH 01/18] t4202: split testcase for invalid HEAD symref and HEAD hash Han-Wen Nienhuys via GitGitGadget
@ 2021-04-19 21:11   ` SZEDER Gábor
  2021-04-27  9:14     ` Han-Wen Nienhuys
  0 siblings, 1 reply; 82+ messages in thread
From: SZEDER Gábor @ 2021-04-19 21:11 UTC (permalink / raw)
  To: Han-Wen Nienhuys via GitGitGadget; +Cc: git, Han-Wen Nienhuys, Han-Wen Nienhuys

On Mon, Apr 19, 2021 at 10:52:46AM +0000, Han-Wen Nienhuys via GitGitGadget wrote:
> From: Han-Wen Nienhuys <hanwen@google.com>
> 
> Reftable will prohibit invalid hashes at the storage level, but
> git-symbolic-ref can still create branches ending in ".lock".
> 
> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> ---
>  t/t4202-log.sh | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/t/t4202-log.sh b/t/t4202-log.sh
> index 350cfa35936a..c575deaad4fb 100755
> --- a/t/t4202-log.sh
> +++ b/t/t4202-log.sh
> @@ -1834,14 +1834,17 @@ test_expect_success 'log --graph --no-walk is forbidden' '
>  	test_must_fail git log --graph --no-walk
>  '
>  
> -test_expect_success 'log diagnoses bogus HEAD' '
> +test_expect_success 'log diagnoses bogus HEAD hash' '
>  	git init empty &&

This test creates a new repo in 'empty'...

>  	test_must_fail git -C empty log 2>stderr &&
>  	test_i18ngrep does.not.have.any.commits stderr &&
>  	echo 1234abcd >empty/.git/refs/heads/main &&
>  	test_must_fail git -C empty log 2>stderr &&
> -	test_i18ngrep broken stderr &&
> -	echo "ref: refs/heads/invalid.lock" >empty/.git/HEAD &&
> +	test_i18ngrep broken stderr'
> +
> +test_expect_success 'log diagnoses bogus HEAD symref' '
> +	git init empty &&

... and this test create a new repo in 'empty' as well.  Or rather
re-initializes the already existing repository there.

Is this intentional?  It surely cases some confusion.

> +	git --git-dir empty/.git symbolic-ref HEAD refs/heads/invalid.lock &&
>  	test_must_fail git -C empty log 2>stderr &&
>  	test_i18ngrep broken stderr &&
>  	test_must_fail git -C empty log --default totally-bogus 2>stderr &&
> -- 
> gitgitgadget
> 

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

* Re: [PATCH 05/18] t1413: use tar to save and restore entire .git directory
  2021-04-19 10:52 ` [PATCH 05/18] t1413: use tar to save and restore entire .git directory Han-Wen Nienhuys via GitGitGadget
@ 2021-04-20 22:51   ` Junio C Hamano
  2021-04-27  9:15     ` Han-Wen Nienhuys
  0 siblings, 1 reply; 82+ messages in thread
From: Junio C Hamano @ 2021-04-20 22:51 UTC (permalink / raw)
  To: Han-Wen Nienhuys via GitGitGadget; +Cc: git, Han-Wen Nienhuys, Han-Wen Nienhuys

"Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Han-Wen Nienhuys <hanwen@google.com>
>
> This makes the test independent of the particulars of the storage formats.
>
> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> ---
>  t/t1413-reflog-detach.sh | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/t/t1413-reflog-detach.sh b/t/t1413-reflog-detach.sh
> index bde05208ae6a..b699c2bb7c31 100755
> --- a/t/t1413-reflog-detach.sh
> +++ b/t/t1413-reflog-detach.sh
> @@ -7,8 +7,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
>  . ./test-lib.sh
>  
>  reset_state () {
> -	git checkout main &&
> -	cp saved_reflog .git/logs/HEAD
> +	rm -rf .git && tar -xf .git-saved.tar

Unlike GNUism longer option names like "tar --extract", you do not
need a single dash when you ask "tar xf" (see our Makefile).

Looking at t/t5000-tar-tree.sh, we seem to be supposed to use "$TAR"
(with double quotes) to name the tar utility, so that people can say
TAR=gtar on certain platforms.  I suspect that there already are a
few existing violations but let's not make it worse.

>  }
>  
>  test_expect_success setup '
> @@ -17,7 +16,7 @@ test_expect_success setup '
>  	git branch side &&
>  	test_tick &&
>  	git commit --allow-empty -m second &&
> -	cat .git/logs/HEAD >saved_reflog
> +	tar -cf .git-saved.tar .git

Likewise 

	"$TAR" cf ...

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

* Re: [PATCH 10/18] test-lib: provide test prereq REFFILES
  2021-04-19 10:52 ` [PATCH 10/18] test-lib: provide test prereq REFFILES Han-Wen Nienhuys via GitGitGadget
@ 2021-04-20 22:57   ` Junio C Hamano
  2021-04-20 23:37     ` Junio C Hamano
  2021-04-27  9:16     ` Han-Wen Nienhuys
  0 siblings, 2 replies; 82+ messages in thread
From: Junio C Hamano @ 2021-04-20 22:57 UTC (permalink / raw)
  To: Han-Wen Nienhuys via GitGitGadget; +Cc: git, Han-Wen Nienhuys, Han-Wen Nienhuys

"Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Han-Wen Nienhuys <hanwen@google.com>
>
> REFFILES can be used to mark tests that are specific to the packed/loose ref
> storage format and its limitations. Marking such tests is a preparation for
> introducing the reftable storage backend.

We'd want a bit of documentation either here or in t/README to
explain things like how these two interact with each other, if both
can be active at the same time, etc.

>
> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> ---
>  t/test-lib.sh | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index d3f6af6a6545..ea7397c633db 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -1481,6 +1481,8 @@ parisc* | hppa*)
>  	;;
>  esac
>  
> +test_set_prereq REFFILES
> +
>  ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1
>  test -z "$NO_PERL" && test_set_prereq PERL
>  test -z "$NO_PTHREADS" && test_set_prereq PTHREADS

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

* Re: [PATCH 16/18] t7003: check reflog existence only for REFFILES
  2021-04-19 10:53 ` [PATCH 16/18] t7003: check reflog existence only for REFFILES Han-Wen Nienhuys via GitGitGadget
@ 2021-04-20 22:59   ` Junio C Hamano
  2021-04-26 17:42     ` Han-Wen Nienhuys
  2021-04-27  9:17     ` Han-Wen Nienhuys
  2021-04-21  7:02   ` Ævar Arnfjörð Bjarmason
  1 sibling, 2 replies; 82+ messages in thread
From: Junio C Hamano @ 2021-04-20 22:59 UTC (permalink / raw)
  To: Han-Wen Nienhuys via GitGitGadget; +Cc: git, Han-Wen Nienhuys, Han-Wen Nienhuys

"Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com> writes:

> From: Han-Wen Nienhuys <hanwen@google.com>
>
> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> ---
>  t/t7003-filter-branch.sh | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
> index cf30055c88dd..380bdf934317 100755
> --- a/t/t7003-filter-branch.sh
> +++ b/t/t7003-filter-branch.sh
> @@ -396,7 +396,9 @@ test_expect_success '--prune-empty is able to prune entire branch' '
>  	git branch prune-entire B &&
>  	git filter-branch -f --prune-empty --index-filter "git update-index --remove A.t B.t" prune-entire &&
>  	test_must_fail git rev-parse refs/heads/prune-entire &&
> -	test_must_fail git reflog exists refs/heads/prune-entire
> +	if test_have_prereq REFFILES ; then
> +		test_must_fail git reflog exists refs/heads/prune-entire
> +	fi

Style.  Replace " ; " with a LF and necessary number of tabs.


>  '
>  
>  test_expect_success '--remap-to-ancestor with filename filters' '

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

* Re: [PATCH 10/18] test-lib: provide test prereq REFFILES
  2021-04-20 22:57   ` Junio C Hamano
@ 2021-04-20 23:37     ` Junio C Hamano
  2021-04-26 11:09       ` Han-Wen Nienhuys
  2021-04-27  9:16     ` Han-Wen Nienhuys
  1 sibling, 1 reply; 82+ messages in thread
From: Junio C Hamano @ 2021-04-20 23:37 UTC (permalink / raw)
  To: Han-Wen Nienhuys via GitGitGadget; +Cc: git, Han-Wen Nienhuys, Han-Wen Nienhuys

Junio C Hamano <gitster@pobox.com> writes:

> "Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>> From: Han-Wen Nienhuys <hanwen@google.com>
>>
>> REFFILES can be used to mark tests that are specific to the packed/loose ref
>> storage format and its limitations. Marking such tests is a preparation for
>> introducing the reftable storage backend.
>
> We'd want a bit of documentation either here or in t/README to
> explain things like how these two interact with each other, if both
> can be active at the same time, etc.

By "here", I meant the place in the code where the test_set_prereq
was added, not in the proposed log message that will become hard to
see when test writers need to work with the sources.

Thanks.

>
>>
>> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
>> ---
>>  t/test-lib.sh | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/t/test-lib.sh b/t/test-lib.sh
>> index d3f6af6a6545..ea7397c633db 100644
>> --- a/t/test-lib.sh
>> +++ b/t/test-lib.sh
>> @@ -1481,6 +1481,8 @@ parisc* | hppa*)
>>  	;;
>>  esac
>>  
>> +test_set_prereq REFFILES
>> +
>>  ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1
>>  test -z "$NO_PERL" && test_set_prereq PERL
>>  test -z "$NO_PTHREADS" && test_set_prereq PTHREADS

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

* Re: [PATCH 02/18] t9300: check ref existence using git-rev-parse rather than FS check
  2021-04-19 10:52 ` [PATCH 02/18] t9300: check ref existence using git-rev-parse rather than FS check Han-Wen Nienhuys via GitGitGadget
@ 2021-04-21  6:01   ` Ævar Arnfjörð Bjarmason
  2021-04-27  9:20     ` Han-Wen Nienhuys
  0 siblings, 1 reply; 82+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-04-21  6:01 UTC (permalink / raw)
  To: Han-Wen Nienhuys via GitGitGadget; +Cc: git, Han-Wen Nienhuys, Han-Wen Nienhuys


On Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:

> From: Han-Wen Nienhuys <hanwen@google.com>
>
> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> ---
>  t/t9300-fast-import.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
> index 5c47ac4465cb..087ddf097036 100755
> --- a/t/t9300-fast-import.sh
> +++ b/t/t9300-fast-import.sh
> @@ -392,7 +392,7 @@ test_expect_success 'B: accept branch name "TEMP_TAG"' '
>  		git gc
>  		git prune" &&
>  	git fast-import <input &&
> -	test -f .git/TEMP_TAG &&
> +	git rev-parse TEMP_TAG &&
>  	test $(git rev-parse main) = $(git rev-parse TEMP_TAG^)
>  '

It seems to me that this breaks the test, to the extent that it's
testing something we care about at all.

I.e. reading ea08a6fd19 (Actually allow TAG_FIXUP branches in
fast-import, 2007-08-02) the whole point is to test that a "TEMP_TAG"
ref is accepted by fast-import, as opposed to "refs/heads/TEMP_TAG".

So we're trying to check that the refstore accepts a concept of a name
like HEAD called BLAHBLAH or whatever, that lives at the "top-level".

For something unrelated I was trying to figure out how to detect that
the other day and couldn't come up with anything I was happy with,
e.g. this seems to work:

    # Rely on for-each-ref not listing it...
    git for-each-ref >gfe &&
    ! grep TEMP_TAG gfe &&
    # ... but rev-parse grokking it
    git rev-parse TEMP_TAG

Or, rely on rev-parse emitting a warning about it:

    $ git update-ref refs/heads/TEMP_TAG HEAD
    # A bug? We emit both an error and a warning with
    # --symbolic-full-name?
    $ git rev-parse --symbolic-full-name TEMP_TAG
    warning: refname 'TEMP_TAG' is ambiguous.
    error: refname 'TEMP_TAG' is ambiguous
    $ echo $?
    0

IOW re my
https://lore.kernel.org/git/87wnt2th1v.fsf@evledraar.gmail.com/ this
seems like exactly the sort of edge case where we want to dig a bit more
and assert that we support (or explicitly don't support) this "mode"
under reftable.

In any case, if we're not testing for .git/TEMP_TAG anymore I think your
addition of "git rev-parse TEMP_TAG" is entirely redundant to the ad-hoc
"test_cmp" that comes after it, when would we not be able to rev-parse
FOO, but succeed with FOO^ ?

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

* Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access
  2021-04-19 10:52 ` [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access Han-Wen Nienhuys via GitGitGadget
  2021-04-19 20:38   ` SZEDER Gábor
@ 2021-04-21  6:09   ` Ævar Arnfjörð Bjarmason
  2021-04-21  9:09     ` Han-Wen Nienhuys
  1 sibling, 1 reply; 82+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-04-21  6:09 UTC (permalink / raw)
  To: Han-Wen Nienhuys via GitGitGadget; +Cc: git, Han-Wen Nienhuys, Han-Wen Nienhuys


On Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:

> From: Han-Wen Nienhuys <hanwen@google.com>
>
> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> ---
>  t/t1401-symbolic-ref.sh | 23 +++++++++--------------
>  1 file changed, 9 insertions(+), 14 deletions(-)
>
> diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh
> index a4ebb0b65fec..fd5980d3fb40 100755
> --- a/t/t1401-symbolic-ref.sh
> +++ b/t/t1401-symbolic-ref.sh
> @@ -7,18 +7,13 @@ test_description='basic symbolic-ref tests'
>  # the git repo, meaning that further tests will operate on
>  # the surrounding git repo instead of the trash directory.
>  reset_to_sane() {
> -	echo ref: refs/heads/foo >.git/HEAD
> +	git --git-dir .git symbolic-ref HEAD refs/heads/foo

Isn't that "--git-dir .git" entirely redundant?

>  }
>  
> -test_expect_success 'symbolic-ref writes HEAD' '
> -	git symbolic-ref HEAD refs/heads/foo &&
> -	echo ref: refs/heads/foo >expect &&
> -	test_cmp expect .git/HEAD
> -'
> -
> -test_expect_success 'symbolic-ref reads HEAD' '
> -	echo refs/heads/foo >expect &&
> -	git symbolic-ref HEAD >actual &&
> +test_expect_success 'symbolic-ref read/write roundtrip' '
> +	git symbolic-ref HEAD refs/heads/read-write-roundtrip &&
> +	echo refs/heads/read-write-roundtrip > expect &&

I see SZEDER covered some nits already :)

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

* Re: [PATCH 07/18] t5000: inspect HEAD using git-rev-parse
  2021-04-19 10:52 ` [PATCH 07/18] t5000: inspect HEAD using git-rev-parse Han-Wen Nienhuys via GitGitGadget
@ 2021-04-21  6:11   ` Ævar Arnfjörð Bjarmason
  2021-04-27  9:22     ` Han-Wen Nienhuys
  0 siblings, 1 reply; 82+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-04-21  6:11 UTC (permalink / raw)
  To: Han-Wen Nienhuys via GitGitGadget; +Cc: git, Han-Wen Nienhuys, Han-Wen Nienhuys


On Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:

> From: Han-Wen Nienhuys <hanwen@google.com>
>
> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> ---
>  t/t5000-tar-tree.sh | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
> index 7204799a0b52..472fec4ee64a 100755
> --- a/t/t5000-tar-tree.sh
> +++ b/t/t5000-tar-tree.sh
> @@ -233,9 +233,10 @@ test_expect_success \
>       test_cmp expected.mtime b.mtime'
>  
>  test_expect_success \
> -    'git get-tar-commit-id' \
> -    'git get-tar-commit-id <b.tar >b.commitid &&
> -     test_cmp .git/$(git symbolic-ref HEAD) b.commitid'
> +	'git get-tar-commit-id' \
> +	'git get-tar-commit-id <b.tar >actual &&
> +	git rev-parse HEAD > expect &&
> +	test_cmp expect actual'

If we're doing a "re-style while we're at it" s/<spaces>/<tabs>/ let's
just go all the way and convert it to a more modern style of:

test_expect_success 'git get-tar-commit-id' '
	...
'

But maybe such re-styling would be best left alone, and just a narrow
change of the needed code. There's various surrounding tests in the file
that use the same style, unless we're going to re-style all of them....

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

* Re: [PATCH 09/18] t5304: use "reflog expire --all" to clear the reflog
  2021-04-19 10:52 ` [PATCH 09/18] t5304: use "reflog expire --all" to clear the reflog Han-Wen Nienhuys via GitGitGadget
@ 2021-04-21  6:13   ` Ævar Arnfjörð Bjarmason
  2021-04-27  9:23     ` Han-Wen Nienhuys
  0 siblings, 1 reply; 82+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-04-21  6:13 UTC (permalink / raw)
  To: Han-Wen Nienhuys via GitGitGadget; +Cc: git, Han-Wen Nienhuys, Han-Wen Nienhuys


On Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:

> From: Han-Wen Nienhuys <hanwen@google.com>
>
> This is more explicit, and reduces the depency between test functions. It also
> is more amenable to use with reftable, which has no concept of (non)existence of
> a reflog
>
> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> ---
>  t/t5304-prune.sh | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh
> index b447ce56a9b2..4ffc0076801e 100755
> --- a/t/t5304-prune.sh
> +++ b/t/t5304-prune.sh
> @@ -94,26 +94,22 @@ test_expect_success 'prune: prune nonsense parameters' '
>  '
>  
>  test_expect_success 'prune: prune unreachable heads' '
> -

Similar to a previous comments, a few tests in that file use this
whitespacing. I'd say let's just leave it alone unlress we're doing some
whitespace-only commit earlier.

>  	git config core.logAllRefUpdates false &&
> -	mv .git/logs .git/logs.old &&
>  	: > file2 &&

Also, if we're re-styling things: ">foo" instead of ": >foo".

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

* Re: [PATCH 11/18] t1407: require REFFILES for for_each_reflog test
  2021-04-19 10:52 ` [PATCH 11/18] t1407: require REFFILES for for_each_reflog test Han-Wen Nienhuys via GitGitGadget
@ 2021-04-21  6:23   ` Ævar Arnfjörð Bjarmason
  2021-04-27  9:27     ` Han-Wen Nienhuys
  0 siblings, 1 reply; 82+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-04-21  6:23 UTC (permalink / raw)
  To: Han-Wen Nienhuys via GitGitGadget; +Cc: git, Han-Wen Nienhuys, Han-Wen Nienhuys


On Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:

> From: Han-Wen Nienhuys <hanwen@google.com>
>
> It tries to setup a reflog by catting to .git/logs/
>
> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> ---
>  t/t1407-worktree-ref-store.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t1407-worktree-ref-store.sh b/t/t1407-worktree-ref-store.sh
> index d3fe77751122..27b57f248a94 100755
> --- a/t/t1407-worktree-ref-store.sh
> +++ b/t/t1407-worktree-ref-store.sh
> @@ -52,7 +52,7 @@ test_expect_success 'create_symref(FOO, refs/heads/main)' '
>  	test_cmp expected actual
>  '
>  
> -test_expect_success 'for_each_reflog()' '
> +test_expect_success REFFILES 'for_each_reflog()' '
>  	echo $ZERO_OID > .git/logs/PSEUDO-MAIN &&
>  	mkdir -p     .git/logs/refs/bisect &&
>  	echo $ZERO_OID > .git/logs/refs/bisect/random &&

Hrm, so already the first use of REFFILES has me questioning the need
for it.

I mean obviously this depends on ref-files in the strict sense.

But it seems to me that there's two classes of those issues:

 A. Test where we inherently depend 100% on "reffiles", e.g. the later
    tests of "empty directories" in .git/refs/, presumably there's no
    equivalent of those in reftable.

 B. Tests that are really wanting to test some specific type of ref
    corruption, that could (or not!) happen under reftable, but just
    uses ref files for the setup now.

I think (but am not sure) that this is the latter case. I.e. the
distiniction I noted in [1].

Just skimming the context I wonder which of these can/can't happen under
reftable:

 * We have a PSEUDO-MAIN ref
 * It's set to $ZERO_OID
 * We have a $ZERO_OID in a refs/bisect/random

Etc., the test is just a setup for a call to refs_for_each_reflog().

If I'm wrong and it really is a case of "A" then presumably that has
implications down to refs/iterator.c and beyond.

I don't think we need to exhaustively dig into every one of these for
some initial pass at getting the test suite running, but again re [1] I
worry that if we over-skip we'll end up not marking the distinction
between "A" and "B" above, and thus will have an end-state of losing
test coverage.

1. https://lore.kernel.org/git/87wnt2th1v.fsf@evledraar.gmail.com/

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

* Re: [PATCH 13/18] t2017: mark --orphan/logAllRefUpdates=false test as REFFILES
  2021-04-19 10:52 ` [PATCH 13/18] t2017: mark --orphan/logAllRefUpdates=false test as REFFILES Han-Wen Nienhuys via GitGitGadget
@ 2021-04-21  6:39   ` Ævar Arnfjörð Bjarmason
  2021-04-29 18:14     ` Han-Wen Nienhuys
  0 siblings, 1 reply; 82+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-04-21  6:39 UTC (permalink / raw)
  To: Han-Wen Nienhuys via GitGitGadget; +Cc: git, Han-Wen Nienhuys, Han-Wen Nienhuys


On Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:

> From: Han-Wen Nienhuys <hanwen@google.com>
>
> In reftable, there is no notion of a per-ref 'existence' of a reflog. Each
> reflog entry has its own key, so it is not possible to distinguish between
> {reflog doesn't exist,reflog exists but is empty}. This makes the logic
> in log_ref_setup() (file refs/files-backend.c), which depends on the existence
> of the reflog file infeasible.

Okey, so I'd follow this if the test was doing something like "test -e
.git/logs" to test whether we didn't have reflogs for a specific branch
or something....

> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> ---
>  t/t2017-checkout-orphan.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t2017-checkout-orphan.sh b/t/t2017-checkout-orphan.sh
> index c7adbdd39ab9..88d6992a5e1f 100755
> --- a/t/t2017-checkout-orphan.sh
> +++ b/t/t2017-checkout-orphan.sh
> @@ -76,7 +76,7 @@ test_expect_success '--orphan makes reflog by default' '
>  	git rev-parse --verify delta@{0}
>  '
>  
> -test_expect_success '--orphan does not make reflog when core.logAllRefUpdates = false' '
> +test_expect_success REFFILES '--orphan does not make reflog when core.logAllRefUpdates = false' '
>  	git checkout main &&
>  	git config core.logAllRefUpdates false &&
>  	git checkout --orphan epsilon &&

... but in this test we don't end up doing anything that obviously
depends on ref files, right after this context we do (and this is the
entire test):

    test_must_fail git rev-parse --verify epsilon@{0} &&
    git commit -m Epsilon &&
    test_must_fail git rev-parse --verify epsilon@{0}

So either this is over-skipping of a test, or a summary like this would
be more inaccurate (I'm not suggesting to include it, just writing it
out to state/check my assumptions):

    [...]the reflog implementation leaks the implementation detail that
    it has no per-ref instance of the reflog all the way up to syntax
    like "rev-parse --verify branch@{0}", which is just asking for the
    Nth reflog entry for a branch[...]

But maybe I'm wrong about that, "man git-rev-parse" says, "This" is
reference to the @{<n>} syntax:

    [...]This suffix may only be used immediately following a ref name
    and the ref must have an existing log ($GIT_DIR/logs/<refname>).

In your v7[1] of the reftable series there's no patch to
Documentation/revisions.txt altering that blurb.

So it seems to me that between this & that series there's some closing
of the gap needed with how this "must have an existing log" even works
under reftable.

Per [2] I had assumed that this worked under reftable by abstracting
away the syntax to some query for the ref name, and faking up "file does
not exist" as "there were no records" to anything like rev-parse, but it
doesn't work like that?

1. https://lore.kernel.org/git/pull.847.v7.git.git.1618832276.gitgitgadget@gmail.com/
2. https://eclipse.googlesource.com/jgit/jgit/+/master/Documentation/technical/reftable.md#log-record
3. https://lore.kernel.org/git/87sg3k40mc.fsf@evledraar.gmail.com/

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

* Re: [PATCH 14/18] t1404: mark tests that muck with .git directly as REFFILES.
  2021-04-19 10:52 ` [PATCH 14/18] t1404: mark tests that muck with .git directly " Han-Wen Nienhuys via GitGitGadget
@ 2021-04-21  6:57   ` Ævar Arnfjörð Bjarmason
  2021-04-26 18:36     ` Han-Wen Nienhuys
  0 siblings, 1 reply; 82+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-04-21  6:57 UTC (permalink / raw)
  To: Han-Wen Nienhuys via GitGitGadget
  Cc: git, Han-Wen Nienhuys, Han-Wen Nienhuys, Michael Haggerty


On Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:

> From: Han-Wen Nienhuys <hanwen@google.com>

Some commit message summarizing why we won't need this at all would be
better e.g. maybe:

    [...]Most of the tests being skipped here were added in 19dd7d06e5
    (t1404: demonstrate a bug resolving references, 2016-05-05), as the
    subsequent 5387c0d883 (commit_ref(): if there is an empty dir in the
    way, delete it, 2016-05-05) and e167a5673e (read_raw_ref(): don't
    get confused by an empty directory, 2016-05-05) show the code is all
    specific to the files backend, and the scenario of an "empty
    directory" "refs/heads/foo/" existing, and us wanting to create a
    "file" under "refs/heads/foo/bar" is impossible under reftable.

But:

> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> ---
>  t/t1404-update-ref-errors.sh | 30 +++++++++++++++---------------
>  1 file changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/t/t1404-update-ref-errors.sh b/t/t1404-update-ref-errors.sh
> index 8b51c4efc135..b729c1f48030 100755
> --- a/t/t1404-update-ref-errors.sh
> +++ b/t/t1404-update-ref-errors.sh
> @@ -189,7 +189,7 @@ test_expect_success 'one new ref is a simple prefix of another' '
>  
>  '
>  
> -test_expect_success 'empty directory should not fool rev-parse' '
> +test_expect_success REFFILES 'empty directory should not fool rev-parse' '
>  	prefix=refs/e-rev-parse &&
>  	git update-ref $prefix/foo $C &&
>  	git pack-refs --all &&
> @@ -199,7 +199,7 @@ test_expect_success 'empty directory should not fool rev-parse' '
>  	test_cmp expected actual
>  '
>  
> -test_expect_success 'empty directory should not fool for-each-ref' '
> +test_expect_success REFFILES 'empty directory should not fool for-each-ref' '
>  	prefix=refs/e-for-each-ref &&
>  	git update-ref $prefix/foo $C &&
>  	git for-each-ref $prefix >expected &&
> @@ -209,14 +209,14 @@ test_expect_success 'empty directory should not fool for-each-ref' '
>  	test_cmp expected actual
>  '


[Snip a few tests that are all of the same "empty directory form]

So far this looks good / all covering that bug

> -test_expect_success 'broken reference blocks create' '
> +test_expect_success REFFILES 'broken reference blocks create' '
>  	prefix=refs/broken-create &&
>  	mkdir -p .git/$prefix &&
>  	echo "gobbledigook" >.git/$prefix/foo &&
> @@ -504,7 +504,7 @@ test_expect_success 'broken reference blocks create' '
>  	test_cmp expected output.err
>  '

This doesn't seem specific to the files backend at all. I.e. if you grep
for "reference broken" in the file backends you'll find EINVAL and
REF_ISBROKEN handling, and your refs/reftable-backend.c has the same
exception handling, so presumably we can end up with broken refs.

Maybe not "gobbledigook", but isn't this losing coverage for other invalid ref handling under reftable?

> -test_expect_success 'non-empty directory blocks indirect create' '
> +test_expect_success REFFILES 'non-empty directory blocks indirect create' '
>  	prefix=refs/ne-indirect-create &&
>  	git symbolic-ref $prefix/symref $prefix/foo &&
>  	mkdir -p .git/$prefix/foo/bar &&
> @@ -524,7 +524,7 @@ test_expect_success 'non-empty directory blocks indirect create' '
>  	test_cmp expected output.err
>  '
>  
> -test_expect_success 'broken reference blocks indirect create' '
> +test_expect_success REFFILES 'broken reference blocks indirect create' '
>  	prefix=refs/broken-indirect-create &&
>  	git symbolic-ref $prefix/symref $prefix/foo &&
>  	echo "gobbledigook" >.git/$prefix/foo &&
> @@ -543,7 +543,7 @@ test_expect_success 'broken reference blocks indirect create' '
>  	test_cmp expected output.err
>  '

Here we seem to be back to truly file-specific thing (or maybe we were
all along):

> -test_expect_success 'no bogus intermediate values during delete' '
> +test_expect_success REFFILES 'no bogus intermediate values during delete' '
>  	prefix=refs/slow-transaction &&
>  	# Set up a reference with differing loose and packed versions:
>  	git update-ref $prefix/foo $C &&
> @@ -600,7 +600,7 @@ test_expect_success 'no bogus intermediate values during delete' '
>  	test_must_fail git rev-parse --verify --quiet $prefix/foo
>  '
>  
> -test_expect_success 'delete fails cleanly if packed-refs file is locked' '
> +test_expect_success REFFILES 'delete fails cleanly if packed-refs file is locked' '
>  	prefix=refs/locked-packed-refs &&
>  	# Set up a reference with differing loose and packed versions:
>  	git update-ref $prefix/foo $C &&
> @@ -616,7 +616,7 @@ test_expect_success 'delete fails cleanly if packed-refs file is locked' '
>  	test_cmp unchanged actual
>  '
>  
> -test_expect_success 'delete fails cleanly if packed-refs.new write fails' '
> +test_expect_success REFFILES 'delete fails cleanly if packed-refs.new write fails' '
>  	# Setup and expectations are similar to the test above.
>  	prefix=refs/failed-packed-refs &&
>  	git update-ref $prefix/foo $C &&

Anyway, much of reviewing this commit was trying to rediscover thing
that should really be in the commit message. Presumably you had to run
blame, log etc. to find the commits from Michael Haggerty and dig into
if they were relevant to reftable. Having that information in the commit
message would be *very* helpful.

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

* Re: [PATCH 15/18] t7900: mark pack-refs tests as REFFILES
  2021-04-19 10:53 ` [PATCH 15/18] t7900: mark pack-refs tests " Han-Wen Nienhuys via GitGitGadget
@ 2021-04-21  7:00   ` Ævar Arnfjörð Bjarmason
  2021-04-27  9:41     ` Han-Wen Nienhuys
  0 siblings, 1 reply; 82+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-04-21  7:00 UTC (permalink / raw)
  To: Han-Wen Nienhuys via GitGitGadget; +Cc: git, Han-Wen Nienhuys, Han-Wen Nienhuys


On Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:

> From: Han-Wen Nienhuys <hanwen@google.com>
>
> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> ---
>  t/t7900-maintenance.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh
> index 2412d8c5c006..6f2f55a6c51d 100755
> --- a/t/t7900-maintenance.sh
> +++ b/t/t7900-maintenance.sh
> @@ -343,7 +343,7 @@ test_expect_success 'maintenance.incremental-repack.auto' '
>  	test_subcommand git multi-pack-index write --no-progress <trace-B
>  '
>  
> -test_expect_success 'pack-refs task' '
> +test_expect_success REFFILES 'pack-refs task' '
>  	for n in $(test_seq 1 5)
>  	do
>  		git branch -f to-pack/$n HEAD || return 1

Re [1] maybe this is ok/fine for now, but I think we should really split
out the "is specific to file" part more narrowly (not just here, but in
general).

E.g. I assume that "pack-refs" is simply redundant under reftable, no?

So should this (which the test you're skipping later runs):

    git maintenance run --task=pack-refs

Silently skip, warn, exit with zero or non-zero, some combination
thereof?

Should the current behavior documented in
Documentation/git-maintenance.txt change with your series under reftable
etc?

1. https://lore.kernel.org/git/87sg3k40mc.fsf@evledraar.gmail.com/

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

* Re: [PATCH 16/18] t7003: check reflog existence only for REFFILES
  2021-04-19 10:53 ` [PATCH 16/18] t7003: check reflog existence only for REFFILES Han-Wen Nienhuys via GitGitGadget
  2021-04-20 22:59   ` Junio C Hamano
@ 2021-04-21  7:02   ` Ævar Arnfjörð Bjarmason
  1 sibling, 0 replies; 82+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-04-21  7:02 UTC (permalink / raw)
  To: Han-Wen Nienhuys via GitGitGadget; +Cc: git, Han-Wen Nienhuys, Han-Wen Nienhuys


On Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:

> From: Han-Wen Nienhuys <hanwen@google.com>
>
> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> ---
>  t/t7003-filter-branch.sh | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
> index cf30055c88dd..380bdf934317 100755
> --- a/t/t7003-filter-branch.sh
> +++ b/t/t7003-filter-branch.sh
> @@ -396,7 +396,9 @@ test_expect_success '--prune-empty is able to prune entire branch' '
>  	git branch prune-entire B &&
>  	git filter-branch -f --prune-empty --index-filter "git update-index --remove A.t B.t" prune-entire &&
>  	test_must_fail git rev-parse refs/heads/prune-entire &&
> -	test_must_fail git reflog exists refs/heads/prune-entire
> +	if test_have_prereq REFFILES ; then
> +		test_must_fail git reflog exists refs/heads/prune-entire
> +	fi

Same comment as on an earlier patch[1], i.e. aren't we leaking some
"does the reflog exist" abstraction all the way up from reftable in a
way that's broken here?

1. https://lore.kernel.org/git/87pmyo3zvw.fsf@evledraar.gmail.com/

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

* Re: [PATCH 17/18] t4202: mark bogus head hash test with REFFILES
  2021-04-19 10:53 ` [PATCH 17/18] t4202: mark bogus head hash test with REFFILES Han-Wen Nienhuys via GitGitGadget
@ 2021-04-21  7:08   ` Ævar Arnfjörð Bjarmason
  2021-04-26 18:02     ` Han-Wen Nienhuys
  0 siblings, 1 reply; 82+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-04-21  7:08 UTC (permalink / raw)
  To: Han-Wen Nienhuys via GitGitGadget; +Cc: git, Han-Wen Nienhuys, Han-Wen Nienhuys


On Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:

> From: Han-Wen Nienhuys <hanwen@google.com>
>
> In reftable, hashes are correctly formed by design

With the file backend this hits this in revision.c:

        if (!refname || !(flags & REF_ISSYMREF) || (flags & REF_ISBROKEN))
                die(_("your current branch appears to be broken"));

There's a REF_ISBROKEN is the reftable code, so is hitting this codepath
impossible under reftable and therefore we won't need this test at all?

Maybe, and that would be cool, but re [1]'s 3rd item ("[...]what we
*don't* cover[...]") shouldn't revision.c have a "if (reftable) BUG()"
condition there then?

1. https://lore.kernel.org/git/87wnt2th1v.fsf@evledraar.gmail.com/

> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> ---
>  t/t4202-log.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t4202-log.sh b/t/t4202-log.sh
> index c575deaad4fb..ed6d4ecd3a28 100755
> --- a/t/t4202-log.sh
> +++ b/t/t4202-log.sh
> @@ -1834,7 +1834,7 @@ test_expect_success 'log --graph --no-walk is forbidden' '
>  	test_must_fail git log --graph --no-walk
>  '
>  
> -test_expect_success 'log diagnoses bogus HEAD hash' '
> +test_expect_success REFFILES 'log diagnoses bogus HEAD hash' '
>  	git init empty &&
>  	test_must_fail git -C empty log 2>stderr &&
>  	test_i18ngrep does.not.have.any.commits stderr &&


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

* Re: [PATCH 18/18] t1415: set REFFILES for test specific to storage format
  2021-04-19 10:53 ` [PATCH 18/18] t1415: set REFFILES for test specific to storage format Han-Wen Nienhuys via GitGitGadget
@ 2021-04-21  7:15   ` Ævar Arnfjörð Bjarmason
  2021-04-26 17:41     ` Han-Wen Nienhuys
  0 siblings, 1 reply; 82+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-04-21  7:15 UTC (permalink / raw)
  To: Han-Wen Nienhuys via GitGitGadget; +Cc: git, Han-Wen Nienhuys, Han-Wen Nienhuys


On Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:

> From: Han-Wen Nienhuys <hanwen@google.com>
>
> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> ---
>  t/t1415-worktree-refs.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/t/t1415-worktree-refs.sh b/t/t1415-worktree-refs.sh
> index 7ab91241ab7c..a8083a0af3af 100755
> --- a/t/t1415-worktree-refs.sh
> +++ b/t/t1415-worktree-refs.sh
> @@ -16,7 +16,7 @@ test_expect_success 'setup' '
>  	git -C wt2 update-ref refs/worktree/foo HEAD
>  '
>  
> -test_expect_success 'refs/worktree must not be packed' '
> +test_expect_success REFFILES 'refs/worktree must not be packed' '
>  	git pack-refs --all &&
>  	test_path_is_missing .git/refs/tags/wt1 &&
>  	test_path_is_file .git/refs/worktree/foo &&

So a naïve:
    
    diff --git a/refs/files-backend.c b/refs/files-backend.c
    index 3f29f8c143..01e2dc8bc3 100644
    --- a/refs/files-backend.c
    +++ b/refs/files-backend.c
    @@ -212,7 +212,7 @@ static void files_ref_path(struct files_ref_store *refs,
      */
     static void add_per_worktree_entries_to_dir(struct ref_dir *dir, const char *dirname)
     {
    -       const char *prefixes[] = { "refs/bisect/", "refs/worktree/", "refs/rewritten/" };
    +       const char *prefixes[] = { "refs/bisect/", "refs/rewritten/" };
            int ip;
    
            if (strcmp(dirname, "refs/"))

Will fail the test under non-reftable, i.e. we somehow conflate "is
packed" with correctly discovering these refs? A discussion of how
8aff1a9ca5 (Add a place for (not) sharing stuff between worktrees,
2018-09-29) relates to reftable would be valuable here.

But on the tip of "seen" currently this test fails entirely with
GIT_TEST_REFTABLE=true, so I'm not sure if it got rid of the need for
this abstraction in the files backend or what...

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

* Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access
  2021-04-21  6:09   ` Ævar Arnfjörð Bjarmason
@ 2021-04-21  9:09     ` Han-Wen Nienhuys
  2021-04-22  4:59       ` SZEDER Gábor
  0 siblings, 1 reply; 82+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-21  9:09 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Wed, Apr 21, 2021 at 8:09 AM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
>
>
> On Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:
>
> > From: Han-Wen Nienhuys <hanwen@google.com>
> >
> > Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> > ---
> >  t/t1401-symbolic-ref.sh | 23 +++++++++--------------
> >  1 file changed, 9 insertions(+), 14 deletions(-)
> >
> > diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh
> > index a4ebb0b65fec..fd5980d3fb40 100755
> > --- a/t/t1401-symbolic-ref.sh
> > +++ b/t/t1401-symbolic-ref.sh
> > @@ -7,18 +7,13 @@ test_description='basic symbolic-ref tests'
> >  # the git repo, meaning that further tests will operate on
> >  # the surrounding git repo instead of the trash directory.
> >  reset_to_sane() {
> > -     echo ref: refs/heads/foo >.git/HEAD
> > +     git --git-dir .git symbolic-ref HEAD refs/heads/foo
>
> Isn't that "--git-dir .git" entirely redundant?

See the comment above the changed line: we don't want auto-detection
to clobber the surrounding git repo.

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

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

* Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access
  2021-04-21  9:09     ` Han-Wen Nienhuys
@ 2021-04-22  4:59       ` SZEDER Gábor
  2021-04-22 13:01         ` Han-Wen Nienhuys
  0 siblings, 1 reply; 82+ messages in thread
From: SZEDER Gábor @ 2021-04-22  4:59 UTC (permalink / raw)
  To: Han-Wen Nienhuys
  Cc: Ævar Arnfjörð Bjarmason,
	Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Wed, Apr 21, 2021 at 11:09:07AM +0200, Han-Wen Nienhuys wrote:
> > > diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh
> > > index a4ebb0b65fec..fd5980d3fb40 100755
> > > --- a/t/t1401-symbolic-ref.sh
> > > +++ b/t/t1401-symbolic-ref.sh
> > > @@ -7,18 +7,13 @@ test_description='basic symbolic-ref tests'
> > >  # the git repo, meaning that further tests will operate on
> > >  # the surrounding git repo instead of the trash directory.
> > >  reset_to_sane() {
> > > -     echo ref: refs/heads/foo >.git/HEAD
> > > +     git --git-dir .git symbolic-ref HEAD refs/heads/foo
> >
> > Isn't that "--git-dir .git" entirely redundant?
> 
> See the comment above the changed line: we don't want auto-detection
> to clobber the surrounding git repo.

Indeed, but then this is not a faithful conversion of the original.
That 'echo' will write sane content to HEAD no matter what state the
repository is in.  That 'symbolic-ref' command, however, won't,
because 'git --git-dir .git' turns off only repository discovery, but
not repository verification, and in case of a corrupt '.git/HEAD' it
will bail out.

  $ cd test
  $ git init 
  Initialized empty Git repository in /home/szeder/src/git/test/.git/
  $ git commit --allow-empty -m initial
  [master (root-commit) ec0df0b] initial
  $ echo "foo bar baz" >.git/HEAD
  $ git --git-dir .git symbolic-ref HEAD refs/heads/master
  fatal: not a git repository: '.git'



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

* Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access
  2021-04-22  4:59       ` SZEDER Gábor
@ 2021-04-22 13:01         ` Han-Wen Nienhuys
  2021-04-23  5:12           ` SZEDER Gábor
  0 siblings, 1 reply; 82+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-22 13:01 UTC (permalink / raw)
  To: SZEDER Gábor
  Cc: Ævar Arnfjörð Bjarmason,
	Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Thu, Apr 22, 2021 at 6:59 AM SZEDER Gábor <szeder.dev@gmail.com> wrote:
> > See the comment above the changed line: we don't want auto-detection
> > to clobber the surrounding git repo.
>
> Indeed, but then this is not a faithful conversion of the original.
> That 'echo' will write sane content to HEAD no matter what state the
> repository is in.  That 'symbolic-ref' command, however, won't,
> because 'git --git-dir .git' turns off only repository discovery, but
> not repository verification, and in case of a corrupt '.git/HEAD' it
> will bail out.
>
>   $ cd test
>   $ git init
>   Initialized empty Git repository in /home/szeder/src/git/test/.git/
>   $ git commit --allow-empty -m initial
>   [master (root-commit) ec0df0b] initial
>   $ echo "foo bar baz" >.git/HEAD
>   $ git --git-dir .git symbolic-ref HEAD refs/heads/master
>   fatal: not a git repository: '.git'

But then it's working as intended, no? It will not corrupt the
surrounding repository.

I see it as the test writer's job to clean up to the extent that
git-symbolic-ref can reset to a sane state.

We could reset back to a known state in a more drastic manner
(extracting .git from a tar archive), but that could interfere with
the test functions if they're not isolated from each other.

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

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

* Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access
  2021-04-22 13:01         ` Han-Wen Nienhuys
@ 2021-04-23  5:12           ` SZEDER Gábor
  2021-04-23  7:47             ` Han-Wen Nienhuys
  0 siblings, 1 reply; 82+ messages in thread
From: SZEDER Gábor @ 2021-04-23  5:12 UTC (permalink / raw)
  To: Han-Wen Nienhuys
  Cc: Ævar Arnfjörð Bjarmason,
	Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Thu, Apr 22, 2021 at 03:01:01PM +0200, Han-Wen Nienhuys wrote:
> On Thu, Apr 22, 2021 at 6:59 AM SZEDER Gábor <szeder.dev@gmail.com> wrote:
> > > See the comment above the changed line: we don't want auto-detection
> > > to clobber the surrounding git repo.
> >
> > Indeed, but then this is not a faithful conversion of the original.
> > That 'echo' will write sane content to HEAD no matter what state the
> > repository is in.  That 'symbolic-ref' command, however, won't,
> > because 'git --git-dir .git' turns off only repository discovery, but
> > not repository verification, and in case of a corrupt '.git/HEAD' it
> > will bail out.
> >
> >   $ cd test
> >   $ git init
> >   Initialized empty Git repository in /home/szeder/src/git/test/.git/
> >   $ git commit --allow-empty -m initial
> >   [master (root-commit) ec0df0b] initial
> >   $ echo "foo bar baz" >.git/HEAD
> >   $ git --git-dir .git symbolic-ref HEAD refs/heads/master
> >   fatal: not a git repository: '.git'
> 
> But then it's working as intended, no? It will not corrupt the
> surrounding repository.

No, it definitely does not.

If one of the test cases fails because 'git symbolic-ref' were to
write bogus content to HEAD, then that new 'git symbolic-ref'
invocation in reset_to_sane() will not corrupt the surrounding
repository, but, crucially, it won't restore the test repository's
HEAD to a sane state either, and git commands invoked in subsequent
tests won't recognize the trash dir as their git repository, and will
operate on the surrounding repo instead:

  ~/src/git/t (master)$ vim t/t1401-symbolic-ref.sh
  ~/src/git/t (master *)$ git diff
  diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh
  index a4ebb0b65f..8f8d93bf6a 100755
  --- a/t/t1401-symbolic-ref.sh
  +++ b/t/t1401-symbolic-ref.sh
  @@ -23,7 +23,11 @@ test_expect_success 'symbolic-ref reads HEAD' '
   '
   
   test_expect_success 'symbolic-ref refuses non-ref for HEAD' '
  -       test_must_fail git symbolic-ref HEAD foo
  +       #test_must_fail git symbolic-ref HEAD foo &&
  +       # Lets pretend that the above "git symbolic-ref" did write that
  +       # bogus content to HEAD:
  +       echo foo >.git/HEAD &&
  +       false
   '
   reset_to_sane
   
  ~/src/git/t (master *)$ ./t1401-symbolic-ref.sh 
  ok 1 - symbolic-ref writes HEAD
  ok 2 - symbolic-ref reads HEAD
  not ok 3 - symbolic-ref refuses non-ref for HEAD
  #	
  #		#test_must_fail git symbolic-ref HEAD foo &&
  #		# Lets pretend that the above "git symbolic-ref" did write that
  #		# bogus content to HEAD:
  #		echo foo >.git/HEAD &&
  #		false
  #	
  ok 4 - symbolic-ref refuses bare sha1
  ok 5 - HEAD cannot be removed
  ok 6 - symbolic-ref can be deleted
  ok 7 - symbolic-ref can delete dangling symref
  ok 8 - symbolic-ref fails to delete missing FOO
  ok 9 - symbolic-ref fails to delete real ref
  ok 10 - create large ref name
  ok 11 - symbolic-ref can point to large ref name
  ok 12 - we can parse long symbolic ref
  ok 13 - symbolic-ref reports failure in exit code
  ok 14 - symbolic-ref writes reflog entry
  ok 15 - symbolic-ref does not create ref d/f conflicts
  ok 16 - symbolic-ref can overwrite pointer to invalid name
  ok 17 - symbolic-ref can resolve d/f name (EISDIR)
  ok 18 - symbolic-ref can resolve d/f name (ENOTDIR)
  # failed 1 among 18 test(s)
  1..18
  ~/src/git/t (master *)$

OK, only one test failed, and the surrounding repo is not affected.

No lets switch to your 'git symbolic-ref command in reset_to_sane():

  ~/src/git/t (master *)$ vim t/t1401-symbolic-ref.sh
  ~/src/git/t (master *)$ git diff
  diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh
  index a4ebb0b65f..6ef221d1bb 100755
  --- a/t/t1401-symbolic-ref.sh
  +++ b/t/t1401-symbolic-ref.sh
  @@ -7,7 +7,8 @@ test_description='basic symbolic-ref tests'
   # the git repo, meaning that further tests will operate on
   # the surrounding git repo instead of the trash directory.
   reset_to_sane() {
  -       echo ref: refs/heads/foo >.git/HEAD
  +       #echo ref: refs/heads/foo >.git/HEAD
  +       git --git-dir .git symbolic-ref HEAD refs/heads/foo
   }
   
   test_expect_success 'symbolic-ref writes HEAD' '
  @@ -23,7 +24,11 @@ test_expect_success 'symbolic-ref reads HEAD' '
   '
   
   test_expect_success 'symbolic-ref refuses non-ref for HEAD' '
  -       test_must_fail git symbolic-ref HEAD foo
  +       #test_must_fail git symbolic-ref HEAD foo &&
  +       # Lets pretend that the above "git symbolic-ref" did write that
  +       # bogus content to HEAD:
  +       echo foo >.git/HEAD &&
  +       false
   '
   reset_to_sane
 
  ~/src/git/t (master *)$ ./t1401-symbolic-ref.sh 
  ok 1 - symbolic-ref writes HEAD
  ok 2 - symbolic-ref reads HEAD
  not ok 3 - symbolic-ref refuses non-ref for HEAD
  #	
  #		#test_must_fail git symbolic-ref HEAD foo &&
  #		# Lets pretend that the above "git symbolic-ref" did write that
  #		# bogus content to HEAD:
  #		echo foo >.git/HEAD &&
  #		false
  #	
  fatal: not a git repository: '.git'
  not ok 4 - symbolic-ref refuses bare sha1
  #	
  #		echo content >file && git add file && git commit -m one &&
  #		test_must_fail git symbolic-ref HEAD $(git rev-parse HEAD)
  #	
  fatal: not a git repository: '.git'
  ok 5 - HEAD cannot be removed
  fatal: not a git repository: '.git'
  not ok 6 - symbolic-ref can be deleted
  #	
  #		git symbolic-ref NOTHEAD refs/heads/foo &&
  #		git symbolic-ref -d NOTHEAD &&
  #		test_path_is_file .git/refs/heads/foo &&
  #		test_path_is_missing .git/NOTHEAD
  #	
  fatal: not a git repository: '.git'
  ok 7 - symbolic-ref can delete dangling symref
  fatal: not a git repository: '.git'
  ok 8 - symbolic-ref fails to delete missing FOO
  fatal: not a git repository: '.git'
  not ok 9 - symbolic-ref fails to delete real ref
  #	
  #		echo "fatal: Cannot delete refs/heads/foo, not a symbolic ref" >expect &&
  #		test_must_fail git symbolic-ref -d refs/heads/foo >actual 2>&1 &&
  #		git rev-parse --verify refs/heads/foo &&
  #		test_cmp expect actual
  #	
  fatal: not a git repository: '.git'
  ok 10 - create large ref name
  ok 11 - symbolic-ref can point to large ref name
  ok 12 - we can parse long symbolic ref
  not ok 13 - symbolic-ref reports failure in exit code
  #	
  #		test_when_finished "rm -f .git/HEAD.lock" &&
  #		>.git/HEAD.lock &&
  #		test_must_fail git symbolic-ref HEAD refs/heads/whatever
  #	
  not ok 14 - symbolic-ref writes reflog entry
  #	
  #		git checkout -b log1 &&
  #		test_commit one &&
  #		git checkout -b log2  &&
  #		test_commit two &&
  #		git checkout --orphan orphan &&
  #		git symbolic-ref -m create HEAD refs/heads/log1 &&
  #		git symbolic-ref -m update HEAD refs/heads/log2 &&
  #		cat >expect <<-\EOF &&
  #		update
  #		create
  #		EOF
  #		git log --format=%gs -g -2 >actual &&
  #		test_cmp expect actual
  #	
  not ok 15 - symbolic-ref does not create ref d/f conflicts
  #	
  #		git checkout -b df &&
  #		test_commit df &&
  #		test_must_fail git symbolic-ref refs/heads/df/conflict refs/heads/df &&
  #		git pack-refs --all --prune &&
  #		test_must_fail git symbolic-ref refs/heads/df/conflict refs/heads/df
  #	
  not ok 16 - symbolic-ref can overwrite pointer to invalid name
  #	
  #		test_when_finished reset_to_sane &&
  #		head=$(git rev-parse HEAD) &&
  #		git symbolic-ref HEAD refs/heads/outer &&
  #		test_when_finished "git update-ref -d refs/heads/outer/inner" &&
  #		git update-ref refs/heads/outer/inner $head &&
  #		git symbolic-ref HEAD refs/heads/unrelated
  #	
  not ok 17 - symbolic-ref can resolve d/f name (EISDIR)
  #	
  #		test_when_finished reset_to_sane &&
  #		head=$(git rev-parse HEAD) &&
  #		git symbolic-ref HEAD refs/heads/outer/inner &&
  #		test_when_finished "git update-ref -d refs/heads/outer" &&
  #		git update-ref refs/heads/outer $head &&
  #		echo refs/heads/outer/inner >expect &&
  #		git symbolic-ref HEAD >actual &&
  #		test_cmp expect actual
  #	
  not ok 18 - symbolic-ref can resolve d/f name (ENOTDIR)
  #	
  #		test_when_finished reset_to_sane &&
  #		head=$(git rev-parse HEAD) &&
  #		git symbolic-ref HEAD refs/heads/outer &&
  #		test_when_finished "git update-ref -d refs/heads/outer/inner" &&
  #		git update-ref refs/heads/outer/inner $head &&
  #		echo refs/heads/outer >expect &&
  #		git symbolic-ref HEAD >actual &&
  #		test_cmp expect actual
  #	
  # failed 10 among 18 test(s)
  1..18

Uh-oh, a lot more tests failes, and, much worse!, my git repo is now
on a different and orphaned branch:

  ~/src/git/t (df *+)$ git status 
  On branch df
  
  No commits yet
  
  Changes to be committed:
  [...]

> I see it as the test writer's job to clean up to the extent that
> git-symbolic-ref can reset to a sane state.

No, it's the job of whoever updates the cleanup routine to make sure
that the updated cleanup routine still works just as well as it did in
the past.

> We could reset back to a known state in a more drastic manner
> (extracting .git from a tar archive), but that could interfere with
> the test functions if they're not isolated from each other.




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

* Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access
  2021-04-23  5:12           ` SZEDER Gábor
@ 2021-04-23  7:47             ` Han-Wen Nienhuys
  2021-04-23  7:53               ` Han-Wen Nienhuys
  0 siblings, 1 reply; 82+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-23  7:47 UTC (permalink / raw)
  To: SZEDER Gábor
  Cc: Ævar Arnfjörð Bjarmason,
	Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Fri, Apr 23, 2021 at 7:12 AM SZEDER Gábor <szeder.dev@gmail.com> wrote:
> > I see it as the test writer's job to clean up to the extent that
> > git-symbolic-ref can reset to a sane state.
>
> No, it's the job of whoever updates the cleanup routine to make sure
> that the updated cleanup routine still works just as well as it did in
> the past.

Sorry, I don't mean to shirk my responsibility. What I mean is: is
there a way to signal "This test is fubar. Stop further execution of
test shell script".

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

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

* Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access
  2021-04-23  7:47             ` Han-Wen Nienhuys
@ 2021-04-23  7:53               ` Han-Wen Nienhuys
  2021-04-23  9:16                 ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 82+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-23  7:53 UTC (permalink / raw)
  To: SZEDER Gábor
  Cc: Ævar Arnfjörð Bjarmason,
	Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Fri, Apr 23, 2021 at 9:47 AM Han-Wen Nienhuys <hanwen@google.com> wrote:
>
> On Fri, Apr 23, 2021 at 7:12 AM SZEDER Gábor <szeder.dev@gmail.com> wrote:
> > > I see it as the test writer's job to clean up to the extent that
> > > git-symbolic-ref can reset to a sane state.
> >
> > No, it's the job of whoever updates the cleanup routine to make sure
> > that the updated cleanup routine still works just as well as it did in
> > the past.
>
> Sorry, I don't mean to shirk my responsibility. What I mean is: is
> there a way to signal "This test is fubar. Stop further execution of
> test shell script".

Or, more generally: if a cleanup routine fails, what is the point of
continuing to run the test script? If that happens, the test directory
is an indeterminate state, so the outcome of follow-on test-functions
is indeterminate as well.

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

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

* Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access
  2021-04-23  7:53               ` Han-Wen Nienhuys
@ 2021-04-23  9:16                 ` Ævar Arnfjörð Bjarmason
  2021-04-26 18:01                   ` Han-Wen Nienhuys
  0 siblings, 1 reply; 82+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2021-04-23  9:16 UTC (permalink / raw)
  To: Han-Wen Nienhuys
  Cc: SZEDER Gábor, Han-Wen Nienhuys via GitGitGadget, git,
	Han-Wen Nienhuys


On Fri, Apr 23 2021, Han-Wen Nienhuys wrote:

> On Fri, Apr 23, 2021 at 9:47 AM Han-Wen Nienhuys <hanwen@google.com> wrote:
>>
>> On Fri, Apr 23, 2021 at 7:12 AM SZEDER Gábor <szeder.dev@gmail.com> wrote:
>> > > I see it as the test writer's job to clean up to the extent that
>> > > git-symbolic-ref can reset to a sane state.
>> >
>> > No, it's the job of whoever updates the cleanup routine to make sure
>> > that the updated cleanup routine still works just as well as it did in
>> > the past.
>>
>> Sorry, I don't mean to shirk my responsibility. What I mean is: is
>> there a way to signal "This test is fubar. Stop further execution of
>> test shell script".
>
> Or, more generally: if a cleanup routine fails, what is the point of
> continuing to run the test script? If that happens, the test directory
> is an indeterminate state, so the outcome of follow-on test-functions
> is indeterminate as well.

It's not a cleanup routine that's failing, but potentially the "setup
the next test" routine.

In this case it's probably best to invert the logic, i.e. to make the
tests do:

	test_when_finished "rm -rf copy" &&	
	git clone . copy &&
	<test-logic>

Rather than:

	reset_state &&
	<test-logic>

That also makes it more obvious what's setup and what/where tests rely
on things carried forward from previous tests.

This test is just written in a style that I think it's fair to say
wouldn't pass review today. E.g. if you skip the first N tests we do
that resetting N times redundantly without any need for it. The pattern
of moving state setup & teardown into individual tests is better.
	

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

* Re: [PATCH 10/18] test-lib: provide test prereq REFFILES
  2021-04-20 23:37     ` Junio C Hamano
@ 2021-04-26 11:09       ` Han-Wen Nienhuys
  0 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-26 11:09 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Wed, Apr 21, 2021 at 1:37 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> Junio C Hamano <gitster@pobox.com> writes:
>
> > "Han-Wen Nienhuys via GitGitGadget" <gitgitgadget@gmail.com> writes:
> >
> >> From: Han-Wen Nienhuys <hanwen@google.com>
> >>
> >> REFFILES can be used to mark tests that are specific to the packed/loose ref
> >> storage format and its limitations. Marking such tests is a preparation for
> >> introducing the reftable storage backend.
> >
> > We'd want a bit of documentation either here or in t/README to
> > explain things like how these two interact with each other, if both
> > can be active at the same time, etc.
>
> By "here", I meant the place in the code where the test_set_prereq
> was added, not in the proposed log message that will become hard to
> see when test writers need to work with the sources.

But this doc would be part of the reftable series, not this series, right?

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

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

* Re: [PATCH 18/18] t1415: set REFFILES for test specific to storage format
  2021-04-21  7:15   ` Ævar Arnfjörð Bjarmason
@ 2021-04-26 17:41     ` Han-Wen Nienhuys
  0 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-26 17:41 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Wed, Apr 21, 2021 at 9:15 AM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
>
>
> On Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:
>
> > From: Han-Wen Nienhuys <hanwen@google.com>
> >
> > Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
> > ---
> >  t/t1415-worktree-refs.sh | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/t/t1415-worktree-refs.sh b/t/t1415-worktree-refs.sh
> > index 7ab91241ab7c..a8083a0af3af 100755
> > --- a/t/t1415-worktree-refs.sh
> > +++ b/t/t1415-worktree-refs.sh
> > @@ -16,7 +16,7 @@ test_expect_success 'setup' '
> >       git -C wt2 update-ref refs/worktree/foo HEAD
> >  '
> >
> > -test_expect_success 'refs/worktree must not be packed' '
> > +test_expect_success REFFILES 'refs/worktree must not be packed' '
> >       git pack-refs --all &&
> >       test_path_is_missing .git/refs/tags/wt1 &&
> >       test_path_is_file .git/refs/worktree/foo &&
>
> So a naïve:
>
>     diff --git a/refs/files-backend.c b/refs/files-backend.c
>     index 3f29f8c143..01e2dc8bc3 100644
>     --- a/refs/files-backend.c
>     +++ b/refs/files-backend.c
>     @@ -212,7 +212,7 @@ static void files_ref_path(struct files_ref_store *refs,
>       */
>      static void add_per_worktree_entries_to_dir(struct ref_dir *dir, const char *dirname)
>      {
>     -       const char *prefixes[] = { "refs/bisect/", "refs/worktree/", "refs/rewritten/" };
>     +       const char *prefixes[] = { "refs/bisect/", "refs/rewritten/" };
>             int ip;
>
>             if (strcmp(dirname, "refs/"))
>
> Will fail the test under non-reftable, i.e. we somehow conflate "is
> packed" with correctly discovering these refs?

AFAICT, what happens is that the packed-refs file is shared across all
worktrees, so refs that are per worktree should not be stored there. I
think that is what the test is trying to assert.

> A discussion of how
> 8aff1a9ca5 (Add a place for (not) sharing stuff between worktrees,
> 2018-09-29) relates to reftable would be valuable here.

reftable handles this slightly differently. I added a comment to
reftable-backend.c about this.

> But on the tip of "seen" currently this test fails entirely with
> GIT_TEST_REFTABLE=true, so I'm not sure if it got rid of the need for
> this abstraction in the files backend or what...

Before splitting the series into two (git support and test fixups),
all of these changes reduced the number of test breakages.

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

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

* Re: [PATCH 16/18] t7003: check reflog existence only for REFFILES
  2021-04-20 22:59   ` Junio C Hamano
@ 2021-04-26 17:42     ` Han-Wen Nienhuys
  2021-04-27  9:17     ` Han-Wen Nienhuys
  1 sibling, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-26 17:42 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Wed, Apr 21, 2021 at 12:59 AM Junio C Hamano <gitster@pobox.com> wrote:

> >       git branch prune-entire B &&
> >       git filter-branch -f --prune-empty --index-filter "git update-index --remove A.t B.t" prune-entire &&
> >       test_must_fail git rev-parse refs/heads/prune-entire &&
> > -     test_must_fail git reflog exists refs/heads/prune-entire
> > +     if test_have_prereq REFFILES ; then
> > +             test_must_fail git reflog exists refs/heads/prune-entire
> > +     fi
>
> Style.  Replace " ; " with a LF and necessary number of tabs.

Done.


-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

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

* Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access
  2021-04-23  9:16                 ` Ævar Arnfjörð Bjarmason
@ 2021-04-26 18:01                   ` Han-Wen Nienhuys
  0 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-26 18:01 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: SZEDER Gábor, Han-Wen Nienhuys via GitGitGadget, git,
	Han-Wen Nienhuys

On Fri, Apr 23, 2021 at 11:16 AM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> It's not a cleanup routine that's failing, but potentially the "setup
> the next test" routine.
>
> In this case it's probably best to invert the logic, i.e. to make the
> tests do:
>
>         test_when_finished "rm -rf copy" &&
>         git clone . copy &&
>         <test-logic>
>
> Rather than:
>
>         reset_state &&
>         <test-logic>
>
> That also makes it more obvious what's setup and what/where tests rely
> on things carried forward from previous tests.

I'm using $TAR to recreate the repo scratch now. It appears to work.

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

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

* Re: [PATCH 17/18] t4202: mark bogus head hash test with REFFILES
  2021-04-21  7:08   ` Ævar Arnfjörð Bjarmason
@ 2021-04-26 18:02     ` Han-Wen Nienhuys
  0 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-26 18:02 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Wed, Apr 21, 2021 at 9:08 AM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> > In reftable, hashes are correctly formed by design
>
> With the file backend this hits this in revision.c:
>
>         if (!refname || !(flags & REF_ISSYMREF) || (flags & REF_ISBROKEN))
>                 die(_("your current branch appears to be broken"));
>
> There's a REF_ISBROKEN is the reftable code, so is hitting this codepath
> impossible under reftable and therefore we won't need this test at all?

I've removed the REF_ISBROKEN bit. It would only trigger in case of
unknown record_types, and I made it a BUG instead.

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

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

* Re: [PATCH 14/18] t1404: mark tests that muck with .git directly as REFFILES.
  2021-04-21  6:57   ` Ævar Arnfjörð Bjarmason
@ 2021-04-26 18:36     ` Han-Wen Nienhuys
  0 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-26 18:36 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys,
	Michael Haggerty

On Wed, Apr 21, 2021 at 8:57 AM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> > -test_expect_success 'broken reference blocks create' '
> > +test_expect_success REFFILES 'broken reference blocks create' '
> >       prefix=refs/broken-create &&
> >       mkdir -p .git/$prefix &&
> >       echo "gobbledigook" >.git/$prefix/foo &&
> > @@ -504,7 +504,7 @@ test_expect_success 'broken reference blocks create' '
> >       test_cmp expected output.err
> >  '
>
> This doesn't seem specific to the files backend at all. I.e. if you grep
> for "reference broken" in the file backends you'll find EINVAL and
> REF_ISBROKEN handling, and your refs/reftable-backend.c has the same
> exception handling, so presumably we can end up with broken refs.

I think it's not possible. In the files backend a broken ref is a
shortread (less than 40 digits hex) or garbage following the hex (or
maybe non-hex digits). This is all impossible with reftable.

I've removed EINVAL from reftable-backend.c

It's possible to have a corrupt reftable file, but that would surface
as  REFTABLE_FORMAT_ERROR, and is morally equivalent to an I/O error.
I added a test for this; it says:

++ git update-ref refs/heads/main 69af1687b671131ed0cfa61b7fcdc907a4c21f2c
fatal: update_ref failed for ref 'refs/heads/main': reftable:
transaction prepare: corrupt reftable file

> Anyway, much of reviewing this commit was trying to rediscover thing
> that should really be in the commit message. Presumably you had to run
> blame, log etc. to find the commits from Michael Haggerty and dig into
> if they were relevant to reftable. Having that information in the commit
> message would be *very* helpful.

I added some more explanation. I did not dig into the history or the
blame, as the tests seem relevant given what I know about how the
files backend works, but for that same reason irrelevant to reftable.
Maybe it should be documented more explicitly how the files backend
works?

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

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

* Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access
  2021-04-19 20:38   ` SZEDER Gábor
@ 2021-04-27  9:13     ` Han-Wen Nienhuys
  0 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-27  9:13 UTC (permalink / raw)
  To: SZEDER Gábor
  Cc: Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Mon, Apr 19, 2021 at 10:38 PM SZEDER Gábor <szeder.dev@gmail.com> wrote:
> > +     git symbolic-ref HEAD > actual &&
>
> Style nit: no space between redirection and filename, i.e. these
> should be '>expect' and '>actual'.

Done

> > +     ! git symbolic-ref NOTHEAD
>
> Please use 'test_must_fail git ...', because otherwise a segfault
> could go unnoticed.

Done.

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

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

* Re: [PATCH 01/18] t4202: split testcase for invalid HEAD symref and HEAD hash
  2021-04-19 21:11   ` SZEDER Gábor
@ 2021-04-27  9:14     ` Han-Wen Nienhuys
  0 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-27  9:14 UTC (permalink / raw)
  To: SZEDER Gábor
  Cc: Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Mon, Apr 19, 2021 at 11:11 PM SZEDER Gábor <szeder.dev@gmail.com> wrote:
> > +test_expect_success 'log diagnoses bogus HEAD symref' '
> > +     git init empty &&
>
> ... and this test create a new repo in 'empty' as well.  Or rather
> re-initializes the already existing repository there.
>
> Is this intentional?  It surely cases some confusion.

fixed.

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

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

* Re: [PATCH 05/18] t1413: use tar to save and restore entire .git directory
  2021-04-20 22:51   ` Junio C Hamano
@ 2021-04-27  9:15     ` Han-Wen Nienhuys
  0 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-27  9:15 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Wed, Apr 21, 2021 at 12:51 AM Junio C Hamano <gitster@pobox.com> wrote:

> > +     rm -rf .git && tar -xf .git-saved.tar
>
> Unlike GNUism longer option names like "tar --extract", you do not
> need a single dash when you ask "tar xf" (see our Makefile).
>
> Looking at t/t5000-tar-tree.sh, we seem to be supposed to use "$TAR"
> (with double quotes) to name the tar utility, so that people can say
> TAR=gtar on certain platforms.  I suspect that there already are a
> few existing violations but let's not make it worse.

Done.



-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

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

* Re: [PATCH 10/18] test-lib: provide test prereq REFFILES
  2021-04-20 22:57   ` Junio C Hamano
  2021-04-20 23:37     ` Junio C Hamano
@ 2021-04-27  9:16     ` Han-Wen Nienhuys
  1 sibling, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-27  9:16 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Wed, Apr 21, 2021 at 12:57 AM Junio C Hamano <gitster@pobox.com> wrote:
> > REFFILES can be used to mark tests that are specific to the packed/loose ref
> > storage format and its limitations. Marking such tests is a preparation for
> > introducing the reftable storage backend.
>
> We'd want a bit of documentation either here or in t/README to
> explain things like how these two interact with each other, if both
> can be active at the same time, etc.

Documented the prereq in README.

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

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

* Re: [PATCH 16/18] t7003: check reflog existence only for REFFILES
  2021-04-20 22:59   ` Junio C Hamano
  2021-04-26 17:42     ` Han-Wen Nienhuys
@ 2021-04-27  9:17     ` Han-Wen Nienhuys
  1 sibling, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-27  9:17 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Wed, Apr 21, 2021 at 12:59 AM Junio C Hamano <gitster@pobox.com> wrote:
> > diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
> > index cf30055c88dd..380bdf934317 100755
> > --- a/t/t7003-filter-branch.sh
> > +++ b/t/t7003-filter-branch.sh
> > @@ -396,7 +396,9 @@ test_expect_success '--prune-empty is able to prune entire branch' '
> >       git branch prune-entire B &&
> >       git filter-branch -f --prune-empty --index-filter "git update-index --remove A.t B.t" prune-entire &&
> >       test_must_fail git rev-parse refs/heads/prune-entire &&
> > -     test_must_fail git reflog exists refs/heads/prune-entire
> > +     if test_have_prereq REFFILES ; then
> > +             test_must_fail git reflog exists refs/heads/prune-entire
> > +     fi
>
> Style.  Replace " ; " with a LF and necessary number of tabs.

Don.e

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

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

* Re: [PATCH 02/18] t9300: check ref existence using git-rev-parse rather than FS check
  2021-04-21  6:01   ` Ævar Arnfjörð Bjarmason
@ 2021-04-27  9:20     ` Han-Wen Nienhuys
  0 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-27  9:20 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Wed, Apr 21, 2021 at 8:01 AM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> It seems to me that this breaks the test, to the extent that it's
> testing something we care about at all.
>
> I.e. reading ea08a6fd19 (Actually allow TAG_FIXUP branches in
> fast-import, 2007-08-02) the whole point is to test that a "TEMP_TAG"
> ref is accepted by fast-import, as opposed to "refs/heads/TEMP_TAG".

I've changed it to use the test-tool instead, which doesn't search for refs.

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

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

* Re: [PATCH 07/18] t5000: inspect HEAD using git-rev-parse
  2021-04-21  6:11   ` Ævar Arnfjörð Bjarmason
@ 2021-04-27  9:22     ` Han-Wen Nienhuys
  0 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-27  9:22 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Wed, Apr 21, 2021 at 8:11 AM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> If we're doing a "re-style while we're at it" s/<spaces>/<tabs>/ let's
> just go all the way and convert it to a more modern style of:
>
> test_expect_success 'git get-tar-commit-id' '

> But maybe such re-styling would be best left alone, and just a narrow
> change of the needed code. There's various surrounding tests in the file
> that use the same style, unless we're going to re-style all of them....

The file wasn't style-consistent to begin with, but I've added a
commit that restyles the rest of the file.

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--
Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

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

* Re: [PATCH 09/18] t5304: use "reflog expire --all" to clear the reflog
  2021-04-21  6:13   ` Ævar Arnfjörð Bjarmason
@ 2021-04-27  9:23     ` Han-Wen Nienhuys
  0 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-27  9:23 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Wed, Apr 21, 2021 at 8:13 AM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> >  test_expect_success 'prune: prune unreachable heads' '
> > -
>
> Similar to a previous comments, a few tests in that file use this
> whitespacing. I'd say let's just leave it alone unlress we're doing some
> whitespace-only commit earlier.

Done.

> >       git config core.logAllRefUpdates false &&
> > -     mv .git/logs .git/logs.old &&
> >       : > file2 &&
>
> Also, if we're re-styling things: ">foo" instead of ": >foo".

Done.


-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

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

* Re: [PATCH 11/18] t1407: require REFFILES for for_each_reflog test
  2021-04-21  6:23   ` Ævar Arnfjörð Bjarmason
@ 2021-04-27  9:27     ` Han-Wen Nienhuys
  0 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-27  9:27 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Wed, Apr 21, 2021 at 8:23 AM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> > -test_expect_success 'for_each_reflog()' '
> > +test_expect_success REFFILES 'for_each_reflog()' '
> >       echo $ZERO_OID > .git/logs/PSEUDO-MAIN &&
> >       mkdir -p     .git/logs/refs/bisect &&
> >       echo $ZERO_OID > .git/logs/refs/bisect/random &&
>
> Hrm, so already the first use of REFFILES has me questioning the need
> for it.
>
> I mean obviously this depends on ref-files in the strict sense.
>
> ..
>
>  * We have a PSEUDO-MAIN ref
>  * It's set to $ZERO_OID
>  * We have a $ZERO_OID in a refs/bisect/random

I've added some comments about what is happening here. The $ZERO_OID
is irrelevant here. The test tries to verify that a per-worktree ref
only appears in output of an invocation from that worktree. It's a
useful test, but this needs to be tested in an entirely different way.
(looks like setting logAllRefUpdates also doesn't trigger creating
reflogs for pseudorefs.)


-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

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

* Re: [PATCH 15/18] t7900: mark pack-refs tests as REFFILES
  2021-04-21  7:00   ` Ævar Arnfjörð Bjarmason
@ 2021-04-27  9:41     ` Han-Wen Nienhuys
  0 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-27  9:41 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Wed, Apr 21, 2021 at 9:00 AM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> Re [1] maybe this is ok/fine for now, but I think we should really split
> out the "is specific to file" part more narrowly (not just here, but in
> general).
>
> E.g. I assume that "pack-refs" is simply redundant under reftable, no?


I've expanded on the commit message to clarify this.

> Should the current behavior documented in
> Documentation/git-maintenance.txt change with your series under reftable
> etc?

No, not for now. Once the reftable support is landed, we could update
the docs to not talk about loose vs packed refs, but that seems
premature at the moment.

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

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

* [PATCH v2 00/21] Prepare tests for reftable backend
  2021-04-19 10:52 [PATCH 00/18] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                   ` (17 preceding siblings ...)
  2021-04-19 10:53 ` [PATCH 18/18] t1415: set REFFILES for test specific to storage format Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38 ` Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 01/21] t4202: split testcase for invalid HEAD symref and HEAD hash Han-Wen Nienhuys via GitGitGadget
                     ` (20 more replies)
  18 siblings, 21 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys

Rewrites some tests to avoid direct filesystem access.

Introduces the test prereq REFFILES to mark other tests that depend on
specifics of the files ref backend.

changes in v2 (relative to v1 from Apr 19)

 * t9300: use ref-store test-helper to read toplevel tag.
 * t1401: use $TAR for restoring.
 * t1407: clarify what test is doing.
 * t1417: "$TAR" rather than tar
 * t1415: clarify test objective.
 * t7003: formatting.
 * README entry for REFFILES.

cc: SZEDER Gábor szeder.dev@gmail.com cc: Ævar Arnfjörð Bjarmason
avarab@gmail.com cc: Han-Wen Nienhuys hanwen@google.com

cc: Han-Wen Nienhuys hanwen@google.com

Han-Wen Nienhuys (21):
  t4202: split testcase for invalid HEAD symref and HEAD hash
  t/helper/ref-store: initialize oid in resolve-ref
  t9300: check ref existence using test-helper rather than a file system
    check
  t5601: read HEAD using rev-parse
  t1401-symbolic-ref: avoid direct filesystem access
  t1413: use tar to save and restore entire .git directory
  t1301: fix typo in error message
  t5000: reformat indentation to the latest fashion
  t5000: inspect HEAD using git-rev-parse
  t7003: use rev-parse rather than FS inspection
  t5304: restyle: trim empty lines, drop ':' before >
  t5304: use "reflog expire --all" to clear the reflog
  test-lib: provide test prereq REFFILES
  t1407: require REFFILES for for_each_reflog test
  t1414: mark corruption test with REFFILES
  t2017: mark --orphan/logAllRefUpdates=false test as REFFILES
  t1404: mark tests that muck with .git directly as REFFILES.
  t7900: mark pack-refs tests as REFFILES
  t7003: check reflog existence only for REFFILES
  t4202: mark bogus head hash test with REFFILES
  t1415: set REFFILES for test specific to storage format

 t/README                      |   6 ++
 t/helper/test-ref-store.c     |   2 +-
 t/t1301-shared-repo.sh        |   2 +-
 t/t1401-symbolic-ref.sh       |  34 +++++-----
 t/t1404-update-ref-errors.sh  |  30 ++++-----
 t/t1407-worktree-ref-store.sh |   9 ++-
 t/t1413-reflog-detach.sh      |   5 +-
 t/t1414-reflog-walk.sh        |   2 +-
 t/t1415-worktree-refs.sh      |   5 +-
 t/t2017-checkout-orphan.sh    |   2 +-
 t/t4202-log.sh                |  10 ++-
 t/t5000-tar-tree.sh           | 113 +++++++++++++++++-----------------
 t/t5304-prune.sh              |  83 ++++++++-----------------
 t/t5601-clone.sh              |   3 +-
 t/t7003-filter-branch.sh      |   7 ++-
 t/t7900-maintenance.sh        |   2 +-
 t/t9300-fast-import.sh        |   2 +-
 t/test-lib.sh                 |   2 +
 18 files changed, 156 insertions(+), 163 deletions(-)


base-commit: 311531c9de557d25ac087c1637818bd2aad6eb3a
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1008%2Fhanwen%2Freffiles-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1008/hanwen/reffiles-v2
Pull-Request: https://github.com/git/git/pull/1008

Range-diff vs v1:

  1:  91ef012cbcc9 !  1:  8ad4a35cda70 t4202: split testcase for invalid HEAD symref and HEAD hash
     @@ t/t4202-log.sh: test_expect_success 'log --graph --no-walk is forbidden' '
      +	test_i18ngrep broken stderr'
      +
      +test_expect_success 'log diagnoses bogus HEAD symref' '
     ++	rm -rf empty &&
      +	git init empty &&
      +	git --git-dir empty/.git symbolic-ref HEAD refs/heads/invalid.lock &&
       	test_must_fail git -C empty log 2>stderr &&
  -:  ------------ >  2:  e6222944a3eb t/helper/ref-store: initialize oid in resolve-ref
  2:  ccc26a8950be !  3:  c5855b0caa73 t9300: check ref existence using git-rev-parse rather than FS check
     @@ Metadata
      Author: Han-Wen Nienhuys <hanwen@google.com>
      
       ## Commit message ##
     -    t9300: check ref existence using git-rev-parse rather than FS check
     +    t9300: check ref existence using test-helper rather than a file system check
      
          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
      
     @@ t/t9300-fast-import.sh: test_expect_success 'B: accept branch name "TEMP_TAG"' '
       		git prune" &&
       	git fast-import <input &&
      -	test -f .git/TEMP_TAG &&
     -+	git rev-parse TEMP_TAG &&
     ++	test $(test-tool ref-store main resolve-ref TEMP_TAG 0 | cut -f1 -d " " ) != "$ZERO_OID" &&
       	test $(git rev-parse main) = $(git rev-parse TEMP_TAG^)
       '
       
  3:  47b5ec56a383 =  4:  369c968ab837 t5601: read HEAD using rev-parse
  4:  53cf1069552b !  5:  248d9ffe7927 t1401-symbolic-ref: avoid direct filesystem access
     @@ Commit message
          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
      
       ## t/t1401-symbolic-ref.sh ##
     -@@ t/t1401-symbolic-ref.sh: test_description='basic symbolic-ref tests'
     - # the git repo, meaning that further tests will operate on
     - # the surrounding git repo instead of the trash directory.
     - reset_to_sane() {
     --	echo ref: refs/heads/foo >.git/HEAD
     -+	git --git-dir .git symbolic-ref HEAD refs/heads/foo
     - }
     +@@
     + test_description='basic symbolic-ref tests'
     + . ./test-lib.sh
       
     +-# If the tests munging HEAD fail, they can break detection of
     +-# the git repo, meaning that further tests will operate on
     +-# the surrounding git repo instead of the trash directory.
     +-reset_to_sane() {
     +-	echo ref: refs/heads/foo >.git/HEAD
     +-}
     +-
      -test_expect_success 'symbolic-ref writes HEAD' '
     --	git symbolic-ref HEAD refs/heads/foo &&
     ++test_expect_success 'setup' '
     + 	git symbolic-ref HEAD refs/heads/foo &&
      -	echo ref: refs/heads/foo >expect &&
      -	test_cmp expect .git/HEAD
     --'
     --
     ++	test_commit file &&
     ++	"$TAR" cf .git.tar .git/
     + '
     + 
      -test_expect_success 'symbolic-ref reads HEAD' '
      -	echo refs/heads/foo >expect &&
     --	git symbolic-ref HEAD >actual &&
     ++reset_to_sane() {
     ++	rm -rf .git &&
     ++	"$TAR" xf .git.tar
     ++}
     ++
      +test_expect_success 'symbolic-ref read/write roundtrip' '
      +	git symbolic-ref HEAD refs/heads/read-write-roundtrip &&
     -+	echo refs/heads/read-write-roundtrip > expect &&
     -+	git symbolic-ref HEAD > actual &&
     ++	echo refs/heads/read-write-roundtrip >expect &&
     + 	git symbolic-ref HEAD >actual &&
       	test_cmp expect actual
       '
     +@@ t/t1401-symbolic-ref.sh: test_expect_success 'symbolic-ref reads HEAD' '
     + test_expect_success 'symbolic-ref refuses non-ref for HEAD' '
     + 	test_must_fail git symbolic-ref HEAD foo
     + '
     ++
     + reset_to_sane
     + 
     + test_expect_success 'symbolic-ref refuses bare sha1' '
     +-	echo content >file && git add file && git commit -m one &&
     + 	test_must_fail git symbolic-ref HEAD $(git rev-parse HEAD)
     + '
     ++
     + reset_to_sane
       
     + test_expect_success 'HEAD cannot be removed' '
      @@ t/t1401-symbolic-ref.sh: reset_to_sane
       test_expect_success 'symbolic-ref can be deleted' '
       	git symbolic-ref NOTHEAD refs/heads/foo &&
     @@ t/t1401-symbolic-ref.sh: reset_to_sane
      -	test_path_is_file .git/refs/heads/foo &&
      -	test_path_is_missing .git/NOTHEAD
      +	git rev-parse refs/heads/foo &&
     -+	! git symbolic-ref NOTHEAD
     ++	test_must_fail git symbolic-ref NOTHEAD
       '
       reset_to_sane
       
     @@ t/t1401-symbolic-ref.sh: reset_to_sane
       	git symbolic-ref -d NOTHEAD &&
      -	test_path_is_missing .git/refs/heads/missing &&
      -	test_path_is_missing .git/NOTHEAD
     -+	! git rev-parse refs/heads/missing &&
     -+	! git symbolic-ref NOTHEAD
     ++	test_must_fail git rev-parse refs/heads/missing &&
     ++	test_must_fail git symbolic-ref NOTHEAD
       '
       reset_to_sane
       
  5:  223583594c00 !  6:  e4e8fc1d4b4f t1413: use tar to save and restore entire .git directory
     @@ t/t1413-reflog-detach.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
       reset_state () {
      -	git checkout main &&
      -	cp saved_reflog .git/logs/HEAD
     -+	rm -rf .git && tar -xf .git-saved.tar
     ++	rm -rf .git && "$TAR" xf .git-saved.tar
       }
       
       test_expect_success setup '
     @@ t/t1413-reflog-detach.sh: test_expect_success setup '
       	test_tick &&
       	git commit --allow-empty -m second &&
      -	cat .git/logs/HEAD >saved_reflog
     -+	tar -cf .git-saved.tar .git
     ++	"$TAR" cf .git-saved.tar .git
       '
       
       test_expect_success baseline '
  6:  70da8f5631d0 =  7:  89cc215c6014 t1301: fix typo in error message
  -:  ------------ >  8:  e67b90847c4e t5000: reformat indentation to the latest fashion
  7:  79843c0d5727 !  9:  d6072a70ae7d t5000: inspect HEAD using git-rev-parse
     @@ Commit message
          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
      
       ## t/t5000-tar-tree.sh ##
     -@@ t/t5000-tar-tree.sh: test_expect_success \
     -      test_cmp expected.mtime b.mtime'
     +@@ t/t5000-tar-tree.sh: test_expect_success 'validate file modification time' '
     + 	test_cmp expected.mtime b.mtime
     + '
       
     - test_expect_success \
     +-test_expect_success \
      -    'git get-tar-commit-id' \
      -    'git get-tar-commit-id <b.tar >b.commitid &&
      -     test_cmp .git/$(git symbolic-ref HEAD) b.commitid'
     -+	'git get-tar-commit-id' \
     -+	'git get-tar-commit-id <b.tar >actual &&
     -+	git rev-parse HEAD > expect &&
     -+	test_cmp expect actual'
     ++test_expect_success 'git get-tar-commit-id' '
     ++	git get-tar-commit-id <b.tar >actual &&
     ++	git rev-parse HEAD >expect &&
     ++	test_cmp expect actual
     ++'
       
       test_expect_success 'git archive with --output, override inferred format' '
       	git archive --format=tar --output=d4.zip HEAD &&
  8:  dbb81b5b89d8 = 10:  4bf1bf16bca3 t7003: use rev-parse rather than FS inspection
  -:  ------------ > 11:  6f15c15573af t5304: restyle: trim empty lines, drop ':' before >
  9:  ba575839e422 ! 12:  d8e80d83b6f8 t5304: use "reflog expire --all" to clear the reflog
     @@ Commit message
      
       ## t/t5304-prune.sh ##
      @@ t/t5304-prune.sh: test_expect_success 'prune: prune nonsense parameters' '
     - '
       
       test_expect_success 'prune: prune unreachable heads' '
     --
       	git config core.logAllRefUpdates false &&
      -	mv .git/logs .git/logs.old &&
     - 	: > file2 &&
     +-	: > file2 &&
     ++	>file2 &&
       	git add file2 &&
       	git commit -m temporary &&
       	tmp_head=$(git rev-list -1 HEAD) &&
     @@ t/t5304-prune.sh: test_expect_success 'prune: prune nonsense parameters' '
      +	git reflog expire --all &&
       	git prune &&
       	test_must_fail git reset $tmp_head --
     --
       '
     - 
     +@@ t/t5304-prune.sh: test_expect_success 'prune: prune unreachable heads' '
       test_expect_success 'prune: do not prune detached HEAD with no reflog' '
     - 
       	git checkout --detach --quiet &&
       	git commit --allow-empty -m "detached commit" &&
      -	# verify that there is no reflogs
     @@ t/t5304-prune.sh: test_expect_success 'prune: prune nonsense parameters' '
      +	git reflog expire --all &&
       	git prune -n >prune_actual &&
       	test_must_be_empty prune_actual
     - 
     -@@ t/t5304-prune.sh: test_expect_success 'prune: prune former HEAD after checking out branch' '
     - 
     + '
     +@@ t/t5304-prune.sh: test_expect_success 'prune: do not prune detached HEAD with no reflog' '
     + test_expect_success 'prune: prune former HEAD after checking out branch' '
       	head_oid=$(git rev-parse HEAD) &&
       	git checkout --quiet main &&
      +	git reflog expire --all &&
       	git prune -v >prune_actual &&
       	grep "$head_oid" prune_actual
     - 
     + '
 10:  3d3b733c3127 ! 13:  180847f4db14 test-lib: provide test prereq REFFILES
     @@ Commit message
      
          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
      
     + ## t/README ##
     +@@ t/README: use these, and "test_set_prereq" for how to define your own.
     + 
     +    Git wasn't compiled with NO_PTHREADS=YesPlease.
     + 
     ++ - REFFILES
     ++
     ++   Test is specific to packed/loose ref storage, and should be
     ++   disabled for other ref storage backends
     ++
     ++
     + Tips for Writing Tests
     + ----------------------
     + 
     +
       ## t/test-lib.sh ##
      @@ t/test-lib.sh: parisc* | hppa*)
       	;;
 11:  dd1f6969c28d ! 14:  f3307b62bfd7 t1407: require REFFILES for for_each_reflog test
     @@ Metadata
       ## Commit message ##
          t1407: require REFFILES for for_each_reflog test
      
     -    It tries to setup a reflog by catting to .git/logs/
     +    Add extensive comment why this test needs a REFFILES annotation.
     +
     +    I tried forcing universal reflog creation with core.logAllRefUpdates=true, but
     +    that apparently also doesn't cause reflogs to be created for pseudorefs
      
          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
      
     @@ t/t1407-worktree-ref-store.sh: test_expect_success 'create_symref(FOO, refs/head
       '
       
      -test_expect_success 'for_each_reflog()' '
     ++# Some refs (refs/bisect/*, pseudorefs) are kept per worktree, so they should
     ++# only appear in the for-each-reflog output if it is called from the correct
     ++# worktree, which is exercised in this test. This test is poorly written (and
     ++# therefore marked REFFILES) for mulitple reasons: 1) it creates invalidly
     ++# formatted log entres. 2) it uses direct FS access for creating the reflogs. 3)
     ++# PSEUDO-WT and refs/bisect/random do not create reflogs by default, so it is
     ++# not testing a realistic scenario.
      +test_expect_success REFFILES 'for_each_reflog()' '
       	echo $ZERO_OID > .git/logs/PSEUDO-MAIN &&
       	mkdir -p     .git/logs/refs/bisect &&
 12:  86951eb39cb6 = 15:  0d3b18cd3542 t1414: mark corruption test with REFFILES
 13:  1ce545043846 = 16:  b64e3e7ade15 t2017: mark --orphan/logAllRefUpdates=false test as REFFILES
 14:  a3abc4f70e7d ! 17:  fcc2b714dd50 t1404: mark tests that muck with .git directly as REFFILES.
     @@ Metadata
       ## Commit message ##
          t1404: mark tests that muck with .git directly as REFFILES.
      
     +    The packed/loose ref storage is an overlay combination of packed-refs (refs and
     +    tags in a single file) and one-file-per-ref. This creates all kinds of edge
     +    cases related to directory/file conflicts, (non-)empty directories, and the
     +    locking scheme, none of which applies to reftable.
     +
          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
      
       ## t/t1404-update-ref-errors.sh ##
 15:  2b3021c4ba62 ! 18:  ff3b67c84c41 t7900: mark pack-refs tests as REFFILES
     @@ Metadata
       ## Commit message ##
          t7900: mark pack-refs tests as REFFILES
      
     +    Reftable automatically compacts tables on writes. The functionality of
     +    incremental compaction is unittested in reftable/stack_test.c
     +    (test_reftable_stack_auto_compaction)
     +
     +    In addition, pack-refs triggers a full compaction of the entire stack. This is
     +    exercised in t0031-reftable.sh.
     +
     +    Given that git-maintenance simply calls out git-pack-refs, it seems superfluous
     +    to test this further for reftable.
     +
          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
      
       ## t/t7900-maintenance.sh ##
 16:  a5b9439192db ! 19:  24dcf05d8fa6 t7003: check reflog existence only for REFFILES
     @@ t/t7003-filter-branch.sh: test_expect_success '--prune-empty is able to prune en
       	git filter-branch -f --prune-empty --index-filter "git update-index --remove A.t B.t" prune-entire &&
       	test_must_fail git rev-parse refs/heads/prune-entire &&
      -	test_must_fail git reflog exists refs/heads/prune-entire
     -+	if test_have_prereq REFFILES ; then
     ++	if test_have_prereq REFFILES
     ++	then
      +		test_must_fail git reflog exists refs/heads/prune-entire
      +	fi
       '
 17:  a2cce772d44f = 20:  a33cdfda74ff t4202: mark bogus head hash test with REFFILES
 18:  0665edb1308b ! 21:  d7e5de8dba46 t1415: set REFFILES for test specific to storage format
     @@ Metadata
       ## Commit message ##
          t1415: set REFFILES for test specific to storage format
      
     +    Packing refs (and therefore checking that certain refs are not packed) is a
     +    property of the packed/loose ref storage. Add a comment to explain what the test
     +    checks.
     +
          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
      
       ## t/t1415-worktree-refs.sh ##
     @@ t/t1415-worktree-refs.sh: test_expect_success 'setup' '
       '
       
      -test_expect_success 'refs/worktree must not be packed' '
     ++# The 'packed-refs' files is stored directly in .git/. This means it is global
     ++# to the repository, and can only contain refs that are shared across all
     ++# worktrees.
      +test_expect_success REFFILES 'refs/worktree must not be packed' '
       	git pack-refs --all &&
       	test_path_is_missing .git/refs/tags/wt1 &&

-- 
gitgitgadget

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

* [PATCH v2 01/21] t4202: split testcase for invalid HEAD symref and HEAD hash
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38   ` Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 02/21] t/helper/ref-store: initialize oid in resolve-ref Han-Wen Nienhuys via GitGitGadget
                     ` (19 subsequent siblings)
  20 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Reftable will prohibit invalid hashes at the storage level, but
git-symbolic-ref can still create branches ending in ".lock".

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t4202-log.sh | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index 350cfa35936a..a8c5a00d012d 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -1834,14 +1834,18 @@ test_expect_success 'log --graph --no-walk is forbidden' '
 	test_must_fail git log --graph --no-walk
 '
 
-test_expect_success 'log diagnoses bogus HEAD' '
+test_expect_success 'log diagnoses bogus HEAD hash' '
 	git init empty &&
 	test_must_fail git -C empty log 2>stderr &&
 	test_i18ngrep does.not.have.any.commits stderr &&
 	echo 1234abcd >empty/.git/refs/heads/main &&
 	test_must_fail git -C empty log 2>stderr &&
-	test_i18ngrep broken stderr &&
-	echo "ref: refs/heads/invalid.lock" >empty/.git/HEAD &&
+	test_i18ngrep broken stderr'
+
+test_expect_success 'log diagnoses bogus HEAD symref' '
+	rm -rf empty &&
+	git init empty &&
+	git --git-dir empty/.git symbolic-ref HEAD refs/heads/invalid.lock &&
 	test_must_fail git -C empty log 2>stderr &&
 	test_i18ngrep broken stderr &&
 	test_must_fail git -C empty log --default totally-bogus 2>stderr &&
-- 
gitgitgadget


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

* [PATCH v2 02/21] t/helper/ref-store: initialize oid in resolve-ref
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 01/21] t4202: split testcase for invalid HEAD symref and HEAD hash Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38   ` Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 03/21] t9300: check ref existence using test-helper rather than a file system check Han-Wen Nienhuys via GitGitGadget
                     ` (18 subsequent siblings)
  20 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

This will print $ZERO_OID when asking for a non-existent ref from the
test-helper.

Since resolve-ref provides direct access to refs_resolve_ref_unsafe(), it
provides a reliable mechanism for accessing REFNAME, while avoiding the implicit
resolution to refs/heads/REFNAME.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/helper/test-ref-store.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c
index bba5f841c6ab..01d8f3285dc8 100644
--- a/t/helper/test-ref-store.c
+++ b/t/helper/test-ref-store.c
@@ -118,7 +118,7 @@ static int cmd_for_each_ref(struct ref_store *refs, const char **argv)
 
 static int cmd_resolve_ref(struct ref_store *refs, const char **argv)
 {
-	struct object_id oid;
+	struct object_id oid = { 0 };
 	const char *refname = notnull(*argv++, "refname");
 	int resolve_flags = arg_flags(*argv++, "resolve-flags");
 	int flags;
-- 
gitgitgadget


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

* [PATCH v2 03/21] t9300: check ref existence using test-helper rather than a file system check
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 01/21] t4202: split testcase for invalid HEAD symref and HEAD hash Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 02/21] t/helper/ref-store: initialize oid in resolve-ref Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38   ` Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 04/21] t5601: read HEAD using rev-parse Han-Wen Nienhuys via GitGitGadget
                     ` (17 subsequent siblings)
  20 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t9300-fast-import.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 5c47ac4465cb..1aea943bef72 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -392,7 +392,7 @@ test_expect_success 'B: accept branch name "TEMP_TAG"' '
 		git gc
 		git prune" &&
 	git fast-import <input &&
-	test -f .git/TEMP_TAG &&
+	test $(test-tool ref-store main resolve-ref TEMP_TAG 0 | cut -f1 -d " " ) != "$ZERO_OID" &&
 	test $(git rev-parse main) = $(git rev-parse TEMP_TAG^)
 '
 
-- 
gitgitgadget


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

* [PATCH v2 04/21] t5601: read HEAD using rev-parse
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                     ` (2 preceding siblings ...)
  2021-04-27 10:38   ` [PATCH v2 03/21] t9300: check ref existence using test-helper rather than a file system check Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38   ` Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 05/21] t1401-symbolic-ref: avoid direct filesystem access Han-Wen Nienhuys via GitGitGadget
                     ` (16 subsequent siblings)
  20 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t5601-clone.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 329ae599fd3c..7223372c7660 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -305,7 +305,8 @@ test_expect_success 'clone from original with relative alternate' '
 test_expect_success 'clone checking out a tag' '
 	git clone --branch=some-tag src dst.tag &&
 	GIT_DIR=src/.git git rev-parse some-tag >expected &&
-	test_cmp expected dst.tag/.git/HEAD &&
+	GIT_DIR=dst.tag/.git git rev-parse HEAD >actual &&
+	test_cmp expected actual &&
 	GIT_DIR=dst.tag/.git git config remote.origin.fetch >fetch.actual &&
 	echo "+refs/heads/*:refs/remotes/origin/*" >fetch.expected &&
 	test_cmp fetch.expected fetch.actual
-- 
gitgitgadget


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

* [PATCH v2 05/21] t1401-symbolic-ref: avoid direct filesystem access
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                     ` (3 preceding siblings ...)
  2021-04-27 10:38   ` [PATCH v2 04/21] t5601: read HEAD using rev-parse Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38   ` Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 06/21] t1413: use tar to save and restore entire .git directory Han-Wen Nienhuys via GitGitGadget
                     ` (15 subsequent siblings)
  20 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t1401-symbolic-ref.sh | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh
index a4ebb0b65fec..315a62f78019 100755
--- a/t/t1401-symbolic-ref.sh
+++ b/t/t1401-symbolic-ref.sh
@@ -3,21 +3,20 @@
 test_description='basic symbolic-ref tests'
 . ./test-lib.sh
 
-# If the tests munging HEAD fail, they can break detection of
-# the git repo, meaning that further tests will operate on
-# the surrounding git repo instead of the trash directory.
-reset_to_sane() {
-	echo ref: refs/heads/foo >.git/HEAD
-}
-
-test_expect_success 'symbolic-ref writes HEAD' '
+test_expect_success 'setup' '
 	git symbolic-ref HEAD refs/heads/foo &&
-	echo ref: refs/heads/foo >expect &&
-	test_cmp expect .git/HEAD
+	test_commit file &&
+	"$TAR" cf .git.tar .git/
 '
 
-test_expect_success 'symbolic-ref reads HEAD' '
-	echo refs/heads/foo >expect &&
+reset_to_sane() {
+	rm -rf .git &&
+	"$TAR" xf .git.tar
+}
+
+test_expect_success 'symbolic-ref read/write roundtrip' '
+	git symbolic-ref HEAD refs/heads/read-write-roundtrip &&
+	echo refs/heads/read-write-roundtrip >expect &&
 	git symbolic-ref HEAD >actual &&
 	test_cmp expect actual
 '
@@ -25,12 +24,13 @@ test_expect_success 'symbolic-ref reads HEAD' '
 test_expect_success 'symbolic-ref refuses non-ref for HEAD' '
 	test_must_fail git symbolic-ref HEAD foo
 '
+
 reset_to_sane
 
 test_expect_success 'symbolic-ref refuses bare sha1' '
-	echo content >file && git add file && git commit -m one &&
 	test_must_fail git symbolic-ref HEAD $(git rev-parse HEAD)
 '
+
 reset_to_sane
 
 test_expect_success 'HEAD cannot be removed' '
@@ -42,16 +42,16 @@ reset_to_sane
 test_expect_success 'symbolic-ref can be deleted' '
 	git symbolic-ref NOTHEAD refs/heads/foo &&
 	git symbolic-ref -d NOTHEAD &&
-	test_path_is_file .git/refs/heads/foo &&
-	test_path_is_missing .git/NOTHEAD
+	git rev-parse refs/heads/foo &&
+	test_must_fail git symbolic-ref NOTHEAD
 '
 reset_to_sane
 
 test_expect_success 'symbolic-ref can delete dangling symref' '
 	git symbolic-ref NOTHEAD refs/heads/missing &&
 	git symbolic-ref -d NOTHEAD &&
-	test_path_is_missing .git/refs/heads/missing &&
-	test_path_is_missing .git/NOTHEAD
+	test_must_fail git rev-parse refs/heads/missing &&
+	test_must_fail git symbolic-ref NOTHEAD
 '
 reset_to_sane
 
-- 
gitgitgadget


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

* [PATCH v2 06/21] t1413: use tar to save and restore entire .git directory
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                     ` (4 preceding siblings ...)
  2021-04-27 10:38   ` [PATCH v2 05/21] t1401-symbolic-ref: avoid direct filesystem access Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38   ` Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 07/21] t1301: fix typo in error message Han-Wen Nienhuys via GitGitGadget
                     ` (14 subsequent siblings)
  20 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

This makes the test independent of the particulars of the storage formats.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t1413-reflog-detach.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/t/t1413-reflog-detach.sh b/t/t1413-reflog-detach.sh
index bde05208ae6a..934688a1ee82 100755
--- a/t/t1413-reflog-detach.sh
+++ b/t/t1413-reflog-detach.sh
@@ -7,8 +7,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
 . ./test-lib.sh
 
 reset_state () {
-	git checkout main &&
-	cp saved_reflog .git/logs/HEAD
+	rm -rf .git && "$TAR" xf .git-saved.tar
 }
 
 test_expect_success setup '
@@ -17,7 +16,7 @@ test_expect_success setup '
 	git branch side &&
 	test_tick &&
 	git commit --allow-empty -m second &&
-	cat .git/logs/HEAD >saved_reflog
+	"$TAR" cf .git-saved.tar .git
 '
 
 test_expect_success baseline '
-- 
gitgitgadget


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

* [PATCH v2 07/21] t1301: fix typo in error message
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                     ` (5 preceding siblings ...)
  2021-04-27 10:38   ` [PATCH v2 06/21] t1413: use tar to save and restore entire .git directory Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38   ` Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 08/21] t5000: reformat indentation to the latest fashion Han-Wen Nienhuys via GitGitGadget
                     ` (13 subsequent siblings)
  20 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t1301-shared-repo.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh
index ac947bff9fcf..84bf1970d8bf 100755
--- a/t/t1301-shared-repo.sh
+++ b/t/t1301-shared-repo.sh
@@ -124,7 +124,7 @@ test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '
 		: happy
 		;;
 	*)
-		echo Ooops, .git/logs/refs/heads/main is not 0662 [$actual]
+		echo Ooops, .git/logs/refs/heads/main is not 066x [$actual]
 		false
 		;;
 	esac
-- 
gitgitgadget


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

* [PATCH v2 08/21] t5000: reformat indentation to the latest fashion
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                     ` (6 preceding siblings ...)
  2021-04-27 10:38   ` [PATCH v2 07/21] t1301: fix typo in error message Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38   ` Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 09/21] t5000: inspect HEAD using git-rev-parse Han-Wen Nienhuys via GitGitGadget
                     ` (12 subsequent siblings)
  20 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t5000-tar-tree.sh | 104 ++++++++++++++++++++++----------------------
 1 file changed, 53 insertions(+), 51 deletions(-)

diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index 7204799a0b52..b6734cba7e65 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -111,25 +111,25 @@ test_expect_success 'setup' '
 	EOF
 '
 
-test_expect_success \
-    'populate workdir' \
-    'mkdir a &&
-     echo simple textfile >a/a &&
-     ten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&
-     echo long filename >a/four$hundred &&
-     mkdir a/bin &&
-     test-tool genrandom "frotz" 500000 >a/bin/sh &&
-     printf "A\$Format:%s\$O" "$SUBSTFORMAT" >a/substfile1 &&
-     printf "A not substituted O" >a/substfile2 &&
-     if test_have_prereq SYMLINKS; then
-	ln -s a a/l1
-     else
-	printf %s a > a/l1
-     fi &&
-     (p=long_path_to_a_file && cd a &&
-      for depth in 1 2 3 4 5; do mkdir $p && cd $p; done &&
-      echo text >file_with_long_path) &&
-     (cd a && find .) | sort >a.lst'
+test_expect_success 'populate workdir' '
+	mkdir a &&
+	echo simple textfile >a/a &&
+	ten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&
+	echo long filename >a/four$hundred &&
+	mkdir a/bin &&
+	test-tool genrandom "frotz" 500000 >a/bin/sh &&
+	printf "A\$Format:%s\$O" "$SUBSTFORMAT" >a/substfile1 &&
+	printf "A not substituted O" >a/substfile2 &&
+	if test_have_prereq SYMLINKS; then
+		ln -s a a/l1
+	else
+		printf %s a >a/l1
+	fi &&
+	(p=long_path_to_a_file && cd a &&
+		for depth in 1 2 3 4 5; do mkdir $p && cd $p; done &&
+		echo text >file_with_long_path) &&
+	(cd a && find .) | sort >a.lst
+'
 
 test_expect_success \
     'add ignored file' \
@@ -147,18 +147,18 @@ test_expect_success 'setup export-subst' '
 		>a/substfile1
 '
 
-test_expect_success \
-    'create bare clone' \
-    'git clone --bare . bare.git &&
-     cp .git/info/attributes bare.git/info/attributes'
+test_expect_success 'create bare clone' '
+	git clone --bare . bare.git &&
+	cp .git/info/attributes bare.git/info/attributes
+'
 
-test_expect_success \
-    'remove ignored file' \
-    'rm a/ignored'
+test_expect_success 'remove ignored file' '
+	rm a/ignored
+'
 
-test_expect_success \
-    'git archive' \
-    'git archive HEAD >b.tar'
+test_expect_success 'git archive' '
+	git archive HEAD >b.tar
+'
 
 check_tar b
 
@@ -194,26 +194,28 @@ check_added with_untracked2 untracked one/untracked
 check_added with_untracked2 untracked two/untracked
 
 test_expect_success 'git archive on large files' '
-    test_config core.bigfilethreshold 1 &&
-    git archive HEAD >b3.tar &&
-    test_cmp_bin b.tar b3.tar
+	test_config core.bigfilethreshold 1 &&
+	git archive HEAD >b3.tar &&
+	test_cmp_bin b.tar b3.tar
 '
 
-test_expect_success \
-    'git archive in a bare repo' \
-    '(cd bare.git && git archive HEAD) >b3.tar'
+test_expect_success 'git archive in a bare repo' '
+	(cd bare.git && git archive HEAD) >b3.tar
+'
 
-test_expect_success \
-    'git archive vs. the same in a bare repo' \
-    'test_cmp_bin b.tar b3.tar'
+test_expect_success 'git archive vs. the same in a bare repo' '
+	test_cmp_bin b.tar b3.tar
+'
 
-test_expect_success 'git archive with --output' \
-    'git archive --output=b4.tar HEAD &&
-    test_cmp_bin b.tar b4.tar'
+test_expect_success 'git archive with --output' '
+	git archive --output=b4.tar HEAD &&
+	test_cmp_bin b.tar b4.tar
+'
 
-test_expect_success 'git archive --remote' \
-    'git archive --remote=. HEAD >b5.tar &&
-    test_cmp_bin b.tar b5.tar'
+test_expect_success 'git archive --remote' '
+	git archive --remote=. HEAD >b5.tar &&
+	test_cmp_bin b.tar b5.tar
+'
 
 test_expect_success 'git archive --remote with configured remote' '
 	git config remote.foo.url . &&
@@ -224,13 +226,13 @@ test_expect_success 'git archive --remote with configured remote' '
 	test_cmp_bin b.tar b5-nick.tar
 '
 
-test_expect_success \
-    'validate file modification time' \
-    'mkdir extract &&
-     "$TAR" xf b.tar -C extract a/a &&
-     test-tool chmtime --get extract/a/a >b.mtime &&
-     echo "1117231200" >expected.mtime &&
-     test_cmp expected.mtime b.mtime'
+test_expect_success 'validate file modification time' '
+	mkdir extract &&
+	"$TAR" xf b.tar -C extract a/a &&
+	test-tool chmtime --get extract/a/a >b.mtime &&
+	echo "1117231200" >expected.mtime &&
+	test_cmp expected.mtime b.mtime
+'
 
 test_expect_success \
     'git get-tar-commit-id' \
-- 
gitgitgadget


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

* [PATCH v2 09/21] t5000: inspect HEAD using git-rev-parse
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                     ` (7 preceding siblings ...)
  2021-04-27 10:38   ` [PATCH v2 08/21] t5000: reformat indentation to the latest fashion Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38   ` Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 10/21] t7003: use rev-parse rather than FS inspection Han-Wen Nienhuys via GitGitGadget
                     ` (11 subsequent siblings)
  20 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t5000-tar-tree.sh | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index b6734cba7e65..153f8400035a 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -234,10 +234,11 @@ test_expect_success 'validate file modification time' '
 	test_cmp expected.mtime b.mtime
 '
 
-test_expect_success \
-    'git get-tar-commit-id' \
-    'git get-tar-commit-id <b.tar >b.commitid &&
-     test_cmp .git/$(git symbolic-ref HEAD) b.commitid'
+test_expect_success 'git get-tar-commit-id' '
+	git get-tar-commit-id <b.tar >actual &&
+	git rev-parse HEAD >expect &&
+	test_cmp expect actual
+'
 
 test_expect_success 'git archive with --output, override inferred format' '
 	git archive --format=tar --output=d4.zip HEAD &&
-- 
gitgitgadget


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

* [PATCH v2 10/21] t7003: use rev-parse rather than FS inspection
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                     ` (8 preceding siblings ...)
  2021-04-27 10:38   ` [PATCH v2 09/21] t5000: inspect HEAD using git-rev-parse Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38   ` Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 11/21] t5304: restyle: trim empty lines, drop ':' before > Han-Wen Nienhuys via GitGitGadget
                     ` (10 subsequent siblings)
  20 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t7003-filter-branch.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index 1349e5b2321c..cf30055c88dd 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -395,7 +395,7 @@ test_expect_success '--prune-empty is able to prune root commit' '
 test_expect_success '--prune-empty is able to prune entire branch' '
 	git branch prune-entire B &&
 	git filter-branch -f --prune-empty --index-filter "git update-index --remove A.t B.t" prune-entire &&
-	test_path_is_missing .git/refs/heads/prune-entire &&
+	test_must_fail git rev-parse refs/heads/prune-entire &&
 	test_must_fail git reflog exists refs/heads/prune-entire
 '
 
-- 
gitgitgadget


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

* [PATCH v2 11/21] t5304: restyle: trim empty lines, drop ':' before >
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                     ` (9 preceding siblings ...)
  2021-04-27 10:38   ` [PATCH v2 10/21] t7003: use rev-parse rather than FS inspection Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38   ` Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 12/21] t5304: use "reflog expire --all" to clear the reflog Han-Wen Nienhuys via GitGitGadget
                     ` (9 subsequent siblings)
  20 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t5304-prune.sh | 74 +++++++++++++-----------------------------------
 1 file changed, 20 insertions(+), 54 deletions(-)

diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh
index b447ce56a9b2..7f47f13c78e8 100755
--- a/t/t5304-prune.sh
+++ b/t/t5304-prune.sh
@@ -22,30 +22,25 @@ add_blob() {
 }
 
 test_expect_success setup '
-
-	: > file &&
+	>file &&
 	git add file &&
 	test_tick &&
 	git commit -m initial &&
 	git gc
-
 '
 
 test_expect_success 'prune stale packs' '
-
 	orig_pack=$(echo .git/objects/pack/*.pack) &&
-	: > .git/objects/tmp_1.pack &&
-	: > .git/objects/tmp_2.pack &&
+	>.git/objects/tmp_1.pack &&
+	>.git/objects/tmp_2.pack &&
 	test-tool chmtime =-86501 .git/objects/tmp_1.pack &&
 	git prune --expire 1.day &&
 	test_path_is_file $orig_pack &&
 	test_path_is_file .git/objects/tmp_2.pack &&
 	test_path_is_missing .git/objects/tmp_1.pack
-
 '
 
 test_expect_success 'prune --expire' '
-
 	add_blob &&
 	git prune --expire=1.hour.ago &&
 	verbose test $((1 + $before)) = $(git count-objects | sed "s/ .*//") &&
@@ -54,11 +49,9 @@ test_expect_success 'prune --expire' '
 	git prune --expire 1.day &&
 	verbose test $before = $(git count-objects | sed "s/ .*//") &&
 	test_path_is_missing $BLOB_FILE
-
 '
 
 test_expect_success 'gc: implicit prune --expire' '
-
 	add_blob &&
 	test-tool chmtime =-$((2*$week-30)) $BLOB_FILE &&
 	git gc &&
@@ -68,33 +61,25 @@ test_expect_success 'gc: implicit prune --expire' '
 	git gc &&
 	verbose test $before = $(git count-objects | sed "s/ .*//") &&
 	test_path_is_missing $BLOB_FILE
-
 '
 
 test_expect_success 'gc: refuse to start with invalid gc.pruneExpire' '
-
 	git config gc.pruneExpire invalid &&
 	test_must_fail git gc
-
 '
 
 test_expect_success 'gc: start with ok gc.pruneExpire' '
-
 	git config gc.pruneExpire 2.days.ago &&
 	git gc
-
 '
 
 test_expect_success 'prune: prune nonsense parameters' '
-
 	test_must_fail git prune garbage &&
 	test_must_fail git prune --- &&
 	test_must_fail git prune --no-such-option
-
 '
 
 test_expect_success 'prune: prune unreachable heads' '
-
 	git config core.logAllRefUpdates false &&
 	mv .git/logs .git/logs.old &&
 	: > file2 &&
@@ -104,11 +89,9 @@ test_expect_success 'prune: prune unreachable heads' '
 	git reset HEAD^ &&
 	git prune &&
 	test_must_fail git reset $tmp_head --
-
 '
 
 test_expect_success 'prune: do not prune detached HEAD with no reflog' '
-
 	git checkout --detach --quiet &&
 	git commit --allow-empty -m "detached commit" &&
 	# verify that there is no reflogs
@@ -116,75 +99,61 @@ test_expect_success 'prune: do not prune detached HEAD with no reflog' '
 	test_path_is_missing .git/logs &&
 	git prune -n >prune_actual &&
 	test_must_be_empty prune_actual
-
 '
 
 test_expect_success 'prune: prune former HEAD after checking out branch' '
-
 	head_oid=$(git rev-parse HEAD) &&
 	git checkout --quiet main &&
 	git prune -v >prune_actual &&
 	grep "$head_oid" prune_actual
-
 '
 
 test_expect_success 'prune: do not prune heads listed as an argument' '
-
-	: > file2 &&
+	>file2 &&
 	git add file2 &&
 	git commit -m temporary &&
 	tmp_head=$(git rev-list -1 HEAD) &&
 	git reset HEAD^ &&
 	git prune -- $tmp_head &&
 	git reset $tmp_head --
-
 '
 
 test_expect_success 'gc --no-prune' '
-
 	add_blob &&
 	test-tool chmtime =-$((5001*$day)) $BLOB_FILE &&
 	git config gc.pruneExpire 2.days.ago &&
 	git gc --no-prune &&
 	verbose test 1 = $(git count-objects | sed "s/ .*//") &&
 	test_path_is_file $BLOB_FILE
-
 '
 
 test_expect_success 'gc respects gc.pruneExpire' '
-
 	git config gc.pruneExpire 5002.days.ago &&
 	git gc &&
 	test_path_is_file $BLOB_FILE &&
 	git config gc.pruneExpire 5000.days.ago &&
 	git gc &&
 	test_path_is_missing $BLOB_FILE
-
 '
 
 test_expect_success 'gc --prune=<date>' '
-
 	add_blob &&
 	test-tool chmtime =-$((5001*$day)) $BLOB_FILE &&
 	git gc --prune=5002.days.ago &&
 	test_path_is_file $BLOB_FILE &&
 	git gc --prune=5000.days.ago &&
 	test_path_is_missing $BLOB_FILE
-
 '
 
 test_expect_success 'gc --prune=never' '
-
 	add_blob &&
 	git gc --prune=never &&
 	test_path_is_file $BLOB_FILE &&
 	git gc --prune=now &&
 	test_path_is_missing $BLOB_FILE
-
 '
 
 test_expect_success 'gc respects gc.pruneExpire=never' '
-
 	git config gc.pruneExpire never &&
 	add_blob &&
 	git gc &&
@@ -192,17 +161,14 @@ test_expect_success 'gc respects gc.pruneExpire=never' '
 	git config gc.pruneExpire now &&
 	git gc &&
 	test_path_is_missing $BLOB_FILE
-
 '
 
 test_expect_success 'prune --expire=never' '
-
 	add_blob &&
 	git prune --expire=never &&
 	test_path_is_file $BLOB_FILE &&
 	git prune &&
 	test_path_is_missing $BLOB_FILE
-
 '
 
 test_expect_success 'gc: prune old objects after local clone' '
@@ -222,16 +188,16 @@ test_expect_success 'gc: prune old objects after local clone' '
 test_expect_success 'garbage report in count-objects -v' '
 	test_when_finished "rm -f .git/objects/pack/fake*" &&
 	test_when_finished "rm -f .git/objects/pack/foo*" &&
-	: >.git/objects/pack/foo &&
-	: >.git/objects/pack/foo.bar &&
-	: >.git/objects/pack/foo.keep &&
-	: >.git/objects/pack/foo.pack &&
-	: >.git/objects/pack/fake.bar &&
-	: >.git/objects/pack/fake.keep &&
-	: >.git/objects/pack/fake.pack &&
-	: >.git/objects/pack/fake.idx &&
-	: >.git/objects/pack/fake2.keep &&
-	: >.git/objects/pack/fake3.idx &&
+	>.git/objects/pack/foo &&
+	>.git/objects/pack/foo.bar &&
+	>.git/objects/pack/foo.keep &&
+	>.git/objects/pack/foo.pack &&
+	>.git/objects/pack/fake.bar &&
+	>.git/objects/pack/fake.keep &&
+	>.git/objects/pack/fake.pack &&
+	>.git/objects/pack/fake.idx &&
+	>.git/objects/pack/fake2.keep &&
+	>.git/objects/pack/fake3.idx &&
 	git count-objects -v 2>stderr &&
 	grep "index file .git/objects/pack/fake.idx is too small" stderr &&
 	grep "^warning:" stderr | sort >actual &&
@@ -250,12 +216,12 @@ EOF
 test_expect_success 'clean pack garbage with gc' '
 	test_when_finished "rm -f .git/objects/pack/fake*" &&
 	test_when_finished "rm -f .git/objects/pack/foo*" &&
-	: >.git/objects/pack/foo.keep &&
-	: >.git/objects/pack/foo.pack &&
-	: >.git/objects/pack/fake.idx &&
-	: >.git/objects/pack/fake2.keep &&
-	: >.git/objects/pack/fake2.idx &&
-	: >.git/objects/pack/fake3.keep &&
+	>.git/objects/pack/foo.keep &&
+	>.git/objects/pack/foo.pack &&
+	>.git/objects/pack/fake.idx &&
+	>.git/objects/pack/fake2.keep &&
+	>.git/objects/pack/fake2.idx &&
+	>.git/objects/pack/fake3.keep &&
 	git gc &&
 	git count-objects -v 2>stderr &&
 	grep "^warning:" stderr | sort >actual &&
-- 
gitgitgadget


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

* [PATCH v2 12/21] t5304: use "reflog expire --all" to clear the reflog
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                     ` (10 preceding siblings ...)
  2021-04-27 10:38   ` [PATCH v2 11/21] t5304: restyle: trim empty lines, drop ':' before > Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38   ` Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 13/21] test-lib: provide test prereq REFFILES Han-Wen Nienhuys via GitGitGadget
                     ` (8 subsequent siblings)
  20 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

This is more explicit, and reduces the depency between test functions. It also
is more amenable to use with reftable, which has no concept of (non)existence of
a reflog

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t5304-prune.sh | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh
index 7f47f13c78e8..7b850ae26171 100755
--- a/t/t5304-prune.sh
+++ b/t/t5304-prune.sh
@@ -81,12 +81,12 @@ test_expect_success 'prune: prune nonsense parameters' '
 
 test_expect_success 'prune: prune unreachable heads' '
 	git config core.logAllRefUpdates false &&
-	mv .git/logs .git/logs.old &&
-	: > file2 &&
+	>file2 &&
 	git add file2 &&
 	git commit -m temporary &&
 	tmp_head=$(git rev-list -1 HEAD) &&
 	git reset HEAD^ &&
+	git reflog expire --all &&
 	git prune &&
 	test_must_fail git reset $tmp_head --
 '
@@ -94,9 +94,7 @@ test_expect_success 'prune: prune unreachable heads' '
 test_expect_success 'prune: do not prune detached HEAD with no reflog' '
 	git checkout --detach --quiet &&
 	git commit --allow-empty -m "detached commit" &&
-	# verify that there is no reflogs
-	# (should be removed and disabled by previous test)
-	test_path_is_missing .git/logs &&
+	git reflog expire --all &&
 	git prune -n >prune_actual &&
 	test_must_be_empty prune_actual
 '
@@ -104,6 +102,7 @@ test_expect_success 'prune: do not prune detached HEAD with no reflog' '
 test_expect_success 'prune: prune former HEAD after checking out branch' '
 	head_oid=$(git rev-parse HEAD) &&
 	git checkout --quiet main &&
+	git reflog expire --all &&
 	git prune -v >prune_actual &&
 	grep "$head_oid" prune_actual
 '
-- 
gitgitgadget


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

* [PATCH v2 13/21] test-lib: provide test prereq REFFILES
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                     ` (11 preceding siblings ...)
  2021-04-27 10:38   ` [PATCH v2 12/21] t5304: use "reflog expire --all" to clear the reflog Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38   ` Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 14/21] t1407: require REFFILES for for_each_reflog test Han-Wen Nienhuys via GitGitGadget
                     ` (7 subsequent siblings)
  20 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

REFFILES can be used to mark tests that are specific to the packed/loose ref
storage format and its limitations. Marking such tests is a preparation for
introducing the reftable storage backend.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/README      | 6 ++++++
 t/test-lib.sh | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/t/README b/t/README
index fd9375b146d1..723bd3387fb7 100644
--- a/t/README
+++ b/t/README
@@ -1114,6 +1114,12 @@ use these, and "test_set_prereq" for how to define your own.
 
    Git wasn't compiled with NO_PTHREADS=YesPlease.
 
+ - REFFILES
+
+   Test is specific to packed/loose ref storage, and should be
+   disabled for other ref storage backends
+
+
 Tips for Writing Tests
 ----------------------
 
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 3dec266221cd..4a0c08e81e12 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -1483,6 +1483,8 @@ parisc* | hppa*)
 	;;
 esac
 
+test_set_prereq REFFILES
+
 ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1
 test -z "$NO_PERL" && test_set_prereq PERL
 test -z "$NO_PTHREADS" && test_set_prereq PTHREADS
-- 
gitgitgadget


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

* [PATCH v2 14/21] t1407: require REFFILES for for_each_reflog test
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                     ` (12 preceding siblings ...)
  2021-04-27 10:38   ` [PATCH v2 13/21] test-lib: provide test prereq REFFILES Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38   ` Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 15/21] t1414: mark corruption test with REFFILES Han-Wen Nienhuys via GitGitGadget
                     ` (6 subsequent siblings)
  20 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Add extensive comment why this test needs a REFFILES annotation.

I tried forcing universal reflog creation with core.logAllRefUpdates=true, but
that apparently also doesn't cause reflogs to be created for pseudorefs

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t1407-worktree-ref-store.sh | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/t/t1407-worktree-ref-store.sh b/t/t1407-worktree-ref-store.sh
index d3fe77751122..ad8006c81397 100755
--- a/t/t1407-worktree-ref-store.sh
+++ b/t/t1407-worktree-ref-store.sh
@@ -52,7 +52,14 @@ test_expect_success 'create_symref(FOO, refs/heads/main)' '
 	test_cmp expected actual
 '
 
-test_expect_success 'for_each_reflog()' '
+# Some refs (refs/bisect/*, pseudorefs) are kept per worktree, so they should
+# only appear in the for-each-reflog output if it is called from the correct
+# worktree, which is exercised in this test. This test is poorly written (and
+# therefore marked REFFILES) for mulitple reasons: 1) it creates invalidly
+# formatted log entres. 2) it uses direct FS access for creating the reflogs. 3)
+# PSEUDO-WT and refs/bisect/random do not create reflogs by default, so it is
+# not testing a realistic scenario.
+test_expect_success REFFILES 'for_each_reflog()' '
 	echo $ZERO_OID > .git/logs/PSEUDO-MAIN &&
 	mkdir -p     .git/logs/refs/bisect &&
 	echo $ZERO_OID > .git/logs/refs/bisect/random &&
-- 
gitgitgadget


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

* [PATCH v2 15/21] t1414: mark corruption test with REFFILES
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                     ` (13 preceding siblings ...)
  2021-04-27 10:38   ` [PATCH v2 14/21] t1407: require REFFILES for for_each_reflog test Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38   ` Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 16/21] t2017: mark --orphan/logAllRefUpdates=false test as REFFILES Han-Wen Nienhuys via GitGitGadget
                     ` (5 subsequent siblings)
  20 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

The reftable format guarantees that reflog entries are well-formed

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t1414-reflog-walk.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t1414-reflog-walk.sh b/t/t1414-reflog-walk.sh
index 80d94704d012..72a5ac61a520 100755
--- a/t/t1414-reflog-walk.sh
+++ b/t/t1414-reflog-walk.sh
@@ -119,7 +119,7 @@ test_expect_success 'min/max age uses entry date to limit' '
 	test_cmp expect actual
 '
 
-test_expect_success 'walk prefers reflog to ref tip' '
+test_expect_success REFFILES 'walk prefers reflog to ref tip' '
 	head=$(git rev-parse HEAD) &&
 	one=$(git rev-parse one) &&
 	ident="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE" &&
-- 
gitgitgadget


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

* [PATCH v2 16/21] t2017: mark --orphan/logAllRefUpdates=false test as REFFILES
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                     ` (14 preceding siblings ...)
  2021-04-27 10:38   ` [PATCH v2 15/21] t1414: mark corruption test with REFFILES Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38   ` Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 17/21] t1404: mark tests that muck with .git directly " Han-Wen Nienhuys via GitGitGadget
                     ` (4 subsequent siblings)
  20 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

In reftable, there is no notion of a per-ref 'existence' of a reflog. Each
reflog entry has its own key, so it is not possible to distinguish between
{reflog doesn't exist,reflog exists but is empty}. This makes the logic
in log_ref_setup() (file refs/files-backend.c), which depends on the existence
of the reflog file infeasible.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t2017-checkout-orphan.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t2017-checkout-orphan.sh b/t/t2017-checkout-orphan.sh
index c7adbdd39ab9..88d6992a5e1f 100755
--- a/t/t2017-checkout-orphan.sh
+++ b/t/t2017-checkout-orphan.sh
@@ -76,7 +76,7 @@ test_expect_success '--orphan makes reflog by default' '
 	git rev-parse --verify delta@{0}
 '
 
-test_expect_success '--orphan does not make reflog when core.logAllRefUpdates = false' '
+test_expect_success REFFILES '--orphan does not make reflog when core.logAllRefUpdates = false' '
 	git checkout main &&
 	git config core.logAllRefUpdates false &&
 	git checkout --orphan epsilon &&
-- 
gitgitgadget


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

* [PATCH v2 17/21] t1404: mark tests that muck with .git directly as REFFILES.
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                     ` (15 preceding siblings ...)
  2021-04-27 10:38   ` [PATCH v2 16/21] t2017: mark --orphan/logAllRefUpdates=false test as REFFILES Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38   ` Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 18/21] t7900: mark pack-refs tests " Han-Wen Nienhuys via GitGitGadget
                     ` (3 subsequent siblings)
  20 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

The packed/loose ref storage is an overlay combination of packed-refs (refs and
tags in a single file) and one-file-per-ref. This creates all kinds of edge
cases related to directory/file conflicts, (non-)empty directories, and the
locking scheme, none of which applies to reftable.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t1404-update-ref-errors.sh | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/t/t1404-update-ref-errors.sh b/t/t1404-update-ref-errors.sh
index 8b51c4efc135..b729c1f48030 100755
--- a/t/t1404-update-ref-errors.sh
+++ b/t/t1404-update-ref-errors.sh
@@ -189,7 +189,7 @@ test_expect_success 'one new ref is a simple prefix of another' '
 
 '
 
-test_expect_success 'empty directory should not fool rev-parse' '
+test_expect_success REFFILES 'empty directory should not fool rev-parse' '
 	prefix=refs/e-rev-parse &&
 	git update-ref $prefix/foo $C &&
 	git pack-refs --all &&
@@ -199,7 +199,7 @@ test_expect_success 'empty directory should not fool rev-parse' '
 	test_cmp expected actual
 '
 
-test_expect_success 'empty directory should not fool for-each-ref' '
+test_expect_success REFFILES 'empty directory should not fool for-each-ref' '
 	prefix=refs/e-for-each-ref &&
 	git update-ref $prefix/foo $C &&
 	git for-each-ref $prefix >expected &&
@@ -209,14 +209,14 @@ test_expect_success 'empty directory should not fool for-each-ref' '
 	test_cmp expected actual
 '
 
-test_expect_success 'empty directory should not fool create' '
+test_expect_success REFFILES 'empty directory should not fool create' '
 	prefix=refs/e-create &&
 	mkdir -p .git/$prefix/foo/bar/baz &&
 	printf "create %s $C\n" $prefix/foo |
 	git update-ref --stdin
 '
 
-test_expect_success 'empty directory should not fool verify' '
+test_expect_success REFFILES 'empty directory should not fool verify' '
 	prefix=refs/e-verify &&
 	git update-ref $prefix/foo $C &&
 	git pack-refs --all &&
@@ -225,7 +225,7 @@ test_expect_success 'empty directory should not fool verify' '
 	git update-ref --stdin
 '
 
-test_expect_success 'empty directory should not fool 1-arg update' '
+test_expect_success REFFILES 'empty directory should not fool 1-arg update' '
 	prefix=refs/e-update-1 &&
 	git update-ref $prefix/foo $C &&
 	git pack-refs --all &&
@@ -234,7 +234,7 @@ test_expect_success 'empty directory should not fool 1-arg update' '
 	git update-ref --stdin
 '
 
-test_expect_success 'empty directory should not fool 2-arg update' '
+test_expect_success REFFILES 'empty directory should not fool 2-arg update' '
 	prefix=refs/e-update-2 &&
 	git update-ref $prefix/foo $C &&
 	git pack-refs --all &&
@@ -243,7 +243,7 @@ test_expect_success 'empty directory should not fool 2-arg update' '
 	git update-ref --stdin
 '
 
-test_expect_success 'empty directory should not fool 0-arg delete' '
+test_expect_success REFFILES 'empty directory should not fool 0-arg delete' '
 	prefix=refs/e-delete-0 &&
 	git update-ref $prefix/foo $C &&
 	git pack-refs --all &&
@@ -252,7 +252,7 @@ test_expect_success 'empty directory should not fool 0-arg delete' '
 	git update-ref --stdin
 '
 
-test_expect_success 'empty directory should not fool 1-arg delete' '
+test_expect_success REFFILES 'empty directory should not fool 1-arg delete' '
 	prefix=refs/e-delete-1 &&
 	git update-ref $prefix/foo $C &&
 	git pack-refs --all &&
@@ -466,7 +466,7 @@ test_expect_success 'incorrect old value blocks indirect no-deref delete' '
 	test_cmp expected output.err
 '
 
-test_expect_success 'non-empty directory blocks create' '
+test_expect_success REFFILES 'non-empty directory blocks create' '
 	prefix=refs/ne-create &&
 	mkdir -p .git/$prefix/foo/bar &&
 	: >.git/$prefix/foo/bar/baz.lock &&
@@ -485,7 +485,7 @@ test_expect_success 'non-empty directory blocks create' '
 	test_cmp expected output.err
 '
 
-test_expect_success 'broken reference blocks create' '
+test_expect_success REFFILES 'broken reference blocks create' '
 	prefix=refs/broken-create &&
 	mkdir -p .git/$prefix &&
 	echo "gobbledigook" >.git/$prefix/foo &&
@@ -504,7 +504,7 @@ test_expect_success 'broken reference blocks create' '
 	test_cmp expected output.err
 '
 
-test_expect_success 'non-empty directory blocks indirect create' '
+test_expect_success REFFILES 'non-empty directory blocks indirect create' '
 	prefix=refs/ne-indirect-create &&
 	git symbolic-ref $prefix/symref $prefix/foo &&
 	mkdir -p .git/$prefix/foo/bar &&
@@ -524,7 +524,7 @@ test_expect_success 'non-empty directory blocks indirect create' '
 	test_cmp expected output.err
 '
 
-test_expect_success 'broken reference blocks indirect create' '
+test_expect_success REFFILES 'broken reference blocks indirect create' '
 	prefix=refs/broken-indirect-create &&
 	git symbolic-ref $prefix/symref $prefix/foo &&
 	echo "gobbledigook" >.git/$prefix/foo &&
@@ -543,7 +543,7 @@ test_expect_success 'broken reference blocks indirect create' '
 	test_cmp expected output.err
 '
 
-test_expect_success 'no bogus intermediate values during delete' '
+test_expect_success REFFILES 'no bogus intermediate values during delete' '
 	prefix=refs/slow-transaction &&
 	# Set up a reference with differing loose and packed versions:
 	git update-ref $prefix/foo $C &&
@@ -600,7 +600,7 @@ test_expect_success 'no bogus intermediate values during delete' '
 	test_must_fail git rev-parse --verify --quiet $prefix/foo
 '
 
-test_expect_success 'delete fails cleanly if packed-refs file is locked' '
+test_expect_success REFFILES 'delete fails cleanly if packed-refs file is locked' '
 	prefix=refs/locked-packed-refs &&
 	# Set up a reference with differing loose and packed versions:
 	git update-ref $prefix/foo $C &&
@@ -616,7 +616,7 @@ test_expect_success 'delete fails cleanly if packed-refs file is locked' '
 	test_cmp unchanged actual
 '
 
-test_expect_success 'delete fails cleanly if packed-refs.new write fails' '
+test_expect_success REFFILES 'delete fails cleanly if packed-refs.new write fails' '
 	# Setup and expectations are similar to the test above.
 	prefix=refs/failed-packed-refs &&
 	git update-ref $prefix/foo $C &&
-- 
gitgitgadget


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

* [PATCH v2 18/21] t7900: mark pack-refs tests as REFFILES
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                     ` (16 preceding siblings ...)
  2021-04-27 10:38   ` [PATCH v2 17/21] t1404: mark tests that muck with .git directly " Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38   ` Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 19/21] t7003: check reflog existence only for REFFILES Han-Wen Nienhuys via GitGitGadget
                     ` (2 subsequent siblings)
  20 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Reftable automatically compacts tables on writes. The functionality of
incremental compaction is unittested in reftable/stack_test.c
(test_reftable_stack_auto_compaction)

In addition, pack-refs triggers a full compaction of the entire stack. This is
exercised in t0031-reftable.sh.

Given that git-maintenance simply calls out git-pack-refs, it seems superfluous
to test this further for reftable.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t7900-maintenance.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh
index 2412d8c5c006..6f2f55a6c51d 100755
--- a/t/t7900-maintenance.sh
+++ b/t/t7900-maintenance.sh
@@ -343,7 +343,7 @@ test_expect_success 'maintenance.incremental-repack.auto' '
 	test_subcommand git multi-pack-index write --no-progress <trace-B
 '
 
-test_expect_success 'pack-refs task' '
+test_expect_success REFFILES 'pack-refs task' '
 	for n in $(test_seq 1 5)
 	do
 		git branch -f to-pack/$n HEAD || return 1
-- 
gitgitgadget


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

* [PATCH v2 19/21] t7003: check reflog existence only for REFFILES
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                     ` (17 preceding siblings ...)
  2021-04-27 10:38   ` [PATCH v2 18/21] t7900: mark pack-refs tests " Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38   ` Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 20/21] t4202: mark bogus head hash test with REFFILES Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 21/21] t1415: set REFFILES for test specific to storage format Han-Wen Nienhuys via GitGitGadget
  20 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t7003-filter-branch.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh
index cf30055c88dd..e18a21895238 100755
--- a/t/t7003-filter-branch.sh
+++ b/t/t7003-filter-branch.sh
@@ -396,7 +396,10 @@ test_expect_success '--prune-empty is able to prune entire branch' '
 	git branch prune-entire B &&
 	git filter-branch -f --prune-empty --index-filter "git update-index --remove A.t B.t" prune-entire &&
 	test_must_fail git rev-parse refs/heads/prune-entire &&
-	test_must_fail git reflog exists refs/heads/prune-entire
+	if test_have_prereq REFFILES
+	then
+		test_must_fail git reflog exists refs/heads/prune-entire
+	fi
 '
 
 test_expect_success '--remap-to-ancestor with filename filters' '
-- 
gitgitgadget


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

* [PATCH v2 20/21] t4202: mark bogus head hash test with REFFILES
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                     ` (18 preceding siblings ...)
  2021-04-27 10:38   ` [PATCH v2 19/21] t7003: check reflog existence only for REFFILES Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38   ` Han-Wen Nienhuys via GitGitGadget
  2021-04-27 10:38   ` [PATCH v2 21/21] t1415: set REFFILES for test specific to storage format Han-Wen Nienhuys via GitGitGadget
  20 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

In reftable, hashes are correctly formed by design

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t4202-log.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t4202-log.sh b/t/t4202-log.sh
index a8c5a00d012d..3f969b01508c 100755
--- a/t/t4202-log.sh
+++ b/t/t4202-log.sh
@@ -1834,7 +1834,7 @@ test_expect_success 'log --graph --no-walk is forbidden' '
 	test_must_fail git log --graph --no-walk
 '
 
-test_expect_success 'log diagnoses bogus HEAD hash' '
+test_expect_success REFFILES 'log diagnoses bogus HEAD hash' '
 	git init empty &&
 	test_must_fail git -C empty log 2>stderr &&
 	test_i18ngrep does.not.have.any.commits stderr &&
-- 
gitgitgadget


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

* [PATCH v2 21/21] t1415: set REFFILES for test specific to storage format
  2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
                     ` (19 preceding siblings ...)
  2021-04-27 10:38   ` [PATCH v2 20/21] t4202: mark bogus head hash test with REFFILES Han-Wen Nienhuys via GitGitGadget
@ 2021-04-27 10:38   ` Han-Wen Nienhuys via GitGitGadget
  20 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys via GitGitGadget @ 2021-04-27 10:38 UTC (permalink / raw)
  To: git; +Cc: Han-Wen Nienhuys, Han-Wen Nienhuys, Han-Wen Nienhuys

From: Han-Wen Nienhuys <hanwen@google.com>

Packing refs (and therefore checking that certain refs are not packed) is a
property of the packed/loose ref storage. Add a comment to explain what the test
checks.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
---
 t/t1415-worktree-refs.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/t/t1415-worktree-refs.sh b/t/t1415-worktree-refs.sh
index 7ab91241ab7c..d6e6e523bbba 100755
--- a/t/t1415-worktree-refs.sh
+++ b/t/t1415-worktree-refs.sh
@@ -16,7 +16,10 @@ test_expect_success 'setup' '
 	git -C wt2 update-ref refs/worktree/foo HEAD
 '
 
-test_expect_success 'refs/worktree must not be packed' '
+# The 'packed-refs' files is stored directly in .git/. This means it is global
+# to the repository, and can only contain refs that are shared across all
+# worktrees.
+test_expect_success REFFILES 'refs/worktree must not be packed' '
 	git pack-refs --all &&
 	test_path_is_missing .git/refs/tags/wt1 &&
 	test_path_is_file .git/refs/worktree/foo &&
-- 
gitgitgadget

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

* Re: [PATCH 13/18] t2017: mark --orphan/logAllRefUpdates=false test as REFFILES
  2021-04-21  6:39   ` Ævar Arnfjörð Bjarmason
@ 2021-04-29 18:14     ` Han-Wen Nienhuys
  0 siblings, 0 replies; 82+ messages in thread
From: Han-Wen Nienhuys @ 2021-04-29 18:14 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason
  Cc: Han-Wen Nienhuys via GitGitGadget, git, Han-Wen Nienhuys

On Wed, Apr 21, 2021 at 8:39 AM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
> > In reftable, there is no notion of a per-ref 'existence' of a reflog. Each
> > reflog entry has its own key, so it is not possible to distinguish between
> > {reflog doesn't exist,reflog exists but is empty}. This makes the logic
> > in log_ref_setup() (file refs/files-backend.c), which depends on the existence
> > of the reflog file infeasible.
>
> Okey, so I'd follow this if the test was doing something like "test -e
> .git/logs" to test whether we didn't have reflogs for a specific branch
> or something....
>
..
> In your v7[1] of the reftable series there's no patch to
> Documentation/revisions.txt altering that blurb.
>
> So it seems to me that between this & that series there's some closing
> of the gap needed with how this "must have an existing log" even works
> under reftable.

the problem is that it's using BRANCH@{0} as a way to indicate whether
the reflog exists or not,  and something looks at the current tip of
BRANCH for @{0} even if the reflog is empty:

hanwen@hanwen1:~/vc/git$ ls -l .git/logs/refs/heads/windows-2
-rw-r----- 1 hanwen primarygroup 0 Apr 29 20:08 .git/logs/refs/heads/windows-2
hanwen@hanwen1:~/vc/git$ git rev-parse windows-2@{0}
7048e02d79350e332f34f2bfae50eb28700cbeda
hanwen@hanwen1:~/vc/git$ rm .git/logs/refs/heads/windows-2
hanwen@hanwen1:~/vc/git$ git rev-parse windows-2@{0}
windows-2@{0}
fatal: ambiguous argument 'windows-2@{0}': unknown revision or path
not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

in reftable, with the current implementation, all reflogs are assumed
to exist (but possibly empty).

> Per [2] I had assumed that this worked under reftable by abstracting
> away the syntax to some query for the ref name, and faking up "file does
> not exist" as "there were no records" to anything like rev-parse, but it
> doesn't work like that?

you could make it work like that, but I bet that then there are a host
of other tests that fail because they might check that a reflog exists
(but is empty) after doing eg. "git reflog expire --all".

-- 
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--

Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg

Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

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

end of thread, back to index

Thread overview: 82+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-19 10:52 [PATCH 00/18] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
2021-04-19 10:52 ` [PATCH 01/18] t4202: split testcase for invalid HEAD symref and HEAD hash Han-Wen Nienhuys via GitGitGadget
2021-04-19 21:11   ` SZEDER Gábor
2021-04-27  9:14     ` Han-Wen Nienhuys
2021-04-19 10:52 ` [PATCH 02/18] t9300: check ref existence using git-rev-parse rather than FS check Han-Wen Nienhuys via GitGitGadget
2021-04-21  6:01   ` Ævar Arnfjörð Bjarmason
2021-04-27  9:20     ` Han-Wen Nienhuys
2021-04-19 10:52 ` [PATCH 03/18] t5601: read HEAD using rev-parse Han-Wen Nienhuys via GitGitGadget
2021-04-19 10:52 ` [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access Han-Wen Nienhuys via GitGitGadget
2021-04-19 20:38   ` SZEDER Gábor
2021-04-27  9:13     ` Han-Wen Nienhuys
2021-04-21  6:09   ` Ævar Arnfjörð Bjarmason
2021-04-21  9:09     ` Han-Wen Nienhuys
2021-04-22  4:59       ` SZEDER Gábor
2021-04-22 13:01         ` Han-Wen Nienhuys
2021-04-23  5:12           ` SZEDER Gábor
2021-04-23  7:47             ` Han-Wen Nienhuys
2021-04-23  7:53               ` Han-Wen Nienhuys
2021-04-23  9:16                 ` Ævar Arnfjörð Bjarmason
2021-04-26 18:01                   ` Han-Wen Nienhuys
2021-04-19 10:52 ` [PATCH 05/18] t1413: use tar to save and restore entire .git directory Han-Wen Nienhuys via GitGitGadget
2021-04-20 22:51   ` Junio C Hamano
2021-04-27  9:15     ` Han-Wen Nienhuys
2021-04-19 10:52 ` [PATCH 06/18] t1301: fix typo in error message Han-Wen Nienhuys via GitGitGadget
2021-04-19 10:52 ` [PATCH 07/18] t5000: inspect HEAD using git-rev-parse Han-Wen Nienhuys via GitGitGadget
2021-04-21  6:11   ` Ævar Arnfjörð Bjarmason
2021-04-27  9:22     ` Han-Wen Nienhuys
2021-04-19 10:52 ` [PATCH 08/18] t7003: use rev-parse rather than FS inspection Han-Wen Nienhuys via GitGitGadget
2021-04-19 10:52 ` [PATCH 09/18] t5304: use "reflog expire --all" to clear the reflog Han-Wen Nienhuys via GitGitGadget
2021-04-21  6:13   ` Ævar Arnfjörð Bjarmason
2021-04-27  9:23     ` Han-Wen Nienhuys
2021-04-19 10:52 ` [PATCH 10/18] test-lib: provide test prereq REFFILES Han-Wen Nienhuys via GitGitGadget
2021-04-20 22:57   ` Junio C Hamano
2021-04-20 23:37     ` Junio C Hamano
2021-04-26 11:09       ` Han-Wen Nienhuys
2021-04-27  9:16     ` Han-Wen Nienhuys
2021-04-19 10:52 ` [PATCH 11/18] t1407: require REFFILES for for_each_reflog test Han-Wen Nienhuys via GitGitGadget
2021-04-21  6:23   ` Ævar Arnfjörð Bjarmason
2021-04-27  9:27     ` Han-Wen Nienhuys
2021-04-19 10:52 ` [PATCH 12/18] t1414: mark corruption test with REFFILES Han-Wen Nienhuys via GitGitGadget
2021-04-19 10:52 ` [PATCH 13/18] t2017: mark --orphan/logAllRefUpdates=false test as REFFILES Han-Wen Nienhuys via GitGitGadget
2021-04-21  6:39   ` Ævar Arnfjörð Bjarmason
2021-04-29 18:14     ` Han-Wen Nienhuys
2021-04-19 10:52 ` [PATCH 14/18] t1404: mark tests that muck with .git directly " Han-Wen Nienhuys via GitGitGadget
2021-04-21  6:57   ` Ævar Arnfjörð Bjarmason
2021-04-26 18:36     ` Han-Wen Nienhuys
2021-04-19 10:53 ` [PATCH 15/18] t7900: mark pack-refs tests " Han-Wen Nienhuys via GitGitGadget
2021-04-21  7:00   ` Ævar Arnfjörð Bjarmason
2021-04-27  9:41     ` Han-Wen Nienhuys
2021-04-19 10:53 ` [PATCH 16/18] t7003: check reflog existence only for REFFILES Han-Wen Nienhuys via GitGitGadget
2021-04-20 22:59   ` Junio C Hamano
2021-04-26 17:42     ` Han-Wen Nienhuys
2021-04-27  9:17     ` Han-Wen Nienhuys
2021-04-21  7:02   ` Ævar Arnfjörð Bjarmason
2021-04-19 10:53 ` [PATCH 17/18] t4202: mark bogus head hash test with REFFILES Han-Wen Nienhuys via GitGitGadget
2021-04-21  7:08   ` Ævar Arnfjörð Bjarmason
2021-04-26 18:02     ` Han-Wen Nienhuys
2021-04-19 10:53 ` [PATCH 18/18] t1415: set REFFILES for test specific to storage format Han-Wen Nienhuys via GitGitGadget
2021-04-21  7:15   ` Ævar Arnfjörð Bjarmason
2021-04-26 17:41     ` Han-Wen Nienhuys
2021-04-27 10:38 ` [PATCH v2 00/21] Prepare tests for reftable backend Han-Wen Nienhuys via GitGitGadget
2021-04-27 10:38   ` [PATCH v2 01/21] t4202: split testcase for invalid HEAD symref and HEAD hash Han-Wen Nienhuys via GitGitGadget
2021-04-27 10:38   ` [PATCH v2 02/21] t/helper/ref-store: initialize oid in resolve-ref Han-Wen Nienhuys via GitGitGadget
2021-04-27 10:38   ` [PATCH v2 03/21] t9300: check ref existence using test-helper rather than a file system check Han-Wen Nienhuys via GitGitGadget
2021-04-27 10:38   ` [PATCH v2 04/21] t5601: read HEAD using rev-parse Han-Wen Nienhuys via GitGitGadget
2021-04-27 10:38   ` [PATCH v2 05/21] t1401-symbolic-ref: avoid direct filesystem access Han-Wen Nienhuys via GitGitGadget
2021-04-27 10:38   ` [PATCH v2 06/21] t1413: use tar to save and restore entire .git directory Han-Wen Nienhuys via GitGitGadget
2021-04-27 10:38   ` [PATCH v2 07/21] t1301: fix typo in error message Han-Wen Nienhuys via GitGitGadget
2021-04-27 10:38   ` [PATCH v2 08/21] t5000: reformat indentation to the latest fashion Han-Wen Nienhuys via GitGitGadget
2021-04-27 10:38   ` [PATCH v2 09/21] t5000: inspect HEAD using git-rev-parse Han-Wen Nienhuys via GitGitGadget
2021-04-27 10:38   ` [PATCH v2 10/21] t7003: use rev-parse rather than FS inspection Han-Wen Nienhuys via GitGitGadget
2021-04-27 10:38   ` [PATCH v2 11/21] t5304: restyle: trim empty lines, drop ':' before > Han-Wen Nienhuys via GitGitGadget
2021-04-27 10:38   ` [PATCH v2 12/21] t5304: use "reflog expire --all" to clear the reflog Han-Wen Nienhuys via GitGitGadget
2021-04-27 10:38   ` [PATCH v2 13/21] test-lib: provide test prereq REFFILES Han-Wen Nienhuys via GitGitGadget
2021-04-27 10:38   ` [PATCH v2 14/21] t1407: require REFFILES for for_each_reflog test Han-Wen Nienhuys via GitGitGadget
2021-04-27 10:38   ` [PATCH v2 15/21] t1414: mark corruption test with REFFILES Han-Wen Nienhuys via GitGitGadget
2021-04-27 10:38   ` [PATCH v2 16/21] t2017: mark --orphan/logAllRefUpdates=false test as REFFILES Han-Wen Nienhuys via GitGitGadget
2021-04-27 10:38   ` [PATCH v2 17/21] t1404: mark tests that muck with .git directly " Han-Wen Nienhuys via GitGitGadget
2021-04-27 10:38   ` [PATCH v2 18/21] t7900: mark pack-refs tests " Han-Wen Nienhuys via GitGitGadget
2021-04-27 10:38   ` [PATCH v2 19/21] t7003: check reflog existence only for REFFILES Han-Wen Nienhuys via GitGitGadget
2021-04-27 10:38   ` [PATCH v2 20/21] t4202: mark bogus head hash test with REFFILES Han-Wen Nienhuys via GitGitGadget
2021-04-27 10:38   ` [PATCH v2 21/21] t1415: set REFFILES for test specific to storage format Han-Wen Nienhuys via GitGitGadget

Git Mailing List Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/git/0 git/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 git git/ https://lore.kernel.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.git


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git