{"thread":{"id":"55516","subject":"[PATCH 00/18] Prepare tests for reftable backend","startedAt":"2021-04-19T10:53:09Z","lastAt":"2021-06-02T07:49:48Z","messageCount":138,"participants":["Han-Wen Nienhuys via GitGitGadget","SZEDER Gábor","Junio C Hamano","Ævar Arnfjörð Bjarmason","Han-Wen Nienhuys","Bagas Sanjaya"],"isPatch":true,"patchVersion":1,"patchTotal":18},"messages":[{"id":"422242","messageId":"pull.1008.git.git.1618829583.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":null,"subject":"[PATCH 00/18] Prepare tests for reftable backend","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-19T10:52:45Z","receivedAt":"2021-04-19T10:53:09Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"Rewrites some tests to avoid direct filesystem access.\n\nIntroduces the test prereq REFFILES to mark other tests that depend on\nspecifics of the files ref backend.\n\nHan-Wen Nienhuys (18):\n  t4202: split testcase for invalid HEAD symref and HEAD hash\n  t9300: check ref existence using git-rev-parse rather than FS check\n  t5601: read HEAD using rev-parse\n  t1401-symbolic-ref: avoid direct filesystem access\n  t1413: use tar to save and restore entire .git directory\n  t1301: fix typo in error message\n  t5000: inspect HEAD using git-rev-parse\n  t7003: use rev-parse rather than FS inspection\n  t5304: use \"reflog expire --all\" to clear the reflog\n  test-lib: provide test prereq REFFILES\n  t1407: require REFFILES for for_each_reflog test\n  t1414: mark corruption test with REFFILES\n  t2017: mark --orphan/logAllRefUpdates=false test as REFFILES\n  t1404: mark tests that muck with .git directly as REFFILES.\n  t7900: mark pack-refs tests as REFFILES\n  t7003: check reflog existence only for REFFILES\n  t4202: mark bogus head hash test with REFFILES\n  t1415: set REFFILES for test specific to storage format\n\n t/t1301-shared-repo.sh        |  2 +-\n t/t1401-symbolic-ref.sh       | 23 +++++++++--------------\n t/t1404-update-ref-errors.sh  | 30 +++++++++++++++---------------\n t/t1407-worktree-ref-store.sh |  2 +-\n t/t1413-reflog-detach.sh      |  5 ++---\n t/t1414-reflog-walk.sh        |  2 +-\n t/t1415-worktree-refs.sh      |  2 +-\n t/t2017-checkout-orphan.sh    |  2 +-\n t/t4202-log.sh                |  9 ++++++---\n t/t5000-tar-tree.sh           |  7 ++++---\n t/t5304-prune.sh              |  9 +++------\n t/t5601-clone.sh              |  3 ++-\n t/t7003-filter-branch.sh      |  6 ++++--\n t/t7900-maintenance.sh        |  2 +-\n t/t9300-fast-import.sh        |  2 +-\n t/test-lib.sh                 |  2 ++\n 16 files changed, 54 insertions(+), 54 deletions(-)\n\n\nbase-commit: 54a391711554ed41b4b0792cfef004abc74893bd\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1008%2Fhanwen%2Freffiles-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1008/hanwen/reffiles-v1\nPull-Request: https://github.com/git/git/pull/1008\n-- \ngitgitgadget\n"},{"id":"422243","messageId":"91ef012cbcc9a3106fa51236e20458f108e50ce9.1618829583.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.git.git.1618829583.gitgitgadget@gmail.com","subject":"[PATCH 01/18] t4202: split testcase for invalid HEAD symref and HEAD hash","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-19T10:52:46Z","receivedAt":"2021-04-19T10:53:10Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nReftable will prohibit invalid hashes at the storage level, but\ngit-symbolic-ref can still create branches ending in \".lock\".\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t4202-log.sh | 9 ++++++---\n 1 file changed, 6 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex 350cfa35936a..c575deaad4fb 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -1834,14 +1834,17 @@ test_expect_success 'log --graph --no-walk is forbidden' '\n \ttest_must_fail git log --graph --no-walk\n '\n \n-test_expect_success 'log diagnoses bogus HEAD' '\n+test_expect_success 'log diagnoses bogus HEAD hash' '\n \tgit init empty &&\n \ttest_must_fail git -C empty log 2>stderr &&\n \ttest_i18ngrep does.not.have.any.commits stderr &&\n \techo 1234abcd >empty/.git/refs/heads/main &&\n \ttest_must_fail git -C empty log 2>stderr &&\n-\ttest_i18ngrep broken stderr &&\n-\techo \"ref: refs/heads/invalid.lock\" >empty/.git/HEAD &&\n+\ttest_i18ngrep broken stderr'\n+\n+test_expect_success 'log diagnoses bogus HEAD symref' '\n+\tgit init empty &&\n+\tgit --git-dir empty/.git symbolic-ref HEAD refs/heads/invalid.lock &&\n \ttest_must_fail git -C empty log 2>stderr &&\n \ttest_i18ngrep broken stderr &&\n \ttest_must_fail git -C empty log --default totally-bogus 2>stderr &&\n-- \ngitgitgadget\n\n"},{"id":"422244","messageId":"223583594c0089ef259e83f2f10c08fd94f55959.1618829583.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.git.git.1618829583.gitgitgadget@gmail.com","subject":"[PATCH 05/18] t1413: use tar to save and restore entire .git directory","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-19T10:52:50Z","receivedAt":"2021-04-19T10:53:11Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nThis makes the test independent of the particulars of the storage formats.\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t1413-reflog-detach.sh | 5 ++---\n 1 file changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t1413-reflog-detach.sh b/t/t1413-reflog-detach.sh\nindex bde05208ae6a..b699c2bb7c31 100755\n--- a/t/t1413-reflog-detach.sh\n+++ b/t/t1413-reflog-detach.sh\n@@ -7,8 +7,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n . ./test-lib.sh\n \n reset_state () {\n-\tgit checkout main &&\n-\tcp saved_reflog .git/logs/HEAD\n+\trm -rf .git && tar -xf .git-saved.tar\n }\n \n test_expect_success setup '\n@@ -17,7 +16,7 @@ test_expect_success setup '\n \tgit branch side &&\n \ttest_tick &&\n \tgit commit --allow-empty -m second &&\n-\tcat .git/logs/HEAD >saved_reflog\n+\ttar -cf .git-saved.tar .git\n '\n \n test_expect_success baseline '\n-- \ngitgitgadget\n\n"},{"id":"422245","messageId":"53cf1069552b6cd6161ce6f69a31c44e59091096.1618829583.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.git.git.1618829583.gitgitgadget@gmail.com","subject":"[PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-19T10:52:49Z","receivedAt":"2021-04-19T10:53:12Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t1401-symbolic-ref.sh | 23 +++++++++--------------\n 1 file changed, 9 insertions(+), 14 deletions(-)\n\ndiff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh\nindex a4ebb0b65fec..fd5980d3fb40 100755\n--- a/t/t1401-symbolic-ref.sh\n+++ b/t/t1401-symbolic-ref.sh\n@@ -7,18 +7,13 @@ test_description='basic symbolic-ref tests'\n # the git repo, meaning that further tests will operate on\n # the surrounding git repo instead of the trash directory.\n reset_to_sane() {\n-\techo ref: refs/heads/foo >.git/HEAD\n+\tgit --git-dir .git symbolic-ref HEAD refs/heads/foo\n }\n \n-test_expect_success 'symbolic-ref writes HEAD' '\n-\tgit symbolic-ref HEAD refs/heads/foo &&\n-\techo ref: refs/heads/foo >expect &&\n-\ttest_cmp expect .git/HEAD\n-'\n-\n-test_expect_success 'symbolic-ref reads HEAD' '\n-\techo refs/heads/foo >expect &&\n-\tgit symbolic-ref HEAD >actual &&\n+test_expect_success 'symbolic-ref read/write roundtrip' '\n+\tgit symbolic-ref HEAD refs/heads/read-write-roundtrip &&\n+\techo refs/heads/read-write-roundtrip > expect &&\n+\tgit symbolic-ref HEAD > actual &&\n \ttest_cmp expect actual\n '\n \n@@ -42,16 +37,16 @@ reset_to_sane\n test_expect_success 'symbolic-ref can be deleted' '\n \tgit symbolic-ref NOTHEAD refs/heads/foo &&\n \tgit symbolic-ref -d NOTHEAD &&\n-\ttest_path_is_file .git/refs/heads/foo &&\n-\ttest_path_is_missing .git/NOTHEAD\n+\tgit rev-parse refs/heads/foo &&\n+\t! git symbolic-ref NOTHEAD\n '\n reset_to_sane\n \n test_expect_success 'symbolic-ref can delete dangling symref' '\n \tgit symbolic-ref NOTHEAD refs/heads/missing &&\n \tgit symbolic-ref -d NOTHEAD &&\n-\ttest_path_is_missing .git/refs/heads/missing &&\n-\ttest_path_is_missing .git/NOTHEAD\n+\t! git rev-parse refs/heads/missing &&\n+\t! git symbolic-ref NOTHEAD\n '\n reset_to_sane\n \n-- \ngitgitgadget\n\n"},{"id":"422246","messageId":"47b5ec56a38379adf3eb48acd5a093bbdfdeb511.1618829583.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.git.git.1618829583.gitgitgadget@gmail.com","subject":"[PATCH 03/18] t5601: read HEAD using rev-parse","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-19T10:52:48Z","receivedAt":"2021-04-19T10:53:13Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t5601-clone.sh | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex 329ae599fd3c..7223372c7660 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -305,7 +305,8 @@ test_expect_success 'clone from original with relative alternate' '\n test_expect_success 'clone checking out a tag' '\n \tgit clone --branch=some-tag src dst.tag &&\n \tGIT_DIR=src/.git git rev-parse some-tag >expected &&\n-\ttest_cmp expected dst.tag/.git/HEAD &&\n+\tGIT_DIR=dst.tag/.git git rev-parse HEAD >actual &&\n+\ttest_cmp expected actual &&\n \tGIT_DIR=dst.tag/.git git config remote.origin.fetch >fetch.actual &&\n \techo \"+refs/heads/*:refs/remotes/origin/*\" >fetch.expected &&\n \ttest_cmp fetch.expected fetch.actual\n-- \ngitgitgadget\n\n"},{"id":"422247","messageId":"70da8f5631d024c2a940a1f0b888fa1c467207a2.1618829583.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.git.git.1618829583.gitgitgadget@gmail.com","subject":"[PATCH 06/18] t1301: fix typo in error message","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-19T10:52:51Z","receivedAt":"2021-04-19T10:53:16Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t1301-shared-repo.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh\nindex ac947bff9fcf..84bf1970d8bf 100755\n--- a/t/t1301-shared-repo.sh\n+++ b/t/t1301-shared-repo.sh\n@@ -124,7 +124,7 @@ test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '\n \t\t: happy\n \t\t;;\n \t*)\n-\t\techo Ooops, .git/logs/refs/heads/main is not 0662 [$actual]\n+\t\techo Ooops, .git/logs/refs/heads/main is not 066x [$actual]\n \t\tfalse\n \t\t;;\n \tesac\n-- \ngitgitgadget\n\n"},{"id":"422248","messageId":"ccc26a8950be41e5be4dc78295c66ecbade8a50e.1618829583.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.git.git.1618829583.gitgitgadget@gmail.com","subject":"[PATCH 02/18] t9300: check ref existence using git-rev-parse rather than FS check","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-19T10:52:47Z","receivedAt":"2021-04-19T10:53:16Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t9300-fast-import.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex 5c47ac4465cb..087ddf097036 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -392,7 +392,7 @@ test_expect_success 'B: accept branch name \"TEMP_TAG\"' '\n \t\tgit gc\n \t\tgit prune\" &&\n \tgit fast-import <input &&\n-\ttest -f .git/TEMP_TAG &&\n+\tgit rev-parse TEMP_TAG &&\n \ttest $(git rev-parse main) = $(git rev-parse TEMP_TAG^)\n '\n \n-- \ngitgitgadget\n\n"},{"id":"422249","messageId":"79843c0d572765a3004968235391b5ae17365d56.1618829583.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.git.git.1618829583.gitgitgadget@gmail.com","subject":"[PATCH 07/18] t5000: inspect HEAD using git-rev-parse","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-19T10:52:52Z","receivedAt":"2021-04-19T10:53:18Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t5000-tar-tree.sh | 7 ++++---\n 1 file changed, 4 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex 7204799a0b52..472fec4ee64a 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -233,9 +233,10 @@ test_expect_success \\\n      test_cmp expected.mtime b.mtime'\n \n test_expect_success \\\n-    'git get-tar-commit-id' \\\n-    'git get-tar-commit-id <b.tar >b.commitid &&\n-     test_cmp .git/$(git symbolic-ref HEAD) b.commitid'\n+\t'git get-tar-commit-id' \\\n+\t'git get-tar-commit-id <b.tar >actual &&\n+\tgit rev-parse HEAD > expect &&\n+\ttest_cmp expect actual'\n \n test_expect_success 'git archive with --output, override inferred format' '\n \tgit archive --format=tar --output=d4.zip HEAD &&\n-- \ngitgitgadget\n\n"},{"id":"422250","messageId":"ba575839e422dfe241f7b567de14c10ec648f2e3.1618829583.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.git.git.1618829583.gitgitgadget@gmail.com","subject":"[PATCH 09/18] t5304: use \"reflog expire --all\" to clear the reflog","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-19T10:52:54Z","receivedAt":"2021-04-19T10:53:43Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nThis is more explicit, and reduces the depency between test functions. It also\nis more amenable to use with reftable, which has no concept of (non)existence of\na reflog\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t5304-prune.sh | 9 +++------\n 1 file changed, 3 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t5304-prune.sh b/t/t5304-prune.sh\nindex b447ce56a9b2..4ffc0076801e 100755\n--- a/t/t5304-prune.sh\n+++ b/t/t5304-prune.sh\n@@ -94,26 +94,22 @@ test_expect_success 'prune: prune nonsense parameters' '\n '\n \n test_expect_success 'prune: prune unreachable heads' '\n-\n \tgit config core.logAllRefUpdates false &&\n-\tmv .git/logs .git/logs.old &&\n \t: > file2 &&\n \tgit add file2 &&\n \tgit commit -m temporary &&\n \ttmp_head=$(git rev-list -1 HEAD) &&\n \tgit reset HEAD^ &&\n+\tgit reflog expire --all &&\n \tgit prune &&\n \ttest_must_fail git reset $tmp_head --\n-\n '\n \n test_expect_success 'prune: do not prune detached HEAD with no reflog' '\n \n \tgit checkout --detach --quiet &&\n \tgit commit --allow-empty -m \"detached commit\" &&\n-\t# verify that there is no reflogs\n-\t# (should be removed and disabled by previous test)\n-\ttest_path_is_missing .git/logs &&\n+\tgit reflog expire --all &&\n \tgit prune -n >prune_actual &&\n \ttest_must_be_empty prune_actual\n \n@@ -123,6 +119,7 @@ test_expect_success 'prune: prune former HEAD after checking out branch' '\n \n \thead_oid=$(git rev-parse HEAD) &&\n \tgit checkout --quiet main &&\n+\tgit reflog expire --all &&\n \tgit prune -v >prune_actual &&\n \tgrep \"$head_oid\" prune_actual\n \n-- \ngitgitgadget\n\n"},{"id":"422251","messageId":"dbb81b5b89d8c168d5583ade113d789de6cba4e3.1618829583.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.git.git.1618829583.gitgitgadget@gmail.com","subject":"[PATCH 08/18] t7003: use rev-parse rather than FS inspection","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-19T10:52:53Z","receivedAt":"2021-04-19T10:53:49Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t7003-filter-branch.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex 1349e5b2321c..cf30055c88dd 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -395,7 +395,7 @@ test_expect_success '--prune-empty is able to prune root commit' '\n test_expect_success '--prune-empty is able to prune entire branch' '\n \tgit branch prune-entire B &&\n \tgit filter-branch -f --prune-empty --index-filter \"git update-index --remove A.t B.t\" prune-entire &&\n-\ttest_path_is_missing .git/refs/heads/prune-entire &&\n+\ttest_must_fail git rev-parse refs/heads/prune-entire &&\n \ttest_must_fail git reflog exists refs/heads/prune-entire\n '\n \n-- \ngitgitgadget\n\n"},{"id":"422252","messageId":"3d3b733c31273a004e80d5cbab8f746a2010e9ea.1618829583.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.git.git.1618829583.gitgitgadget@gmail.com","subject":"[PATCH 10/18] test-lib: provide test prereq REFFILES","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-19T10:52:55Z","receivedAt":"2021-04-19T10:53:49Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nREFFILES can be used to mark tests that are specific to the packed/loose ref\nstorage format and its limitations. Marking such tests is a preparation for\nintroducing the reftable storage backend.\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/test-lib.sh | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex d3f6af6a6545..ea7397c633db 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1481,6 +1481,8 @@ parisc* | hppa*)\n \t;;\n esac\n \n+test_set_prereq REFFILES\n+\n ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1\n test -z \"$NO_PERL\" && test_set_prereq PERL\n test -z \"$NO_PTHREADS\" && test_set_prereq PTHREADS\n-- \ngitgitgadget\n\n"},{"id":"422253","messageId":"86951eb39cb65d4928cf03964afc28e06e1f9166.1618829583.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.git.git.1618829583.gitgitgadget@gmail.com","subject":"[PATCH 12/18] t1414: mark corruption test with REFFILES","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-19T10:52:57Z","receivedAt":"2021-04-19T10:53:50Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nThe reftable format guarantees that reflog entries are well-formed\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t1414-reflog-walk.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t1414-reflog-walk.sh b/t/t1414-reflog-walk.sh\nindex 80d94704d012..72a5ac61a520 100755\n--- a/t/t1414-reflog-walk.sh\n+++ b/t/t1414-reflog-walk.sh\n@@ -119,7 +119,7 @@ test_expect_success 'min/max age uses entry date to limit' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success 'walk prefers reflog to ref tip' '\n+test_expect_success REFFILES 'walk prefers reflog to ref tip' '\n \thead=$(git rev-parse HEAD) &&\n \tone=$(git rev-parse one) &&\n \tident=\"$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE\" &&\n-- \ngitgitgadget\n\n"},{"id":"422254","messageId":"dd1f6969c28d95027d1ac9f7b6f6a43640babada.1618829583.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.git.git.1618829583.gitgitgadget@gmail.com","subject":"[PATCH 11/18] t1407: require REFFILES for for_each_reflog test","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-19T10:52:56Z","receivedAt":"2021-04-19T10:53:53Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nIt tries to setup a reflog by catting to .git/logs/\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t1407-worktree-ref-store.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t1407-worktree-ref-store.sh b/t/t1407-worktree-ref-store.sh\nindex d3fe77751122..27b57f248a94 100755\n--- a/t/t1407-worktree-ref-store.sh\n+++ b/t/t1407-worktree-ref-store.sh\n@@ -52,7 +52,7 @@ test_expect_success 'create_symref(FOO, refs/heads/main)' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'for_each_reflog()' '\n+test_expect_success REFFILES 'for_each_reflog()' '\n \techo $ZERO_OID > .git/logs/PSEUDO-MAIN &&\n \tmkdir -p     .git/logs/refs/bisect &&\n \techo $ZERO_OID > .git/logs/refs/bisect/random &&\n-- \ngitgitgadget\n\n"},{"id":"422255","messageId":"1ce545043846ee06070d1a4bc05fcd5221847eab.1618829583.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.git.git.1618829583.gitgitgadget@gmail.com","subject":"[PATCH 13/18] t2017: mark --orphan/logAllRefUpdates=false test as REFFILES","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-19T10:52:58Z","receivedAt":"2021-04-19T10:54:27Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nIn reftable, there is no notion of a per-ref 'existence' of a reflog. Each\nreflog entry has its own key, so it is not possible to distinguish between\n{reflog doesn't exist,reflog exists but is empty}. This makes the logic\nin log_ref_setup() (file refs/files-backend.c), which depends on the existence\nof the reflog file infeasible.\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t2017-checkout-orphan.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t2017-checkout-orphan.sh b/t/t2017-checkout-orphan.sh\nindex c7adbdd39ab9..88d6992a5e1f 100755\n--- a/t/t2017-checkout-orphan.sh\n+++ b/t/t2017-checkout-orphan.sh\n@@ -76,7 +76,7 @@ test_expect_success '--orphan makes reflog by default' '\n \tgit rev-parse --verify delta@{0}\n '\n \n-test_expect_success '--orphan does not make reflog when core.logAllRefUpdates = false' '\n+test_expect_success REFFILES '--orphan does not make reflog when core.logAllRefUpdates = false' '\n \tgit checkout main &&\n \tgit config core.logAllRefUpdates false &&\n \tgit checkout --orphan epsilon &&\n-- \ngitgitgadget\n\n"},{"id":"422256","messageId":"2b3021c4ba626033cde3b28dda7e5a83b85be2b1.1618829583.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.git.git.1618829583.gitgitgadget@gmail.com","subject":"[PATCH 15/18] t7900: mark pack-refs tests as REFFILES","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-19T10:53:00Z","receivedAt":"2021-04-19T10:54:28Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t7900-maintenance.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh\nindex 2412d8c5c006..6f2f55a6c51d 100755\n--- a/t/t7900-maintenance.sh\n+++ b/t/t7900-maintenance.sh\n@@ -343,7 +343,7 @@ test_expect_success 'maintenance.incremental-repack.auto' '\n \ttest_subcommand git multi-pack-index write --no-progress <trace-B\n '\n \n-test_expect_success 'pack-refs task' '\n+test_expect_success REFFILES 'pack-refs task' '\n \tfor n in $(test_seq 1 5)\n \tdo\n \t\tgit branch -f to-pack/$n HEAD || return 1\n-- \ngitgitgadget\n\n"},{"id":"422257","messageId":"a5b9439192db3ad3c01db0e67cc1f60bad9109e8.1618829583.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.git.git.1618829583.gitgitgadget@gmail.com","subject":"[PATCH 16/18] t7003: check reflog existence only for REFFILES","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-19T10:53:01Z","receivedAt":"2021-04-19T10:54:29Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t7003-filter-branch.sh | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex cf30055c88dd..380bdf934317 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -396,7 +396,9 @@ test_expect_success '--prune-empty is able to prune entire branch' '\n \tgit branch prune-entire B &&\n \tgit filter-branch -f --prune-empty --index-filter \"git update-index --remove A.t B.t\" prune-entire &&\n \ttest_must_fail git rev-parse refs/heads/prune-entire &&\n-\ttest_must_fail git reflog exists refs/heads/prune-entire\n+\tif test_have_prereq REFFILES ; then\n+\t\ttest_must_fail git reflog exists refs/heads/prune-entire\n+\tfi\n '\n \n test_expect_success '--remap-to-ancestor with filename filters' '\n-- \ngitgitgadget\n\n"},{"id":"422258","messageId":"a3abc4f70e7d6bd833024f2c9b42ff731896e14d.1618829583.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.git.git.1618829583.gitgitgadget@gmail.com","subject":"[PATCH 14/18] t1404: mark tests that muck with .git directly as REFFILES.","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-19T10:52:59Z","receivedAt":"2021-04-19T10:54:31Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t1404-update-ref-errors.sh | 30 +++++++++++++++---------------\n 1 file changed, 15 insertions(+), 15 deletions(-)\n\ndiff --git a/t/t1404-update-ref-errors.sh b/t/t1404-update-ref-errors.sh\nindex 8b51c4efc135..b729c1f48030 100755\n--- a/t/t1404-update-ref-errors.sh\n+++ b/t/t1404-update-ref-errors.sh\n@@ -189,7 +189,7 @@ test_expect_success 'one new ref is a simple prefix of another' '\n \n '\n \n-test_expect_success 'empty directory should not fool rev-parse' '\n+test_expect_success REFFILES 'empty directory should not fool rev-parse' '\n \tprefix=refs/e-rev-parse &&\n \tgit update-ref $prefix/foo $C &&\n \tgit pack-refs --all &&\n@@ -199,7 +199,7 @@ test_expect_success 'empty directory should not fool rev-parse' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'empty directory should not fool for-each-ref' '\n+test_expect_success REFFILES 'empty directory should not fool for-each-ref' '\n \tprefix=refs/e-for-each-ref &&\n \tgit update-ref $prefix/foo $C &&\n \tgit for-each-ref $prefix >expected &&\n@@ -209,14 +209,14 @@ test_expect_success 'empty directory should not fool for-each-ref' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'empty directory should not fool create' '\n+test_expect_success REFFILES 'empty directory should not fool create' '\n \tprefix=refs/e-create &&\n \tmkdir -p .git/$prefix/foo/bar/baz &&\n \tprintf \"create %s $C\\n\" $prefix/foo |\n \tgit update-ref --stdin\n '\n \n-test_expect_success 'empty directory should not fool verify' '\n+test_expect_success REFFILES 'empty directory should not fool verify' '\n \tprefix=refs/e-verify &&\n \tgit update-ref $prefix/foo $C &&\n \tgit pack-refs --all &&\n@@ -225,7 +225,7 @@ test_expect_success 'empty directory should not fool verify' '\n \tgit update-ref --stdin\n '\n \n-test_expect_success 'empty directory should not fool 1-arg update' '\n+test_expect_success REFFILES 'empty directory should not fool 1-arg update' '\n \tprefix=refs/e-update-1 &&\n \tgit update-ref $prefix/foo $C &&\n \tgit pack-refs --all &&\n@@ -234,7 +234,7 @@ test_expect_success 'empty directory should not fool 1-arg update' '\n \tgit update-ref --stdin\n '\n \n-test_expect_success 'empty directory should not fool 2-arg update' '\n+test_expect_success REFFILES 'empty directory should not fool 2-arg update' '\n \tprefix=refs/e-update-2 &&\n \tgit update-ref $prefix/foo $C &&\n \tgit pack-refs --all &&\n@@ -243,7 +243,7 @@ test_expect_success 'empty directory should not fool 2-arg update' '\n \tgit update-ref --stdin\n '\n \n-test_expect_success 'empty directory should not fool 0-arg delete' '\n+test_expect_success REFFILES 'empty directory should not fool 0-arg delete' '\n \tprefix=refs/e-delete-0 &&\n \tgit update-ref $prefix/foo $C &&\n \tgit pack-refs --all &&\n@@ -252,7 +252,7 @@ test_expect_success 'empty directory should not fool 0-arg delete' '\n \tgit update-ref --stdin\n '\n \n-test_expect_success 'empty directory should not fool 1-arg delete' '\n+test_expect_success REFFILES 'empty directory should not fool 1-arg delete' '\n \tprefix=refs/e-delete-1 &&\n \tgit update-ref $prefix/foo $C &&\n \tgit pack-refs --all &&\n@@ -466,7 +466,7 @@ test_expect_success 'incorrect old value blocks indirect no-deref delete' '\n \ttest_cmp expected output.err\n '\n \n-test_expect_success 'non-empty directory blocks create' '\n+test_expect_success REFFILES 'non-empty directory blocks create' '\n \tprefix=refs/ne-create &&\n \tmkdir -p .git/$prefix/foo/bar &&\n \t: >.git/$prefix/foo/bar/baz.lock &&\n@@ -485,7 +485,7 @@ test_expect_success 'non-empty directory blocks create' '\n \ttest_cmp expected output.err\n '\n \n-test_expect_success 'broken reference blocks create' '\n+test_expect_success REFFILES 'broken reference blocks create' '\n \tprefix=refs/broken-create &&\n \tmkdir -p .git/$prefix &&\n \techo \"gobbledigook\" >.git/$prefix/foo &&\n@@ -504,7 +504,7 @@ test_expect_success 'broken reference blocks create' '\n \ttest_cmp expected output.err\n '\n \n-test_expect_success 'non-empty directory blocks indirect create' '\n+test_expect_success REFFILES 'non-empty directory blocks indirect create' '\n \tprefix=refs/ne-indirect-create &&\n \tgit symbolic-ref $prefix/symref $prefix/foo &&\n \tmkdir -p .git/$prefix/foo/bar &&\n@@ -524,7 +524,7 @@ test_expect_success 'non-empty directory blocks indirect create' '\n \ttest_cmp expected output.err\n '\n \n-test_expect_success 'broken reference blocks indirect create' '\n+test_expect_success REFFILES 'broken reference blocks indirect create' '\n \tprefix=refs/broken-indirect-create &&\n \tgit symbolic-ref $prefix/symref $prefix/foo &&\n \techo \"gobbledigook\" >.git/$prefix/foo &&\n@@ -543,7 +543,7 @@ test_expect_success 'broken reference blocks indirect create' '\n \ttest_cmp expected output.err\n '\n \n-test_expect_success 'no bogus intermediate values during delete' '\n+test_expect_success REFFILES 'no bogus intermediate values during delete' '\n \tprefix=refs/slow-transaction &&\n \t# Set up a reference with differing loose and packed versions:\n \tgit update-ref $prefix/foo $C &&\n@@ -600,7 +600,7 @@ test_expect_success 'no bogus intermediate values during delete' '\n \ttest_must_fail git rev-parse --verify --quiet $prefix/foo\n '\n \n-test_expect_success 'delete fails cleanly if packed-refs file is locked' '\n+test_expect_success REFFILES 'delete fails cleanly if packed-refs file is locked' '\n \tprefix=refs/locked-packed-refs &&\n \t# Set up a reference with differing loose and packed versions:\n \tgit update-ref $prefix/foo $C &&\n@@ -616,7 +616,7 @@ test_expect_success 'delete fails cleanly if packed-refs file is locked' '\n \ttest_cmp unchanged actual\n '\n \n-test_expect_success 'delete fails cleanly if packed-refs.new write fails' '\n+test_expect_success REFFILES 'delete fails cleanly if packed-refs.new write fails' '\n \t# Setup and expectations are similar to the test above.\n \tprefix=refs/failed-packed-refs &&\n \tgit update-ref $prefix/foo $C &&\n-- \ngitgitgadget\n\n"},{"id":"422259","messageId":"a2cce772d44f5939475a1dfddc1a55ab9bbb8ac5.1618829584.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.git.git.1618829583.gitgitgadget@gmail.com","subject":"[PATCH 17/18] t4202: mark bogus head hash test with REFFILES","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-19T10:53:02Z","receivedAt":"2021-04-19T10:54:37Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nIn reftable, hashes are correctly formed by design\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t4202-log.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex c575deaad4fb..ed6d4ecd3a28 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -1834,7 +1834,7 @@ test_expect_success 'log --graph --no-walk is forbidden' '\n \ttest_must_fail git log --graph --no-walk\n '\n \n-test_expect_success 'log diagnoses bogus HEAD hash' '\n+test_expect_success REFFILES 'log diagnoses bogus HEAD hash' '\n \tgit init empty &&\n \ttest_must_fail git -C empty log 2>stderr &&\n \ttest_i18ngrep does.not.have.any.commits stderr &&\n-- \ngitgitgadget\n\n"},{"id":"422260","messageId":"0665edb1308b8cd4536d6922fd36315e1abdd9d1.1618829584.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.git.git.1618829583.gitgitgadget@gmail.com","subject":"[PATCH 18/18] t1415: set REFFILES for test specific to storage format","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-19T10:53:03Z","receivedAt":"2021-04-19T10:54:39Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t1415-worktree-refs.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t1415-worktree-refs.sh b/t/t1415-worktree-refs.sh\nindex 7ab91241ab7c..a8083a0af3af 100755\n--- a/t/t1415-worktree-refs.sh\n+++ b/t/t1415-worktree-refs.sh\n@@ -16,7 +16,7 @@ test_expect_success 'setup' '\n \tgit -C wt2 update-ref refs/worktree/foo HEAD\n '\n \n-test_expect_success 'refs/worktree must not be packed' '\n+test_expect_success REFFILES 'refs/worktree must not be packed' '\n \tgit pack-refs --all &&\n \ttest_path_is_missing .git/refs/tags/wt1 &&\n \ttest_path_is_file .git/refs/worktree/foo &&\n-- \ngitgitgadget\n"},{"id":"422336","messageId":"20210419203835.GW2947267@szeder.dev","threadId":"55516","inReplyTo":"53cf1069552b6cd6161ce6f69a31c44e59091096.1618829583.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2021-04-19T20:38:35Z","receivedAt":"2021-04-19T20:38:42Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Mon, Apr 19, 2021 at 10:52:49AM +0000, Han-Wen Nienhuys via GitGitGadget wrote:\n> From: Han-Wen Nienhuys <hanwen@google.com>\n> \n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t1401-symbolic-ref.sh | 23 +++++++++--------------\n>  1 file changed, 9 insertions(+), 14 deletions(-)\n> \n> diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh\n> index a4ebb0b65fec..fd5980d3fb40 100755\n> --- a/t/t1401-symbolic-ref.sh\n> +++ b/t/t1401-symbolic-ref.sh\n> @@ -7,18 +7,13 @@ test_description='basic symbolic-ref tests'\n>  # the git repo, meaning that further tests will operate on\n>  # the surrounding git repo instead of the trash directory.\n>  reset_to_sane() {\n> -\techo ref: refs/heads/foo >.git/HEAD\n> +\tgit --git-dir .git symbolic-ref HEAD refs/heads/foo\n>  }\n>  \n> -test_expect_success 'symbolic-ref writes HEAD' '\n> -\tgit symbolic-ref HEAD refs/heads/foo &&\n> -\techo ref: refs/heads/foo >expect &&\n> -\ttest_cmp expect .git/HEAD\n> -'\n> -\n> -test_expect_success 'symbolic-ref reads HEAD' '\n> -\techo refs/heads/foo >expect &&\n> -\tgit symbolic-ref HEAD >actual &&\n> +test_expect_success 'symbolic-ref read/write roundtrip' '\n> +\tgit symbolic-ref HEAD refs/heads/read-write-roundtrip &&\n> +\techo refs/heads/read-write-roundtrip > expect &&\n> +\tgit symbolic-ref HEAD > actual &&\n\nStyle nit: no space between redirection and filename, i.e. these\nshould be '>expect' and '>actual'.\n\n>  \ttest_cmp expect actual\n>  '\n>  \n> @@ -42,16 +37,16 @@ reset_to_sane\n>  test_expect_success 'symbolic-ref can be deleted' '\n>  \tgit symbolic-ref NOTHEAD refs/heads/foo &&\n>  \tgit symbolic-ref -d NOTHEAD &&\n> -\ttest_path_is_file .git/refs/heads/foo &&\n> -\ttest_path_is_missing .git/NOTHEAD\n> +\tgit rev-parse refs/heads/foo &&\n> +\t! git symbolic-ref NOTHEAD\n\nPlease use 'test_must_fail git ...', because otherwise a segfault\ncould go unnoticed.\n\n>  '\n>  reset_to_sane\n>  \n>  test_expect_success 'symbolic-ref can delete dangling symref' '\n>  \tgit symbolic-ref NOTHEAD refs/heads/missing &&\n>  \tgit symbolic-ref -d NOTHEAD &&\n> -\ttest_path_is_missing .git/refs/heads/missing &&\n> -\ttest_path_is_missing .git/NOTHEAD\n> +\t! git rev-parse refs/heads/missing &&\n> +\t! git symbolic-ref NOTHEAD\n>  '\n>  reset_to_sane\n>  \n> -- \n> gitgitgadget\n> \n"},{"id":"422340","messageId":"20210419211108.GX2947267@szeder.dev","threadId":"55516","inReplyTo":"91ef012cbcc9a3106fa51236e20458f108e50ce9.1618829583.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 01/18] t4202: split testcase for invalid HEAD symref and HEAD hash","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2021-04-19T21:11:08Z","receivedAt":"2021-04-19T21:11:16Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Mon, Apr 19, 2021 at 10:52:46AM +0000, Han-Wen Nienhuys via GitGitGadget wrote:\n> From: Han-Wen Nienhuys <hanwen@google.com>\n> \n> Reftable will prohibit invalid hashes at the storage level, but\n> git-symbolic-ref can still create branches ending in \".lock\".\n> \n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t4202-log.sh | 9 ++++++---\n>  1 file changed, 6 insertions(+), 3 deletions(-)\n> \n> diff --git a/t/t4202-log.sh b/t/t4202-log.sh\n> index 350cfa35936a..c575deaad4fb 100755\n> --- a/t/t4202-log.sh\n> +++ b/t/t4202-log.sh\n> @@ -1834,14 +1834,17 @@ test_expect_success 'log --graph --no-walk is forbidden' '\n>  \ttest_must_fail git log --graph --no-walk\n>  '\n>  \n> -test_expect_success 'log diagnoses bogus HEAD' '\n> +test_expect_success 'log diagnoses bogus HEAD hash' '\n>  \tgit init empty &&\n\nThis test creates a new repo in 'empty'...\n\n>  \ttest_must_fail git -C empty log 2>stderr &&\n>  \ttest_i18ngrep does.not.have.any.commits stderr &&\n>  \techo 1234abcd >empty/.git/refs/heads/main &&\n>  \ttest_must_fail git -C empty log 2>stderr &&\n> -\ttest_i18ngrep broken stderr &&\n> -\techo \"ref: refs/heads/invalid.lock\" >empty/.git/HEAD &&\n> +\ttest_i18ngrep broken stderr'\n> +\n> +test_expect_success 'log diagnoses bogus HEAD symref' '\n> +\tgit init empty &&\n\n... and this test create a new repo in 'empty' as well.  Or rather\nre-initializes the already existing repository there.\n\nIs this intentional?  It surely cases some confusion.\n\n> +\tgit --git-dir empty/.git symbolic-ref HEAD refs/heads/invalid.lock &&\n>  \ttest_must_fail git -C empty log 2>stderr &&\n>  \ttest_i18ngrep broken stderr &&\n>  \ttest_must_fail git -C empty log --default totally-bogus 2>stderr &&\n> -- \n> gitgitgadget\n> \n"},{"id":"422489","messageId":"xmqqfszk36z8.fsf@gitster.g","threadId":"55516","inReplyTo":"223583594c0089ef259e83f2f10c08fd94f55959.1618829583.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 05/18] t1413: use tar to save and restore entire .git directory","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-04-20T22:51:23Z","receivedAt":"2021-04-20T22:51:33Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Han-Wen Nienhuys via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> This makes the test independent of the particulars of the storage formats.\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t1413-reflog-detach.sh | 5 ++---\n>  1 file changed, 2 insertions(+), 3 deletions(-)\n>\n> diff --git a/t/t1413-reflog-detach.sh b/t/t1413-reflog-detach.sh\n> index bde05208ae6a..b699c2bb7c31 100755\n> --- a/t/t1413-reflog-detach.sh\n> +++ b/t/t1413-reflog-detach.sh\n> @@ -7,8 +7,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n>  . ./test-lib.sh\n>  \n>  reset_state () {\n> -\tgit checkout main &&\n> -\tcp saved_reflog .git/logs/HEAD\n> +\trm -rf .git && tar -xf .git-saved.tar\n\nUnlike GNUism longer option names like \"tar --extract\", you do not\nneed a single dash when you ask \"tar xf\" (see our Makefile).\n\nLooking at t/t5000-tar-tree.sh, we seem to be supposed to use \"$TAR\"\n(with double quotes) to name the tar utility, so that people can say\nTAR=gtar on certain platforms.  I suspect that there already are a\nfew existing violations but let's not make it worse.\n\n>  }\n>  \n>  test_expect_success setup '\n> @@ -17,7 +16,7 @@ test_expect_success setup '\n>  \tgit branch side &&\n>  \ttest_tick &&\n>  \tgit commit --allow-empty -m second &&\n> -\tcat .git/logs/HEAD >saved_reflog\n> +\ttar -cf .git-saved.tar .git\n\nLikewise \n\n\t\"$TAR\" cf ...\n"},{"id":"422490","messageId":"xmqqa6ps36ow.fsf@gitster.g","threadId":"55516","inReplyTo":"3d3b733c31273a004e80d5cbab8f746a2010e9ea.1618829583.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 10/18] test-lib: provide test prereq REFFILES","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-04-20T22:57:35Z","receivedAt":"2021-04-20T22:57:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Han-Wen Nienhuys via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> REFFILES can be used to mark tests that are specific to the packed/loose ref\n> storage format and its limitations. Marking such tests is a preparation for\n> introducing the reftable storage backend.\n\nWe'd want a bit of documentation either here or in t/README to\nexplain things like how these two interact with each other, if both\ncan be active at the same time, etc.\n\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/test-lib.sh | 2 ++\n>  1 file changed, 2 insertions(+)\n>\n> diff --git a/t/test-lib.sh b/t/test-lib.sh\n> index d3f6af6a6545..ea7397c633db 100644\n> --- a/t/test-lib.sh\n> +++ b/t/test-lib.sh\n> @@ -1481,6 +1481,8 @@ parisc* | hppa*)\n>  \t;;\n>  esac\n>  \n> +test_set_prereq REFFILES\n> +\n>  ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1\n>  test -z \"$NO_PERL\" && test_set_prereq PERL\n>  test -z \"$NO_PTHREADS\" && test_set_prereq PTHREADS\n"},{"id":"422491","messageId":"xmqq5z0g36m9.fsf@gitster.g","threadId":"55516","inReplyTo":"a5b9439192db3ad3c01db0e67cc1f60bad9109e8.1618829583.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 16/18] t7003: check reflog existence only for REFFILES","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-04-20T22:59:10Z","receivedAt":"2021-04-20T22:59:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Han-Wen Nienhuys via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t7003-filter-branch.sh | 4 +++-\n>  1 file changed, 3 insertions(+), 1 deletion(-)\n>\n> diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\n> index cf30055c88dd..380bdf934317 100755\n> --- a/t/t7003-filter-branch.sh\n> +++ b/t/t7003-filter-branch.sh\n> @@ -396,7 +396,9 @@ test_expect_success '--prune-empty is able to prune entire branch' '\n>  \tgit branch prune-entire B &&\n>  \tgit filter-branch -f --prune-empty --index-filter \"git update-index --remove A.t B.t\" prune-entire &&\n>  \ttest_must_fail git rev-parse refs/heads/prune-entire &&\n> -\ttest_must_fail git reflog exists refs/heads/prune-entire\n> +\tif test_have_prereq REFFILES ; then\n> +\t\ttest_must_fail git reflog exists refs/heads/prune-entire\n> +\tfi\n\nStyle.  Replace \" ; \" with a LF and necessary number of tabs.\n\n\n>  '\n>  \n>  test_expect_success '--remap-to-ancestor with filename filters' '\n"},{"id":"422503","messageId":"xmqqo8e81q9p.fsf@gitster.g","threadId":"55516","inReplyTo":"xmqqa6ps36ow.fsf@gitster.g","subject":"Re: [PATCH 10/18] test-lib: provide test prereq REFFILES","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-04-20T23:37:38Z","receivedAt":"2021-04-20T23:37:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> \"Han-Wen Nienhuys via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n>\n>> From: Han-Wen Nienhuys <hanwen@google.com>\n>>\n>> REFFILES can be used to mark tests that are specific to the packed/loose ref\n>> storage format and its limitations. Marking such tests is a preparation for\n>> introducing the reftable storage backend.\n>\n> We'd want a bit of documentation either here or in t/README to\n> explain things like how these two interact with each other, if both\n> can be active at the same time, etc.\n\nBy \"here\", I meant the place in the code where the test_set_prereq\nwas added, not in the proposed log message that will become hard to\nsee when test writers need to work with the sources.\n\nThanks.\n\n>\n>>\n>> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n>> ---\n>>  t/test-lib.sh | 2 ++\n>>  1 file changed, 2 insertions(+)\n>>\n>> diff --git a/t/test-lib.sh b/t/test-lib.sh\n>> index d3f6af6a6545..ea7397c633db 100644\n>> --- a/t/test-lib.sh\n>> +++ b/t/test-lib.sh\n>> @@ -1481,6 +1481,8 @@ parisc* | hppa*)\n>>  \t;;\n>>  esac\n>>  \n>> +test_set_prereq REFFILES\n>> +\n>>  ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1\n>>  test -z \"$NO_PERL\" && test_set_prereq PERL\n>>  test -z \"$NO_PTHREADS\" && test_set_prereq PTHREADS\n"},{"id":"422528","messageId":"87k0ow2n29.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"ccc26a8950be41e5be4dc78295c66ecbade8a50e.1618829583.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 02/18] t9300: check ref existence using git-rev-parse rather than FS check","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-04-21T06:01:34Z","receivedAt":"2021-04-21T06:01:39Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t9300-fast-import.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\n> index 5c47ac4465cb..087ddf097036 100755\n> --- a/t/t9300-fast-import.sh\n> +++ b/t/t9300-fast-import.sh\n> @@ -392,7 +392,7 @@ test_expect_success 'B: accept branch name \"TEMP_TAG\"' '\n>  \t\tgit gc\n>  \t\tgit prune\" &&\n>  \tgit fast-import <input &&\n> -\ttest -f .git/TEMP_TAG &&\n> +\tgit rev-parse TEMP_TAG &&\n>  \ttest $(git rev-parse main) = $(git rev-parse TEMP_TAG^)\n>  '\n\nIt seems to me that this breaks the test, to the extent that it's\ntesting something we care about at all.\n\nI.e. reading ea08a6fd19 (Actually allow TAG_FIXUP branches in\nfast-import, 2007-08-02) the whole point is to test that a \"TEMP_TAG\"\nref is accepted by fast-import, as opposed to \"refs/heads/TEMP_TAG\".\n\nSo we're trying to check that the refstore accepts a concept of a name\nlike HEAD called BLAHBLAH or whatever, that lives at the \"top-level\".\n\nFor something unrelated I was trying to figure out how to detect that\nthe other day and couldn't come up with anything I was happy with,\ne.g. this seems to work:\n\n    # Rely on for-each-ref not listing it...\n    git for-each-ref >gfe &&\n    ! grep TEMP_TAG gfe &&\n    # ... but rev-parse grokking it\n    git rev-parse TEMP_TAG\n\nOr, rely on rev-parse emitting a warning about it:\n\n    $ git update-ref refs/heads/TEMP_TAG HEAD\n    # A bug? We emit both an error and a warning with\n    # --symbolic-full-name?\n    $ git rev-parse --symbolic-full-name TEMP_TAG\n    warning: refname 'TEMP_TAG' is ambiguous.\n    error: refname 'TEMP_TAG' is ambiguous\n    $ echo $?\n    0\n\nIOW re my\nhttps://lore.kernel.org/git/87wnt2th1v.fsf@evledraar.gmail.com/ this\nseems like exactly the sort of edge case where we want to dig a bit more\nand assert that we support (or explicitly don't support) this \"mode\"\nunder reftable.\n\nIn any case, if we're not testing for .git/TEMP_TAG anymore I think your\naddition of \"git rev-parse TEMP_TAG\" is entirely redundant to the ad-hoc\n\"test_cmp\" that comes after it, when would we not be able to rev-parse\nFOO, but succeed with FOO^ ?\n"},{"id":"422529","messageId":"871rb45ftz.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"53cf1069552b6cd6161ce6f69a31c44e59091096.1618829583.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-04-21T06:09:28Z","receivedAt":"2021-04-21T06:09:38Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t1401-symbolic-ref.sh | 23 +++++++++--------------\n>  1 file changed, 9 insertions(+), 14 deletions(-)\n>\n> diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh\n> index a4ebb0b65fec..fd5980d3fb40 100755\n> --- a/t/t1401-symbolic-ref.sh\n> +++ b/t/t1401-symbolic-ref.sh\n> @@ -7,18 +7,13 @@ test_description='basic symbolic-ref tests'\n>  # the git repo, meaning that further tests will operate on\n>  # the surrounding git repo instead of the trash directory.\n>  reset_to_sane() {\n> -\techo ref: refs/heads/foo >.git/HEAD\n> +\tgit --git-dir .git symbolic-ref HEAD refs/heads/foo\n\nIsn't that \"--git-dir .git\" entirely redundant?\n\n>  }\n>  \n> -test_expect_success 'symbolic-ref writes HEAD' '\n> -\tgit symbolic-ref HEAD refs/heads/foo &&\n> -\techo ref: refs/heads/foo >expect &&\n> -\ttest_cmp expect .git/HEAD\n> -'\n> -\n> -test_expect_success 'symbolic-ref reads HEAD' '\n> -\techo refs/heads/foo >expect &&\n> -\tgit symbolic-ref HEAD >actual &&\n> +test_expect_success 'symbolic-ref read/write roundtrip' '\n> +\tgit symbolic-ref HEAD refs/heads/read-write-roundtrip &&\n> +\techo refs/heads/read-write-roundtrip > expect &&\n\nI see SZEDER covered some nits already :)\n"},{"id":"422530","messageId":"87y2dc4164.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"79843c0d572765a3004968235391b5ae17365d56.1618829583.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 07/18] t5000: inspect HEAD using git-rev-parse","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-04-21T06:11:31Z","receivedAt":"2021-04-21T06:11:38Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t5000-tar-tree.sh | 7 ++++---\n>  1 file changed, 4 insertions(+), 3 deletions(-)\n>\n> diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\n> index 7204799a0b52..472fec4ee64a 100755\n> --- a/t/t5000-tar-tree.sh\n> +++ b/t/t5000-tar-tree.sh\n> @@ -233,9 +233,10 @@ test_expect_success \\\n>       test_cmp expected.mtime b.mtime'\n>  \n>  test_expect_success \\\n> -    'git get-tar-commit-id' \\\n> -    'git get-tar-commit-id <b.tar >b.commitid &&\n> -     test_cmp .git/$(git symbolic-ref HEAD) b.commitid'\n> +\t'git get-tar-commit-id' \\\n> +\t'git get-tar-commit-id <b.tar >actual &&\n> +\tgit rev-parse HEAD > expect &&\n> +\ttest_cmp expect actual'\n\nIf we're doing a \"re-style while we're at it\" s/<spaces>/<tabs>/ let's\njust go all the way and convert it to a more modern style of:\n\ntest_expect_success 'git get-tar-commit-id' '\n\t...\n'\n\nBut maybe such re-styling would be best left alone, and just a narrow\nchange of the needed code. There's various surrounding tests in the file\nthat use the same style, unless we're going to re-style all of them....\n"},{"id":"422531","messageId":"87v98g413h.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"ba575839e422dfe241f7b567de14c10ec648f2e3.1618829583.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 09/18] t5304: use \"reflog expire --all\" to clear the reflog","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-04-21T06:13:06Z","receivedAt":"2021-04-21T06:13:11Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> This is more explicit, and reduces the depency between test functions. It also\n> is more amenable to use with reftable, which has no concept of (non)existence of\n> a reflog\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t5304-prune.sh | 9 +++------\n>  1 file changed, 3 insertions(+), 6 deletions(-)\n>\n> diff --git a/t/t5304-prune.sh b/t/t5304-prune.sh\n> index b447ce56a9b2..4ffc0076801e 100755\n> --- a/t/t5304-prune.sh\n> +++ b/t/t5304-prune.sh\n> @@ -94,26 +94,22 @@ test_expect_success 'prune: prune nonsense parameters' '\n>  '\n>  \n>  test_expect_success 'prune: prune unreachable heads' '\n> -\n\nSimilar to a previous comments, a few tests in that file use this\nwhitespacing. I'd say let's just leave it alone unlress we're doing some\nwhitespace-only commit earlier.\n\n>  \tgit config core.logAllRefUpdates false &&\n> -\tmv .git/logs .git/logs.old &&\n>  \t: > file2 &&\n\nAlso, if we're re-styling things: \">foo\" instead of \": >foo\".\n"},{"id":"422532","messageId":"87sg3k40mc.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"dd1f6969c28d95027d1ac9f7b6f6a43640babada.1618829583.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 11/18] t1407: require REFFILES for for_each_reflog test","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-04-21T06:23:23Z","receivedAt":"2021-04-21T06:23:29Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> It tries to setup a reflog by catting to .git/logs/\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t1407-worktree-ref-store.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t1407-worktree-ref-store.sh b/t/t1407-worktree-ref-store.sh\n> index d3fe77751122..27b57f248a94 100755\n> --- a/t/t1407-worktree-ref-store.sh\n> +++ b/t/t1407-worktree-ref-store.sh\n> @@ -52,7 +52,7 @@ test_expect_success 'create_symref(FOO, refs/heads/main)' '\n>  \ttest_cmp expected actual\n>  '\n>  \n> -test_expect_success 'for_each_reflog()' '\n> +test_expect_success REFFILES 'for_each_reflog()' '\n>  \techo $ZERO_OID > .git/logs/PSEUDO-MAIN &&\n>  \tmkdir -p     .git/logs/refs/bisect &&\n>  \techo $ZERO_OID > .git/logs/refs/bisect/random &&\n\nHrm, so already the first use of REFFILES has me questioning the need\nfor it.\n\nI mean obviously this depends on ref-files in the strict sense.\n\nBut it seems to me that there's two classes of those issues:\n\n A. Test where we inherently depend 100% on \"reffiles\", e.g. the later\n    tests of \"empty directories\" in .git/refs/, presumably there's no\n    equivalent of those in reftable.\n\n B. Tests that are really wanting to test some specific type of ref\n    corruption, that could (or not!) happen under reftable, but just\n    uses ref files for the setup now.\n\nI think (but am not sure) that this is the latter case. I.e. the\ndistiniction I noted in [1].\n\nJust skimming the context I wonder which of these can/can't happen under\nreftable:\n\n * We have a PSEUDO-MAIN ref\n * It's set to $ZERO_OID\n * We have a $ZERO_OID in a refs/bisect/random\n\nEtc., the test is just a setup for a call to refs_for_each_reflog().\n\nIf I'm wrong and it really is a case of \"A\" then presumably that has\nimplications down to refs/iterator.c and beyond.\n\nI don't think we need to exhaustively dig into every one of these for\nsome initial pass at getting the test suite running, but again re [1] I\nworry that if we over-skip we'll end up not marking the distinction\nbetween \"A\" and \"B\" above, and thus will have an end-state of losing\ntest coverage.\n\n1. https://lore.kernel.org/git/87wnt2th1v.fsf@evledraar.gmail.com/\n"},{"id":"422533","messageId":"87pmyo3zvw.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"1ce545043846ee06070d1a4bc05fcd5221847eab.1618829583.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 13/18] t2017: mark --orphan/logAllRefUpdates=false test as REFFILES","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-04-21T06:39:15Z","receivedAt":"2021-04-21T06:39:20Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> In reftable, there is no notion of a per-ref 'existence' of a reflog. Each\n> reflog entry has its own key, so it is not possible to distinguish between\n> {reflog doesn't exist,reflog exists but is empty}. This makes the logic\n> in log_ref_setup() (file refs/files-backend.c), which depends on the existence\n> of the reflog file infeasible.\n\nOkey, so I'd follow this if the test was doing something like \"test -e\n.git/logs\" to test whether we didn't have reflogs for a specific branch\nor something....\n\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t2017-checkout-orphan.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t2017-checkout-orphan.sh b/t/t2017-checkout-orphan.sh\n> index c7adbdd39ab9..88d6992a5e1f 100755\n> --- a/t/t2017-checkout-orphan.sh\n> +++ b/t/t2017-checkout-orphan.sh\n> @@ -76,7 +76,7 @@ test_expect_success '--orphan makes reflog by default' '\n>  \tgit rev-parse --verify delta@{0}\n>  '\n>  \n> -test_expect_success '--orphan does not make reflog when core.logAllRefUpdates = false' '\n> +test_expect_success REFFILES '--orphan does not make reflog when core.logAllRefUpdates = false' '\n>  \tgit checkout main &&\n>  \tgit config core.logAllRefUpdates false &&\n>  \tgit checkout --orphan epsilon &&\n\n... but in this test we don't end up doing anything that obviously\ndepends on ref files, right after this context we do (and this is the\nentire test):\n\n    test_must_fail git rev-parse --verify epsilon@{0} &&\n    git commit -m Epsilon &&\n    test_must_fail git rev-parse --verify epsilon@{0}\n\nSo either this is over-skipping of a test, or a summary like this would\nbe more inaccurate (I'm not suggesting to include it, just writing it\nout to state/check my assumptions):\n\n    [...]the reflog implementation leaks the implementation detail that\n    it has no per-ref instance of the reflog all the way up to syntax\n    like \"rev-parse --verify branch@{0}\", which is just asking for the\n    Nth reflog entry for a branch[...]\n\nBut maybe I'm wrong about that, \"man git-rev-parse\" says, \"This\" is\nreference to the @{<n>} syntax:\n\n    [...]This suffix may only be used immediately following a ref name\n    and the ref must have an existing log ($GIT_DIR/logs/<refname>).\n\nIn your v7[1] of the reftable series there's no patch to\nDocumentation/revisions.txt altering that blurb.\n\nSo it seems to me that between this & that series there's some closing\nof the gap needed with how this \"must have an existing log\" even works\nunder reftable.\n\nPer [2] I had assumed that this worked under reftable by abstracting\naway the syntax to some query for the ref name, and faking up \"file does\nnot exist\" as \"there were no records\" to anything like rev-parse, but it\ndoesn't work like that?\n\n1. https://lore.kernel.org/git/pull.847.v7.git.git.1618832276.gitgitgadget@gmail.com/\n2. https://eclipse.googlesource.com/jgit/jgit/+/master/Documentation/technical/reftable.md#log-record\n3. https://lore.kernel.org/git/87sg3k40mc.fsf@evledraar.gmail.com/\n"},{"id":"422534","messageId":"87mtts3z2a.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"a3abc4f70e7d6bd833024f2c9b42ff731896e14d.1618829583.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 14/18] t1404: mark tests that muck with .git directly as REFFILES.","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-04-21T06:57:01Z","receivedAt":"2021-04-21T06:57:08Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n\nSome commit message summarizing why we won't need this at all would be\nbetter e.g. maybe:\n\n    [...]Most of the tests being skipped here were added in 19dd7d06e5\n    (t1404: demonstrate a bug resolving references, 2016-05-05), as the\n    subsequent 5387c0d883 (commit_ref(): if there is an empty dir in the\n    way, delete it, 2016-05-05) and e167a5673e (read_raw_ref(): don't\n    get confused by an empty directory, 2016-05-05) show the code is all\n    specific to the files backend, and the scenario of an \"empty\n    directory\" \"refs/heads/foo/\" existing, and us wanting to create a\n    \"file\" under \"refs/heads/foo/bar\" is impossible under reftable.\n\nBut:\n\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t1404-update-ref-errors.sh | 30 +++++++++++++++---------------\n>  1 file changed, 15 insertions(+), 15 deletions(-)\n>\n> diff --git a/t/t1404-update-ref-errors.sh b/t/t1404-update-ref-errors.sh\n> index 8b51c4efc135..b729c1f48030 100755\n> --- a/t/t1404-update-ref-errors.sh\n> +++ b/t/t1404-update-ref-errors.sh\n> @@ -189,7 +189,7 @@ test_expect_success 'one new ref is a simple prefix of another' '\n>  \n>  '\n>  \n> -test_expect_success 'empty directory should not fool rev-parse' '\n> +test_expect_success REFFILES 'empty directory should not fool rev-parse' '\n>  \tprefix=refs/e-rev-parse &&\n>  \tgit update-ref $prefix/foo $C &&\n>  \tgit pack-refs --all &&\n> @@ -199,7 +199,7 @@ test_expect_success 'empty directory should not fool rev-parse' '\n>  \ttest_cmp expected actual\n>  '\n>  \n> -test_expect_success 'empty directory should not fool for-each-ref' '\n> +test_expect_success REFFILES 'empty directory should not fool for-each-ref' '\n>  \tprefix=refs/e-for-each-ref &&\n>  \tgit update-ref $prefix/foo $C &&\n>  \tgit for-each-ref $prefix >expected &&\n> @@ -209,14 +209,14 @@ test_expect_success 'empty directory should not fool for-each-ref' '\n>  \ttest_cmp expected actual\n>  '\n\n\n[Snip a few tests that are all of the same \"empty directory form]\n\nSo far this looks good / all covering that bug\n\n> -test_expect_success 'broken reference blocks create' '\n> +test_expect_success REFFILES 'broken reference blocks create' '\n>  \tprefix=refs/broken-create &&\n>  \tmkdir -p .git/$prefix &&\n>  \techo \"gobbledigook\" >.git/$prefix/foo &&\n> @@ -504,7 +504,7 @@ test_expect_success 'broken reference blocks create' '\n>  \ttest_cmp expected output.err\n>  '\n\nThis doesn't seem specific to the files backend at all. I.e. if you grep\nfor \"reference broken\" in the file backends you'll find EINVAL and\nREF_ISBROKEN handling, and your refs/reftable-backend.c has the same\nexception handling, so presumably we can end up with broken refs.\n\nMaybe not \"gobbledigook\", but isn't this losing coverage for other invalid ref handling under reftable?\n\n> -test_expect_success 'non-empty directory blocks indirect create' '\n> +test_expect_success REFFILES 'non-empty directory blocks indirect create' '\n>  \tprefix=refs/ne-indirect-create &&\n>  \tgit symbolic-ref $prefix/symref $prefix/foo &&\n>  \tmkdir -p .git/$prefix/foo/bar &&\n> @@ -524,7 +524,7 @@ test_expect_success 'non-empty directory blocks indirect create' '\n>  \ttest_cmp expected output.err\n>  '\n>  \n> -test_expect_success 'broken reference blocks indirect create' '\n> +test_expect_success REFFILES 'broken reference blocks indirect create' '\n>  \tprefix=refs/broken-indirect-create &&\n>  \tgit symbolic-ref $prefix/symref $prefix/foo &&\n>  \techo \"gobbledigook\" >.git/$prefix/foo &&\n> @@ -543,7 +543,7 @@ test_expect_success 'broken reference blocks indirect create' '\n>  \ttest_cmp expected output.err\n>  '\n\nHere we seem to be back to truly file-specific thing (or maybe we were\nall along):\n\n> -test_expect_success 'no bogus intermediate values during delete' '\n> +test_expect_success REFFILES 'no bogus intermediate values during delete' '\n>  \tprefix=refs/slow-transaction &&\n>  \t# Set up a reference with differing loose and packed versions:\n>  \tgit update-ref $prefix/foo $C &&\n> @@ -600,7 +600,7 @@ test_expect_success 'no bogus intermediate values during delete' '\n>  \ttest_must_fail git rev-parse --verify --quiet $prefix/foo\n>  '\n>  \n> -test_expect_success 'delete fails cleanly if packed-refs file is locked' '\n> +test_expect_success REFFILES 'delete fails cleanly if packed-refs file is locked' '\n>  \tprefix=refs/locked-packed-refs &&\n>  \t# Set up a reference with differing loose and packed versions:\n>  \tgit update-ref $prefix/foo $C &&\n> @@ -616,7 +616,7 @@ test_expect_success 'delete fails cleanly if packed-refs file is locked' '\n>  \ttest_cmp unchanged actual\n>  '\n>  \n> -test_expect_success 'delete fails cleanly if packed-refs.new write fails' '\n> +test_expect_success REFFILES 'delete fails cleanly if packed-refs.new write fails' '\n>  \t# Setup and expectations are similar to the test above.\n>  \tprefix=refs/failed-packed-refs &&\n>  \tgit update-ref $prefix/foo $C &&\n\nAnyway, much of reviewing this commit was trying to rediscover thing\nthat should really be in the commit message. Presumably you had to run\nblame, log etc. to find the commits from Michael Haggerty and dig into\nif they were relevant to reftable. Having that information in the commit\nmessage would be *very* helpful.\n"},{"id":"422537","messageId":"87k0ow3yvq.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"2b3021c4ba626033cde3b28dda7e5a83b85be2b1.1618829583.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 15/18] t7900: mark pack-refs tests as REFFILES","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-04-21T07:00:57Z","receivedAt":"2021-04-21T07:01:05Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t7900-maintenance.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh\n> index 2412d8c5c006..6f2f55a6c51d 100755\n> --- a/t/t7900-maintenance.sh\n> +++ b/t/t7900-maintenance.sh\n> @@ -343,7 +343,7 @@ test_expect_success 'maintenance.incremental-repack.auto' '\n>  \ttest_subcommand git multi-pack-index write --no-progress <trace-B\n>  '\n>  \n> -test_expect_success 'pack-refs task' '\n> +test_expect_success REFFILES 'pack-refs task' '\n>  \tfor n in $(test_seq 1 5)\n>  \tdo\n>  \t\tgit branch -f to-pack/$n HEAD || return 1\n\nRe [1] maybe this is ok/fine for now, but I think we should really split\nout the \"is specific to file\" part more narrowly (not just here, but in\ngeneral).\n\nE.g. I assume that \"pack-refs\" is simply redundant under reftable, no?\n\nSo should this (which the test you're skipping later runs):\n\n    git maintenance run --task=pack-refs\n\nSilently skip, warn, exit with zero or non-zero, some combination\nthereof?\n\nShould the current behavior documented in\nDocumentation/git-maintenance.txt change with your series under reftable\netc?\n\n1. https://lore.kernel.org/git/87sg3k40mc.fsf@evledraar.gmail.com/\n"},{"id":"422538","messageId":"87h7k03ytd.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"a5b9439192db3ad3c01db0e67cc1f60bad9109e8.1618829583.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 16/18] t7003: check reflog existence only for REFFILES","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-04-21T07:02:22Z","receivedAt":"2021-04-21T07:02:49Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t7003-filter-branch.sh | 4 +++-\n>  1 file changed, 3 insertions(+), 1 deletion(-)\n>\n> diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\n> index cf30055c88dd..380bdf934317 100755\n> --- a/t/t7003-filter-branch.sh\n> +++ b/t/t7003-filter-branch.sh\n> @@ -396,7 +396,9 @@ test_expect_success '--prune-empty is able to prune entire branch' '\n>  \tgit branch prune-entire B &&\n>  \tgit filter-branch -f --prune-empty --index-filter \"git update-index --remove A.t B.t\" prune-entire &&\n>  \ttest_must_fail git rev-parse refs/heads/prune-entire &&\n> -\ttest_must_fail git reflog exists refs/heads/prune-entire\n> +\tif test_have_prereq REFFILES ; then\n> +\t\ttest_must_fail git reflog exists refs/heads/prune-entire\n> +\tfi\n\nSame comment as on an earlier patch[1], i.e. aren't we leaking some\n\"does the reflog exist\" abstraction all the way up from reftable in a\nway that's broken here?\n\n1. https://lore.kernel.org/git/87pmyo3zvw.fsf@evledraar.gmail.com/\n"},{"id":"422539","messageId":"87eef43yjq.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"a2cce772d44f5939475a1dfddc1a55ab9bbb8ac5.1618829584.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 17/18] t4202: mark bogus head hash test with REFFILES","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-04-21T07:08:09Z","receivedAt":"2021-04-21T07:08:21Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> In reftable, hashes are correctly formed by design\n\nWith the file backend this hits this in revision.c:\n\n        if (!refname || !(flags & REF_ISSYMREF) || (flags & REF_ISBROKEN))\n                die(_(\"your current branch appears to be broken\"));\n\nThere's a REF_ISBROKEN is the reftable code, so is hitting this codepath\nimpossible under reftable and therefore we won't need this test at all?\n\nMaybe, and that would be cool, but re [1]'s 3rd item (\"[...]what we\n*don't* cover[...]\") shouldn't revision.c have a \"if (reftable) BUG()\"\ncondition there then?\n\n1. https://lore.kernel.org/git/87wnt2th1v.fsf@evledraar.gmail.com/\n\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t4202-log.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t4202-log.sh b/t/t4202-log.sh\n> index c575deaad4fb..ed6d4ecd3a28 100755\n> --- a/t/t4202-log.sh\n> +++ b/t/t4202-log.sh\n> @@ -1834,7 +1834,7 @@ test_expect_success 'log --graph --no-walk is forbidden' '\n>  \ttest_must_fail git log --graph --no-walk\n>  '\n>  \n> -test_expect_success 'log diagnoses bogus HEAD hash' '\n> +test_expect_success REFFILES 'log diagnoses bogus HEAD hash' '\n>  \tgit init empty &&\n>  \ttest_must_fail git -C empty log 2>stderr &&\n>  \ttest_i18ngrep does.not.have.any.commits stderr &&\n\n"},{"id":"422540","messageId":"87bla83y7i.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"0665edb1308b8cd4536d6922fd36315e1abdd9d1.1618829584.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 18/18] t1415: set REFFILES for test specific to storage format","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-04-21T07:15:29Z","receivedAt":"2021-04-21T07:15:33Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t1415-worktree-refs.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t1415-worktree-refs.sh b/t/t1415-worktree-refs.sh\n> index 7ab91241ab7c..a8083a0af3af 100755\n> --- a/t/t1415-worktree-refs.sh\n> +++ b/t/t1415-worktree-refs.sh\n> @@ -16,7 +16,7 @@ test_expect_success 'setup' '\n>  \tgit -C wt2 update-ref refs/worktree/foo HEAD\n>  '\n>  \n> -test_expect_success 'refs/worktree must not be packed' '\n> +test_expect_success REFFILES 'refs/worktree must not be packed' '\n>  \tgit pack-refs --all &&\n>  \ttest_path_is_missing .git/refs/tags/wt1 &&\n>  \ttest_path_is_file .git/refs/worktree/foo &&\n\nSo a naïve:\n    \n    diff --git a/refs/files-backend.c b/refs/files-backend.c\n    index 3f29f8c143..01e2dc8bc3 100644\n    --- a/refs/files-backend.c\n    +++ b/refs/files-backend.c\n    @@ -212,7 +212,7 @@ static void files_ref_path(struct files_ref_store *refs,\n      */\n     static void add_per_worktree_entries_to_dir(struct ref_dir *dir, const char *dirname)\n     {\n    -       const char *prefixes[] = { \"refs/bisect/\", \"refs/worktree/\", \"refs/rewritten/\" };\n    +       const char *prefixes[] = { \"refs/bisect/\", \"refs/rewritten/\" };\n            int ip;\n    \n            if (strcmp(dirname, \"refs/\"))\n\nWill fail the test under non-reftable, i.e. we somehow conflate \"is\npacked\" with correctly discovering these refs? A discussion of how\n8aff1a9ca5 (Add a place for (not) sharing stuff between worktrees,\n2018-09-29) relates to reftable would be valuable here.\n\nBut on the tip of \"seen\" currently this test fails entirely with\nGIT_TEST_REFTABLE=true, so I'm not sure if it got rid of the need for\nthis abstraction in the files backend or what...\n"},{"id":"422550","messageId":"CAFQ2z_MMAM6jZ0+zRi+8fyS69Qw4fKQSsXgQW2zW7tcMdmN=QQ@mail.gmail.com","threadId":"55516","inReplyTo":"871rb45ftz.fsf@evledraar.gmail.com","subject":"Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-04-21T09:09:07Z","receivedAt":"2021-04-21T09:09:23Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Wed, Apr 21, 2021 at 8:09 AM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n>\n>\n> On Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n>\n> > From: Han-Wen Nienhuys <hanwen@google.com>\n> >\n> > Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> > ---\n> >  t/t1401-symbolic-ref.sh | 23 +++++++++--------------\n> >  1 file changed, 9 insertions(+), 14 deletions(-)\n> >\n> > diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh\n> > index a4ebb0b65fec..fd5980d3fb40 100755\n> > --- a/t/t1401-symbolic-ref.sh\n> > +++ b/t/t1401-symbolic-ref.sh\n> > @@ -7,18 +7,13 @@ test_description='basic symbolic-ref tests'\n> >  # the git repo, meaning that further tests will operate on\n> >  # the surrounding git repo instead of the trash directory.\n> >  reset_to_sane() {\n> > -     echo ref: refs/heads/foo >.git/HEAD\n> > +     git --git-dir .git symbolic-ref HEAD refs/heads/foo\n>\n> Isn't that \"--git-dir .git\" entirely redundant?\n\nSee the comment above the changed line: we don't want auto-detection\nto clobber the surrounding git repo.\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"422663","messageId":"20210422045953.GC2947267@szeder.dev","threadId":"55516","inReplyTo":"CAFQ2z_MMAM6jZ0+zRi+8fyS69Qw4fKQSsXgQW2zW7tcMdmN=QQ@mail.gmail.com","subject":"Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2021-04-22T04:59:53Z","receivedAt":"2021-04-22T05:00:00Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Wed, Apr 21, 2021 at 11:09:07AM +0200, Han-Wen Nienhuys wrote:\n> > > diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh\n> > > index a4ebb0b65fec..fd5980d3fb40 100755\n> > > --- a/t/t1401-symbolic-ref.sh\n> > > +++ b/t/t1401-symbolic-ref.sh\n> > > @@ -7,18 +7,13 @@ test_description='basic symbolic-ref tests'\n> > >  # the git repo, meaning that further tests will operate on\n> > >  # the surrounding git repo instead of the trash directory.\n> > >  reset_to_sane() {\n> > > -     echo ref: refs/heads/foo >.git/HEAD\n> > > +     git --git-dir .git symbolic-ref HEAD refs/heads/foo\n> >\n> > Isn't that \"--git-dir .git\" entirely redundant?\n> \n> See the comment above the changed line: we don't want auto-detection\n> to clobber the surrounding git repo.\n\nIndeed, but then this is not a faithful conversion of the original.\nThat 'echo' will write sane content to HEAD no matter what state the\nrepository is in.  That 'symbolic-ref' command, however, won't,\nbecause 'git --git-dir .git' turns off only repository discovery, but\nnot repository verification, and in case of a corrupt '.git/HEAD' it\nwill bail out.\n\n  $ cd test\n  $ git init \n  Initialized empty Git repository in /home/szeder/src/git/test/.git/\n  $ git commit --allow-empty -m initial\n  [master (root-commit) ec0df0b] initial\n  $ echo \"foo bar baz\" >.git/HEAD\n  $ git --git-dir .git symbolic-ref HEAD refs/heads/master\n  fatal: not a git repository: '.git'\n\n\n"},{"id":"422679","messageId":"CAFQ2z_Md=LAkJzohf3E5ogWGQHzxN_ik=yHAGmxm7bg-yT6-Zw@mail.gmail.com","threadId":"55516","inReplyTo":"20210422045953.GC2947267@szeder.dev","subject":"Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-04-22T13:01:01Z","receivedAt":"2021-04-22T13:01:18Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Thu, Apr 22, 2021 at 6:59 AM SZEDER Gábor <szeder.dev@gmail.com> wrote:\n> > See the comment above the changed line: we don't want auto-detection\n> > to clobber the surrounding git repo.\n>\n> Indeed, but then this is not a faithful conversion of the original.\n> That 'echo' will write sane content to HEAD no matter what state the\n> repository is in.  That 'symbolic-ref' command, however, won't,\n> because 'git --git-dir .git' turns off only repository discovery, but\n> not repository verification, and in case of a corrupt '.git/HEAD' it\n> will bail out.\n>\n>   $ cd test\n>   $ git init\n>   Initialized empty Git repository in /home/szeder/src/git/test/.git/\n>   $ git commit --allow-empty -m initial\n>   [master (root-commit) ec0df0b] initial\n>   $ echo \"foo bar baz\" >.git/HEAD\n>   $ git --git-dir .git symbolic-ref HEAD refs/heads/master\n>   fatal: not a git repository: '.git'\n\nBut then it's working as intended, no? It will not corrupt the\nsurrounding repository.\n\nI see it as the test writer's job to clean up to the extent that\ngit-symbolic-ref can reset to a sane state.\n\nWe could reset back to a known state in a more drastic manner\n(extracting .git from a tar archive), but that could interfere with\nthe test functions if they're not isolated from each other.\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"422709","messageId":"20210423051255.GD2947267@szeder.dev","threadId":"55516","inReplyTo":"CAFQ2z_Md=LAkJzohf3E5ogWGQHzxN_ik=yHAGmxm7bg-yT6-Zw@mail.gmail.com","subject":"Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2021-04-23T05:12:55Z","receivedAt":"2021-04-23T05:13:02Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Thu, Apr 22, 2021 at 03:01:01PM +0200, Han-Wen Nienhuys wrote:\n> On Thu, Apr 22, 2021 at 6:59 AM SZEDER Gábor <szeder.dev@gmail.com> wrote:\n> > > See the comment above the changed line: we don't want auto-detection\n> > > to clobber the surrounding git repo.\n> >\n> > Indeed, but then this is not a faithful conversion of the original.\n> > That 'echo' will write sane content to HEAD no matter what state the\n> > repository is in.  That 'symbolic-ref' command, however, won't,\n> > because 'git --git-dir .git' turns off only repository discovery, but\n> > not repository verification, and in case of a corrupt '.git/HEAD' it\n> > will bail out.\n> >\n> >   $ cd test\n> >   $ git init\n> >   Initialized empty Git repository in /home/szeder/src/git/test/.git/\n> >   $ git commit --allow-empty -m initial\n> >   [master (root-commit) ec0df0b] initial\n> >   $ echo \"foo bar baz\" >.git/HEAD\n> >   $ git --git-dir .git symbolic-ref HEAD refs/heads/master\n> >   fatal: not a git repository: '.git'\n> \n> But then it's working as intended, no? It will not corrupt the\n> surrounding repository.\n\nNo, it definitely does not.\n\nIf one of the test cases fails because 'git symbolic-ref' were to\nwrite bogus content to HEAD, then that new 'git symbolic-ref'\ninvocation in reset_to_sane() will not corrupt the surrounding\nrepository, but, crucially, it won't restore the test repository's\nHEAD to a sane state either, and git commands invoked in subsequent\ntests won't recognize the trash dir as their git repository, and will\noperate on the surrounding repo instead:\n\n  ~/src/git/t (master)$ vim t/t1401-symbolic-ref.sh\n  ~/src/git/t (master *)$ git diff\n  diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh\n  index a4ebb0b65f..8f8d93bf6a 100755\n  --- a/t/t1401-symbolic-ref.sh\n  +++ b/t/t1401-symbolic-ref.sh\n  @@ -23,7 +23,11 @@ test_expect_success 'symbolic-ref reads HEAD' '\n   '\n   \n   test_expect_success 'symbolic-ref refuses non-ref for HEAD' '\n  -       test_must_fail git symbolic-ref HEAD foo\n  +       #test_must_fail git symbolic-ref HEAD foo &&\n  +       # Lets pretend that the above \"git symbolic-ref\" did write that\n  +       # bogus content to HEAD:\n  +       echo foo >.git/HEAD &&\n  +       false\n   '\n   reset_to_sane\n   \n  ~/src/git/t (master *)$ ./t1401-symbolic-ref.sh \n  ok 1 - symbolic-ref writes HEAD\n  ok 2 - symbolic-ref reads HEAD\n  not ok 3 - symbolic-ref refuses non-ref for HEAD\n  #\t\n  #\t\t#test_must_fail git symbolic-ref HEAD foo &&\n  #\t\t# Lets pretend that the above \"git symbolic-ref\" did write that\n  #\t\t# bogus content to HEAD:\n  #\t\techo foo >.git/HEAD &&\n  #\t\tfalse\n  #\t\n  ok 4 - symbolic-ref refuses bare sha1\n  ok 5 - HEAD cannot be removed\n  ok 6 - symbolic-ref can be deleted\n  ok 7 - symbolic-ref can delete dangling symref\n  ok 8 - symbolic-ref fails to delete missing FOO\n  ok 9 - symbolic-ref fails to delete real ref\n  ok 10 - create large ref name\n  ok 11 - symbolic-ref can point to large ref name\n  ok 12 - we can parse long symbolic ref\n  ok 13 - symbolic-ref reports failure in exit code\n  ok 14 - symbolic-ref writes reflog entry\n  ok 15 - symbolic-ref does not create ref d/f conflicts\n  ok 16 - symbolic-ref can overwrite pointer to invalid name\n  ok 17 - symbolic-ref can resolve d/f name (EISDIR)\n  ok 18 - symbolic-ref can resolve d/f name (ENOTDIR)\n  # failed 1 among 18 test(s)\n  1..18\n  ~/src/git/t (master *)$\n\nOK, only one test failed, and the surrounding repo is not affected.\n\nNo lets switch to your 'git symbolic-ref command in reset_to_sane():\n\n  ~/src/git/t (master *)$ vim t/t1401-symbolic-ref.sh\n  ~/src/git/t (master *)$ git diff\n  diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh\n  index a4ebb0b65f..6ef221d1bb 100755\n  --- a/t/t1401-symbolic-ref.sh\n  +++ b/t/t1401-symbolic-ref.sh\n  @@ -7,7 +7,8 @@ test_description='basic symbolic-ref tests'\n   # the git repo, meaning that further tests will operate on\n   # the surrounding git repo instead of the trash directory.\n   reset_to_sane() {\n  -       echo ref: refs/heads/foo >.git/HEAD\n  +       #echo ref: refs/heads/foo >.git/HEAD\n  +       git --git-dir .git symbolic-ref HEAD refs/heads/foo\n   }\n   \n   test_expect_success 'symbolic-ref writes HEAD' '\n  @@ -23,7 +24,11 @@ test_expect_success 'symbolic-ref reads HEAD' '\n   '\n   \n   test_expect_success 'symbolic-ref refuses non-ref for HEAD' '\n  -       test_must_fail git symbolic-ref HEAD foo\n  +       #test_must_fail git symbolic-ref HEAD foo &&\n  +       # Lets pretend that the above \"git symbolic-ref\" did write that\n  +       # bogus content to HEAD:\n  +       echo foo >.git/HEAD &&\n  +       false\n   '\n   reset_to_sane\n \n  ~/src/git/t (master *)$ ./t1401-symbolic-ref.sh \n  ok 1 - symbolic-ref writes HEAD\n  ok 2 - symbolic-ref reads HEAD\n  not ok 3 - symbolic-ref refuses non-ref for HEAD\n  #\t\n  #\t\t#test_must_fail git symbolic-ref HEAD foo &&\n  #\t\t# Lets pretend that the above \"git symbolic-ref\" did write that\n  #\t\t# bogus content to HEAD:\n  #\t\techo foo >.git/HEAD &&\n  #\t\tfalse\n  #\t\n  fatal: not a git repository: '.git'\n  not ok 4 - symbolic-ref refuses bare sha1\n  #\t\n  #\t\techo content >file && git add file && git commit -m one &&\n  #\t\ttest_must_fail git symbolic-ref HEAD $(git rev-parse HEAD)\n  #\t\n  fatal: not a git repository: '.git'\n  ok 5 - HEAD cannot be removed\n  fatal: not a git repository: '.git'\n  not ok 6 - symbolic-ref can be deleted\n  #\t\n  #\t\tgit symbolic-ref NOTHEAD refs/heads/foo &&\n  #\t\tgit symbolic-ref -d NOTHEAD &&\n  #\t\ttest_path_is_file .git/refs/heads/foo &&\n  #\t\ttest_path_is_missing .git/NOTHEAD\n  #\t\n  fatal: not a git repository: '.git'\n  ok 7 - symbolic-ref can delete dangling symref\n  fatal: not a git repository: '.git'\n  ok 8 - symbolic-ref fails to delete missing FOO\n  fatal: not a git repository: '.git'\n  not ok 9 - symbolic-ref fails to delete real ref\n  #\t\n  #\t\techo \"fatal: Cannot delete refs/heads/foo, not a symbolic ref\" >expect &&\n  #\t\ttest_must_fail git symbolic-ref -d refs/heads/foo >actual 2>&1 &&\n  #\t\tgit rev-parse --verify refs/heads/foo &&\n  #\t\ttest_cmp expect actual\n  #\t\n  fatal: not a git repository: '.git'\n  ok 10 - create large ref name\n  ok 11 - symbolic-ref can point to large ref name\n  ok 12 - we can parse long symbolic ref\n  not ok 13 - symbolic-ref reports failure in exit code\n  #\t\n  #\t\ttest_when_finished \"rm -f .git/HEAD.lock\" &&\n  #\t\t>.git/HEAD.lock &&\n  #\t\ttest_must_fail git symbolic-ref HEAD refs/heads/whatever\n  #\t\n  not ok 14 - symbolic-ref writes reflog entry\n  #\t\n  #\t\tgit checkout -b log1 &&\n  #\t\ttest_commit one &&\n  #\t\tgit checkout -b log2  &&\n  #\t\ttest_commit two &&\n  #\t\tgit checkout --orphan orphan &&\n  #\t\tgit symbolic-ref -m create HEAD refs/heads/log1 &&\n  #\t\tgit symbolic-ref -m update HEAD refs/heads/log2 &&\n  #\t\tcat >expect <<-\\EOF &&\n  #\t\tupdate\n  #\t\tcreate\n  #\t\tEOF\n  #\t\tgit log --format=%gs -g -2 >actual &&\n  #\t\ttest_cmp expect actual\n  #\t\n  not ok 15 - symbolic-ref does not create ref d/f conflicts\n  #\t\n  #\t\tgit checkout -b df &&\n  #\t\ttest_commit df &&\n  #\t\ttest_must_fail git symbolic-ref refs/heads/df/conflict refs/heads/df &&\n  #\t\tgit pack-refs --all --prune &&\n  #\t\ttest_must_fail git symbolic-ref refs/heads/df/conflict refs/heads/df\n  #\t\n  not ok 16 - symbolic-ref can overwrite pointer to invalid name\n  #\t\n  #\t\ttest_when_finished reset_to_sane &&\n  #\t\thead=$(git rev-parse HEAD) &&\n  #\t\tgit symbolic-ref HEAD refs/heads/outer &&\n  #\t\ttest_when_finished \"git update-ref -d refs/heads/outer/inner\" &&\n  #\t\tgit update-ref refs/heads/outer/inner $head &&\n  #\t\tgit symbolic-ref HEAD refs/heads/unrelated\n  #\t\n  not ok 17 - symbolic-ref can resolve d/f name (EISDIR)\n  #\t\n  #\t\ttest_when_finished reset_to_sane &&\n  #\t\thead=$(git rev-parse HEAD) &&\n  #\t\tgit symbolic-ref HEAD refs/heads/outer/inner &&\n  #\t\ttest_when_finished \"git update-ref -d refs/heads/outer\" &&\n  #\t\tgit update-ref refs/heads/outer $head &&\n  #\t\techo refs/heads/outer/inner >expect &&\n  #\t\tgit symbolic-ref HEAD >actual &&\n  #\t\ttest_cmp expect actual\n  #\t\n  not ok 18 - symbolic-ref can resolve d/f name (ENOTDIR)\n  #\t\n  #\t\ttest_when_finished reset_to_sane &&\n  #\t\thead=$(git rev-parse HEAD) &&\n  #\t\tgit symbolic-ref HEAD refs/heads/outer &&\n  #\t\ttest_when_finished \"git update-ref -d refs/heads/outer/inner\" &&\n  #\t\tgit update-ref refs/heads/outer/inner $head &&\n  #\t\techo refs/heads/outer >expect &&\n  #\t\tgit symbolic-ref HEAD >actual &&\n  #\t\ttest_cmp expect actual\n  #\t\n  # failed 10 among 18 test(s)\n  1..18\n\nUh-oh, a lot more tests failes, and, much worse!, my git repo is now\non a different and orphaned branch:\n\n  ~/src/git/t (df *+)$ git status \n  On branch df\n  \n  No commits yet\n  \n  Changes to be committed:\n  [...]\n\n> I see it as the test writer's job to clean up to the extent that\n> git-symbolic-ref can reset to a sane state.\n\nNo, it's the job of whoever updates the cleanup routine to make sure\nthat the updated cleanup routine still works just as well as it did in\nthe past.\n\n> We could reset back to a known state in a more drastic manner\n> (extracting .git from a tar archive), but that could interfere with\n> the test functions if they're not isolated from each other.\n\n\n\n"},{"id":"422731","messageId":"CAFQ2z_NgFC-7zENyD7HkEgvS6Dtc4qYqPRFL3m1LsbXnrFkPsA@mail.gmail.com","threadId":"55516","inReplyTo":"20210423051255.GD2947267@szeder.dev","subject":"Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-04-23T07:47:50Z","receivedAt":"2021-04-23T07:48:05Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Fri, Apr 23, 2021 at 7:12 AM SZEDER Gábor <szeder.dev@gmail.com> wrote:\n> > I see it as the test writer's job to clean up to the extent that\n> > git-symbolic-ref can reset to a sane state.\n>\n> No, it's the job of whoever updates the cleanup routine to make sure\n> that the updated cleanup routine still works just as well as it did in\n> the past.\n\nSorry, I don't mean to shirk my responsibility. What I mean is: is\nthere a way to signal \"This test is fubar. Stop further execution of\ntest shell script\".\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"422732","messageId":"CAFQ2z_N9_eXtuGcXSj1bwP5sy+t1fn8Q=X1na0jK9OpzDz2UAA@mail.gmail.com","threadId":"55516","inReplyTo":"CAFQ2z_NgFC-7zENyD7HkEgvS6Dtc4qYqPRFL3m1LsbXnrFkPsA@mail.gmail.com","subject":"Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-04-23T07:53:12Z","receivedAt":"2021-04-23T07:53:33Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Fri, Apr 23, 2021 at 9:47 AM Han-Wen Nienhuys <hanwen@google.com> wrote:\n>\n> On Fri, Apr 23, 2021 at 7:12 AM SZEDER Gábor <szeder.dev@gmail.com> wrote:\n> > > I see it as the test writer's job to clean up to the extent that\n> > > git-symbolic-ref can reset to a sane state.\n> >\n> > No, it's the job of whoever updates the cleanup routine to make sure\n> > that the updated cleanup routine still works just as well as it did in\n> > the past.\n>\n> Sorry, I don't mean to shirk my responsibility. What I mean is: is\n> there a way to signal \"This test is fubar. Stop further execution of\n> test shell script\".\n\nOr, more generally: if a cleanup routine fails, what is the point of\ncontinuing to run the test script? If that happens, the test directory\nis an indeterminate state, so the outcome of follow-on test-functions\nis indeterminate as well.\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"422736","messageId":"87mttp1hv3.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"CAFQ2z_N9_eXtuGcXSj1bwP5sy+t1fn8Q=X1na0jK9OpzDz2UAA@mail.gmail.com","subject":"Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-04-23T09:16:00Z","receivedAt":"2021-04-23T09:16:05Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Fri, Apr 23 2021, Han-Wen Nienhuys wrote:\n\n> On Fri, Apr 23, 2021 at 9:47 AM Han-Wen Nienhuys <hanwen@google.com> wrote:\n>>\n>> On Fri, Apr 23, 2021 at 7:12 AM SZEDER Gábor <szeder.dev@gmail.com> wrote:\n>> > > I see it as the test writer's job to clean up to the extent that\n>> > > git-symbolic-ref can reset to a sane state.\n>> >\n>> > No, it's the job of whoever updates the cleanup routine to make sure\n>> > that the updated cleanup routine still works just as well as it did in\n>> > the past.\n>>\n>> Sorry, I don't mean to shirk my responsibility. What I mean is: is\n>> there a way to signal \"This test is fubar. Stop further execution of\n>> test shell script\".\n>\n> Or, more generally: if a cleanup routine fails, what is the point of\n> continuing to run the test script? If that happens, the test directory\n> is an indeterminate state, so the outcome of follow-on test-functions\n> is indeterminate as well.\n\nIt's not a cleanup routine that's failing, but potentially the \"setup\nthe next test\" routine.\n\nIn this case it's probably best to invert the logic, i.e. to make the\ntests do:\n\n\ttest_when_finished \"rm -rf copy\" &&\t\n\tgit clone . copy &&\n\t<test-logic>\n\nRather than:\n\n\treset_state &&\n\t<test-logic>\n\nThat also makes it more obvious what's setup and what/where tests rely\non things carried forward from previous tests.\n\nThis test is just written in a style that I think it's fair to say\nwouldn't pass review today. E.g. if you skip the first N tests we do\nthat resetting N times redundantly without any need for it. The pattern\nof moving state setup & teardown into individual tests is better.\n\t\n"},{"id":"422921","messageId":"CAFQ2z_MMiFgo3jCAgRUcuaaHphHYXgNCJiq8-y+aY874FF-9dg@mail.gmail.com","threadId":"55516","inReplyTo":"xmqqo8e81q9p.fsf@gitster.g","subject":"Re: [PATCH 10/18] test-lib: provide test prereq REFFILES","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-04-26T11:09:04Z","receivedAt":"2021-04-26T11:09:19Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Wed, Apr 21, 2021 at 1:37 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n> > \"Han-Wen Nienhuys via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n> >\n> >> From: Han-Wen Nienhuys <hanwen@google.com>\n> >>\n> >> REFFILES can be used to mark tests that are specific to the packed/loose ref\n> >> storage format and its limitations. Marking such tests is a preparation for\n> >> introducing the reftable storage backend.\n> >\n> > We'd want a bit of documentation either here or in t/README to\n> > explain things like how these two interact with each other, if both\n> > can be active at the same time, etc.\n>\n> By \"here\", I meant the place in the code where the test_set_prereq\n> was added, not in the proposed log message that will become hard to\n> see when test writers need to work with the sources.\n\nBut this doc would be part of the reftable series, not this series, right?\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"422990","messageId":"CAFQ2z_NU3z=dxiqvYDtM7UGwMCdBA1pHq5UjPMERwa6F5xOW-A@mail.gmail.com","threadId":"55516","inReplyTo":"87bla83y7i.fsf@evledraar.gmail.com","subject":"Re: [PATCH 18/18] t1415: set REFFILES for test specific to storage format","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-04-26T17:41:45Z","receivedAt":"2021-04-26T17:42:00Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Wed, Apr 21, 2021 at 9:15 AM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n>\n>\n> On Mon, Apr 19 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n>\n> > From: Han-Wen Nienhuys <hanwen@google.com>\n> >\n> > Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> > ---\n> >  t/t1415-worktree-refs.sh | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> >\n> > diff --git a/t/t1415-worktree-refs.sh b/t/t1415-worktree-refs.sh\n> > index 7ab91241ab7c..a8083a0af3af 100755\n> > --- a/t/t1415-worktree-refs.sh\n> > +++ b/t/t1415-worktree-refs.sh\n> > @@ -16,7 +16,7 @@ test_expect_success 'setup' '\n> >       git -C wt2 update-ref refs/worktree/foo HEAD\n> >  '\n> >\n> > -test_expect_success 'refs/worktree must not be packed' '\n> > +test_expect_success REFFILES 'refs/worktree must not be packed' '\n> >       git pack-refs --all &&\n> >       test_path_is_missing .git/refs/tags/wt1 &&\n> >       test_path_is_file .git/refs/worktree/foo &&\n>\n> So a naïve:\n>\n>     diff --git a/refs/files-backend.c b/refs/files-backend.c\n>     index 3f29f8c143..01e2dc8bc3 100644\n>     --- a/refs/files-backend.c\n>     +++ b/refs/files-backend.c\n>     @@ -212,7 +212,7 @@ static void files_ref_path(struct files_ref_store *refs,\n>       */\n>      static void add_per_worktree_entries_to_dir(struct ref_dir *dir, const char *dirname)\n>      {\n>     -       const char *prefixes[] = { \"refs/bisect/\", \"refs/worktree/\", \"refs/rewritten/\" };\n>     +       const char *prefixes[] = { \"refs/bisect/\", \"refs/rewritten/\" };\n>             int ip;\n>\n>             if (strcmp(dirname, \"refs/\"))\n>\n> Will fail the test under non-reftable, i.e. we somehow conflate \"is\n> packed\" with correctly discovering these refs?\n\nAFAICT, what happens is that the packed-refs file is shared across all\nworktrees, so refs that are per worktree should not be stored there. I\nthink that is what the test is trying to assert.\n\n> A discussion of how\n> 8aff1a9ca5 (Add a place for (not) sharing stuff between worktrees,\n> 2018-09-29) relates to reftable would be valuable here.\n\nreftable handles this slightly differently. I added a comment to\nreftable-backend.c about this.\n\n> But on the tip of \"seen\" currently this test fails entirely with\n> GIT_TEST_REFTABLE=true, so I'm not sure if it got rid of the need for\n> this abstraction in the files backend or what...\n\nBefore splitting the series into two (git support and test fixups),\nall of these changes reduced the number of test breakages.\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"422991","messageId":"CAFQ2z_PhxR+mhfAwvW1jMUSNeF=gQ3Xg-qsX0yK+7YPc7XQNYg@mail.gmail.com","threadId":"55516","inReplyTo":"xmqq5z0g36m9.fsf@gitster.g","subject":"Re: [PATCH 16/18] t7003: check reflog existence only for REFFILES","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-04-26T17:42:03Z","receivedAt":"2021-04-26T17:42:18Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Wed, Apr 21, 2021 at 12:59 AM Junio C Hamano <gitster@pobox.com> wrote:\n\n> >       git branch prune-entire B &&\n> >       git filter-branch -f --prune-empty --index-filter \"git update-index --remove A.t B.t\" prune-entire &&\n> >       test_must_fail git rev-parse refs/heads/prune-entire &&\n> > -     test_must_fail git reflog exists refs/heads/prune-entire\n> > +     if test_have_prereq REFFILES ; then\n> > +             test_must_fail git reflog exists refs/heads/prune-entire\n> > +     fi\n>\n> Style.  Replace \" ; \" with a LF and necessary number of tabs.\n\nDone.\n\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"423024","messageId":"CAFQ2z_MLSb1kv42KcjWvWNy1FkmKiMiAtB_7VTc2TDgNKP1HfA@mail.gmail.com","threadId":"55516","inReplyTo":"87mttp1hv3.fsf@evledraar.gmail.com","subject":"Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-04-26T18:01:21Z","receivedAt":"2021-04-26T18:01:43Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Fri, Apr 23, 2021 at 11:16 AM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> It's not a cleanup routine that's failing, but potentially the \"setup\n> the next test\" routine.\n>\n> In this case it's probably best to invert the logic, i.e. to make the\n> tests do:\n>\n>         test_when_finished \"rm -rf copy\" &&\n>         git clone . copy &&\n>         <test-logic>\n>\n> Rather than:\n>\n>         reset_state &&\n>         <test-logic>\n>\n> That also makes it more obvious what's setup and what/where tests rely\n> on things carried forward from previous tests.\n\nI'm using $TAR to recreate the repo scratch now. It appears to work.\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"423025","messageId":"CAFQ2z_Ogj__y5-=Re+WOvE12rnMU4OmF9_9wfq+U20bL-xSWZg@mail.gmail.com","threadId":"55516","inReplyTo":"87eef43yjq.fsf@evledraar.gmail.com","subject":"Re: [PATCH 17/18] t4202: mark bogus head hash test with REFFILES","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-04-26T18:02:43Z","receivedAt":"2021-04-26T18:03:03Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Wed, Apr 21, 2021 at 9:08 AM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> > In reftable, hashes are correctly formed by design\n>\n> With the file backend this hits this in revision.c:\n>\n>         if (!refname || !(flags & REF_ISSYMREF) || (flags & REF_ISBROKEN))\n>                 die(_(\"your current branch appears to be broken\"));\n>\n> There's a REF_ISBROKEN is the reftable code, so is hitting this codepath\n> impossible under reftable and therefore we won't need this test at all?\n\nI've removed the REF_ISBROKEN bit. It would only trigger in case of\nunknown record_types, and I made it a BUG instead.\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"423026","messageId":"CAFQ2z_M-ahhbgnvpTXhs3nR0KJKqHtE7snqrpzi_O-M1sVCfaQ@mail.gmail.com","threadId":"55516","inReplyTo":"87mtts3z2a.fsf@evledraar.gmail.com","subject":"Re: [PATCH 14/18] t1404: mark tests that muck with .git directly as REFFILES.","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-04-26T18:36:41Z","receivedAt":"2021-04-26T18:37:01Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Wed, Apr 21, 2021 at 8:57 AM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> > -test_expect_success 'broken reference blocks create' '\n> > +test_expect_success REFFILES 'broken reference blocks create' '\n> >       prefix=refs/broken-create &&\n> >       mkdir -p .git/$prefix &&\n> >       echo \"gobbledigook\" >.git/$prefix/foo &&\n> > @@ -504,7 +504,7 @@ test_expect_success 'broken reference blocks create' '\n> >       test_cmp expected output.err\n> >  '\n>\n> This doesn't seem specific to the files backend at all. I.e. if you grep\n> for \"reference broken\" in the file backends you'll find EINVAL and\n> REF_ISBROKEN handling, and your refs/reftable-backend.c has the same\n> exception handling, so presumably we can end up with broken refs.\n\nI think it's not possible. In the files backend a broken ref is a\nshortread (less than 40 digits hex) or garbage following the hex (or\nmaybe non-hex digits). This is all impossible with reftable.\n\nI've removed EINVAL from reftable-backend.c\n\nIt's possible to have a corrupt reftable file, but that would surface\nas  REFTABLE_FORMAT_ERROR, and is morally equivalent to an I/O error.\nI added a test for this; it says:\n\n++ git update-ref refs/heads/main 69af1687b671131ed0cfa61b7fcdc907a4c21f2c\nfatal: update_ref failed for ref 'refs/heads/main': reftable:\ntransaction prepare: corrupt reftable file\n\n> Anyway, much of reviewing this commit was trying to rediscover thing\n> that should really be in the commit message. Presumably you had to run\n> blame, log etc. to find the commits from Michael Haggerty and dig into\n> if they were relevant to reftable. Having that information in the commit\n> message would be *very* helpful.\n\nI added some more explanation. I did not dig into the history or the\nblame, as the tests seem relevant given what I know about how the\nfiles backend works, but for that same reason irrelevant to reftable.\nMaybe it should be documented more explicitly how the files backend\nworks?\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"423066","messageId":"CAFQ2z_ObrsJ+SgvY8s0_ba-8aZxLwvXujT9ERPRnC_oAhJs+Zg@mail.gmail.com","threadId":"55516","inReplyTo":"20210419203835.GW2947267@szeder.dev","subject":"Re: [PATCH 04/18] t1401-symbolic-ref: avoid direct filesystem access","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-04-27T09:13:29Z","receivedAt":"2021-04-27T09:13:44Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Mon, Apr 19, 2021 at 10:38 PM SZEDER Gábor <szeder.dev@gmail.com> wrote:\n> > +     git symbolic-ref HEAD > actual &&\n>\n> Style nit: no space between redirection and filename, i.e. these\n> should be '>expect' and '>actual'.\n\nDone\n\n> > +     ! git symbolic-ref NOTHEAD\n>\n> Please use 'test_must_fail git ...', because otherwise a segfault\n> could go unnoticed.\n\nDone.\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"423067","messageId":"CAFQ2z_MzjQyaqCkoy7mpwf+gFVmFktaSiPdQc8KbyAKGNkPb2w@mail.gmail.com","threadId":"55516","inReplyTo":"20210419211108.GX2947267@szeder.dev","subject":"Re: [PATCH 01/18] t4202: split testcase for invalid HEAD symref and HEAD hash","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-04-27T09:14:17Z","receivedAt":"2021-04-27T09:14:33Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Mon, Apr 19, 2021 at 11:11 PM SZEDER Gábor <szeder.dev@gmail.com> wrote:\n> > +test_expect_success 'log diagnoses bogus HEAD symref' '\n> > +     git init empty &&\n>\n> ... and this test create a new repo in 'empty' as well.  Or rather\n> re-initializes the already existing repository there.\n>\n> Is this intentional?  It surely cases some confusion.\n\nfixed.\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"423068","messageId":"CAFQ2z_MugeKxFbbLAoV1Ax3sQZRpkesvUk4zUYwivbcrE2od6g@mail.gmail.com","threadId":"55516","inReplyTo":"xmqqfszk36z8.fsf@gitster.g","subject":"Re: [PATCH 05/18] t1413: use tar to save and restore entire .git directory","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-04-27T09:15:16Z","receivedAt":"2021-04-27T09:15:34Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Wed, Apr 21, 2021 at 12:51 AM Junio C Hamano <gitster@pobox.com> wrote:\n\n> > +     rm -rf .git && tar -xf .git-saved.tar\n>\n> Unlike GNUism longer option names like \"tar --extract\", you do not\n> need a single dash when you ask \"tar xf\" (see our Makefile).\n>\n> Looking at t/t5000-tar-tree.sh, we seem to be supposed to use \"$TAR\"\n> (with double quotes) to name the tar utility, so that people can say\n> TAR=gtar on certain platforms.  I suspect that there already are a\n> few existing violations but let's not make it worse.\n\nDone.\n\n\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"423069","messageId":"CAFQ2z_PNYG9sT8HjmQYVfw0--QE3m3+iTw=c5Rum6LHe+SxJEw@mail.gmail.com","threadId":"55516","inReplyTo":"xmqqa6ps36ow.fsf@gitster.g","subject":"Re: [PATCH 10/18] test-lib: provide test prereq REFFILES","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-04-27T09:16:04Z","receivedAt":"2021-04-27T09:16:24Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Wed, Apr 21, 2021 at 12:57 AM Junio C Hamano <gitster@pobox.com> wrote:\n> > REFFILES can be used to mark tests that are specific to the packed/loose ref\n> > storage format and its limitations. Marking such tests is a preparation for\n> > introducing the reftable storage backend.\n>\n> We'd want a bit of documentation either here or in t/README to\n> explain things like how these two interact with each other, if both\n> can be active at the same time, etc.\n\nDocumented the prereq in README.\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"423070","messageId":"CAFQ2z_NohJhKFXnivWCMOU8KYW4mQ-vgTZhdchJadcCuMe=e+w@mail.gmail.com","threadId":"55516","inReplyTo":"xmqq5z0g36m9.fsf@gitster.g","subject":"Re: [PATCH 16/18] t7003: check reflog existence only for REFFILES","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-04-27T09:17:11Z","receivedAt":"2021-04-27T09:17:38Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Wed, Apr 21, 2021 at 12:59 AM Junio C Hamano <gitster@pobox.com> wrote:\n> > diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\n> > index cf30055c88dd..380bdf934317 100755\n> > --- a/t/t7003-filter-branch.sh\n> > +++ b/t/t7003-filter-branch.sh\n> > @@ -396,7 +396,9 @@ test_expect_success '--prune-empty is able to prune entire branch' '\n> >       git branch prune-entire B &&\n> >       git filter-branch -f --prune-empty --index-filter \"git update-index --remove A.t B.t\" prune-entire &&\n> >       test_must_fail git rev-parse refs/heads/prune-entire &&\n> > -     test_must_fail git reflog exists refs/heads/prune-entire\n> > +     if test_have_prereq REFFILES ; then\n> > +             test_must_fail git reflog exists refs/heads/prune-entire\n> > +     fi\n>\n> Style.  Replace \" ; \" with a LF and necessary number of tabs.\n\nDon.e\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"423071","messageId":"CAFQ2z_OmjgWd-nrNSOS_QfcfXQ=rNT8_sXymYk6fvLH8iCQ3YA@mail.gmail.com","threadId":"55516","inReplyTo":"87k0ow2n29.fsf@evledraar.gmail.com","subject":"Re: [PATCH 02/18] t9300: check ref existence using git-rev-parse rather than FS check","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-04-27T09:20:37Z","receivedAt":"2021-04-27T09:20:54Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Wed, Apr 21, 2021 at 8:01 AM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> It seems to me that this breaks the test, to the extent that it's\n> testing something we care about at all.\n>\n> I.e. reading ea08a6fd19 (Actually allow TAG_FIXUP branches in\n> fast-import, 2007-08-02) the whole point is to test that a \"TEMP_TAG\"\n> ref is accepted by fast-import, as opposed to \"refs/heads/TEMP_TAG\".\n\nI've changed it to use the test-tool instead, which doesn't search for refs.\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"423072","messageId":"CAFQ2z_O4ybpnnzDhRzbXfdfB6LoEEaFLhAURspZqZn0DDeh4fQ@mail.gmail.com","threadId":"55516","inReplyTo":"87y2dc4164.fsf@evledraar.gmail.com","subject":"Re: [PATCH 07/18] t5000: inspect HEAD using git-rev-parse","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-04-27T09:22:07Z","receivedAt":"2021-04-27T09:22:23Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Wed, Apr 21, 2021 at 8:11 AM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> If we're doing a \"re-style while we're at it\" s/<spaces>/<tabs>/ let's\n> just go all the way and convert it to a more modern style of:\n>\n> test_expect_success 'git get-tar-commit-id' '\n\n> But maybe such re-styling would be best left alone, and just a narrow\n> change of the needed code. There's various surrounding tests in the file\n> that use the same style, unless we're going to re-style all of them....\n\nThe file wasn't style-consistent to begin with, but I've added a\ncommit that restyles the rest of the file.\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\nRegistergericht und -nummer: Hamburg, HRB 86891\nSitz der Gesellschaft: Hamburg\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"423073","messageId":"CAFQ2z_PDpquxUDzFuZBE+TJZWEkP2A-xTC1-nhkQ9+AGQthXsg@mail.gmail.com","threadId":"55516","inReplyTo":"87v98g413h.fsf@evledraar.gmail.com","subject":"Re: [PATCH 09/18] t5304: use \"reflog expire --all\" to clear the reflog","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-04-27T09:23:02Z","receivedAt":"2021-04-27T09:23:18Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Wed, Apr 21, 2021 at 8:13 AM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> >  test_expect_success 'prune: prune unreachable heads' '\n> > -\n>\n> Similar to a previous comments, a few tests in that file use this\n> whitespacing. I'd say let's just leave it alone unlress we're doing some\n> whitespace-only commit earlier.\n\nDone.\n\n> >       git config core.logAllRefUpdates false &&\n> > -     mv .git/logs .git/logs.old &&\n> >       : > file2 &&\n>\n> Also, if we're re-styling things: \">foo\" instead of \": >foo\".\n\nDone.\n\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"423074","messageId":"CAFQ2z_NxM=Bkjb1rVo0eBpMUHP7fYN6mjTh3U1A=qmkVa9eXQw@mail.gmail.com","threadId":"55516","inReplyTo":"87sg3k40mc.fsf@evledraar.gmail.com","subject":"Re: [PATCH 11/18] t1407: require REFFILES for for_each_reflog test","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-04-27T09:27:05Z","receivedAt":"2021-04-27T09:27:20Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Wed, Apr 21, 2021 at 8:23 AM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> > -test_expect_success 'for_each_reflog()' '\n> > +test_expect_success REFFILES 'for_each_reflog()' '\n> >       echo $ZERO_OID > .git/logs/PSEUDO-MAIN &&\n> >       mkdir -p     .git/logs/refs/bisect &&\n> >       echo $ZERO_OID > .git/logs/refs/bisect/random &&\n>\n> Hrm, so already the first use of REFFILES has me questioning the need\n> for it.\n>\n> I mean obviously this depends on ref-files in the strict sense.\n>\n> ..\n>\n>  * We have a PSEUDO-MAIN ref\n>  * It's set to $ZERO_OID\n>  * We have a $ZERO_OID in a refs/bisect/random\n\nI've added some comments about what is happening here. The $ZERO_OID\nis irrelevant here. The test tries to verify that a per-worktree ref\nonly appears in output of an invocation from that worktree. It's a\nuseful test, but this needs to be tested in an entirely different way.\n(looks like setting logAllRefUpdates also doesn't trigger creating\nreflogs for pseudorefs.)\n\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"423075","messageId":"CAFQ2z_O=aHW=fwwdCmyN-bMeuwBeLM_pLBNr7xhjP+M7e=k70g@mail.gmail.com","threadId":"55516","inReplyTo":"87k0ow3yvq.fsf@evledraar.gmail.com","subject":"Re: [PATCH 15/18] t7900: mark pack-refs tests as REFFILES","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-04-27T09:41:18Z","receivedAt":"2021-04-27T09:41:33Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Wed, Apr 21, 2021 at 9:00 AM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> Re [1] maybe this is ok/fine for now, but I think we should really split\n> out the \"is specific to file\" part more narrowly (not just here, but in\n> general).\n>\n> E.g. I assume that \"pack-refs\" is simply redundant under reftable, no?\n\n\nI've expanded on the commit message to clarify this.\n\n> Should the current behavior documented in\n> Documentation/git-maintenance.txt change with your series under reftable\n> etc?\n\nNo, not for now. Once the reftable support is landed, we could update\nthe docs to not talk about loose vs packed refs, but that seems\npremature at the moment.\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"423078","messageId":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.git.git.1618829583.gitgitgadget@gmail.com","subject":"[PATCH v2 00/21] Prepare tests for reftable backend","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:01Z","receivedAt":"2021-04-27T10:38:55Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"Rewrites some tests to avoid direct filesystem access.\n\nIntroduces the test prereq REFFILES to mark other tests that depend on\nspecifics of the files ref backend.\n\nchanges in v2 (relative to v1 from Apr 19)\n\n * t9300: use ref-store test-helper to read toplevel tag.\n * t1401: use $TAR for restoring.\n * t1407: clarify what test is doing.\n * t1417: \"$TAR\" rather than tar\n * t1415: clarify test objective.\n * t7003: formatting.\n * README entry for REFFILES.\n\ncc: SZEDER Gábor szeder.dev@gmail.com cc: Ævar Arnfjörð Bjarmason\navarab@gmail.com cc: Han-Wen Nienhuys hanwen@google.com\n\ncc: Han-Wen Nienhuys hanwen@google.com\n\nHan-Wen Nienhuys (21):\n  t4202: split testcase for invalid HEAD symref and HEAD hash\n  t/helper/ref-store: initialize oid in resolve-ref\n  t9300: check ref existence using test-helper rather than a file system\n    check\n  t5601: read HEAD using rev-parse\n  t1401-symbolic-ref: avoid direct filesystem access\n  t1413: use tar to save and restore entire .git directory\n  t1301: fix typo in error message\n  t5000: reformat indentation to the latest fashion\n  t5000: inspect HEAD using git-rev-parse\n  t7003: use rev-parse rather than FS inspection\n  t5304: restyle: trim empty lines, drop ':' before >\n  t5304: use \"reflog expire --all\" to clear the reflog\n  test-lib: provide test prereq REFFILES\n  t1407: require REFFILES for for_each_reflog test\n  t1414: mark corruption test with REFFILES\n  t2017: mark --orphan/logAllRefUpdates=false test as REFFILES\n  t1404: mark tests that muck with .git directly as REFFILES.\n  t7900: mark pack-refs tests as REFFILES\n  t7003: check reflog existence only for REFFILES\n  t4202: mark bogus head hash test with REFFILES\n  t1415: set REFFILES for test specific to storage format\n\n t/README                      |   6 ++\n t/helper/test-ref-store.c     |   2 +-\n t/t1301-shared-repo.sh        |   2 +-\n t/t1401-symbolic-ref.sh       |  34 +++++-----\n t/t1404-update-ref-errors.sh  |  30 ++++-----\n t/t1407-worktree-ref-store.sh |   9 ++-\n t/t1413-reflog-detach.sh      |   5 +-\n t/t1414-reflog-walk.sh        |   2 +-\n t/t1415-worktree-refs.sh      |   5 +-\n t/t2017-checkout-orphan.sh    |   2 +-\n t/t4202-log.sh                |  10 ++-\n t/t5000-tar-tree.sh           | 113 +++++++++++++++++-----------------\n t/t5304-prune.sh              |  83 ++++++++-----------------\n t/t5601-clone.sh              |   3 +-\n t/t7003-filter-branch.sh      |   7 ++-\n t/t7900-maintenance.sh        |   2 +-\n t/t9300-fast-import.sh        |   2 +-\n t/test-lib.sh                 |   2 +\n 18 files changed, 156 insertions(+), 163 deletions(-)\n\n\nbase-commit: 311531c9de557d25ac087c1637818bd2aad6eb3a\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1008%2Fhanwen%2Freffiles-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1008/hanwen/reffiles-v2\nPull-Request: https://github.com/git/git/pull/1008\n\nRange-diff vs v1:\n\n  1:  91ef012cbcc9 !  1:  8ad4a35cda70 t4202: split testcase for invalid HEAD symref and HEAD hash\n     @@ t/t4202-log.sh: test_expect_success 'log --graph --no-walk is forbidden' '\n      +\ttest_i18ngrep broken stderr'\n      +\n      +test_expect_success 'log diagnoses bogus HEAD symref' '\n     ++\trm -rf empty &&\n      +\tgit init empty &&\n      +\tgit --git-dir empty/.git symbolic-ref HEAD refs/heads/invalid.lock &&\n       \ttest_must_fail git -C empty log 2>stderr &&\n  -:  ------------ >  2:  e6222944a3eb t/helper/ref-store: initialize oid in resolve-ref\n  2:  ccc26a8950be !  3:  c5855b0caa73 t9300: check ref existence using git-rev-parse rather than FS check\n     @@ Metadata\n      Author: Han-Wen Nienhuys <hanwen@google.com>\n      \n       ## Commit message ##\n     -    t9300: check ref existence using git-rev-parse rather than FS check\n     +    t9300: check ref existence using test-helper rather than a file system check\n      \n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n      \n     @@ t/t9300-fast-import.sh: test_expect_success 'B: accept branch name \"TEMP_TAG\"' '\n       \t\tgit prune\" &&\n       \tgit fast-import <input &&\n      -\ttest -f .git/TEMP_TAG &&\n     -+\tgit rev-parse TEMP_TAG &&\n     ++\ttest $(test-tool ref-store main resolve-ref TEMP_TAG 0 | cut -f1 -d \" \" ) != \"$ZERO_OID\" &&\n       \ttest $(git rev-parse main) = $(git rev-parse TEMP_TAG^)\n       '\n       \n  3:  47b5ec56a383 =  4:  369c968ab837 t5601: read HEAD using rev-parse\n  4:  53cf1069552b !  5:  248d9ffe7927 t1401-symbolic-ref: avoid direct filesystem access\n     @@ Commit message\n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n      \n       ## t/t1401-symbolic-ref.sh ##\n     -@@ t/t1401-symbolic-ref.sh: test_description='basic symbolic-ref tests'\n     - # the git repo, meaning that further tests will operate on\n     - # the surrounding git repo instead of the trash directory.\n     - reset_to_sane() {\n     --\techo ref: refs/heads/foo >.git/HEAD\n     -+\tgit --git-dir .git symbolic-ref HEAD refs/heads/foo\n     - }\n     +@@\n     + test_description='basic symbolic-ref tests'\n     + . ./test-lib.sh\n       \n     +-# If the tests munging HEAD fail, they can break detection of\n     +-# the git repo, meaning that further tests will operate on\n     +-# the surrounding git repo instead of the trash directory.\n     +-reset_to_sane() {\n     +-\techo ref: refs/heads/foo >.git/HEAD\n     +-}\n     +-\n      -test_expect_success 'symbolic-ref writes HEAD' '\n     --\tgit symbolic-ref HEAD refs/heads/foo &&\n     ++test_expect_success 'setup' '\n     + \tgit symbolic-ref HEAD refs/heads/foo &&\n      -\techo ref: refs/heads/foo >expect &&\n      -\ttest_cmp expect .git/HEAD\n     --'\n     --\n     ++\ttest_commit file &&\n     ++\t\"$TAR\" cf .git.tar .git/\n     + '\n     + \n      -test_expect_success 'symbolic-ref reads HEAD' '\n      -\techo refs/heads/foo >expect &&\n     --\tgit symbolic-ref HEAD >actual &&\n     ++reset_to_sane() {\n     ++\trm -rf .git &&\n     ++\t\"$TAR\" xf .git.tar\n     ++}\n     ++\n      +test_expect_success 'symbolic-ref read/write roundtrip' '\n      +\tgit symbolic-ref HEAD refs/heads/read-write-roundtrip &&\n     -+\techo refs/heads/read-write-roundtrip > expect &&\n     -+\tgit symbolic-ref HEAD > actual &&\n     ++\techo refs/heads/read-write-roundtrip >expect &&\n     + \tgit symbolic-ref HEAD >actual &&\n       \ttest_cmp expect actual\n       '\n     +@@ t/t1401-symbolic-ref.sh: test_expect_success 'symbolic-ref reads HEAD' '\n     + test_expect_success 'symbolic-ref refuses non-ref for HEAD' '\n     + \ttest_must_fail git symbolic-ref HEAD foo\n     + '\n     ++\n     + reset_to_sane\n     + \n     + test_expect_success 'symbolic-ref refuses bare sha1' '\n     +-\techo content >file && git add file && git commit -m one &&\n     + \ttest_must_fail git symbolic-ref HEAD $(git rev-parse HEAD)\n     + '\n     ++\n     + reset_to_sane\n       \n     + test_expect_success 'HEAD cannot be removed' '\n      @@ t/t1401-symbolic-ref.sh: reset_to_sane\n       test_expect_success 'symbolic-ref can be deleted' '\n       \tgit symbolic-ref NOTHEAD refs/heads/foo &&\n     @@ t/t1401-symbolic-ref.sh: reset_to_sane\n      -\ttest_path_is_file .git/refs/heads/foo &&\n      -\ttest_path_is_missing .git/NOTHEAD\n      +\tgit rev-parse refs/heads/foo &&\n     -+\t! git symbolic-ref NOTHEAD\n     ++\ttest_must_fail git symbolic-ref NOTHEAD\n       '\n       reset_to_sane\n       \n     @@ t/t1401-symbolic-ref.sh: reset_to_sane\n       \tgit symbolic-ref -d NOTHEAD &&\n      -\ttest_path_is_missing .git/refs/heads/missing &&\n      -\ttest_path_is_missing .git/NOTHEAD\n     -+\t! git rev-parse refs/heads/missing &&\n     -+\t! git symbolic-ref NOTHEAD\n     ++\ttest_must_fail git rev-parse refs/heads/missing &&\n     ++\ttest_must_fail git symbolic-ref NOTHEAD\n       '\n       reset_to_sane\n       \n  5:  223583594c00 !  6:  e4e8fc1d4b4f t1413: use tar to save and restore entire .git directory\n     @@ t/t1413-reflog-detach.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n       reset_state () {\n      -\tgit checkout main &&\n      -\tcp saved_reflog .git/logs/HEAD\n     -+\trm -rf .git && tar -xf .git-saved.tar\n     ++\trm -rf .git && \"$TAR\" xf .git-saved.tar\n       }\n       \n       test_expect_success setup '\n     @@ t/t1413-reflog-detach.sh: test_expect_success setup '\n       \ttest_tick &&\n       \tgit commit --allow-empty -m second &&\n      -\tcat .git/logs/HEAD >saved_reflog\n     -+\ttar -cf .git-saved.tar .git\n     ++\t\"$TAR\" cf .git-saved.tar .git\n       '\n       \n       test_expect_success baseline '\n  6:  70da8f5631d0 =  7:  89cc215c6014 t1301: fix typo in error message\n  -:  ------------ >  8:  e67b90847c4e t5000: reformat indentation to the latest fashion\n  7:  79843c0d5727 !  9:  d6072a70ae7d t5000: inspect HEAD using git-rev-parse\n     @@ Commit message\n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n      \n       ## t/t5000-tar-tree.sh ##\n     -@@ t/t5000-tar-tree.sh: test_expect_success \\\n     -      test_cmp expected.mtime b.mtime'\n     +@@ t/t5000-tar-tree.sh: test_expect_success 'validate file modification time' '\n     + \ttest_cmp expected.mtime b.mtime\n     + '\n       \n     - test_expect_success \\\n     +-test_expect_success \\\n      -    'git get-tar-commit-id' \\\n      -    'git get-tar-commit-id <b.tar >b.commitid &&\n      -     test_cmp .git/$(git symbolic-ref HEAD) b.commitid'\n     -+\t'git get-tar-commit-id' \\\n     -+\t'git get-tar-commit-id <b.tar >actual &&\n     -+\tgit rev-parse HEAD > expect &&\n     -+\ttest_cmp expect actual'\n     ++test_expect_success 'git get-tar-commit-id' '\n     ++\tgit get-tar-commit-id <b.tar >actual &&\n     ++\tgit rev-parse HEAD >expect &&\n     ++\ttest_cmp expect actual\n     ++'\n       \n       test_expect_success 'git archive with --output, override inferred format' '\n       \tgit archive --format=tar --output=d4.zip HEAD &&\n  8:  dbb81b5b89d8 = 10:  4bf1bf16bca3 t7003: use rev-parse rather than FS inspection\n  -:  ------------ > 11:  6f15c15573af t5304: restyle: trim empty lines, drop ':' before >\n  9:  ba575839e422 ! 12:  d8e80d83b6f8 t5304: use \"reflog expire --all\" to clear the reflog\n     @@ Commit message\n      \n       ## t/t5304-prune.sh ##\n      @@ t/t5304-prune.sh: test_expect_success 'prune: prune nonsense parameters' '\n     - '\n       \n       test_expect_success 'prune: prune unreachable heads' '\n     --\n       \tgit config core.logAllRefUpdates false &&\n      -\tmv .git/logs .git/logs.old &&\n     - \t: > file2 &&\n     +-\t: > file2 &&\n     ++\t>file2 &&\n       \tgit add file2 &&\n       \tgit commit -m temporary &&\n       \ttmp_head=$(git rev-list -1 HEAD) &&\n     @@ t/t5304-prune.sh: test_expect_success 'prune: prune nonsense parameters' '\n      +\tgit reflog expire --all &&\n       \tgit prune &&\n       \ttest_must_fail git reset $tmp_head --\n     --\n       '\n     - \n     +@@ t/t5304-prune.sh: test_expect_success 'prune: prune unreachable heads' '\n       test_expect_success 'prune: do not prune detached HEAD with no reflog' '\n     - \n       \tgit checkout --detach --quiet &&\n       \tgit commit --allow-empty -m \"detached commit\" &&\n      -\t# verify that there is no reflogs\n     @@ t/t5304-prune.sh: test_expect_success 'prune: prune nonsense parameters' '\n      +\tgit reflog expire --all &&\n       \tgit prune -n >prune_actual &&\n       \ttest_must_be_empty prune_actual\n     - \n     -@@ t/t5304-prune.sh: test_expect_success 'prune: prune former HEAD after checking out branch' '\n     - \n     + '\n     +@@ t/t5304-prune.sh: test_expect_success 'prune: do not prune detached HEAD with no reflog' '\n     + test_expect_success 'prune: prune former HEAD after checking out branch' '\n       \thead_oid=$(git rev-parse HEAD) &&\n       \tgit checkout --quiet main &&\n      +\tgit reflog expire --all &&\n       \tgit prune -v >prune_actual &&\n       \tgrep \"$head_oid\" prune_actual\n     - \n     + '\n 10:  3d3b733c3127 ! 13:  180847f4db14 test-lib: provide test prereq REFFILES\n     @@ Commit message\n      \n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n      \n     + ## t/README ##\n     +@@ t/README: use these, and \"test_set_prereq\" for how to define your own.\n     + \n     +    Git wasn't compiled with NO_PTHREADS=YesPlease.\n     + \n     ++ - REFFILES\n     ++\n     ++   Test is specific to packed/loose ref storage, and should be\n     ++   disabled for other ref storage backends\n     ++\n     ++\n     + Tips for Writing Tests\n     + ----------------------\n     + \n     +\n       ## t/test-lib.sh ##\n      @@ t/test-lib.sh: parisc* | hppa*)\n       \t;;\n 11:  dd1f6969c28d ! 14:  f3307b62bfd7 t1407: require REFFILES for for_each_reflog test\n     @@ Metadata\n       ## Commit message ##\n          t1407: require REFFILES for for_each_reflog test\n      \n     -    It tries to setup a reflog by catting to .git/logs/\n     +    Add extensive comment why this test needs a REFFILES annotation.\n     +\n     +    I tried forcing universal reflog creation with core.logAllRefUpdates=true, but\n     +    that apparently also doesn't cause reflogs to be created for pseudorefs\n      \n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n      \n     @@ t/t1407-worktree-ref-store.sh: test_expect_success 'create_symref(FOO, refs/head\n       '\n       \n      -test_expect_success 'for_each_reflog()' '\n     ++# Some refs (refs/bisect/*, pseudorefs) are kept per worktree, so they should\n     ++# only appear in the for-each-reflog output if it is called from the correct\n     ++# worktree, which is exercised in this test. This test is poorly written (and\n     ++# therefore marked REFFILES) for mulitple reasons: 1) it creates invalidly\n     ++# formatted log entres. 2) it uses direct FS access for creating the reflogs. 3)\n     ++# PSEUDO-WT and refs/bisect/random do not create reflogs by default, so it is\n     ++# not testing a realistic scenario.\n      +test_expect_success REFFILES 'for_each_reflog()' '\n       \techo $ZERO_OID > .git/logs/PSEUDO-MAIN &&\n       \tmkdir -p     .git/logs/refs/bisect &&\n 12:  86951eb39cb6 = 15:  0d3b18cd3542 t1414: mark corruption test with REFFILES\n 13:  1ce545043846 = 16:  b64e3e7ade15 t2017: mark --orphan/logAllRefUpdates=false test as REFFILES\n 14:  a3abc4f70e7d ! 17:  fcc2b714dd50 t1404: mark tests that muck with .git directly as REFFILES.\n     @@ Metadata\n       ## Commit message ##\n          t1404: mark tests that muck with .git directly as REFFILES.\n      \n     +    The packed/loose ref storage is an overlay combination of packed-refs (refs and\n     +    tags in a single file) and one-file-per-ref. This creates all kinds of edge\n     +    cases related to directory/file conflicts, (non-)empty directories, and the\n     +    locking scheme, none of which applies to reftable.\n     +\n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n      \n       ## t/t1404-update-ref-errors.sh ##\n 15:  2b3021c4ba62 ! 18:  ff3b67c84c41 t7900: mark pack-refs tests as REFFILES\n     @@ Metadata\n       ## Commit message ##\n          t7900: mark pack-refs tests as REFFILES\n      \n     +    Reftable automatically compacts tables on writes. The functionality of\n     +    incremental compaction is unittested in reftable/stack_test.c\n     +    (test_reftable_stack_auto_compaction)\n     +\n     +    In addition, pack-refs triggers a full compaction of the entire stack. This is\n     +    exercised in t0031-reftable.sh.\n     +\n     +    Given that git-maintenance simply calls out git-pack-refs, it seems superfluous\n     +    to test this further for reftable.\n     +\n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n      \n       ## t/t7900-maintenance.sh ##\n 16:  a5b9439192db ! 19:  24dcf05d8fa6 t7003: check reflog existence only for REFFILES\n     @@ t/t7003-filter-branch.sh: test_expect_success '--prune-empty is able to prune en\n       \tgit filter-branch -f --prune-empty --index-filter \"git update-index --remove A.t B.t\" prune-entire &&\n       \ttest_must_fail git rev-parse refs/heads/prune-entire &&\n      -\ttest_must_fail git reflog exists refs/heads/prune-entire\n     -+\tif test_have_prereq REFFILES ; then\n     ++\tif test_have_prereq REFFILES\n     ++\tthen\n      +\t\ttest_must_fail git reflog exists refs/heads/prune-entire\n      +\tfi\n       '\n 17:  a2cce772d44f = 20:  a33cdfda74ff t4202: mark bogus head hash test with REFFILES\n 18:  0665edb1308b ! 21:  d7e5de8dba46 t1415: set REFFILES for test specific to storage format\n     @@ Metadata\n       ## Commit message ##\n          t1415: set REFFILES for test specific to storage format\n      \n     +    Packing refs (and therefore checking that certain refs are not packed) is a\n     +    property of the packed/loose ref storage. Add a comment to explain what the test\n     +    checks.\n     +\n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n      \n       ## t/t1415-worktree-refs.sh ##\n     @@ t/t1415-worktree-refs.sh: test_expect_success 'setup' '\n       '\n       \n      -test_expect_success 'refs/worktree must not be packed' '\n     ++# The 'packed-refs' files is stored directly in .git/. This means it is global\n     ++# to the repository, and can only contain refs that are shared across all\n     ++# worktrees.\n      +test_expect_success REFFILES 'refs/worktree must not be packed' '\n       \tgit pack-refs --all &&\n       \ttest_path_is_missing .git/refs/tags/wt1 &&\n\n-- \ngitgitgadget\n"},{"id":"423079","messageId":"369c968ab8372291fa08c7cc756432d2ff039157.1619519903.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v2 04/21] t5601: read HEAD using rev-parse","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:05Z","receivedAt":"2021-04-27T10:39:00Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t5601-clone.sh | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex 329ae599fd3c..7223372c7660 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -305,7 +305,8 @@ test_expect_success 'clone from original with relative alternate' '\n test_expect_success 'clone checking out a tag' '\n \tgit clone --branch=some-tag src dst.tag &&\n \tGIT_DIR=src/.git git rev-parse some-tag >expected &&\n-\ttest_cmp expected dst.tag/.git/HEAD &&\n+\tGIT_DIR=dst.tag/.git git rev-parse HEAD >actual &&\n+\ttest_cmp expected actual &&\n \tGIT_DIR=dst.tag/.git git config remote.origin.fetch >fetch.actual &&\n \techo \"+refs/heads/*:refs/remotes/origin/*\" >fetch.expected &&\n \ttest_cmp fetch.expected fetch.actual\n-- \ngitgitgadget\n\n"},{"id":"423080","messageId":"8ad4a35cda706b1bfcd8ddcf1b1c2e1d8f692c70.1619519903.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v2 01/21] t4202: split testcase for invalid HEAD symref and HEAD hash","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:02Z","receivedAt":"2021-04-27T10:39:01Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nReftable will prohibit invalid hashes at the storage level, but\ngit-symbolic-ref can still create branches ending in \".lock\".\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t4202-log.sh | 10 +++++++---\n 1 file changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex 350cfa35936a..a8c5a00d012d 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -1834,14 +1834,18 @@ test_expect_success 'log --graph --no-walk is forbidden' '\n \ttest_must_fail git log --graph --no-walk\n '\n \n-test_expect_success 'log diagnoses bogus HEAD' '\n+test_expect_success 'log diagnoses bogus HEAD hash' '\n \tgit init empty &&\n \ttest_must_fail git -C empty log 2>stderr &&\n \ttest_i18ngrep does.not.have.any.commits stderr &&\n \techo 1234abcd >empty/.git/refs/heads/main &&\n \ttest_must_fail git -C empty log 2>stderr &&\n-\ttest_i18ngrep broken stderr &&\n-\techo \"ref: refs/heads/invalid.lock\" >empty/.git/HEAD &&\n+\ttest_i18ngrep broken stderr'\n+\n+test_expect_success 'log diagnoses bogus HEAD symref' '\n+\trm -rf empty &&\n+\tgit init empty &&\n+\tgit --git-dir empty/.git symbolic-ref HEAD refs/heads/invalid.lock &&\n \ttest_must_fail git -C empty log 2>stderr &&\n \ttest_i18ngrep broken stderr &&\n \ttest_must_fail git -C empty log --default totally-bogus 2>stderr &&\n-- \ngitgitgadget\n\n"},{"id":"423081","messageId":"e4e8fc1d4b4f450d46dd320ffc2398515044b28a.1619519903.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v2 06/21] t1413: use tar to save and restore entire .git directory","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:07Z","receivedAt":"2021-04-27T10:39:02Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nThis makes the test independent of the particulars of the storage formats.\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t1413-reflog-detach.sh | 5 ++---\n 1 file changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t1413-reflog-detach.sh b/t/t1413-reflog-detach.sh\nindex bde05208ae6a..934688a1ee82 100755\n--- a/t/t1413-reflog-detach.sh\n+++ b/t/t1413-reflog-detach.sh\n@@ -7,8 +7,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n . ./test-lib.sh\n \n reset_state () {\n-\tgit checkout main &&\n-\tcp saved_reflog .git/logs/HEAD\n+\trm -rf .git && \"$TAR\" xf .git-saved.tar\n }\n \n test_expect_success setup '\n@@ -17,7 +16,7 @@ test_expect_success setup '\n \tgit branch side &&\n \ttest_tick &&\n \tgit commit --allow-empty -m second &&\n-\tcat .git/logs/HEAD >saved_reflog\n+\t\"$TAR\" cf .git-saved.tar .git\n '\n \n test_expect_success baseline '\n-- \ngitgitgadget\n\n"},{"id":"423082","messageId":"248d9ffe79272c7a6efef64512d72ccb9a91349a.1619519903.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v2 05/21] t1401-symbolic-ref: avoid direct filesystem access","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:06Z","receivedAt":"2021-04-27T10:39:02Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t1401-symbolic-ref.sh | 34 +++++++++++++++++-----------------\n 1 file changed, 17 insertions(+), 17 deletions(-)\n\ndiff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh\nindex a4ebb0b65fec..315a62f78019 100755\n--- a/t/t1401-symbolic-ref.sh\n+++ b/t/t1401-symbolic-ref.sh\n@@ -3,21 +3,20 @@\n test_description='basic symbolic-ref tests'\n . ./test-lib.sh\n \n-# If the tests munging HEAD fail, they can break detection of\n-# the git repo, meaning that further tests will operate on\n-# the surrounding git repo instead of the trash directory.\n-reset_to_sane() {\n-\techo ref: refs/heads/foo >.git/HEAD\n-}\n-\n-test_expect_success 'symbolic-ref writes HEAD' '\n+test_expect_success 'setup' '\n \tgit symbolic-ref HEAD refs/heads/foo &&\n-\techo ref: refs/heads/foo >expect &&\n-\ttest_cmp expect .git/HEAD\n+\ttest_commit file &&\n+\t\"$TAR\" cf .git.tar .git/\n '\n \n-test_expect_success 'symbolic-ref reads HEAD' '\n-\techo refs/heads/foo >expect &&\n+reset_to_sane() {\n+\trm -rf .git &&\n+\t\"$TAR\" xf .git.tar\n+}\n+\n+test_expect_success 'symbolic-ref read/write roundtrip' '\n+\tgit symbolic-ref HEAD refs/heads/read-write-roundtrip &&\n+\techo refs/heads/read-write-roundtrip >expect &&\n \tgit symbolic-ref HEAD >actual &&\n \ttest_cmp expect actual\n '\n@@ -25,12 +24,13 @@ test_expect_success 'symbolic-ref reads HEAD' '\n test_expect_success 'symbolic-ref refuses non-ref for HEAD' '\n \ttest_must_fail git symbolic-ref HEAD foo\n '\n+\n reset_to_sane\n \n test_expect_success 'symbolic-ref refuses bare sha1' '\n-\techo content >file && git add file && git commit -m one &&\n \ttest_must_fail git symbolic-ref HEAD $(git rev-parse HEAD)\n '\n+\n reset_to_sane\n \n test_expect_success 'HEAD cannot be removed' '\n@@ -42,16 +42,16 @@ reset_to_sane\n test_expect_success 'symbolic-ref can be deleted' '\n \tgit symbolic-ref NOTHEAD refs/heads/foo &&\n \tgit symbolic-ref -d NOTHEAD &&\n-\ttest_path_is_file .git/refs/heads/foo &&\n-\ttest_path_is_missing .git/NOTHEAD\n+\tgit rev-parse refs/heads/foo &&\n+\ttest_must_fail git symbolic-ref NOTHEAD\n '\n reset_to_sane\n \n test_expect_success 'symbolic-ref can delete dangling symref' '\n \tgit symbolic-ref NOTHEAD refs/heads/missing &&\n \tgit symbolic-ref -d NOTHEAD &&\n-\ttest_path_is_missing .git/refs/heads/missing &&\n-\ttest_path_is_missing .git/NOTHEAD\n+\ttest_must_fail git rev-parse refs/heads/missing &&\n+\ttest_must_fail git symbolic-ref NOTHEAD\n '\n reset_to_sane\n \n-- \ngitgitgadget\n\n"},{"id":"423083","messageId":"e6222944a3eb441d44ab6c7d1e9b873f5546220a.1619519903.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v2 02/21] t/helper/ref-store: initialize oid in resolve-ref","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:03Z","receivedAt":"2021-04-27T10:39:04Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nThis will print $ZERO_OID when asking for a non-existent ref from the\ntest-helper.\n\nSince resolve-ref provides direct access to refs_resolve_ref_unsafe(), it\nprovides a reliable mechanism for accessing REFNAME, while avoiding the implicit\nresolution to refs/heads/REFNAME.\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/helper/test-ref-store.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c\nindex bba5f841c6ab..01d8f3285dc8 100644\n--- a/t/helper/test-ref-store.c\n+++ b/t/helper/test-ref-store.c\n@@ -118,7 +118,7 @@ static int cmd_for_each_ref(struct ref_store *refs, const char **argv)\n \n static int cmd_resolve_ref(struct ref_store *refs, const char **argv)\n {\n-\tstruct object_id oid;\n+\tstruct object_id oid = { 0 };\n \tconst char *refname = notnull(*argv++, \"refname\");\n \tint resolve_flags = arg_flags(*argv++, \"resolve-flags\");\n \tint flags;\n-- \ngitgitgadget\n\n"},{"id":"423084","messageId":"c5855b0caa7320c8b3f1ad5c5904ae73b1decb97.1619519903.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v2 03/21] t9300: check ref existence using test-helper rather than a file system check","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:04Z","receivedAt":"2021-04-27T10:39:05Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t9300-fast-import.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex 5c47ac4465cb..1aea943bef72 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -392,7 +392,7 @@ test_expect_success 'B: accept branch name \"TEMP_TAG\"' '\n \t\tgit gc\n \t\tgit prune\" &&\n \tgit fast-import <input &&\n-\ttest -f .git/TEMP_TAG &&\n+\ttest $(test-tool ref-store main resolve-ref TEMP_TAG 0 | cut -f1 -d \" \" ) != \"$ZERO_OID\" &&\n \ttest $(git rev-parse main) = $(git rev-parse TEMP_TAG^)\n '\n \n-- \ngitgitgadget\n\n"},{"id":"423085","messageId":"e67b90847c4eb78fff786944c04413f8a02cffb4.1619519903.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v2 08/21] t5000: reformat indentation to the latest fashion","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:09Z","receivedAt":"2021-04-27T10:39:06Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t5000-tar-tree.sh | 104 ++++++++++++++++++++++----------------------\n 1 file changed, 53 insertions(+), 51 deletions(-)\n\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex 7204799a0b52..b6734cba7e65 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -111,25 +111,25 @@ test_expect_success 'setup' '\n \tEOF\n '\n \n-test_expect_success \\\n-    'populate workdir' \\\n-    'mkdir a &&\n-     echo simple textfile >a/a &&\n-     ten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&\n-     echo long filename >a/four$hundred &&\n-     mkdir a/bin &&\n-     test-tool genrandom \"frotz\" 500000 >a/bin/sh &&\n-     printf \"A\\$Format:%s\\$O\" \"$SUBSTFORMAT\" >a/substfile1 &&\n-     printf \"A not substituted O\" >a/substfile2 &&\n-     if test_have_prereq SYMLINKS; then\n-\tln -s a a/l1\n-     else\n-\tprintf %s a > a/l1\n-     fi &&\n-     (p=long_path_to_a_file && cd a &&\n-      for depth in 1 2 3 4 5; do mkdir $p && cd $p; done &&\n-      echo text >file_with_long_path) &&\n-     (cd a && find .) | sort >a.lst'\n+test_expect_success 'populate workdir' '\n+\tmkdir a &&\n+\techo simple textfile >a/a &&\n+\tten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&\n+\techo long filename >a/four$hundred &&\n+\tmkdir a/bin &&\n+\ttest-tool genrandom \"frotz\" 500000 >a/bin/sh &&\n+\tprintf \"A\\$Format:%s\\$O\" \"$SUBSTFORMAT\" >a/substfile1 &&\n+\tprintf \"A not substituted O\" >a/substfile2 &&\n+\tif test_have_prereq SYMLINKS; then\n+\t\tln -s a a/l1\n+\telse\n+\t\tprintf %s a >a/l1\n+\tfi &&\n+\t(p=long_path_to_a_file && cd a &&\n+\t\tfor depth in 1 2 3 4 5; do mkdir $p && cd $p; done &&\n+\t\techo text >file_with_long_path) &&\n+\t(cd a && find .) | sort >a.lst\n+'\n \n test_expect_success \\\n     'add ignored file' \\\n@@ -147,18 +147,18 @@ test_expect_success 'setup export-subst' '\n \t\t>a/substfile1\n '\n \n-test_expect_success \\\n-    'create bare clone' \\\n-    'git clone --bare . bare.git &&\n-     cp .git/info/attributes bare.git/info/attributes'\n+test_expect_success 'create bare clone' '\n+\tgit clone --bare . bare.git &&\n+\tcp .git/info/attributes bare.git/info/attributes\n+'\n \n-test_expect_success \\\n-    'remove ignored file' \\\n-    'rm a/ignored'\n+test_expect_success 'remove ignored file' '\n+\trm a/ignored\n+'\n \n-test_expect_success \\\n-    'git archive' \\\n-    'git archive HEAD >b.tar'\n+test_expect_success 'git archive' '\n+\tgit archive HEAD >b.tar\n+'\n \n check_tar b\n \n@@ -194,26 +194,28 @@ check_added with_untracked2 untracked one/untracked\n check_added with_untracked2 untracked two/untracked\n \n test_expect_success 'git archive on large files' '\n-    test_config core.bigfilethreshold 1 &&\n-    git archive HEAD >b3.tar &&\n-    test_cmp_bin b.tar b3.tar\n+\ttest_config core.bigfilethreshold 1 &&\n+\tgit archive HEAD >b3.tar &&\n+\ttest_cmp_bin b.tar b3.tar\n '\n \n-test_expect_success \\\n-    'git archive in a bare repo' \\\n-    '(cd bare.git && git archive HEAD) >b3.tar'\n+test_expect_success 'git archive in a bare repo' '\n+\t(cd bare.git && git archive HEAD) >b3.tar\n+'\n \n-test_expect_success \\\n-    'git archive vs. the same in a bare repo' \\\n-    'test_cmp_bin b.tar b3.tar'\n+test_expect_success 'git archive vs. the same in a bare repo' '\n+\ttest_cmp_bin b.tar b3.tar\n+'\n \n-test_expect_success 'git archive with --output' \\\n-    'git archive --output=b4.tar HEAD &&\n-    test_cmp_bin b.tar b4.tar'\n+test_expect_success 'git archive with --output' '\n+\tgit archive --output=b4.tar HEAD &&\n+\ttest_cmp_bin b.tar b4.tar\n+'\n \n-test_expect_success 'git archive --remote' \\\n-    'git archive --remote=. HEAD >b5.tar &&\n-    test_cmp_bin b.tar b5.tar'\n+test_expect_success 'git archive --remote' '\n+\tgit archive --remote=. HEAD >b5.tar &&\n+\ttest_cmp_bin b.tar b5.tar\n+'\n \n test_expect_success 'git archive --remote with configured remote' '\n \tgit config remote.foo.url . &&\n@@ -224,13 +226,13 @@ test_expect_success 'git archive --remote with configured remote' '\n \ttest_cmp_bin b.tar b5-nick.tar\n '\n \n-test_expect_success \\\n-    'validate file modification time' \\\n-    'mkdir extract &&\n-     \"$TAR\" xf b.tar -C extract a/a &&\n-     test-tool chmtime --get extract/a/a >b.mtime &&\n-     echo \"1117231200\" >expected.mtime &&\n-     test_cmp expected.mtime b.mtime'\n+test_expect_success 'validate file modification time' '\n+\tmkdir extract &&\n+\t\"$TAR\" xf b.tar -C extract a/a &&\n+\ttest-tool chmtime --get extract/a/a >b.mtime &&\n+\techo \"1117231200\" >expected.mtime &&\n+\ttest_cmp expected.mtime b.mtime\n+'\n \n test_expect_success \\\n     'git get-tar-commit-id' \\\n-- \ngitgitgadget\n\n"},{"id":"423086","messageId":"d6072a70ae7d75382d30d1239c218e4e58207c20.1619519903.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v2 09/21] t5000: inspect HEAD using git-rev-parse","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:10Z","receivedAt":"2021-04-27T10:39:07Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t5000-tar-tree.sh | 9 +++++----\n 1 file changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex b6734cba7e65..153f8400035a 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -234,10 +234,11 @@ test_expect_success 'validate file modification time' '\n \ttest_cmp expected.mtime b.mtime\n '\n \n-test_expect_success \\\n-    'git get-tar-commit-id' \\\n-    'git get-tar-commit-id <b.tar >b.commitid &&\n-     test_cmp .git/$(git symbolic-ref HEAD) b.commitid'\n+test_expect_success 'git get-tar-commit-id' '\n+\tgit get-tar-commit-id <b.tar >actual &&\n+\tgit rev-parse HEAD >expect &&\n+\ttest_cmp expect actual\n+'\n \n test_expect_success 'git archive with --output, override inferred format' '\n \tgit archive --format=tar --output=d4.zip HEAD &&\n-- \ngitgitgadget\n\n"},{"id":"423087","messageId":"89cc215c601437147cd4f7c6641ac0382d951190.1619519903.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v2 07/21] t1301: fix typo in error message","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:08Z","receivedAt":"2021-04-27T10:39:08Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t1301-shared-repo.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh\nindex ac947bff9fcf..84bf1970d8bf 100755\n--- a/t/t1301-shared-repo.sh\n+++ b/t/t1301-shared-repo.sh\n@@ -124,7 +124,7 @@ test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '\n \t\t: happy\n \t\t;;\n \t*)\n-\t\techo Ooops, .git/logs/refs/heads/main is not 0662 [$actual]\n+\t\techo Ooops, .git/logs/refs/heads/main is not 066x [$actual]\n \t\tfalse\n \t\t;;\n \tesac\n-- \ngitgitgadget\n\n"},{"id":"423088","messageId":"6f15c15573afcef08f7ab2f4e14ef4cdb575261c.1619519903.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v2 11/21] t5304: restyle: trim empty lines, drop ':' before >","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:12Z","receivedAt":"2021-04-27T10:39:12Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t5304-prune.sh | 74 +++++++++++++-----------------------------------\n 1 file changed, 20 insertions(+), 54 deletions(-)\n\ndiff --git a/t/t5304-prune.sh b/t/t5304-prune.sh\nindex b447ce56a9b2..7f47f13c78e8 100755\n--- a/t/t5304-prune.sh\n+++ b/t/t5304-prune.sh\n@@ -22,30 +22,25 @@ add_blob() {\n }\n \n test_expect_success setup '\n-\n-\t: > file &&\n+\t>file &&\n \tgit add file &&\n \ttest_tick &&\n \tgit commit -m initial &&\n \tgit gc\n-\n '\n \n test_expect_success 'prune stale packs' '\n-\n \torig_pack=$(echo .git/objects/pack/*.pack) &&\n-\t: > .git/objects/tmp_1.pack &&\n-\t: > .git/objects/tmp_2.pack &&\n+\t>.git/objects/tmp_1.pack &&\n+\t>.git/objects/tmp_2.pack &&\n \ttest-tool chmtime =-86501 .git/objects/tmp_1.pack &&\n \tgit prune --expire 1.day &&\n \ttest_path_is_file $orig_pack &&\n \ttest_path_is_file .git/objects/tmp_2.pack &&\n \ttest_path_is_missing .git/objects/tmp_1.pack\n-\n '\n \n test_expect_success 'prune --expire' '\n-\n \tadd_blob &&\n \tgit prune --expire=1.hour.ago &&\n \tverbose test $((1 + $before)) = $(git count-objects | sed \"s/ .*//\") &&\n@@ -54,11 +49,9 @@ test_expect_success 'prune --expire' '\n \tgit prune --expire 1.day &&\n \tverbose test $before = $(git count-objects | sed \"s/ .*//\") &&\n \ttest_path_is_missing $BLOB_FILE\n-\n '\n \n test_expect_success 'gc: implicit prune --expire' '\n-\n \tadd_blob &&\n \ttest-tool chmtime =-$((2*$week-30)) $BLOB_FILE &&\n \tgit gc &&\n@@ -68,33 +61,25 @@ test_expect_success 'gc: implicit prune --expire' '\n \tgit gc &&\n \tverbose test $before = $(git count-objects | sed \"s/ .*//\") &&\n \ttest_path_is_missing $BLOB_FILE\n-\n '\n \n test_expect_success 'gc: refuse to start with invalid gc.pruneExpire' '\n-\n \tgit config gc.pruneExpire invalid &&\n \ttest_must_fail git gc\n-\n '\n \n test_expect_success 'gc: start with ok gc.pruneExpire' '\n-\n \tgit config gc.pruneExpire 2.days.ago &&\n \tgit gc\n-\n '\n \n test_expect_success 'prune: prune nonsense parameters' '\n-\n \ttest_must_fail git prune garbage &&\n \ttest_must_fail git prune --- &&\n \ttest_must_fail git prune --no-such-option\n-\n '\n \n test_expect_success 'prune: prune unreachable heads' '\n-\n \tgit config core.logAllRefUpdates false &&\n \tmv .git/logs .git/logs.old &&\n \t: > file2 &&\n@@ -104,11 +89,9 @@ test_expect_success 'prune: prune unreachable heads' '\n \tgit reset HEAD^ &&\n \tgit prune &&\n \ttest_must_fail git reset $tmp_head --\n-\n '\n \n test_expect_success 'prune: do not prune detached HEAD with no reflog' '\n-\n \tgit checkout --detach --quiet &&\n \tgit commit --allow-empty -m \"detached commit\" &&\n \t# verify that there is no reflogs\n@@ -116,75 +99,61 @@ test_expect_success 'prune: do not prune detached HEAD with no reflog' '\n \ttest_path_is_missing .git/logs &&\n \tgit prune -n >prune_actual &&\n \ttest_must_be_empty prune_actual\n-\n '\n \n test_expect_success 'prune: prune former HEAD after checking out branch' '\n-\n \thead_oid=$(git rev-parse HEAD) &&\n \tgit checkout --quiet main &&\n \tgit prune -v >prune_actual &&\n \tgrep \"$head_oid\" prune_actual\n-\n '\n \n test_expect_success 'prune: do not prune heads listed as an argument' '\n-\n-\t: > file2 &&\n+\t>file2 &&\n \tgit add file2 &&\n \tgit commit -m temporary &&\n \ttmp_head=$(git rev-list -1 HEAD) &&\n \tgit reset HEAD^ &&\n \tgit prune -- $tmp_head &&\n \tgit reset $tmp_head --\n-\n '\n \n test_expect_success 'gc --no-prune' '\n-\n \tadd_blob &&\n \ttest-tool chmtime =-$((5001*$day)) $BLOB_FILE &&\n \tgit config gc.pruneExpire 2.days.ago &&\n \tgit gc --no-prune &&\n \tverbose test 1 = $(git count-objects | sed \"s/ .*//\") &&\n \ttest_path_is_file $BLOB_FILE\n-\n '\n \n test_expect_success 'gc respects gc.pruneExpire' '\n-\n \tgit config gc.pruneExpire 5002.days.ago &&\n \tgit gc &&\n \ttest_path_is_file $BLOB_FILE &&\n \tgit config gc.pruneExpire 5000.days.ago &&\n \tgit gc &&\n \ttest_path_is_missing $BLOB_FILE\n-\n '\n \n test_expect_success 'gc --prune=<date>' '\n-\n \tadd_blob &&\n \ttest-tool chmtime =-$((5001*$day)) $BLOB_FILE &&\n \tgit gc --prune=5002.days.ago &&\n \ttest_path_is_file $BLOB_FILE &&\n \tgit gc --prune=5000.days.ago &&\n \ttest_path_is_missing $BLOB_FILE\n-\n '\n \n test_expect_success 'gc --prune=never' '\n-\n \tadd_blob &&\n \tgit gc --prune=never &&\n \ttest_path_is_file $BLOB_FILE &&\n \tgit gc --prune=now &&\n \ttest_path_is_missing $BLOB_FILE\n-\n '\n \n test_expect_success 'gc respects gc.pruneExpire=never' '\n-\n \tgit config gc.pruneExpire never &&\n \tadd_blob &&\n \tgit gc &&\n@@ -192,17 +161,14 @@ test_expect_success 'gc respects gc.pruneExpire=never' '\n \tgit config gc.pruneExpire now &&\n \tgit gc &&\n \ttest_path_is_missing $BLOB_FILE\n-\n '\n \n test_expect_success 'prune --expire=never' '\n-\n \tadd_blob &&\n \tgit prune --expire=never &&\n \ttest_path_is_file $BLOB_FILE &&\n \tgit prune &&\n \ttest_path_is_missing $BLOB_FILE\n-\n '\n \n test_expect_success 'gc: prune old objects after local clone' '\n@@ -222,16 +188,16 @@ test_expect_success 'gc: prune old objects after local clone' '\n test_expect_success 'garbage report in count-objects -v' '\n \ttest_when_finished \"rm -f .git/objects/pack/fake*\" &&\n \ttest_when_finished \"rm -f .git/objects/pack/foo*\" &&\n-\t: >.git/objects/pack/foo &&\n-\t: >.git/objects/pack/foo.bar &&\n-\t: >.git/objects/pack/foo.keep &&\n-\t: >.git/objects/pack/foo.pack &&\n-\t: >.git/objects/pack/fake.bar &&\n-\t: >.git/objects/pack/fake.keep &&\n-\t: >.git/objects/pack/fake.pack &&\n-\t: >.git/objects/pack/fake.idx &&\n-\t: >.git/objects/pack/fake2.keep &&\n-\t: >.git/objects/pack/fake3.idx &&\n+\t>.git/objects/pack/foo &&\n+\t>.git/objects/pack/foo.bar &&\n+\t>.git/objects/pack/foo.keep &&\n+\t>.git/objects/pack/foo.pack &&\n+\t>.git/objects/pack/fake.bar &&\n+\t>.git/objects/pack/fake.keep &&\n+\t>.git/objects/pack/fake.pack &&\n+\t>.git/objects/pack/fake.idx &&\n+\t>.git/objects/pack/fake2.keep &&\n+\t>.git/objects/pack/fake3.idx &&\n \tgit count-objects -v 2>stderr &&\n \tgrep \"index file .git/objects/pack/fake.idx is too small\" stderr &&\n \tgrep \"^warning:\" stderr | sort >actual &&\n@@ -250,12 +216,12 @@ EOF\n test_expect_success 'clean pack garbage with gc' '\n \ttest_when_finished \"rm -f .git/objects/pack/fake*\" &&\n \ttest_when_finished \"rm -f .git/objects/pack/foo*\" &&\n-\t: >.git/objects/pack/foo.keep &&\n-\t: >.git/objects/pack/foo.pack &&\n-\t: >.git/objects/pack/fake.idx &&\n-\t: >.git/objects/pack/fake2.keep &&\n-\t: >.git/objects/pack/fake2.idx &&\n-\t: >.git/objects/pack/fake3.keep &&\n+\t>.git/objects/pack/foo.keep &&\n+\t>.git/objects/pack/foo.pack &&\n+\t>.git/objects/pack/fake.idx &&\n+\t>.git/objects/pack/fake2.keep &&\n+\t>.git/objects/pack/fake2.idx &&\n+\t>.git/objects/pack/fake3.keep &&\n \tgit gc &&\n \tgit count-objects -v 2>stderr &&\n \tgrep \"^warning:\" stderr | sort >actual &&\n-- \ngitgitgadget\n\n"},{"id":"423089","messageId":"4bf1bf16bca35002453c4542c6758e3545e4844a.1619519903.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v2 10/21] t7003: use rev-parse rather than FS inspection","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:11Z","receivedAt":"2021-04-27T10:39:14Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t7003-filter-branch.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex 1349e5b2321c..cf30055c88dd 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -395,7 +395,7 @@ test_expect_success '--prune-empty is able to prune root commit' '\n test_expect_success '--prune-empty is able to prune entire branch' '\n \tgit branch prune-entire B &&\n \tgit filter-branch -f --prune-empty --index-filter \"git update-index --remove A.t B.t\" prune-entire &&\n-\ttest_path_is_missing .git/refs/heads/prune-entire &&\n+\ttest_must_fail git rev-parse refs/heads/prune-entire &&\n \ttest_must_fail git reflog exists refs/heads/prune-entire\n '\n \n-- \ngitgitgadget\n\n"},{"id":"423090","messageId":"d8e80d83b6f8ee929b187aaffd5f37c3c981b50b.1619519903.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v2 12/21] t5304: use \"reflog expire --all\" to clear the reflog","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:13Z","receivedAt":"2021-04-27T10:39:16Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nThis is more explicit, and reduces the depency between test functions. It also\nis more amenable to use with reftable, which has no concept of (non)existence of\na reflog\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t5304-prune.sh | 9 ++++-----\n 1 file changed, 4 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t5304-prune.sh b/t/t5304-prune.sh\nindex 7f47f13c78e8..7b850ae26171 100755\n--- a/t/t5304-prune.sh\n+++ b/t/t5304-prune.sh\n@@ -81,12 +81,12 @@ test_expect_success 'prune: prune nonsense parameters' '\n \n test_expect_success 'prune: prune unreachable heads' '\n \tgit config core.logAllRefUpdates false &&\n-\tmv .git/logs .git/logs.old &&\n-\t: > file2 &&\n+\t>file2 &&\n \tgit add file2 &&\n \tgit commit -m temporary &&\n \ttmp_head=$(git rev-list -1 HEAD) &&\n \tgit reset HEAD^ &&\n+\tgit reflog expire --all &&\n \tgit prune &&\n \ttest_must_fail git reset $tmp_head --\n '\n@@ -94,9 +94,7 @@ test_expect_success 'prune: prune unreachable heads' '\n test_expect_success 'prune: do not prune detached HEAD with no reflog' '\n \tgit checkout --detach --quiet &&\n \tgit commit --allow-empty -m \"detached commit\" &&\n-\t# verify that there is no reflogs\n-\t# (should be removed and disabled by previous test)\n-\ttest_path_is_missing .git/logs &&\n+\tgit reflog expire --all &&\n \tgit prune -n >prune_actual &&\n \ttest_must_be_empty prune_actual\n '\n@@ -104,6 +102,7 @@ test_expect_success 'prune: do not prune detached HEAD with no reflog' '\n test_expect_success 'prune: prune former HEAD after checking out branch' '\n \thead_oid=$(git rev-parse HEAD) &&\n \tgit checkout --quiet main &&\n+\tgit reflog expire --all &&\n \tgit prune -v >prune_actual &&\n \tgrep \"$head_oid\" prune_actual\n '\n-- \ngitgitgadget\n\n"},{"id":"423091","messageId":"ff3b67c84c412dafaa506355e83427a731b47623.1619519903.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v2 18/21] t7900: mark pack-refs tests as REFFILES","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:19Z","receivedAt":"2021-04-27T10:39:17Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nReftable automatically compacts tables on writes. The functionality of\nincremental compaction is unittested in reftable/stack_test.c\n(test_reftable_stack_auto_compaction)\n\nIn addition, pack-refs triggers a full compaction of the entire stack. This is\nexercised in t0031-reftable.sh.\n\nGiven that git-maintenance simply calls out git-pack-refs, it seems superfluous\nto test this further for reftable.\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t7900-maintenance.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh\nindex 2412d8c5c006..6f2f55a6c51d 100755\n--- a/t/t7900-maintenance.sh\n+++ b/t/t7900-maintenance.sh\n@@ -343,7 +343,7 @@ test_expect_success 'maintenance.incremental-repack.auto' '\n \ttest_subcommand git multi-pack-index write --no-progress <trace-B\n '\n \n-test_expect_success 'pack-refs task' '\n+test_expect_success REFFILES 'pack-refs task' '\n \tfor n in $(test_seq 1 5)\n \tdo\n \t\tgit branch -f to-pack/$n HEAD || return 1\n-- \ngitgitgadget\n\n"},{"id":"423092","messageId":"f3307b62bfd776dce7178932031609e754b4ca75.1619519903.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v2 14/21] t1407: require REFFILES for for_each_reflog test","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:15Z","receivedAt":"2021-04-27T10:39:19Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nAdd extensive comment why this test needs a REFFILES annotation.\n\nI tried forcing universal reflog creation with core.logAllRefUpdates=true, but\nthat apparently also doesn't cause reflogs to be created for pseudorefs\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t1407-worktree-ref-store.sh | 9 ++++++++-\n 1 file changed, 8 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t1407-worktree-ref-store.sh b/t/t1407-worktree-ref-store.sh\nindex d3fe77751122..ad8006c81397 100755\n--- a/t/t1407-worktree-ref-store.sh\n+++ b/t/t1407-worktree-ref-store.sh\n@@ -52,7 +52,14 @@ test_expect_success 'create_symref(FOO, refs/heads/main)' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'for_each_reflog()' '\n+# Some refs (refs/bisect/*, pseudorefs) are kept per worktree, so they should\n+# only appear in the for-each-reflog output if it is called from the correct\n+# worktree, which is exercised in this test. This test is poorly written (and\n+# therefore marked REFFILES) for mulitple reasons: 1) it creates invalidly\n+# formatted log entres. 2) it uses direct FS access for creating the reflogs. 3)\n+# PSEUDO-WT and refs/bisect/random do not create reflogs by default, so it is\n+# not testing a realistic scenario.\n+test_expect_success REFFILES 'for_each_reflog()' '\n \techo $ZERO_OID > .git/logs/PSEUDO-MAIN &&\n \tmkdir -p     .git/logs/refs/bisect &&\n \techo $ZERO_OID > .git/logs/refs/bisect/random &&\n-- \ngitgitgadget\n\n"},{"id":"423093","messageId":"180847f4db1470bcc585a93f662eb5e60ea010ea.1619519903.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v2 13/21] test-lib: provide test prereq REFFILES","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:14Z","receivedAt":"2021-04-27T10:39:22Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nREFFILES can be used to mark tests that are specific to the packed/loose ref\nstorage format and its limitations. Marking such tests is a preparation for\nintroducing the reftable storage backend.\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/README      | 6 ++++++\n t/test-lib.sh | 2 ++\n 2 files changed, 8 insertions(+)\n\ndiff --git a/t/README b/t/README\nindex fd9375b146d1..723bd3387fb7 100644\n--- a/t/README\n+++ b/t/README\n@@ -1114,6 +1114,12 @@ use these, and \"test_set_prereq\" for how to define your own.\n \n    Git wasn't compiled with NO_PTHREADS=YesPlease.\n \n+ - REFFILES\n+\n+   Test is specific to packed/loose ref storage, and should be\n+   disabled for other ref storage backends\n+\n+\n Tips for Writing Tests\n ----------------------\n \ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex 3dec266221cd..4a0c08e81e12 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1483,6 +1483,8 @@ parisc* | hppa*)\n \t;;\n esac\n \n+test_set_prereq REFFILES\n+\n ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1\n test -z \"$NO_PERL\" && test_set_prereq PERL\n test -z \"$NO_PTHREADS\" && test_set_prereq PTHREADS\n-- \ngitgitgadget\n\n"},{"id":"423094","messageId":"0d3b18cd35423dadd35d55073bd7230bfc908fee.1619519903.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v2 15/21] t1414: mark corruption test with REFFILES","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:16Z","receivedAt":"2021-04-27T10:39:23Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nThe reftable format guarantees that reflog entries are well-formed\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t1414-reflog-walk.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t1414-reflog-walk.sh b/t/t1414-reflog-walk.sh\nindex 80d94704d012..72a5ac61a520 100755\n--- a/t/t1414-reflog-walk.sh\n+++ b/t/t1414-reflog-walk.sh\n@@ -119,7 +119,7 @@ test_expect_success 'min/max age uses entry date to limit' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success 'walk prefers reflog to ref tip' '\n+test_expect_success REFFILES 'walk prefers reflog to ref tip' '\n \thead=$(git rev-parse HEAD) &&\n \tone=$(git rev-parse one) &&\n \tident=\"$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE\" &&\n-- \ngitgitgadget\n\n"},{"id":"423095","messageId":"24dcf05d8fa6172d04ca047a860ad5019aad17b7.1619519903.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v2 19/21] t7003: check reflog existence only for REFFILES","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:20Z","receivedAt":"2021-04-27T10:39:27Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t7003-filter-branch.sh | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex cf30055c88dd..e18a21895238 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -396,7 +396,10 @@ test_expect_success '--prune-empty is able to prune entire branch' '\n \tgit branch prune-entire B &&\n \tgit filter-branch -f --prune-empty --index-filter \"git update-index --remove A.t B.t\" prune-entire &&\n \ttest_must_fail git rev-parse refs/heads/prune-entire &&\n-\ttest_must_fail git reflog exists refs/heads/prune-entire\n+\tif test_have_prereq REFFILES\n+\tthen\n+\t\ttest_must_fail git reflog exists refs/heads/prune-entire\n+\tfi\n '\n \n test_expect_success '--remap-to-ancestor with filename filters' '\n-- \ngitgitgadget\n\n"},{"id":"423096","messageId":"b64e3e7ade1583f5ff669cfb6510f5d7402be028.1619519903.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v2 16/21] t2017: mark --orphan/logAllRefUpdates=false test as REFFILES","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:17Z","receivedAt":"2021-04-27T10:39:35Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nIn reftable, there is no notion of a per-ref 'existence' of a reflog. Each\nreflog entry has its own key, so it is not possible to distinguish between\n{reflog doesn't exist,reflog exists but is empty}. This makes the logic\nin log_ref_setup() (file refs/files-backend.c), which depends on the existence\nof the reflog file infeasible.\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t2017-checkout-orphan.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t2017-checkout-orphan.sh b/t/t2017-checkout-orphan.sh\nindex c7adbdd39ab9..88d6992a5e1f 100755\n--- a/t/t2017-checkout-orphan.sh\n+++ b/t/t2017-checkout-orphan.sh\n@@ -76,7 +76,7 @@ test_expect_success '--orphan makes reflog by default' '\n \tgit rev-parse --verify delta@{0}\n '\n \n-test_expect_success '--orphan does not make reflog when core.logAllRefUpdates = false' '\n+test_expect_success REFFILES '--orphan does not make reflog when core.logAllRefUpdates = false' '\n \tgit checkout main &&\n \tgit config core.logAllRefUpdates false &&\n \tgit checkout --orphan epsilon &&\n-- \ngitgitgadget\n\n"},{"id":"423097","messageId":"fcc2b714dd5067732fa822c9ef3347636fe2138d.1619519903.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v2 17/21] t1404: mark tests that muck with .git directly as REFFILES.","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:18Z","receivedAt":"2021-04-27T10:39:36Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nThe packed/loose ref storage is an overlay combination of packed-refs (refs and\ntags in a single file) and one-file-per-ref. This creates all kinds of edge\ncases related to directory/file conflicts, (non-)empty directories, and the\nlocking scheme, none of which applies to reftable.\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t1404-update-ref-errors.sh | 30 +++++++++++++++---------------\n 1 file changed, 15 insertions(+), 15 deletions(-)\n\ndiff --git a/t/t1404-update-ref-errors.sh b/t/t1404-update-ref-errors.sh\nindex 8b51c4efc135..b729c1f48030 100755\n--- a/t/t1404-update-ref-errors.sh\n+++ b/t/t1404-update-ref-errors.sh\n@@ -189,7 +189,7 @@ test_expect_success 'one new ref is a simple prefix of another' '\n \n '\n \n-test_expect_success 'empty directory should not fool rev-parse' '\n+test_expect_success REFFILES 'empty directory should not fool rev-parse' '\n \tprefix=refs/e-rev-parse &&\n \tgit update-ref $prefix/foo $C &&\n \tgit pack-refs --all &&\n@@ -199,7 +199,7 @@ test_expect_success 'empty directory should not fool rev-parse' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'empty directory should not fool for-each-ref' '\n+test_expect_success REFFILES 'empty directory should not fool for-each-ref' '\n \tprefix=refs/e-for-each-ref &&\n \tgit update-ref $prefix/foo $C &&\n \tgit for-each-ref $prefix >expected &&\n@@ -209,14 +209,14 @@ test_expect_success 'empty directory should not fool for-each-ref' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'empty directory should not fool create' '\n+test_expect_success REFFILES 'empty directory should not fool create' '\n \tprefix=refs/e-create &&\n \tmkdir -p .git/$prefix/foo/bar/baz &&\n \tprintf \"create %s $C\\n\" $prefix/foo |\n \tgit update-ref --stdin\n '\n \n-test_expect_success 'empty directory should not fool verify' '\n+test_expect_success REFFILES 'empty directory should not fool verify' '\n \tprefix=refs/e-verify &&\n \tgit update-ref $prefix/foo $C &&\n \tgit pack-refs --all &&\n@@ -225,7 +225,7 @@ test_expect_success 'empty directory should not fool verify' '\n \tgit update-ref --stdin\n '\n \n-test_expect_success 'empty directory should not fool 1-arg update' '\n+test_expect_success REFFILES 'empty directory should not fool 1-arg update' '\n \tprefix=refs/e-update-1 &&\n \tgit update-ref $prefix/foo $C &&\n \tgit pack-refs --all &&\n@@ -234,7 +234,7 @@ test_expect_success 'empty directory should not fool 1-arg update' '\n \tgit update-ref --stdin\n '\n \n-test_expect_success 'empty directory should not fool 2-arg update' '\n+test_expect_success REFFILES 'empty directory should not fool 2-arg update' '\n \tprefix=refs/e-update-2 &&\n \tgit update-ref $prefix/foo $C &&\n \tgit pack-refs --all &&\n@@ -243,7 +243,7 @@ test_expect_success 'empty directory should not fool 2-arg update' '\n \tgit update-ref --stdin\n '\n \n-test_expect_success 'empty directory should not fool 0-arg delete' '\n+test_expect_success REFFILES 'empty directory should not fool 0-arg delete' '\n \tprefix=refs/e-delete-0 &&\n \tgit update-ref $prefix/foo $C &&\n \tgit pack-refs --all &&\n@@ -252,7 +252,7 @@ test_expect_success 'empty directory should not fool 0-arg delete' '\n \tgit update-ref --stdin\n '\n \n-test_expect_success 'empty directory should not fool 1-arg delete' '\n+test_expect_success REFFILES 'empty directory should not fool 1-arg delete' '\n \tprefix=refs/e-delete-1 &&\n \tgit update-ref $prefix/foo $C &&\n \tgit pack-refs --all &&\n@@ -466,7 +466,7 @@ test_expect_success 'incorrect old value blocks indirect no-deref delete' '\n \ttest_cmp expected output.err\n '\n \n-test_expect_success 'non-empty directory blocks create' '\n+test_expect_success REFFILES 'non-empty directory blocks create' '\n \tprefix=refs/ne-create &&\n \tmkdir -p .git/$prefix/foo/bar &&\n \t: >.git/$prefix/foo/bar/baz.lock &&\n@@ -485,7 +485,7 @@ test_expect_success 'non-empty directory blocks create' '\n \ttest_cmp expected output.err\n '\n \n-test_expect_success 'broken reference blocks create' '\n+test_expect_success REFFILES 'broken reference blocks create' '\n \tprefix=refs/broken-create &&\n \tmkdir -p .git/$prefix &&\n \techo \"gobbledigook\" >.git/$prefix/foo &&\n@@ -504,7 +504,7 @@ test_expect_success 'broken reference blocks create' '\n \ttest_cmp expected output.err\n '\n \n-test_expect_success 'non-empty directory blocks indirect create' '\n+test_expect_success REFFILES 'non-empty directory blocks indirect create' '\n \tprefix=refs/ne-indirect-create &&\n \tgit symbolic-ref $prefix/symref $prefix/foo &&\n \tmkdir -p .git/$prefix/foo/bar &&\n@@ -524,7 +524,7 @@ test_expect_success 'non-empty directory blocks indirect create' '\n \ttest_cmp expected output.err\n '\n \n-test_expect_success 'broken reference blocks indirect create' '\n+test_expect_success REFFILES 'broken reference blocks indirect create' '\n \tprefix=refs/broken-indirect-create &&\n \tgit symbolic-ref $prefix/symref $prefix/foo &&\n \techo \"gobbledigook\" >.git/$prefix/foo &&\n@@ -543,7 +543,7 @@ test_expect_success 'broken reference blocks indirect create' '\n \ttest_cmp expected output.err\n '\n \n-test_expect_success 'no bogus intermediate values during delete' '\n+test_expect_success REFFILES 'no bogus intermediate values during delete' '\n \tprefix=refs/slow-transaction &&\n \t# Set up a reference with differing loose and packed versions:\n \tgit update-ref $prefix/foo $C &&\n@@ -600,7 +600,7 @@ test_expect_success 'no bogus intermediate values during delete' '\n \ttest_must_fail git rev-parse --verify --quiet $prefix/foo\n '\n \n-test_expect_success 'delete fails cleanly if packed-refs file is locked' '\n+test_expect_success REFFILES 'delete fails cleanly if packed-refs file is locked' '\n \tprefix=refs/locked-packed-refs &&\n \t# Set up a reference with differing loose and packed versions:\n \tgit update-ref $prefix/foo $C &&\n@@ -616,7 +616,7 @@ test_expect_success 'delete fails cleanly if packed-refs file is locked' '\n \ttest_cmp unchanged actual\n '\n \n-test_expect_success 'delete fails cleanly if packed-refs.new write fails' '\n+test_expect_success REFFILES 'delete fails cleanly if packed-refs.new write fails' '\n \t# Setup and expectations are similar to the test above.\n \tprefix=refs/failed-packed-refs &&\n \tgit update-ref $prefix/foo $C &&\n-- \ngitgitgadget\n\n"},{"id":"423098","messageId":"d7e5de8dba465098afa421d162df5ca7b0fb1a33.1619519903.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v2 21/21] t1415: set REFFILES for test specific to storage format","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:22Z","receivedAt":"2021-04-27T10:39:38Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nPacking refs (and therefore checking that certain refs are not packed) is a\nproperty of the packed/loose ref storage. Add a comment to explain what the test\nchecks.\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t1415-worktree-refs.sh | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t1415-worktree-refs.sh b/t/t1415-worktree-refs.sh\nindex 7ab91241ab7c..d6e6e523bbba 100755\n--- a/t/t1415-worktree-refs.sh\n+++ b/t/t1415-worktree-refs.sh\n@@ -16,7 +16,10 @@ test_expect_success 'setup' '\n \tgit -C wt2 update-ref refs/worktree/foo HEAD\n '\n \n-test_expect_success 'refs/worktree must not be packed' '\n+# The 'packed-refs' files is stored directly in .git/. This means it is global\n+# to the repository, and can only contain refs that are shared across all\n+# worktrees.\n+test_expect_success REFFILES 'refs/worktree must not be packed' '\n \tgit pack-refs --all &&\n \ttest_path_is_missing .git/refs/tags/wt1 &&\n \ttest_path_is_file .git/refs/worktree/foo &&\n-- \ngitgitgadget\n"},{"id":"423099","messageId":"a33cdfda74ff55fbc8242d3486e1fd5a26ad4c00.1619519903.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v2 20/21] t4202: mark bogus head hash test with REFFILES","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-04-27T10:38:21Z","receivedAt":"2021-04-27T10:40:04Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nIn reftable, hashes are correctly formed by design\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t4202-log.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex a8c5a00d012d..3f969b01508c 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -1834,7 +1834,7 @@ test_expect_success 'log --graph --no-walk is forbidden' '\n \ttest_must_fail git log --graph --no-walk\n '\n \n-test_expect_success 'log diagnoses bogus HEAD hash' '\n+test_expect_success REFFILES 'log diagnoses bogus HEAD hash' '\n \tgit init empty &&\n \ttest_must_fail git -C empty log 2>stderr &&\n \ttest_i18ngrep does.not.have.any.commits stderr &&\n-- \ngitgitgadget\n\n"},{"id":"423289","messageId":"CAFQ2z_Mdv=vZa5yzBjGyG_o4poNeSJsfa7-KwpVH559cWqM9Qg@mail.gmail.com","threadId":"55516","inReplyTo":"87pmyo3zvw.fsf@evledraar.gmail.com","subject":"Re: [PATCH 13/18] t2017: mark --orphan/logAllRefUpdates=false test as REFFILES","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-04-29T18:14:39Z","receivedAt":"2021-04-29T18:14:55Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Wed, Apr 21, 2021 at 8:39 AM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> > In reftable, there is no notion of a per-ref 'existence' of a reflog. Each\n> > reflog entry has its own key, so it is not possible to distinguish between\n> > {reflog doesn't exist,reflog exists but is empty}. This makes the logic\n> > in log_ref_setup() (file refs/files-backend.c), which depends on the existence\n> > of the reflog file infeasible.\n>\n> Okey, so I'd follow this if the test was doing something like \"test -e\n> .git/logs\" to test whether we didn't have reflogs for a specific branch\n> or something....\n>\n..\n> In your v7[1] of the reftable series there's no patch to\n> Documentation/revisions.txt altering that blurb.\n>\n> So it seems to me that between this & that series there's some closing\n> of the gap needed with how this \"must have an existing log\" even works\n> under reftable.\n\nthe problem is that it's using BRANCH@{0} as a way to indicate whether\nthe reflog exists or not,  and something looks at the current tip of\nBRANCH for @{0} even if the reflog is empty:\n\nhanwen@hanwen1:~/vc/git$ ls -l .git/logs/refs/heads/windows-2\n-rw-r----- 1 hanwen primarygroup 0 Apr 29 20:08 .git/logs/refs/heads/windows-2\nhanwen@hanwen1:~/vc/git$ git rev-parse windows-2@{0}\n7048e02d79350e332f34f2bfae50eb28700cbeda\nhanwen@hanwen1:~/vc/git$ rm .git/logs/refs/heads/windows-2\nhanwen@hanwen1:~/vc/git$ git rev-parse windows-2@{0}\nwindows-2@{0}\nfatal: ambiguous argument 'windows-2@{0}': unknown revision or path\nnot in the working tree.\nUse '--' to separate paths from revisions, like this:\n'git <command> [<revision>...] -- [<file>...]'\n\nin reftable, with the current implementation, all reflogs are assumed\nto exist (but possibly empty).\n\n> Per [2] I had assumed that this worked under reftable by abstracting\n> away the syntax to some query for the ref name, and faking up \"file does\n> not exist\" as \"there were no records\" to anything like rev-parse, but it\n> doesn't work like that?\n\nyou could make it work like that, but I bet that then there are a host\nof other tests that fail because they might check that a reflog exists\n(but is empty) after doing eg. \"git reflog expire --all\".\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"425109","messageId":"87a6opqwc9.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"8ad4a35cda706b1bfcd8ddcf1b1c2e1d8f692c70.1619519903.git.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 01/21] t4202: split testcase for invalid HEAD symref and HEAD hash","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-05-20T15:03:20Z","receivedAt":"2021-05-20T15:05:48Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, Apr 27 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> Reftable will prohibit invalid hashes at the storage level, but\n> git-symbolic-ref can still create branches ending in \".lock\".\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t4202-log.sh | 10 +++++++---\n>  1 file changed, 7 insertions(+), 3 deletions(-)\n>\n> diff --git a/t/t4202-log.sh b/t/t4202-log.sh\n> index 350cfa35936a..a8c5a00d012d 100755\n> --- a/t/t4202-log.sh\n> +++ b/t/t4202-log.sh\n> @@ -1834,14 +1834,18 @@ test_expect_success 'log --graph --no-walk is forbidden' '\n>  \ttest_must_fail git log --graph --no-walk\n>  '\n>  \n> -test_expect_success 'log diagnoses bogus HEAD' '\n> +test_expect_success 'log diagnoses bogus HEAD hash' '\n>  \tgit init empty &&\n>  \ttest_must_fail git -C empty log 2>stderr &&\n>  \ttest_i18ngrep does.not.have.any.commits stderr &&\n>  \techo 1234abcd >empty/.git/refs/heads/main &&\n>  \ttest_must_fail git -C empty log 2>stderr &&\n> -\ttest_i18ngrep broken stderr &&\n> -\techo \"ref: refs/heads/invalid.lock\" >empty/.git/HEAD &&\n> +\ttest_i18ngrep broken stderr'\n> +\n> +test_expect_success 'log diagnoses bogus HEAD symref' '\n> +\trm -rf empty &&\n> +\tgit init empty &&\n> +\tgit --git-dir empty/.git symbolic-ref HEAD refs/heads/invalid.lock &&\n>  \ttest_must_fail git -C empty log 2>stderr &&\n>  \ttest_i18ngrep broken stderr &&\n>  \ttest_must_fail git -C empty log --default totally-bogus 2>stderr &&\n\nWhen splitting up tests like:\n\n    git init xyz &&\n    [do with xyz]\n\nLet's do:\n\n    # test 1\n    test_when_finished \"rm -rf xyz\" &&\n    git init xyz &&\n    [do with xyz]\n\n    # test 2\n    test_when_finished \"rm -rf xyz\" &&\n    git init xyz &&\n    [do with xyz]\n\nInstead of, as here:\n\n    # test 1\n    git init xyz &&\n    [do with xyz]\n\n    # test 2\n    rm -rf xyz &&\n    git init xyz &&\n    [do with xyz]\n\nThis isn't a logic error, but just a better idiom. Better to have the\nthing creating stuff clean it up, than other tests being aware of their\norder and (possibly redundantly, if we skip tests), clean up after\nearlier tests.\n"},{"id":"425111","messageId":"877djtqw5d.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"e6222944a3eb441d44ab6c7d1e9b873f5546220a.1619519903.git.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 02/21] t/helper/ref-store: initialize oid in resolve-ref","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-05-20T15:06:59Z","receivedAt":"2021-05-20T15:09:55Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, Apr 27 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> This will print $ZERO_OID when asking for a non-existent ref from the\n> test-helper.\n>\n> Since resolve-ref provides direct access to refs_resolve_ref_unsafe(), it\n> provides a reliable mechanism for accessing REFNAME, while avoiding the implicit\n> resolution to refs/heads/REFNAME.\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/helper/test-ref-store.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c\n> index bba5f841c6ab..01d8f3285dc8 100644\n> --- a/t/helper/test-ref-store.c\n> +++ b/t/helper/test-ref-store.c\n> @@ -118,7 +118,7 @@ static int cmd_for_each_ref(struct ref_store *refs, const char **argv)\n>  \n>  static int cmd_resolve_ref(struct ref_store *refs, const char **argv)\n>  {\n> -\tstruct object_id oid;\n> +\tstruct object_id oid = { 0 };\n>  \tconst char *refname = notnull(*argv++, \"refname\");\n>  \tint resolve_flags = arg_flags(*argv++, \"resolve-flags\");\n>  \tint flags;\n\nThis feels a bit magical, later we have this:\n\n        printf(\"%s %s 0x%x\\n\", oid_to_hex(&oid), ref ? ref : \"(null)\", flags);\n\nIsn't ref always going to be NULL in that case too? Wouldn't it make\nmore sense to not zero this out and instead do:\n\n    if (ref)\n        /* current code, mostly */\n    else\n        use zero_oid()\n\nThat seems more straightforward to me than this implicit proxy for\nzero_oid(). Also, isn't the point of zero_oid() to not make this\nparticular assumption, i.e. the recent discussion (haven't followed\nwhere it went) of the \"oid\" having some sort of \"hash type\" member,\nwhich surely would do the wrong thing here under either SHA-1 or\nSHA-256, or maybe I mis(understood|remember) that discussion...\n"},{"id":"425115","messageId":"874kexqvxy.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"c5855b0caa7320c8b3f1ad5c5904ae73b1decb97.1619519903.git.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 03/21] t9300: check ref existence using test-helper rather than a file system check","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-05-20T15:11:36Z","receivedAt":"2021-05-20T15:14:21Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, Apr 27 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t9300-fast-import.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\n> index 5c47ac4465cb..1aea943bef72 100755\n> --- a/t/t9300-fast-import.sh\n> +++ b/t/t9300-fast-import.sh\n> @@ -392,7 +392,7 @@ test_expect_success 'B: accept branch name \"TEMP_TAG\"' '\n>  \t\tgit gc\n>  \t\tgit prune\" &&\n>  \tgit fast-import <input &&\n> -\ttest -f .git/TEMP_TAG &&\n> +\ttest $(test-tool ref-store main resolve-ref TEMP_TAG 0 | cut -f1 -d \" \" ) != \"$ZERO_OID\" &&\n>  \ttest $(git rev-parse main) = $(git rev-parse TEMP_TAG^)\n>  '\n\nWe have resolve-ref and verify-ref in the helper, why not a few-line\n\"exists-ref\" or similar instead of needing to parse this out with\nshell/cut/test?\n\nI haven't tested, but in resolve-ref we do this:\n\n        printf(\"%s %s 0x%x\\n\", oid_to_hex(&oid), ref ? ref : \"(null)\", flags);\n        return ref ? 0 : 1;\n\nSo re my earlier question about \"ref\" being NULL or not, isn't this\ngoing to be reflected by the exit code of resolve-ref already? I.e. any\n\"exists-ref\" would just be a convenience wrapper equivalent to a\n\"--quiet\" flag for resolve-ref, no?\n"},{"id":"425116","messageId":"871ra1qvli.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"248d9ffe79272c7a6efef64512d72ccb9a91349a.1619519903.git.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 05/21] t1401-symbolic-ref: avoid direct filesystem access","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-05-20T15:20:08Z","receivedAt":"2021-05-20T15:22:15Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, Apr 27 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t1401-symbolic-ref.sh | 34 +++++++++++++++++-----------------\n>  1 file changed, 17 insertions(+), 17 deletions(-)\n>\n> diff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh\n> index a4ebb0b65fec..315a62f78019 100755\n> --- a/t/t1401-symbolic-ref.sh\n> +++ b/t/t1401-symbolic-ref.sh\n> @@ -3,21 +3,20 @@\n>  test_description='basic symbolic-ref tests'\n>  . ./test-lib.sh\n>  \n> -# If the tests munging HEAD fail, they can break detection of\n> -# the git repo, meaning that further tests will operate on\n> -# the surrounding git repo instead of the trash directory.\n> -reset_to_sane() {\n> -\techo ref: refs/heads/foo >.git/HEAD\n> -}\n> -\n> -test_expect_success 'symbolic-ref writes HEAD' '\n> +test_expect_success 'setup' '\n>  \tgit symbolic-ref HEAD refs/heads/foo &&\n> -\techo ref: refs/heads/foo >expect &&\n> -\ttest_cmp expect .git/HEAD\n> +\ttest_commit file &&\n> +\t\"$TAR\" cf .git.tar .git/\n>  '\n>  \n> -test_expect_success 'symbolic-ref reads HEAD' '\n> -\techo refs/heads/foo >expect &&\n> +reset_to_sane() {\n> +\trm -rf .git &&\n> +\t\"$TAR\" xf .git.tar\n> +}\n> +\n> +test_expect_success 'symbolic-ref read/write roundtrip' '\n> +\tgit symbolic-ref HEAD refs/heads/read-write-roundtrip &&\n> +\techo refs/heads/read-write-roundtrip >expect &&\n>  \tgit symbolic-ref HEAD >actual &&\n>  \ttest_cmp expect actual\n>  '\n> @@ -25,12 +24,13 @@ test_expect_success 'symbolic-ref reads HEAD' '\n>  test_expect_success 'symbolic-ref refuses non-ref for HEAD' '\n>  \ttest_must_fail git symbolic-ref HEAD foo\n>  '\n> +\n>  reset_to_sane\n>  \n>  test_expect_success 'symbolic-ref refuses bare sha1' '\n> -\techo content >file && git add file && git commit -m one &&\n>  \ttest_must_fail git symbolic-ref HEAD $(git rev-parse HEAD)\n>  '\n> +\n>  reset_to_sane\n>  \n>  test_expect_success 'HEAD cannot be removed' '\n> @@ -42,16 +42,16 @@ reset_to_sane\n>  test_expect_success 'symbolic-ref can be deleted' '\n>  \tgit symbolic-ref NOTHEAD refs/heads/foo &&\n>  \tgit symbolic-ref -d NOTHEAD &&\n> -\ttest_path_is_file .git/refs/heads/foo &&\n> -\ttest_path_is_missing .git/NOTHEAD\n> +\tgit rev-parse refs/heads/foo &&\n> +\ttest_must_fail git symbolic-ref NOTHEAD\n>  '\n>  reset_to_sane\n>  \n>  test_expect_success 'symbolic-ref can delete dangling symref' '\n>  \tgit symbolic-ref NOTHEAD refs/heads/missing &&\n>  \tgit symbolic-ref -d NOTHEAD &&\n> -\ttest_path_is_missing .git/refs/heads/missing &&\n> -\ttest_path_is_missing .git/NOTHEAD\n> +\ttest_must_fail git rev-parse refs/heads/missing &&\n> +\ttest_must_fail git symbolic-ref NOTHEAD\n>  '\n>  reset_to_sane\n\nYou do end up needing to refactor some rather nasty patterns in this\nseries, so this isn't on you initially...\n\nBut since we're encountering this \"reset_to_sane\" pattern, can't we just\nas easily fix it up with something more obvious than replacing an echo\nto a specific ref with a tarring up and untarring of the whole .git each\ntime?\n\nI.e. something like:\n\n   # setup the .git initially\n\nThen:\n\n   test_when_finished \"rm -rf copy\" &&\n   git clone . copy &&\n   # munge the repo and use \"git -C copy\" for the tests\"\n\n?\n"},{"id":"425117","messageId":"87y2c9pgym.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"e4e8fc1d4b4f450d46dd320ffc2398515044b28a.1619519903.git.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 06/21] t1413: use tar to save and restore entire .git directory","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-05-20T15:22:12Z","receivedAt":"2021-05-20T15:23:45Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, Apr 27 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> This makes the test independent of the particulars of the storage formats.\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t1413-reflog-detach.sh | 5 ++---\n>  1 file changed, 2 insertions(+), 3 deletions(-)\n>\n> diff --git a/t/t1413-reflog-detach.sh b/t/t1413-reflog-detach.sh\n> index bde05208ae6a..934688a1ee82 100755\n> --- a/t/t1413-reflog-detach.sh\n> +++ b/t/t1413-reflog-detach.sh\n> @@ -7,8 +7,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n>  . ./test-lib.sh\n>  \n>  reset_state () {\n> -\tgit checkout main &&\n> -\tcp saved_reflog .git/logs/HEAD\n> +\trm -rf .git && \"$TAR\" xf .git-saved.tar\n>  }\n>  \n>  test_expect_success setup '\n> @@ -17,7 +16,7 @@ test_expect_success setup '\n>  \tgit branch side &&\n>  \ttest_tick &&\n>  \tgit commit --allow-empty -m second &&\n> -\tcat .git/logs/HEAD >saved_reflog\n> +\t\"$TAR\" cf .git-saved.tar .git\n>  '\n>  \n>  test_expect_success baseline '\n\nSo what I said in 05, but also didn't the commit messages of 05 and 06\nget mixed up / bad fixup in a WIP version? I.e. the first commit says\n\"use symbolic ref\", but it's mostly about introducing the use of this\ntar/untar pattern.\n\nWhereas this continues the tarring pattern, and doesn't start using it,\nand (presumably) is the mis-squashed commit that should have added this\nwhole tar thing after the first commit does the isolated\ns/echo/symbolic-ref/ fix.\n"},{"id":"425118","messageId":"87v97dpgtf.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"e67b90847c4eb78fff786944c04413f8a02cffb4.1619519903.git.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 08/21] t5000: reformat indentation to the latest fashion","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-05-20T15:24:11Z","receivedAt":"2021-05-20T15:26:28Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, Apr 27 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t5000-tar-tree.sh | 104 ++++++++++++++++++++++----------------------\n>  1 file changed, 53 insertions(+), 51 deletions(-)\n>\n> diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\n> index 7204799a0b52..b6734cba7e65 100755\n> --- a/t/t5000-tar-tree.sh\n> +++ b/t/t5000-tar-tree.sh\n> @@ -111,25 +111,25 @@ test_expect_success 'setup' '\n>  \tEOF\n>  '\n>  \n> -test_expect_success \\\n> -    'populate workdir' \\\n> -    'mkdir a &&\n> -     echo simple textfile >a/a &&\n> -     ten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&\n> -     echo long filename >a/four$hundred &&\n> -     mkdir a/bin &&\n> -     test-tool genrandom \"frotz\" 500000 >a/bin/sh &&\n> -     printf \"A\\$Format:%s\\$O\" \"$SUBSTFORMAT\" >a/substfile1 &&\n> -     printf \"A not substituted O\" >a/substfile2 &&\n> -     if test_have_prereq SYMLINKS; then\n> -\tln -s a a/l1\n> -     else\n> -\tprintf %s a > a/l1\n> -     fi &&\n> -     (p=long_path_to_a_file && cd a &&\n> -      for depth in 1 2 3 4 5; do mkdir $p && cd $p; done &&\n> -      echo text >file_with_long_path) &&\n> -     (cd a && find .) | sort >a.lst'\n> +test_expect_success 'populate workdir' '\n> +\tmkdir a &&\n> +\techo simple textfile >a/a &&\n> +\tten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&\n> +\techo long filename >a/four$hundred &&\n> +\tmkdir a/bin &&\n> +\ttest-tool genrandom \"frotz\" 500000 >a/bin/sh &&\n> +\tprintf \"A\\$Format:%s\\$O\" \"$SUBSTFORMAT\" >a/substfile1 &&\n> +\tprintf \"A not substituted O\" >a/substfile2 &&\n> +\tif test_have_prereq SYMLINKS; then\n> +\t\tln -s a a/l1\n> +\telse\n> +\t\tprintf %s a >a/l1\n> +\tfi &&\n> +\t(p=long_path_to_a_file && cd a &&\n> +\t\tfor depth in 1 2 3 4 5; do mkdir $p && cd $p; done &&\n> +\t\techo text >file_with_long_path) &&\n> +\t(cd a && find .) | sort >a.lst\n> +'\n\nSince we're refactoring this anyway, let's:\n\n * split up ten=... hundred=... into two lines\n * put \"; then\" on its own line, if ...\\nthen\\n...\n * split up that sub-shell into (\\np=...&& ..., i.e. our usual style, some with the one-line for-loop\n\n>  test_expect_success \\\n>      'add ignored file' \\\n> @@ -147,18 +147,18 @@ test_expect_success 'setup export-subst' '\n>  \t\t>a/substfile1\n>  '\n>  \n> -test_expect_success \\\n> -    'create bare clone' \\\n> -    'git clone --bare . bare.git &&\n> -     cp .git/info/attributes bare.git/info/attributes'\n> +test_expect_success 'create bare clone' '\n> +\tgit clone --bare . bare.git &&\n> +\tcp .git/info/attributes bare.git/info/attributes\n> +'\n>  \n> -test_expect_success \\\n> -    'remove ignored file' \\\n> -    'rm a/ignored'\n> +test_expect_success 'remove ignored file' '\n> +\trm a/ignored\n> +'\n>  \n> -test_expect_success \\\n> -    'git archive' \\\n> -    'git archive HEAD >b.tar'\n> +test_expect_success 'git archive' '\n> +\tgit archive HEAD >b.tar\n> +'\n>  \n>  check_tar b\n>  \n> @@ -194,26 +194,28 @@ check_added with_untracked2 untracked one/untracked\n>  check_added with_untracked2 untracked two/untracked\n>  \n>  test_expect_success 'git archive on large files' '\n> -    test_config core.bigfilethreshold 1 &&\n> -    git archive HEAD >b3.tar &&\n> -    test_cmp_bin b.tar b3.tar\n> +\ttest_config core.bigfilethreshold 1 &&\n> +\tgit archive HEAD >b3.tar &&\n> +\ttest_cmp_bin b.tar b3.tar\n>  '\n>  \n> -test_expect_success \\\n> -    'git archive in a bare repo' \\\n> -    '(cd bare.git && git archive HEAD) >b3.tar'\n> +test_expect_success 'git archive in a bare repo' '\n> +\t(cd bare.git && git archive HEAD) >b3.tar\n> +'\n\nDitto subshell etc. on one line, can't this be git -C bare.git archive\nHEAD >b3.tar?\n\n>  \n> -test_expect_success \\\n> -    'git archive vs. the same in a bare repo' \\\n> -    'test_cmp_bin b.tar b3.tar'\n> +test_expect_success 'git archive vs. the same in a bare repo' '\n> +\ttest_cmp_bin b.tar b3.tar\n> +'\n>  \n> -test_expect_success 'git archive with --output' \\\n> -    'git archive --output=b4.tar HEAD &&\n> -    test_cmp_bin b.tar b4.tar'\n> +test_expect_success 'git archive with --output' '\n> +\tgit archive --output=b4.tar HEAD &&\n> +\ttest_cmp_bin b.tar b4.tar\n> +'\n>  \n> -test_expect_success 'git archive --remote' \\\n> -    'git archive --remote=. HEAD >b5.tar &&\n> -    test_cmp_bin b.tar b5.tar'\n> +test_expect_success 'git archive --remote' '\n> +\tgit archive --remote=. HEAD >b5.tar &&\n> +\ttest_cmp_bin b.tar b5.tar\n> +'\n>  \n>  test_expect_success 'git archive --remote with configured remote' '\n>  \tgit config remote.foo.url . &&\n> @@ -224,13 +226,13 @@ test_expect_success 'git archive --remote with configured remote' '\n>  \ttest_cmp_bin b.tar b5-nick.tar\n>  '\n>  \n> -test_expect_success \\\n> -    'validate file modification time' \\\n> -    'mkdir extract &&\n> -     \"$TAR\" xf b.tar -C extract a/a &&\n> -     test-tool chmtime --get extract/a/a >b.mtime &&\n> -     echo \"1117231200\" >expected.mtime &&\n> -     test_cmp expected.mtime b.mtime'\n> +test_expect_success 'validate file modification time' '\n> +\tmkdir extract &&\n> +\t\"$TAR\" xf b.tar -C extract a/a &&\n> +\ttest-tool chmtime --get extract/a/a >b.mtime &&\n> +\techo \"1117231200\" >expected.mtime &&\n> +\ttest_cmp expected.mtime b.mtime\n> +'\n>  \n>  test_expect_success \\\n>      'git get-tar-commit-id' \\\n\n"},{"id":"425119","messageId":"87sg2hpgpk.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"d8e80d83b6f8ee929b187aaffd5f37c3c981b50b.1619519903.git.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 12/21] t5304: use \"reflog expire --all\" to clear the reflog","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-05-20T15:27:23Z","receivedAt":"2021-05-20T15:28:45Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, Apr 27 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> This is more explicit, and reduces the depency between test functions. It also\n> is more amenable to use with reftable, which has no concept of (non)existence of\n> a reflog\n\nSounds good in principle, but:\n\n> @@ -94,9 +94,7 @@ test_expect_success 'prune: prune unreachable heads' '\n>  test_expect_success 'prune: do not prune detached HEAD with no reflog' '\n>  \tgit checkout --detach --quiet &&\n>  \tgit commit --allow-empty -m \"detached commit\" &&\n> -\t# verify that there is no reflogs\n> -\t# (should be removed and disabled by previous test)\n> -\ttest_path_is_missing .git/logs &&\n> +\tgit reflog expire --all &&\n>  \tgit prune -n >prune_actual &&\n>  \ttest_must_be_empty prune_actual\n>  '\n\nIsn't the point of the existing test to check that there isn't an\nexisting reflog, not to just expire it if we find it, or does expire\n--all return non-zero if none was found ?\n\n> @@ -104,6 +102,7 @@ test_expect_success 'prune: do not prune detached HEAD with no reflog' '\n>  test_expect_success 'prune: prune former HEAD after checking out branch' '\n>  \thead_oid=$(git rev-parse HEAD) &&\n>  \tgit checkout --quiet main &&\n> +\tgit reflog expire --all &&\n>  \tgit prune -v >prune_actual &&\n>  \tgrep \"$head_oid\" prune_actual\n>  '\n\nJust skimming this I'm perplexed why this needs expiring now, as opposed\nto being s/file/command/ changes like the rest...\n"},{"id":"425120","messageId":"87pmxlpgb1.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"0d3b18cd35423dadd35d55073bd7230bfc908fee.1619519903.git.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 15/21] t1414: mark corruption test with REFFILES","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-05-20T15:31:28Z","receivedAt":"2021-05-20T15:37:27Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, Apr 27 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> The reftable format guarantees that reflog entries are well-formed\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t1414-reflog-walk.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t1414-reflog-walk.sh b/t/t1414-reflog-walk.sh\n> index 80d94704d012..72a5ac61a520 100755\n> --- a/t/t1414-reflog-walk.sh\n> +++ b/t/t1414-reflog-walk.sh\n> @@ -119,7 +119,7 @@ test_expect_success 'min/max age uses entry date to limit' '\n>  \ttest_cmp expect actual\n>  '\n>  \n> -test_expect_success 'walk prefers reflog to ref tip' '\n> +test_expect_success REFFILES 'walk prefers reflog to ref tip' '\n>  \thead=$(git rev-parse HEAD) &&\n>  \tone=$(git rev-parse one) &&\n>  \tident=\"$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE\" &&\n\nIsn't the point of this test added in 7cf686b9a8 (t1414: document some\nreflog-walk oddities, 2017-07-07) to test what we do not when the reflog\nisn't well formed, but when the reflog and branch history disagree about\nwhat the latest tip is?\n\nPerhaps reftable is going to guarantee that that'll never happen via\nsome transaction mechanism (I'm not sure), but if I'm right then I think\nit's worth at least calling out that difference in the commit message\nand/or modified test description.\n\nNot a big deal, but this also makes me somewhat question the name\n\"REFFILES\" as a prereq if we really mean (as we are in the first test\nthat uses this) \"we don't need this under reftable, specifically\".\n\nMaybe I'm overthinking things and it's stupid to split these up, as we\nhave no other planned ref backend, but for any such future test backend\n/ readability I'd find it much easier to grok if we clearly\ndeliniate/use REFFILES for tests that really are testing the ref files\nbackend specifically, v.s. say a !REFTABLE for things that we're\nskipping because REFTABLE in particular makes certain guarantees we can\ncount on. Say that the reflog and branch is never out of sync.\n\nOf course this also uses ref .. files, anyway, just food for thought.\n"},{"id":"425121","messageId":"87mtsppg8e.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"b64e3e7ade1583f5ff669cfb6510f5d7402be028.1619519903.git.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 16/21] t2017: mark --orphan/logAllRefUpdates=false test as REFFILES","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-05-20T15:38:02Z","receivedAt":"2021-05-20T15:39:02Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, Apr 27 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> In reftable, there is no notion of a per-ref 'existence' of a reflog. Each\n> reflog entry has its own key, so it is not possible to distinguish between\n> {reflog doesn't exist,reflog exists but is empty}. This makes the logic\n> in log_ref_setup() (file refs/files-backend.c), which depends on the existence\n> of the reflog file infeasible.\n\nOkey...\n\n> -test_expect_success '--orphan does not make reflog when core.logAllRefUpdates = false' '\n> +test_expect_success REFFILES '--orphan does not make reflog when core.logAllRefUpdates = false' '\n>  \tgit checkout main &&\n>  \tgit config core.logAllRefUpdates false &&\n>  \tgit checkout --orphan epsilon &&\n\nBut let's not simply skip the test, but positively test for the reftable\nbehavior here, or maybe that's planned for a later series.\n"},{"id":"425122","messageId":"87k0ntpg48.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"ff3b67c84c412dafaa506355e83427a731b47623.1619519903.git.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 18/21] t7900: mark pack-refs tests as REFFILES","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-05-20T15:40:14Z","receivedAt":"2021-05-20T15:41:31Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, Apr 27 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> Reftable automatically compacts tables on writes. The functionality of\n> incremental compaction is unittested in reftable/stack_test.c\n> (test_reftable_stack_auto_compaction)\n>\n> In addition, pack-refs triggers a full compaction of the entire stack. This is\n> exercised in t0031-reftable.sh.\n>\n> Given that git-maintenance simply calls out git-pack-refs, it seems superfluous\n> to test this further for reftable.\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t7900-maintenance.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh\n> index 2412d8c5c006..6f2f55a6c51d 100755\n> --- a/t/t7900-maintenance.sh\n> +++ b/t/t7900-maintenance.sh\n> @@ -343,7 +343,7 @@ test_expect_success 'maintenance.incremental-repack.auto' '\n>  \ttest_subcommand git multi-pack-index write --no-progress <trace-B\n>  '\n>  \n> -test_expect_success 'pack-refs task' '\n> +test_expect_success REFFILES 'pack-refs task' '\n>  \tfor n in $(test_seq 1 5)\n>  \tdo\n>  \t\tgit branch -f to-pack/$n HEAD || return 1\n\nI don't think it's superfluous to test what \"git maintenance\" does\nanyway, i.e. the test ends with:\n\n    test_subcommand git pack-refs --all --prune\n\nShouldn't we test that we .. don't run that, abort, warn, whatever?\nAnyway, as with another earlier comment of mine we're going to have\nchicken & egg problems with amending these tests and then actually\nintroducing reftable support, so maybe \"not yet\", but I worry in general\nabout the loss of coverage...\n"},{"id":"425123","messageId":"87h7ixpg2l.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"24dcf05d8fa6172d04ca047a860ad5019aad17b7.1619519903.git.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 19/21] t7003: check reflog existence only for REFFILES","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-05-20T15:41:52Z","receivedAt":"2021-05-20T15:42:31Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, Apr 27 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t7003-filter-branch.sh | 5 ++++-\n>  1 file changed, 4 insertions(+), 1 deletion(-)\n>\n> diff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\n> index cf30055c88dd..e18a21895238 100755\n> --- a/t/t7003-filter-branch.sh\n> +++ b/t/t7003-filter-branch.sh\n> @@ -396,7 +396,10 @@ test_expect_success '--prune-empty is able to prune entire branch' '\n>  \tgit branch prune-entire B &&\n>  \tgit filter-branch -f --prune-empty --index-filter \"git update-index --remove A.t B.t\" prune-entire &&\n>  \ttest_must_fail git rev-parse refs/heads/prune-entire &&\n> -\ttest_must_fail git reflog exists refs/heads/prune-entire\n> +\tif test_have_prereq REFFILES\n> +\tthen\n> +\t\ttest_must_fail git reflog exists refs/heads/prune-entire\n> +\tfi\n>  '\n>  \n>  test_expect_success '--remap-to-ancestor with filename filters' '\n\nDitto chicken and egg, but isn't this conflating \"we always write logs\"\nv.s. reftable just behaving differently, i.e. shouldn't this be\npositively asserting that we have the log *for that branch* still after\nits deletion?\n"},{"id":"425124","messageId":"87eee1pfzk.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"a33cdfda74ff55fbc8242d3486e1fd5a26ad4c00.1619519903.git.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 20/21] t4202: mark bogus head hash test with REFFILES","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-05-20T15:43:16Z","receivedAt":"2021-05-20T15:44:24Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, Apr 27 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> In reftable, hashes are correctly formed by design\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t4202-log.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t4202-log.sh b/t/t4202-log.sh\n> index a8c5a00d012d..3f969b01508c 100755\n> --- a/t/t4202-log.sh\n> +++ b/t/t4202-log.sh\n> @@ -1834,7 +1834,7 @@ test_expect_success 'log --graph --no-walk is forbidden' '\n>  \ttest_must_fail git log --graph --no-walk\n>  '\n>  \n> -test_expect_success 'log diagnoses bogus HEAD hash' '\n> +test_expect_success REFFILES 'log diagnoses bogus HEAD hash' '\n>  \tgit init empty &&\n>  \ttest_must_fail git -C empty log 2>stderr &&\n>  \ttest_i18ngrep does.not.have.any.commits stderr &&\n\nOkey, they're correctly formed by design, but the first test here is\njust checking what happens when we do a \"git log\" on a repo with no\ncommits. What does that have to do with reflog's guarantees that we have\na valid-looking SHA in some entry in its database?\n\nSurely we also want to test for the same thing, the ref backend doesn't\nchange that we have no commits or refs yet, no?\n"},{"id":"425125","messageId":"87bl95pfnt.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"d7e5de8dba465098afa421d162df5ca7b0fb1a33.1619519903.git.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 21/21] t1415: set REFFILES for test specific to storage format","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-05-20T15:50:37Z","receivedAt":"2021-05-20T15:51:24Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, Apr 27 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> From: Han-Wen Nienhuys <hanwen@google.com>\n>\n> Packing refs (and therefore checking that certain refs are not packed) is a\n> property of the packed/loose ref storage. Add a comment to explain what the test\n> checks.\n>\n> Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> ---\n>  t/t1415-worktree-refs.sh | 5 ++++-\n>  1 file changed, 4 insertions(+), 1 deletion(-)\n>\n> diff --git a/t/t1415-worktree-refs.sh b/t/t1415-worktree-refs.sh\n> index 7ab91241ab7c..d6e6e523bbba 100755\n> --- a/t/t1415-worktree-refs.sh\n> +++ b/t/t1415-worktree-refs.sh\n> @@ -16,7 +16,10 @@ test_expect_success 'setup' '\n>  \tgit -C wt2 update-ref refs/worktree/foo HEAD\n>  '\n>  \n> -test_expect_success 'refs/worktree must not be packed' '\n> +# The 'packed-refs' files is stored directly in .git/. This means it is global\n> +# to the repository, and can only contain refs that are shared across all\n> +# worktrees.\n> +test_expect_success REFFILES 'refs/worktree must not be packed' '\n>  \tgit pack-refs --all &&\n>  \ttest_path_is_missing .git/refs/tags/wt1 &&\n>  \ttest_path_is_file .git/refs/worktree/foo &&\n\nNit but also chicken & egg: Let's keep the \"pack-refs --all\" though\nunder reftable in its own test, and do the test_path_* assertions just\nunder REFFILES, i.e. does/should pack-refs warn/error under reftable as\nredundant, succeed silently?\n"},{"id":"425129","messageId":"878s49pdmd.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"Re: [PATCH v2 00/21] Prepare tests for reftable backend","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-05-20T16:28:47Z","receivedAt":"2021-05-20T16:35:28Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Tue, Apr 27 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> Rewrites some tests to avoid direct filesystem access.\n>\n> Introduces the test prereq REFFILES to mark other tests that depend on\n> specifics of the files ref backend.\n>\n> changes in v2 (relative to v1 from Apr 19)\n>\n>  * t9300: use ref-store test-helper to read toplevel tag.\n>  * t1401: use $TAR for restoring.\n>  * t1407: clarify what test is doing.\n>  * t1417: \"$TAR\" rather than tar\n>  * t1415: clarify test objective.\n>  * t7003: formatting.\n>  * README entry for REFFILES.\n>\n> cc: SZEDER Gábor szeder.dev@gmail.com cc: Ævar Arnfjörð Bjarmason\n> avarab@gmail.com cc: Han-Wen Nienhuys hanwen@google.com\n>\n> cc: Han-Wen Nienhuys hanwen@google.com\n>\n> Han-Wen Nienhuys (21):\n>   t4202: split testcase for invalid HEAD symref and HEAD hash\n>   t/helper/ref-store: initialize oid in resolve-ref\n>   t9300: check ref existence using test-helper rather than a file system\n>     check\n>   t5601: read HEAD using rev-parse\n>   t1401-symbolic-ref: avoid direct filesystem access\n>   t1413: use tar to save and restore entire .git directory\n>   t1301: fix typo in error message\n>   t5000: reformat indentation to the latest fashion\n>   t5000: inspect HEAD using git-rev-parse\n>   t7003: use rev-parse rather than FS inspection\n>   t5304: restyle: trim empty lines, drop ':' before >\n>   t5304: use \"reflog expire --all\" to clear the reflog\n>   test-lib: provide test prereq REFFILES\n>   t1407: require REFFILES for for_each_reflog test\n>   t1414: mark corruption test with REFFILES\n>   t2017: mark --orphan/logAllRefUpdates=false test as REFFILES\n>   t1404: mark tests that muck with .git directly as REFFILES.\n>   t7900: mark pack-refs tests as REFFILES\n>   t7003: check reflog existence only for REFFILES\n>   t4202: mark bogus head hash test with REFFILES\n>   t1415: set REFFILES for test specific to storage format\n>\n>  t/README                      |   6 ++\n>  t/helper/test-ref-store.c     |   2 +-\n>  t/t1301-shared-repo.sh        |   2 +-\n>  t/t1401-symbolic-ref.sh       |  34 +++++-----\n>  t/t1404-update-ref-errors.sh  |  30 ++++-----\n>  t/t1407-worktree-ref-store.sh |   9 ++-\n>  t/t1413-reflog-detach.sh      |   5 +-\n>  t/t1414-reflog-walk.sh        |   2 +-\n>  t/t1415-worktree-refs.sh      |   5 +-\n>  t/t2017-checkout-orphan.sh    |   2 +-\n>  t/t4202-log.sh                |  10 ++-\n>  t/t5000-tar-tree.sh           | 113 +++++++++++++++++-----------------\n>  t/t5304-prune.sh              |  83 ++++++++-----------------\n>  t/t5601-clone.sh              |   3 +-\n>  t/t7003-filter-branch.sh      |   7 ++-\n>  t/t7900-maintenance.sh        |   2 +-\n>  t/t9300-fast-import.sh        |   2 +-\n>  t/test-lib.sh                 |   2 +\n>  18 files changed, 156 insertions(+), 163 deletions(-)\n>\n>\n> base-commit: 311531c9de557d25ac087c1637818bd2aad6eb3a\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1008%2Fhanwen%2Freffiles-v2\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1008/hanwen/reffiles-v2\n> Pull-Request: https://github.com/git/git/pull/1008\n>\n> Range-diff vs v1:\n>\n>   1:  91ef012cbcc9 !  1:  8ad4a35cda70 t4202: split testcase for invalid HEAD symref and HEAD hash\n>      @@ t/t4202-log.sh: test_expect_success 'log --graph --no-walk is forbidden' '\n>       +\ttest_i18ngrep broken stderr'\n>       +\n>       +test_expect_success 'log diagnoses bogus HEAD symref' '\n>      ++\trm -rf empty &&\n>       +\tgit init empty &&\n>       +\tgit --git-dir empty/.git symbolic-ref HEAD refs/heads/invalid.lock &&\n>        \ttest_must_fail git -C empty log 2>stderr &&\n>   -:  ------------ >  2:  e6222944a3eb t/helper/ref-store: initialize oid in resolve-ref\n>   2:  ccc26a8950be !  3:  c5855b0caa73 t9300: check ref existence using git-rev-parse rather than FS check\n>      @@ Metadata\n>       Author: Han-Wen Nienhuys <hanwen@google.com>\n>       \n>        ## Commit message ##\n>      -    t9300: check ref existence using git-rev-parse rather than FS check\n>      +    t9300: check ref existence using test-helper rather than a file system check\n>       \n>           Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n>       \n>      @@ t/t9300-fast-import.sh: test_expect_success 'B: accept branch name \"TEMP_TAG\"' '\n>        \t\tgit prune\" &&\n>        \tgit fast-import <input &&\n>       -\ttest -f .git/TEMP_TAG &&\n>      -+\tgit rev-parse TEMP_TAG &&\n>      ++\ttest $(test-tool ref-store main resolve-ref TEMP_TAG 0 | cut -f1 -d \" \" ) != \"$ZERO_OID\" &&\n>        \ttest $(git rev-parse main) = $(git rev-parse TEMP_TAG^)\n>        '\n>        \n>   3:  47b5ec56a383 =  4:  369c968ab837 t5601: read HEAD using rev-parse\n>   4:  53cf1069552b !  5:  248d9ffe7927 t1401-symbolic-ref: avoid direct filesystem access\n>      @@ Commit message\n>           Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n>       \n>        ## t/t1401-symbolic-ref.sh ##\n>      -@@ t/t1401-symbolic-ref.sh: test_description='basic symbolic-ref tests'\n>      - # the git repo, meaning that further tests will operate on\n>      - # the surrounding git repo instead of the trash directory.\n>      - reset_to_sane() {\n>      --\techo ref: refs/heads/foo >.git/HEAD\n>      -+\tgit --git-dir .git symbolic-ref HEAD refs/heads/foo\n>      - }\n>      +@@\n>      + test_description='basic symbolic-ref tests'\n>      + . ./test-lib.sh\n>        \n>      +-# If the tests munging HEAD fail, they can break detection of\n>      +-# the git repo, meaning that further tests will operate on\n>      +-# the surrounding git repo instead of the trash directory.\n>      +-reset_to_sane() {\n>      +-\techo ref: refs/heads/foo >.git/HEAD\n>      +-}\n>      +-\n>       -test_expect_success 'symbolic-ref writes HEAD' '\n>      --\tgit symbolic-ref HEAD refs/heads/foo &&\n>      ++test_expect_success 'setup' '\n>      + \tgit symbolic-ref HEAD refs/heads/foo &&\n>       -\techo ref: refs/heads/foo >expect &&\n>       -\ttest_cmp expect .git/HEAD\n>      --'\n>      --\n>      ++\ttest_commit file &&\n>      ++\t\"$TAR\" cf .git.tar .git/\n>      + '\n>      + \n>       -test_expect_success 'symbolic-ref reads HEAD' '\n>       -\techo refs/heads/foo >expect &&\n>      --\tgit symbolic-ref HEAD >actual &&\n>      ++reset_to_sane() {\n>      ++\trm -rf .git &&\n>      ++\t\"$TAR\" xf .git.tar\n>      ++}\n>      ++\n>       +test_expect_success 'symbolic-ref read/write roundtrip' '\n>       +\tgit symbolic-ref HEAD refs/heads/read-write-roundtrip &&\n>      -+\techo refs/heads/read-write-roundtrip > expect &&\n>      -+\tgit symbolic-ref HEAD > actual &&\n>      ++\techo refs/heads/read-write-roundtrip >expect &&\n>      + \tgit symbolic-ref HEAD >actual &&\n>        \ttest_cmp expect actual\n>        '\n>      +@@ t/t1401-symbolic-ref.sh: test_expect_success 'symbolic-ref reads HEAD' '\n>      + test_expect_success 'symbolic-ref refuses non-ref for HEAD' '\n>      + \ttest_must_fail git symbolic-ref HEAD foo\n>      + '\n>      ++\n>      + reset_to_sane\n>      + \n>      + test_expect_success 'symbolic-ref refuses bare sha1' '\n>      +-\techo content >file && git add file && git commit -m one &&\n>      + \ttest_must_fail git symbolic-ref HEAD $(git rev-parse HEAD)\n>      + '\n>      ++\n>      + reset_to_sane\n>        \n>      + test_expect_success 'HEAD cannot be removed' '\n>       @@ t/t1401-symbolic-ref.sh: reset_to_sane\n>        test_expect_success 'symbolic-ref can be deleted' '\n>        \tgit symbolic-ref NOTHEAD refs/heads/foo &&\n>      @@ t/t1401-symbolic-ref.sh: reset_to_sane\n>       -\ttest_path_is_file .git/refs/heads/foo &&\n>       -\ttest_path_is_missing .git/NOTHEAD\n>       +\tgit rev-parse refs/heads/foo &&\n>      -+\t! git symbolic-ref NOTHEAD\n>      ++\ttest_must_fail git symbolic-ref NOTHEAD\n>        '\n>        reset_to_sane\n>        \n>      @@ t/t1401-symbolic-ref.sh: reset_to_sane\n>        \tgit symbolic-ref -d NOTHEAD &&\n>       -\ttest_path_is_missing .git/refs/heads/missing &&\n>       -\ttest_path_is_missing .git/NOTHEAD\n>      -+\t! git rev-parse refs/heads/missing &&\n>      -+\t! git symbolic-ref NOTHEAD\n>      ++\ttest_must_fail git rev-parse refs/heads/missing &&\n>      ++\ttest_must_fail git symbolic-ref NOTHEAD\n>        '\n>        reset_to_sane\n>        \n>   5:  223583594c00 !  6:  e4e8fc1d4b4f t1413: use tar to save and restore entire .git directory\n>      @@ t/t1413-reflog-detach.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n>        reset_state () {\n>       -\tgit checkout main &&\n>       -\tcp saved_reflog .git/logs/HEAD\n>      -+\trm -rf .git && tar -xf .git-saved.tar\n>      ++\trm -rf .git && \"$TAR\" xf .git-saved.tar\n>        }\n>        \n>        test_expect_success setup '\n>      @@ t/t1413-reflog-detach.sh: test_expect_success setup '\n>        \ttest_tick &&\n>        \tgit commit --allow-empty -m second &&\n>       -\tcat .git/logs/HEAD >saved_reflog\n>      -+\ttar -cf .git-saved.tar .git\n>      ++\t\"$TAR\" cf .git-saved.tar .git\n>        '\n>        \n>        test_expect_success baseline '\n>   6:  70da8f5631d0 =  7:  89cc215c6014 t1301: fix typo in error message\n>   -:  ------------ >  8:  e67b90847c4e t5000: reformat indentation to the latest fashion\n>   7:  79843c0d5727 !  9:  d6072a70ae7d t5000: inspect HEAD using git-rev-parse\n>      @@ Commit message\n>           Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n>       \n>        ## t/t5000-tar-tree.sh ##\n>      -@@ t/t5000-tar-tree.sh: test_expect_success \\\n>      -      test_cmp expected.mtime b.mtime'\n>      +@@ t/t5000-tar-tree.sh: test_expect_success 'validate file modification time' '\n>      + \ttest_cmp expected.mtime b.mtime\n>      + '\n>        \n>      - test_expect_success \\\n>      +-test_expect_success \\\n>       -    'git get-tar-commit-id' \\\n>       -    'git get-tar-commit-id <b.tar >b.commitid &&\n>       -     test_cmp .git/$(git symbolic-ref HEAD) b.commitid'\n>      -+\t'git get-tar-commit-id' \\\n>      -+\t'git get-tar-commit-id <b.tar >actual &&\n>      -+\tgit rev-parse HEAD > expect &&\n>      -+\ttest_cmp expect actual'\n>      ++test_expect_success 'git get-tar-commit-id' '\n>      ++\tgit get-tar-commit-id <b.tar >actual &&\n>      ++\tgit rev-parse HEAD >expect &&\n>      ++\ttest_cmp expect actual\n>      ++'\n>        \n>        test_expect_success 'git archive with --output, override inferred format' '\n>        \tgit archive --format=tar --output=d4.zip HEAD &&\n>   8:  dbb81b5b89d8 = 10:  4bf1bf16bca3 t7003: use rev-parse rather than FS inspection\n>   -:  ------------ > 11:  6f15c15573af t5304: restyle: trim empty lines, drop ':' before >\n>   9:  ba575839e422 ! 12:  d8e80d83b6f8 t5304: use \"reflog expire --all\" to clear the reflog\n>      @@ Commit message\n>       \n>        ## t/t5304-prune.sh ##\n>       @@ t/t5304-prune.sh: test_expect_success 'prune: prune nonsense parameters' '\n>      - '\n>        \n>        test_expect_success 'prune: prune unreachable heads' '\n>      --\n>        \tgit config core.logAllRefUpdates false &&\n>       -\tmv .git/logs .git/logs.old &&\n>      - \t: > file2 &&\n>      +-\t: > file2 &&\n>      ++\t>file2 &&\n>        \tgit add file2 &&\n>        \tgit commit -m temporary &&\n>        \ttmp_head=$(git rev-list -1 HEAD) &&\n>      @@ t/t5304-prune.sh: test_expect_success 'prune: prune nonsense parameters' '\n>       +\tgit reflog expire --all &&\n>        \tgit prune &&\n>        \ttest_must_fail git reset $tmp_head --\n>      --\n>        '\n>      - \n>      +@@ t/t5304-prune.sh: test_expect_success 'prune: prune unreachable heads' '\n>        test_expect_success 'prune: do not prune detached HEAD with no reflog' '\n>      - \n>        \tgit checkout --detach --quiet &&\n>        \tgit commit --allow-empty -m \"detached commit\" &&\n>       -\t# verify that there is no reflogs\n>      @@ t/t5304-prune.sh: test_expect_success 'prune: prune nonsense parameters' '\n>       +\tgit reflog expire --all &&\n>        \tgit prune -n >prune_actual &&\n>        \ttest_must_be_empty prune_actual\n>      - \n>      -@@ t/t5304-prune.sh: test_expect_success 'prune: prune former HEAD after checking out branch' '\n>      - \n>      + '\n>      +@@ t/t5304-prune.sh: test_expect_success 'prune: do not prune detached HEAD with no reflog' '\n>      + test_expect_success 'prune: prune former HEAD after checking out branch' '\n>        \thead_oid=$(git rev-parse HEAD) &&\n>        \tgit checkout --quiet main &&\n>       +\tgit reflog expire --all &&\n>        \tgit prune -v >prune_actual &&\n>        \tgrep \"$head_oid\" prune_actual\n>      - \n>      + '\n>  10:  3d3b733c3127 ! 13:  180847f4db14 test-lib: provide test prereq REFFILES\n>      @@ Commit message\n>       \n>           Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n>       \n>      + ## t/README ##\n>      +@@ t/README: use these, and \"test_set_prereq\" for how to define your own.\n>      + \n>      +    Git wasn't compiled with NO_PTHREADS=YesPlease.\n>      + \n>      ++ - REFFILES\n>      ++\n>      ++   Test is specific to packed/loose ref storage, and should be\n>      ++   disabled for other ref storage backends\n>      ++\n>      ++\n>      + Tips for Writing Tests\n>      + ----------------------\n>      + \n>      +\n>        ## t/test-lib.sh ##\n>       @@ t/test-lib.sh: parisc* | hppa*)\n>        \t;;\n>  11:  dd1f6969c28d ! 14:  f3307b62bfd7 t1407: require REFFILES for for_each_reflog test\n>      @@ Metadata\n>        ## Commit message ##\n>           t1407: require REFFILES for for_each_reflog test\n>       \n>      -    It tries to setup a reflog by catting to .git/logs/\n>      +    Add extensive comment why this test needs a REFFILES annotation.\n>      +\n>      +    I tried forcing universal reflog creation with core.logAllRefUpdates=true, but\n>      +    that apparently also doesn't cause reflogs to be created for pseudorefs\n>       \n>           Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n>       \n>      @@ t/t1407-worktree-ref-store.sh: test_expect_success 'create_symref(FOO, refs/head\n>        '\n>        \n>       -test_expect_success 'for_each_reflog()' '\n>      ++# Some refs (refs/bisect/*, pseudorefs) are kept per worktree, so they should\n>      ++# only appear in the for-each-reflog output if it is called from the correct\n>      ++# worktree, which is exercised in this test. This test is poorly written (and\n>      ++# therefore marked REFFILES) for mulitple reasons: 1) it creates invalidly\n>      ++# formatted log entres. 2) it uses direct FS access for creating the reflogs. 3)\n>      ++# PSEUDO-WT and refs/bisect/random do not create reflogs by default, so it is\n>      ++# not testing a realistic scenario.\n>       +test_expect_success REFFILES 'for_each_reflog()' '\n>        \techo $ZERO_OID > .git/logs/PSEUDO-MAIN &&\n>        \tmkdir -p     .git/logs/refs/bisect &&\n>  12:  86951eb39cb6 = 15:  0d3b18cd3542 t1414: mark corruption test with REFFILES\n>  13:  1ce545043846 = 16:  b64e3e7ade15 t2017: mark --orphan/logAllRefUpdates=false test as REFFILES\n>  14:  a3abc4f70e7d ! 17:  fcc2b714dd50 t1404: mark tests that muck with .git directly as REFFILES.\n>      @@ Metadata\n>        ## Commit message ##\n>           t1404: mark tests that muck with .git directly as REFFILES.\n>       \n>      +    The packed/loose ref storage is an overlay combination of packed-refs (refs and\n>      +    tags in a single file) and one-file-per-ref. This creates all kinds of edge\n>      +    cases related to directory/file conflicts, (non-)empty directories, and the\n>      +    locking scheme, none of which applies to reftable.\n>      +\n>           Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n>       \n>        ## t/t1404-update-ref-errors.sh ##\n>  15:  2b3021c4ba62 ! 18:  ff3b67c84c41 t7900: mark pack-refs tests as REFFILES\n>      @@ Metadata\n>        ## Commit message ##\n>           t7900: mark pack-refs tests as REFFILES\n>       \n>      +    Reftable automatically compacts tables on writes. The functionality of\n>      +    incremental compaction is unittested in reftable/stack_test.c\n>      +    (test_reftable_stack_auto_compaction)\n>      +\n>      +    In addition, pack-refs triggers a full compaction of the entire stack. This is\n>      +    exercised in t0031-reftable.sh.\n>      +\n>      +    Given that git-maintenance simply calls out git-pack-refs, it seems superfluous\n>      +    to test this further for reftable.\n>      +\n>           Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n>       \n>        ## t/t7900-maintenance.sh ##\n>  16:  a5b9439192db ! 19:  24dcf05d8fa6 t7003: check reflog existence only for REFFILES\n>      @@ t/t7003-filter-branch.sh: test_expect_success '--prune-empty is able to prune en\n>        \tgit filter-branch -f --prune-empty --index-filter \"git update-index --remove A.t B.t\" prune-entire &&\n>        \ttest_must_fail git rev-parse refs/heads/prune-entire &&\n>       -\ttest_must_fail git reflog exists refs/heads/prune-entire\n>      -+\tif test_have_prereq REFFILES ; then\n>      ++\tif test_have_prereq REFFILES\n>      ++\tthen\n>       +\t\ttest_must_fail git reflog exists refs/heads/prune-entire\n>       +\tfi\n>        '\n>  17:  a2cce772d44f = 20:  a33cdfda74ff t4202: mark bogus head hash test with REFFILES\n>  18:  0665edb1308b ! 21:  d7e5de8dba46 t1415: set REFFILES for test specific to storage format\n>      @@ Metadata\n>        ## Commit message ##\n>           t1415: set REFFILES for test specific to storage format\n>       \n>      +    Packing refs (and therefore checking that certain refs are not packed) is a\n>      +    property of the packed/loose ref storage. Add a comment to explain what the test\n>      +    checks.\n>      +\n>           Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n>       \n>        ## t/t1415-worktree-refs.sh ##\n>      @@ t/t1415-worktree-refs.sh: test_expect_success 'setup' '\n>        '\n>        \n>       -test_expect_success 'refs/worktree must not be packed' '\n>      ++# The 'packed-refs' files is stored directly in .git/. This means it is global\n>      ++# to the repository, and can only contain refs that are shared across all\n>      ++# worktrees.\n>       +test_expect_success REFFILES 'refs/worktree must not be packed' '\n>        \tgit pack-refs --all &&\n>        \ttest_path_is_missing .git/refs/tags/wt1 &&\n\nI looked this all over and left some nits, suspect/probably/definite bug\ncomments on specific patches, the ones with no comments from me LGTM.\n\nI intentionally didn't review my own earlier feedback on v1 to look at\nthis with fresh eyes, I'd forgetten what points I raised, aside from the\ngeneral \"let's not skip tests but test the new behavior\" mantra I think\nI either mentioned there or in related discussions.\n\n"},{"id":"425556","messageId":"CAFQ2z_NDKn4vTM_WBrDMumrcTkzS2nOT-cd-TQ=LpTHG+m8Fug@mail.gmail.com","threadId":"55516","inReplyTo":"878s49pdmd.fsf@evledraar.gmail.com","subject":"Re: [PATCH v2 00/21] Prepare tests for reftable backend","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-05-26T09:23:24Z","receivedAt":"2021-05-26T09:23:38Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Thu, May 20, 2021 at 6:35 PM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n\n>\n> I looked this all over and left some nits, suspect/probably/definite bug\n> comments on specific patches, the ones with no comments from me LGTM.\n\nAwesome. Thanks for reviewing. I'll try to go over your comments this week.\n\n> I intentionally didn't review my own earlier feedback on v1 to look at\n> this with fresh eyes, I'd forgetten what points I raised, aside from the\n> general \"let's not skip tests but test the new behavior\" mantra I think\n> I either mentioned there or in related discussions.\n\n\n\"test new behavior\" is troublesome, because it requires merging the\nreftable support first, which in itself is a tough job, and predicated\non getting reviews for that code. This is why I split this series off,\nbecause it can be merged early without impacting coverage of the\nexisting loose/packed backend.\n\nHow about I document more clearly, for each test marked REFFILES, what\nis going on, and what should be done for coverage with reftable? We\ncan go over it as part of the reftable series. \"REFFILES\" will be an\neasy term to grep for.\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"425557","messageId":"87pmxdn6zo.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"CAFQ2z_NDKn4vTM_WBrDMumrcTkzS2nOT-cd-TQ=LpTHG+m8Fug@mail.gmail.com","subject":"Re: [PATCH v2 00/21] Prepare tests for reftable backend","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-05-26T09:52:41Z","receivedAt":"2021-05-26T10:07:30Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Wed, May 26 2021, Han-Wen Nienhuys wrote:\n\n> On Thu, May 20, 2021 at 6:35 PM Ævar Arnfjörð Bjarmason\n> <avarab@gmail.com> wrote:\n>\n>>\n>> I looked this all over and left some nits, suspect/probably/definite bug\n>> comments on specific patches, the ones with no comments from me LGTM.\n>\n> Awesome. Thanks for reviewing. I'll try to go over your comments this week.\n>\n>> I intentionally didn't review my own earlier feedback on v1 to look at\n>> this with fresh eyes, I'd forgetten what points I raised, aside from the\n>> general \"let's not skip tests but test the new behavior\" mantra I think\n>> I either mentioned there or in related discussions.\n>\n>\n> \"test new behavior\" is troublesome, because it requires merging the\n> reftable support first, which in itself is a tough job, and predicated\n> on getting reviews for that code. This is why I split this series off,\n> because it can be merged early without impacting coverage of the\n> existing loose/packed backend.\n>\n> How about I document more clearly, for each test marked REFFILES, what\n> is going on, and what should be done for coverage with reftable? We\n> can go over it as part of the reftable series. \"REFFILES\" will be an\n> easy term to grep for.\n\nIndeed, as I pointed out in some (particularly later patches) v2\ncommentary there's that chicken & egg problem.\n\nHaving re-skimmed my v2 reviews I think these would help:\n\n A. Just leaning on the side of splitting up tests, e.g in my comment on\n    20/21[1], there's a test with file backend specific logic there, but\n    also a general assertion. Should just be two tests.\n\n B. My suggestion in 15/21[2] to split up maybe make these two\n    prerequisites, i.e. REFFILES and REFTABLE.\n\n    One one hand it's a bit silly to have two prerequisites required for\n    the one reftable mode we don't have yet, and as long as we just have\n    two backends it'll be an informed guess at best.\n\n    But I'm leaning on the side of it being a good idea, to clearly\n    document those cases that are really files-backend.c specific, such\n    as low-level test to check that a .git/HEAD exists along with a \"git\n    rev-parse HEAD\" for that backend.\n\n    And then REFTABLE (and !REFTABLE) to test/skip things that are\n    specific to the behavior of reftable, but not in a way that has to\n    do with the \"ref files\" v.s. \"a ref database\" distinction. E.g. a\n    maintenance command calling pack-refs is skipped under REFTABLE, but\n    one could imagine us e.g. having a PostgreSQL backend where that\n    would be mapped to \"VACUUM refs\" or whatever. I.e. it's\n    testing/skipping based on reftable-specific features.\n\n    Even if strictly speaking we'd make no use of the distinction now in\n    that you could losslessly map REFFILES = !REFTABLE and REFTABLE =\n    !REFFILES.\n\n    Or maybe it's useless and we'd want to eventually do a second pass\n    over both REFFILES and REFTABLE to see if we need to change them to\n    positively assert the behavior of the \"other\" backend in both\n    cases. Just a thought...\n\n1. https://lore.kernel.org/git/87eee1pfzk.fsf@evledraar.gmail.com/\n2. http://lore.kernel.org/git/87pmxlpgb1.fsf@evledraar.gmail.com\n"},{"id":"426000","messageId":"CAFQ2z_NFeYf=3=LXwoKjDPh0Lop3GB0OEmqWwOaqJMQA4JGhEg@mail.gmail.com","threadId":"55516","inReplyTo":"871ra1qvli.fsf@evledraar.gmail.com","subject":"Re: [PATCH v2 05/21] t1401-symbolic-ref: avoid direct filesystem access","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-05-31T13:40:57Z","receivedAt":"2021-05-31T14:15:09Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Thu, May 20, 2021 at 5:21 PM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> But since we're encountering this \"reset_to_sane\" pattern, can't we just\n> as easily fix it up with something more obvious than replacing an echo\n> to a specific ref with a tarring up and untarring of the whole .git each\n> time?\n>\n> I.e. something like:\n>\n>    # setup the .git initially\n>\n> Then:\n>\n>    test_when_finished \"rm -rf copy\" &&\n>    git clone . copy &&\n>    # munge the repo and use \"git -C copy\" for the tests\"\n\nI think this is actually worse than tarring up the tree. By using\nclone, your initial state will be affected by any behavior that\ngit-clone does that makes sense when the user is a human. For example,\nrefs/heads/x is renamed to refs/remotes/origin/x. Also, all the\ntimestamps will be off, which might be a problem if there is\ninfrastructure (index refreshes?) that uses timestamps. By contrast,\nusing tar (re)creates a precise snapshot of the initial state.\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\nRegistergericht und -nummer: Hamburg, HRB 86891\nSitz der Gesellschaft: Hamburg\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"426002","messageId":"CAFQ2z_Prqp3f4rXTrijB7z6xFYA7y-M4yRzZ46ARCSzRNkATpw@mail.gmail.com","threadId":"55516","inReplyTo":"87a6opqwc9.fsf@evledraar.gmail.com","subject":"Re: [PATCH v2 01/21] t4202: split testcase for invalid HEAD symref and HEAD hash","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-05-31T13:54:21Z","receivedAt":"2021-05-31T14:43:34Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Thu, May 20, 2021 at 5:05 PM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> When splitting up tests like:\n>\n>     git init xyz &&\n>     [do with xyz]\n>\n> Let's do:\n>\n>     # test 1\n>     test_when_finished \"rm -rf xyz\" &&\n\nDone.\n\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"426004","messageId":"CAFQ2z_NJwS+jvBZO0Ox22C26sGX4kOAJ5oiE8PSp-kOmH7K+Mw@mail.gmail.com","threadId":"55516","inReplyTo":"87v97dpgtf.fsf@evledraar.gmail.com","subject":"Re: [PATCH v2 08/21] t5000: reformat indentation to the latest fashion","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-05-31T13:56:07Z","receivedAt":"2021-05-31T14:46:43Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Thu, May 20, 2021 at 5:26 PM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> Ditto subshell etc. on one line, can't this be git -C bare.git archive\n> HEAD >b3.tar?\n\nyup, both done.\n\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"426006","messageId":"CAFQ2z_N1NOhWagyD0xpbAKimoWLdu1Uzi3QdsQz8kq5sy2TSsg@mail.gmail.com","threadId":"55516","inReplyTo":"87sg2hpgpk.fsf@evledraar.gmail.com","subject":"Re: [PATCH v2 12/21] t5304: use \"reflog expire --all\" to clear the reflog","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-05-31T14:04:52Z","receivedAt":"2021-05-31T15:03:53Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Thu, May 20, 2021 at 5:28 PM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n>\n>\n> On Tue, Apr 27 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n>\n> > From: Han-Wen Nienhuys <hanwen@google.com>\n> >\n> > This is more explicit, and reduces the depency between test functions. It also\n> > is more amenable to use with reftable, which has no concept of (non)existence of\n> > a reflog\n>\n> Sounds good in principle, but:\n>\n> > @@ -94,9 +94,7 @@ test_expect_success 'prune: prune unreachable heads' '\n> >  test_expect_success 'prune: do not prune detached HEAD with no reflog' '\n> >       git checkout --detach --quiet &&\n> >       git commit --allow-empty -m \"detached commit\" &&\n> > -     # verify that there is no reflogs\n> > -     # (should be removed and disabled by previous test)\n> > -     test_path_is_missing .git/logs &&\n> > +     git reflog expire --all &&\n> >       git prune -n >prune_actual &&\n> >       test_must_be_empty prune_actual\n> >  '\n>\n> Isn't the point of the existing test to check that there isn't an\n> existing reflog, not to just expire it if we find it, or does expire\n> --all return non-zero if none was found ?\n\nno. it's verifying that the cross-test behavior is working as\nintended. The real objective is to make sure there is no reflog.\nClarified commit msg.\n\n> > @@ -104,6 +102,7 @@ test_expect_success 'prune: do not prune detached HEAD with no reflog' '\n> >  test_expect_success 'prune: prune former HEAD after checking out branch' '\n> >       head_oid=$(git rev-parse HEAD) &&\n> >       git checkout --quiet main &&\n> > +     git reflog expire --all &&\n> >       git prune -v >prune_actual &&\n> >       grep \"$head_oid\" prune_actual\n> >  '\n>\n> Just skimming this I'm perplexed why this needs expiring now, as opposed\n> to being s/file/command/ changes like the rest...\n\nexplained in the commit msg.\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"426007","messageId":"CAFQ2z_N05LyFkpURwyEe1b-ju09zEzZL=kx-kfbPCgqEDL2tkg@mail.gmail.com","threadId":"55516","inReplyTo":"87k0ntpg48.fsf@evledraar.gmail.com","subject":"Re: [PATCH v2 18/21] t7900: mark pack-refs tests as REFFILES","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-05-31T14:08:49Z","receivedAt":"2021-05-31T15:11:10Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Thu, May 20, 2021 at 5:41 PM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> > -test_expect_success 'pack-refs task' '\n> > +test_expect_success REFFILES 'pack-refs task' '\n> >       for n in $(test_seq 1 5)\n> >       do\n> >               git branch -f to-pack/$n HEAD || return 1\n>\n> I don't think it's superfluous to test what \"git maintenance\" does\n> anyway, i.e. the test ends with:\n>\n>     test_subcommand git pack-refs --all --prune\n>\n> Shouldn't we test that we .. don't run that, abort, warn, whatever?\n\nSure. I've removed the check on the side effect for pack-refs instead.\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"426011","messageId":"CAFQ2z_N=RtSeD6f3a2VPVdDUBxFS1ekC=na=5iVcsWOpkDdORw@mail.gmail.com","threadId":"55516","inReplyTo":"87bl95pfnt.fsf@evledraar.gmail.com","subject":"Re: [PATCH v2 21/21] t1415: set REFFILES for test specific to storage format","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-05-31T14:16:26Z","receivedAt":"2021-05-31T15:29:51Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Thu, May 20, 2021 at 5:51 PM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> > -test_expect_success 'refs/worktree must not be packed' '\n> > +# The 'packed-refs' files is stored directly in .git/. This means it is global\n> > +# to the repository, and can only contain refs that are shared across all\n> > +# worktrees.\n> > +test_expect_success REFFILES 'refs/worktree must not be packed' '\n> >       git pack-refs --all &&\n> >       test_path_is_missing .git/refs/tags/wt1 &&\n> >       test_path_is_file .git/refs/worktree/foo &&\n>\n> Nit but also chicken & egg: Let's keep the \"pack-refs --all\" though\n> under reftable in its own test, and do the test_path_* assertions just\n> under REFFILES, i.e. does/should pack-refs warn/error under reftable as\n> redundant, succeed silently?\n\nI don't understand your comment. This test is checking constraints on\nworktrees that are only relevant for loose/packed storage. In fact,\nunder reftable, there is no such thing as a \"packed ref\" storage\nclass. This test is just not relevant for reftable, and I tried\nexplaining in the comment why this is so. Happy to hear how to further\nclarify this comment.\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"426012","messageId":"CAFQ2z_O6GufrNyfzPtddmW4KOQtMr6OhUZx_LUT2kcyQQ1sY6Q@mail.gmail.com","threadId":"55516","inReplyTo":"87eee1pfzk.fsf@evledraar.gmail.com","subject":"Re: [PATCH v2 20/21] t4202: mark bogus head hash test with REFFILES","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-05-31T14:21:02Z","receivedAt":"2021-05-31T15:29:59Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Thu, May 20, 2021 at 5:44 PM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> > -test_expect_success 'log diagnoses bogus HEAD hash' '\n> > +test_expect_success REFFILES 'log diagnoses bogus HEAD hash' '\n> >       git init empty &&\n> >       test_must_fail git -C empty log 2>stderr &&\n> >       test_i18ngrep does.not.have.any.commits stderr &&\n>\n> Okey, they're correctly formed by design, but the first test here is\n> just checking what happens when we do a \"git log\" on a repo with no\n> commits. What does that have to do with reflog's guarantees that we have\n> a valid-looking SHA in some entry in its database?\n>\n> Surely we also want to test for the same thing, the ref backend doesn't\n> change that we have no commits or refs yet, no?\n\nDone.\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"426013","messageId":"CAFQ2z_OC_mOZO5+V4qtg66FrsDy5PyyRXdECztuW8owpZ9WD-w@mail.gmail.com","threadId":"55516","inReplyTo":"87h7ixpg2l.fsf@evledraar.gmail.com","subject":"Re: [PATCH v2 19/21] t7003: check reflog existence only for REFFILES","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-05-31T14:27:21Z","receivedAt":"2021-05-31T15:40:26Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Thu, May 20, 2021 at 5:42 PM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> > -     test_must_fail git reflog exists refs/heads/prune-entire\n> > +     if test_have_prereq REFFILES\n> > +     then\n> > +             test_must_fail git reflog exists refs/heads/prune-entire\n> > +     fi\n> >  '\n> >\n> >  test_expect_success '--remap-to-ancestor with filename filters' '\n>\n> Ditto chicken and egg, but isn't this conflating \"we always write logs\"\n> v.s. reftable just behaving differently, i.e. shouldn't this be\n> positively asserting that we have the log *for that branch* still after\n> its deletion?\n\nThat is a great topic to discuss on the reftable series.\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"426015","messageId":"CAFQ2z_NmSHdLuh=ksnZcEAPJV66Uej5KUk0Gw6BMEi2uqy16mg@mail.gmail.com","threadId":"55516","inReplyTo":"87pmxdn6zo.fsf@evledraar.gmail.com","subject":"Re: [PATCH v2 00/21] Prepare tests for reftable backend","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-05-31T14:37:33Z","receivedAt":"2021-05-31T15:58:15Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Wed, May 26, 2021 at 12:07 PM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n> >> I looked this all over and left some nits, suspect/probably/definite bug\n> >> comments on specific patches, the ones with no comments from me LGTM.\n> >\n> > Awesome. Thanks for reviewing. I'll try to go over your comments this week.\n\nI'm sending out the series shortly, with a Reviewed-By footer added to\nthe commits.\n\nJun, is this OK to schedule for 'next'  ?\n\n> >> I intentionally didn't review my own earlier feedback on v1 to look at\n> >> this with fresh eyes, I'd forgetten what points I raised, aside from the\n> >> general \"let's not skip tests but test the new behavior\" mantra I think\n> >> I either mentioned there or in related discussions.\n> >\n> > \"test new behavior\" is troublesome, because it requires merging the\n> > reftable support first, which in itself is a tough job, and predicated\n> > on getting reviews for that code. This is why I split this series off,\n> > because it can be merged early without impacting coverage of the\n> > existing loose/packed backend.\n> >\n> > How about I document more clearly, for each test marked REFFILES, what\n> > is going on, and what should be done for coverage with reftable? We\n> > can go over it as part of the reftable series. \"REFFILES\" will be an\n> > easy term to grep for.\n>\n> Indeed, as I pointed out in some (particularly later patches) v2\n> commentary there's that chicken & egg problem.\n>\n> Having re-skimmed my v2 reviews I think these would help:\n>\n>  A. Just leaning on the side of splitting up tests, e.g in my comment on\n>     20/21[1], there's a test with file backend specific logic there, but\n>     also a general assertion. Should just be two tests.\n\nI split a few tests.\n\n>  B. My suggestion in 15/21[2] to split up maybe make these two\n>     prerequisites, i.e. REFFILES and REFTABLE.\n\nUntil reftable is actually merged that will introduce a lot of dead\ncode in the tests. Besides requiring time for me to write that code,\nit also introduces extra reviewer effort. I think that is best done as\npart of the reftable series, when it is close to being merged.\n\n>     One one hand it's a bit silly to have two prerequisites required for\n>     the one reftable mode we don't have yet, and as long as we just have\n>     two backends it'll be an informed guess at best.\n>\n>     But I'm leaning on the side of it being a good idea, to clearly\n>     document those cases that are really files-backend.c specific, such\n>     as low-level test to check that a .git/HEAD exists along with a \"git\n>     rev-parse HEAD\" for that backend.\n>\n>     And then REFTABLE (and !REFTABLE) to test/skip things that are\n>     specific to the behavior of reftable, but not in a way that has to\n>     do with the \"ref files\" v.s. \"a ref database\" distinction. E.g. a\n>     maintenance command calling pack-refs is skipped under REFTABLE, but\n>     one could imagine us e.g. having a PostgreSQL backend where that\n\nLet's first see the actual PostgreSQL backend materialize before\nmaking investments to support it.\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"426017","messageId":"CAFQ2z_N2CfX9UYZTBV_kcssz6Pku4GqjtdZ=ZRiMAyCyNn+Chw@mail.gmail.com","threadId":"55516","inReplyTo":"877djtqw5d.fsf@evledraar.gmail.com","subject":"Re: [PATCH v2 02/21] t/helper/ref-store: initialize oid in resolve-ref","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-05-31T14:48:43Z","receivedAt":"2021-05-31T16:18:23Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Thu, May 20, 2021 at 5:09 PM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n>\n>\n> On Tue, Apr 27 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n>\n> > From: Han-Wen Nienhuys <hanwen@google.com>\n> >\n> > This will print $ZERO_OID when asking for a non-existent ref from the\n> > test-helper.\n> >\n> > Since resolve-ref provides direct access to refs_resolve_ref_unsafe(), it\n> > provides a reliable mechanism for accessing REFNAME, while avoiding the implicit\n> > resolution to refs/heads/REFNAME.\n> >\n> > Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n> > ---\n> >  t/helper/test-ref-store.c | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> >\n> > diff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c\n> > index bba5f841c6ab..01d8f3285dc8 100644\n> > --- a/t/helper/test-ref-store.c\n> > +++ b/t/helper/test-ref-store.c\n> > @@ -118,7 +118,7 @@ static int cmd_for_each_ref(struct ref_store *refs, const char **argv)\n> >\n> >  static int cmd_resolve_ref(struct ref_store *refs, const char **argv)\n> >  {\n> > -     struct object_id oid;\n> > +     struct object_id oid = { 0 };\n> >       const char *refname = notnull(*argv++, \"refname\");\n> >       int resolve_flags = arg_flags(*argv++, \"resolve-flags\");\n> >       int flags;\n>\n> This feels a bit magical, later we have this:\n>\n>         printf(\"%s %s 0x%x\\n\", oid_to_hex(&oid), ref ? ref : \"(null)\", flags);\n>\n> Isn't ref always going to be NULL in that case too? Wouldn't it make\n> more sense to not zero this out and instead do:\n>\n>     if (ref)\n>         /* current code, mostly */\n>     else\n>         use zero_oid()\n\nfor programmatic access, the if will actually make it harder to parse\nout what is happening, so I think this solution is better. Note that\nthe function already handles ref == null, so changing the printf\nformat in this way can only serve to break other tests.\n\n> That seems more straightforward to me than this implicit proxy for\n> zero_oid(). Also, isn't the point of zero_oid() to not make this\n\nused null_oid() instead (zero_oid() doesn't exist in C).\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"426019","messageId":"CAFQ2z_NzRiM6u4sqLHeN9+KwzWum0PVUpcRiS0grEKGD0UqsiA@mail.gmail.com","threadId":"55516","inReplyTo":"87y2c9pgym.fsf@evledraar.gmail.com","subject":"Re: [PATCH v2 06/21] t1413: use tar to save and restore entire .git directory","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-05-31T15:16:03Z","receivedAt":"2021-05-31T17:04:45Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Thu, May 20, 2021 at 5:23 PM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n\n> >  test_expect_success baseline '\n>\n> So what I said in 05, but also didn't the commit messages of 05 and 06\n> get mixed up / bad fixup in a WIP version? I.e. the first commit says\n> \"use symbolic ref\", but it's mostly about introducing the use of this\n> tar/untar pattern.\n>\n> Whereas this continues the tarring pattern, and doesn't start using it,\n> and (presumably) is the mis-squashed commit that should have added this\n> whole tar thing after the first commit does the isolated\n> s/echo/symbolic-ref/ fix.\n\nI've split the commits by test file. I added a separate commit for the\ntar use here.\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\n\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\n\nRegistergericht und -nummer: Hamburg, HRB 86891\n\nSitz der Gesellschaft: Hamburg\n\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"426028","messageId":"7c6ef1dcadfca62081c4b55b78c53bf1d5ae7fe7.1622480197.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 02/22] t/helper/ref-store: initialize oid in resolve-ref","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:17Z","receivedAt":"2021-05-31T17:39:27Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nThis will print $ZERO_OID when asking for a non-existent ref from the\ntest-helper.\n\nSince resolve-ref provides direct access to refs_resolve_ref_unsafe(), it\nprovides a reliable mechanism for accessing REFNAME, while avoiding the implicit\nresolution to refs/heads/REFNAME.\n\nReviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/helper/test-ref-store.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c\nindex bba5f841c6ab..b314b81a45b2 100644\n--- a/t/helper/test-ref-store.c\n+++ b/t/helper/test-ref-store.c\n@@ -118,7 +118,7 @@ static int cmd_for_each_ref(struct ref_store *refs, const char **argv)\n \n static int cmd_resolve_ref(struct ref_store *refs, const char **argv)\n {\n-\tstruct object_id oid;\n+\tstruct object_id oid = *null_oid();\n \tconst char *refname = notnull(*argv++, \"refname\");\n \tint resolve_flags = arg_flags(*argv++, \"resolve-flags\");\n \tint flags;\n-- \ngitgitgadget\n\n"},{"id":"426029","messageId":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v2.git.git.1619519903.gitgitgadget@gmail.com","subject":"[PATCH v3 00/22] Prepare tests for reftable backend","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:15Z","receivedAt":"2021-05-31T17:39:32Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"Rewrites some tests to avoid direct filesystem access.\n\nIntroduces the test prereq REFFILES to mark other tests that depend on\nspecifics of the files ref backend.\n\nchanges in v3 (relative to v2 from Apr 27)\n\n * address avarab's feedback.\n\nHan-Wen Nienhuys (22):\n  t4202: split testcase for invalid HEAD symref and HEAD hash\n  t/helper/ref-store: initialize oid in resolve-ref\n  t9300: check ref existence using test-helper rather than a file system\n    check\n  t5601: read HEAD using rev-parse\n  t1401: use tar to snapshot and restore repo state\n  t1401-symbolic-ref: avoid direct filesystem access\n  t1413: use tar to save and restore entire .git directory\n  t1301: fix typo in error message\n  t5000: reformat indentation to the latest fashion\n  t5000: inspect HEAD using git-rev-parse\n  t7003: use rev-parse rather than FS inspection\n  t5304: restyle: trim empty lines, drop ':' before >\n  t5304: use \"reflog expire --all\" to clear the reflog\n  test-lib: provide test prereq REFFILES\n  t1407: require REFFILES for for_each_reflog test\n  t1414: mark corruption test with REFFILES\n  t2017: mark --orphan/logAllRefUpdates=false test as REFFILES\n  t1404: mark tests that muck with .git directly as REFFILES.\n  t7900: stop checking for loose refs\n  t7003: check reflog existence only for REFFILES\n  t4202: mark bogus head hash test with REFFILES\n  t1415: set REFFILES for test specific to storage format\n\n t/README                      |   6 ++\n t/helper/test-ref-store.c     |   2 +-\n t/t1301-shared-repo.sh        |   2 +-\n t/t1401-symbolic-ref.sh       |  25 ++++---\n t/t1404-update-ref-errors.sh  |  30 ++++-----\n t/t1407-worktree-ref-store.sh |   9 ++-\n t/t1413-reflog-detach.sh      |   5 +-\n t/t1414-reflog-walk.sh        |   4 +-\n t/t1415-worktree-refs.sh      |   5 +-\n t/t2017-checkout-orphan.sh    |   2 +-\n t/t4202-log.sh                |  18 +++--\n t/t5000-tar-tree.sh           | 122 +++++++++++++++++++---------------\n t/t5304-prune.sh              |  83 +++++++----------------\n t/t5601-clone.sh              |   3 +-\n t/t7003-filter-branch.sh      |   7 +-\n t/t7900-maintenance.sh        |   2 -\n t/t9300-fast-import.sh        |   2 +-\n t/test-lib.sh                 |   2 +\n 18 files changed, 170 insertions(+), 159 deletions(-)\n\n\nbase-commit: 4e42405f00ecbbee412846f48cb0253efeebe726\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1008%2Fhanwen%2Freffiles-v3\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1008/hanwen/reffiles-v3\nPull-Request: https://github.com/git/git/pull/1008\n\nRange-diff vs v2:\n\n  1:  8ad4a35cda70 !  1:  6d875c6d7579 t4202: split testcase for invalid HEAD symref and HEAD hash\n     @@ t/t4202-log.sh: test_expect_success 'log --graph --no-walk is forbidden' '\n      -test_expect_success 'log diagnoses bogus HEAD' '\n      +test_expect_success 'log diagnoses bogus HEAD hash' '\n       \tgit init empty &&\n     ++\ttest_when_finished \"rm -rf empty\" &&\n       \ttest_must_fail git -C empty log 2>stderr &&\n       \ttest_i18ngrep does.not.have.any.commits stderr &&\n       \techo 1234abcd >empty/.git/refs/heads/main &&\n     @@ t/t4202-log.sh: test_expect_success 'log --graph --no-walk is forbidden' '\n      +\ttest_i18ngrep broken stderr'\n      +\n      +test_expect_success 'log diagnoses bogus HEAD symref' '\n     -+\trm -rf empty &&\n      +\tgit init empty &&\n      +\tgit --git-dir empty/.git symbolic-ref HEAD refs/heads/invalid.lock &&\n       \ttest_must_fail git -C empty log 2>stderr &&\n  2:  e6222944a3eb !  2:  7c6ef1dcadfc t/helper/ref-store: initialize oid in resolve-ref\n     @@ Commit message\n          provides a reliable mechanism for accessing REFNAME, while avoiding the implicit\n          resolution to refs/heads/REFNAME.\n      \n     +    Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n      \n       ## t/helper/test-ref-store.c ##\n     @@ t/helper/test-ref-store.c: static int cmd_for_each_ref(struct ref_store *refs, c\n       static int cmd_resolve_ref(struct ref_store *refs, const char **argv)\n       {\n      -\tstruct object_id oid;\n     -+\tstruct object_id oid = { 0 };\n     ++\tstruct object_id oid = *null_oid();\n       \tconst char *refname = notnull(*argv++, \"refname\");\n       \tint resolve_flags = arg_flags(*argv++, \"resolve-flags\");\n       \tint flags;\n  3:  c5855b0caa73 !  3:  130099d30aba t9300: check ref existence using test-helper rather than a file system check\n     @@ Commit message\n          t9300: check ref existence using test-helper rather than a file system check\n      \n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n     +    Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n      \n       ## t/t9300-fast-import.sh ##\n      @@ t/t9300-fast-import.sh: test_expect_success 'B: accept branch name \"TEMP_TAG\"' '\n  4:  369c968ab837 !  4:  c898982255c1 t5601: read HEAD using rev-parse\n     @@ Commit message\n          t5601: read HEAD using rev-parse\n      \n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n     +    Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n      \n       ## t/t5601-clone.sh ##\n      @@ t/t5601-clone.sh: test_expect_success 'clone from original with relative alternate' '\n  -:  ------------ >  5:  12d43ff6a9e5 t1401: use tar to snapshot and restore repo state\n  5:  248d9ffe7927 !  6:  f05817d80565 t1401-symbolic-ref: avoid direct filesystem access\n     @@ Metadata\n       ## Commit message ##\n          t1401-symbolic-ref: avoid direct filesystem access\n      \n     +    Use symbolic-ref and rev-parse to inspect refs.\n     +\n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n     +    Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n      \n       ## t/t1401-symbolic-ref.sh ##\n     -@@\n     - test_description='basic symbolic-ref tests'\n     - . ./test-lib.sh\n     +@@ t/t1401-symbolic-ref.sh: test_expect_success 'setup' '\n     + \t\"$TAR\" cf .git.tar .git/\n     + '\n       \n     --# If the tests munging HEAD fail, they can break detection of\n     --# the git repo, meaning that further tests will operate on\n     --# the surrounding git repo instead of the trash directory.\n     --reset_to_sane() {\n     --\techo ref: refs/heads/foo >.git/HEAD\n     --}\n     --\n      -test_expect_success 'symbolic-ref writes HEAD' '\n     -+test_expect_success 'setup' '\n     - \tgit symbolic-ref HEAD refs/heads/foo &&\n     +-\tgit symbolic-ref HEAD refs/heads/foo &&\n      -\techo ref: refs/heads/foo >expect &&\n      -\ttest_cmp expect .git/HEAD\n     -+\ttest_commit file &&\n     -+\t\"$TAR\" cf .git.tar .git/\n     - '\n     - \n     +-'\n     +-\n      -test_expect_success 'symbolic-ref reads HEAD' '\n      -\techo refs/heads/foo >expect &&\n     -+reset_to_sane() {\n     -+\trm -rf .git &&\n     -+\t\"$TAR\" xf .git.tar\n     -+}\n     -+\n      +test_expect_success 'symbolic-ref read/write roundtrip' '\n      +\tgit symbolic-ref HEAD refs/heads/read-write-roundtrip &&\n      +\techo refs/heads/read-write-roundtrip >expect &&\n  6:  e4e8fc1d4b4f !  7:  f6ab40c4e659 t1413: use tar to save and restore entire .git directory\n     @@ Commit message\n          This makes the test independent of the particulars of the storage formats.\n      \n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n     +    Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n      \n       ## t/t1413-reflog-detach.sh ##\n      @@ t/t1413-reflog-detach.sh: export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n  7:  89cc215c6014 !  8:  852bc0f3055d t1301: fix typo in error message\n     @@ Commit message\n          t1301: fix typo in error message\n      \n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n     +    Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n      \n       ## t/t1301-shared-repo.sh ##\n      @@ t/t1301-shared-repo.sh: test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '\n  8:  e67b90847c4e !  9:  e76c1e71bcb0 t5000: reformat indentation to the latest fashion\n     @@ Commit message\n          t5000: reformat indentation to the latest fashion\n      \n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n     +    Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n      \n       ## t/t5000-tar-tree.sh ##\n      @@ t/t5000-tar-tree.sh: test_expect_success 'setup' '\n     @@ t/t5000-tar-tree.sh: test_expect_success 'setup' '\n      +test_expect_success 'populate workdir' '\n      +\tmkdir a &&\n      +\techo simple textfile >a/a &&\n     -+\tten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&\n     -+\techo long filename >a/four$hundred &&\n     ++\tten=0123456789 &&\n     ++\thundred=\"$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten\" &&\n     ++\techo long filename >\"a/four$hundred\" &&\n      +\tmkdir a/bin &&\n      +\ttest-tool genrandom \"frotz\" 500000 >a/bin/sh &&\n      +\tprintf \"A\\$Format:%s\\$O\" \"$SUBSTFORMAT\" >a/substfile1 &&\n      +\tprintf \"A not substituted O\" >a/substfile2 &&\n     -+\tif test_have_prereq SYMLINKS; then\n     ++\tif test_have_prereq SYMLINKS\n     ++\tthen\n      +\t\tln -s a a/l1\n      +\telse\n      +\t\tprintf %s a >a/l1\n      +\tfi &&\n     -+\t(p=long_path_to_a_file && cd a &&\n     -+\t\tfor depth in 1 2 3 4 5; do mkdir $p && cd $p; done &&\n     -+\t\techo text >file_with_long_path) &&\n     ++\t(\n     ++\t\tp=long_path_to_a_file &&\n     ++\t\tcd a &&\n     ++\t\tfor depth in 1 2 3 4 5\n     ++\t\tdo\n     ++\t\t\tmkdir $p &&\n     ++\t\t\tcd $p\n     ++\t\tdone &&\n     ++\t\techo text >file_with_long_path\n     ++\t) &&\n      +\t(cd a && find .) | sort >a.lst\n      +'\n       \n     @@ t/t5000-tar-tree.sh: check_added with_untracked2 untracked one/untracked\n      -    'git archive in a bare repo' \\\n      -    '(cd bare.git && git archive HEAD) >b3.tar'\n      +test_expect_success 'git archive in a bare repo' '\n     -+\t(cd bare.git && git archive HEAD) >b3.tar\n     ++\tgit --git-dir bare.git archive HEAD >b3.tar\n      +'\n       \n      -test_expect_success \\\n  9:  d6072a70ae7d ! 10:  3e748285876b t5000: inspect HEAD using git-rev-parse\n     @@ Commit message\n          t5000: inspect HEAD using git-rev-parse\n      \n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n     +    Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n      \n       ## t/t5000-tar-tree.sh ##\n      @@ t/t5000-tar-tree.sh: test_expect_success 'validate file modification time' '\n 10:  4bf1bf16bca3 ! 11:  a0605387d153 t7003: use rev-parse rather than FS inspection\n     @@ Commit message\n          t7003: use rev-parse rather than FS inspection\n      \n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n     +    Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n      \n       ## t/t7003-filter-branch.sh ##\n      @@ t/t7003-filter-branch.sh: test_expect_success '--prune-empty is able to prune root commit' '\n 11:  6f15c15573af ! 12:  c12406ac9655 t5304: restyle: trim empty lines, drop ':' before >\n     @@ Commit message\n          t5304: restyle: trim empty lines, drop ':' before >\n      \n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n     +    Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n      \n       ## t/t5304-prune.sh ##\n      @@ t/t5304-prune.sh: add_blob() {\n 12:  d8e80d83b6f8 ! 13:  9ede1b73d523 t5304: use \"reflog expire --all\" to clear the reflog\n     @@ Metadata\n       ## Commit message ##\n          t5304: use \"reflog expire --all\" to clear the reflog\n      \n     -    This is more explicit, and reduces the depency between test functions. It also\n     -    is more amenable to use with reftable, which has no concept of (non)existence of\n     -    a reflog\n     +    This test checks that unreachable objects are really removed. For the test to\n     +    work, it has to ensure that no reflog retain any reachable objects.\n     +\n     +    Previously, it did this by manipulating the file system to remove reflog in the\n     +    first test, and relying on git not updating the reflog if the relevant logfile\n     +    doesn't exist in follow-up tests.\n     +\n     +    Now, explicitly clear the reflog using 'reflog expire'. This reduces the\n     +    dependency between test functions. It also is more amenable to use with\n     +    reftable, which has no concept of (non)-existence of a reflog\n      \n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n     +    Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n      \n       ## t/t5304-prune.sh ##\n      @@ t/t5304-prune.sh: test_expect_success 'prune: prune nonsense parameters' '\n 13:  180847f4db14 ! 14:  8c552699fdbc test-lib: provide test prereq REFFILES\n     @@ Commit message\n          introducing the reftable storage backend.\n      \n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n     +    Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n      \n       ## t/README ##\n      @@ t/README: use these, and \"test_set_prereq\" for how to define your own.\n 14:  f3307b62bfd7 ! 15:  57fcd175fa72 t1407: require REFFILES for for_each_reflog test\n     @@ Commit message\n          that apparently also doesn't cause reflogs to be created for pseudorefs\n      \n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n     +    Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n      \n       ## t/t1407-worktree-ref-store.sh ##\n      @@ t/t1407-worktree-ref-store.sh: test_expect_success 'create_symref(FOO, refs/heads/main)' '\n 15:  0d3b18cd3542 ! 16:  5fe2dc0efce9 t1414: mark corruption test with REFFILES\n     @@ Metadata\n       ## Commit message ##\n          t1414: mark corruption test with REFFILES\n      \n     -    The reftable format guarantees that reflog entries are well-formed\n     +    The test checks what happens if reflog and ref database disagree on the state of\n     +    the latest commit. This seems to require accessing reflog storage directly.\n      \n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n     +    Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n      \n       ## t/t1414-reflog-walk.sh ##\n      @@ t/t1414-reflog-walk.sh: test_expect_success 'min/max age uses entry date to limit' '\n     @@ t/t1414-reflog-walk.sh: test_expect_success 'min/max age uses entry date to limi\n       '\n       \n      -test_expect_success 'walk prefers reflog to ref tip' '\n     ++# Create a situation where the reflog and ref database disagree about the latest\n     ++# state of HEAD.\n      +test_expect_success REFFILES 'walk prefers reflog to ref tip' '\n       \thead=$(git rev-parse HEAD) &&\n       \tone=$(git rev-parse one) &&\n 16:  b64e3e7ade15 ! 17:  496796d4e084 t2017: mark --orphan/logAllRefUpdates=false test as REFFILES\n     @@ Commit message\n          of the reflog file infeasible.\n      \n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n     +    Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n      \n       ## t/t2017-checkout-orphan.sh ##\n      @@ t/t2017-checkout-orphan.sh: test_expect_success '--orphan makes reflog by default' '\n 17:  fcc2b714dd50 ! 18:  c9d199b84499 t1404: mark tests that muck with .git directly as REFFILES.\n     @@ Commit message\n          locking scheme, none of which applies to reftable.\n      \n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n     +    Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n      \n       ## t/t1404-update-ref-errors.sh ##\n      @@ t/t1404-update-ref-errors.sh: test_expect_success 'one new ref is a simple prefix of another' '\n 18:  ff3b67c84c41 <  -:  ------------ t7900: mark pack-refs tests as REFFILES\n  -:  ------------ > 19:  6919c15e5f98 t7900: stop checking for loose refs\n 19:  24dcf05d8fa6 ! 20:  73f89faa3b0a t7003: check reflog existence only for REFFILES\n     @@ Commit message\n          t7003: check reflog existence only for REFFILES\n      \n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n     +    Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n      \n       ## t/t7003-filter-branch.sh ##\n      @@ t/t7003-filter-branch.sh: test_expect_success '--prune-empty is able to prune entire branch' '\n 20:  a33cdfda74ff ! 21:  ff86cf916943 t4202: mark bogus head hash test with REFFILES\n     @@ Metadata\n       ## Commit message ##\n          t4202: mark bogus head hash test with REFFILES\n      \n     -    In reftable, hashes are correctly formed by design\n     +    In reftable, hashes are correctly formed by design.\n     +\n     +    Split off test for git-log in empty repo.\n      \n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n     +    Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n      \n       ## t/t4202-log.sh ##\n      @@ t/t4202-log.sh: test_expect_success 'log --graph --no-walk is forbidden' '\n     @@ t/t4202-log.sh: test_expect_success 'log --graph --no-walk is forbidden' '\n       '\n       \n      -test_expect_success 'log diagnoses bogus HEAD hash' '\n     -+test_expect_success REFFILES 'log diagnoses bogus HEAD hash' '\n     ++test_expect_success 'log on empty repo fails' '\n       \tgit init empty &&\n     + \ttest_when_finished \"rm -rf empty\" &&\n     + \ttest_must_fail git -C empty log 2>stderr &&\n     +-\ttest_i18ngrep does.not.have.any.commits stderr &&\n     ++\ttest_i18ngrep does.not.have.any.commits stderr\n     ++'\n     ++\n     ++test_expect_success REFFILES 'log diagnoses bogus HEAD hash' '\n     ++\tgit init empty &&\n     ++\ttest_when_finished \"rm -rf empty\" &&\n     + \techo 1234abcd >empty/.git/refs/heads/main &&\n       \ttest_must_fail git -C empty log 2>stderr &&\n     - \ttest_i18ngrep does.not.have.any.commits stderr &&\n     +-\ttest_i18ngrep broken stderr'\n     ++\ttest_i18ngrep broken stderr\n     ++'\n     + \n     + test_expect_success 'log diagnoses bogus HEAD symref' '\n     + \tgit init empty &&\n 21:  d7e5de8dba46 ! 22:  cbcbb2d78fc9 t1415: set REFFILES for test specific to storage format\n     @@ Metadata\n       ## Commit message ##\n          t1415: set REFFILES for test specific to storage format\n      \n     -    Packing refs (and therefore checking that certain refs are not packed) is a\n     -    property of the packed/loose ref storage. Add a comment to explain what the test\n     -    checks.\n     +    Packing refs (and therefore checking that certain refs are not packed)\n     +    is a property of the packed/loose ref storage. Add a comment to explain\n     +    what the test checks.\n      \n          Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>\n     +    Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n      \n       ## t/t1415-worktree-refs.sh ##\n      @@ t/t1415-worktree-refs.sh: test_expect_success 'setup' '\n     @@ t/t1415-worktree-refs.sh: test_expect_success 'setup' '\n       '\n       \n      -test_expect_success 'refs/worktree must not be packed' '\n     -+# The 'packed-refs' files is stored directly in .git/. This means it is global\n     ++# The 'packed-refs' file is stored directly in .git/. This means it is global\n      +# to the repository, and can only contain refs that are shared across all\n      +# worktrees.\n      +test_expect_success REFFILES 'refs/worktree must not be packed' '\n\n-- \ngitgitgadget\n"},{"id":"426030","messageId":"6d875c6d757991c73a578933b65a569cb937546e.1622480197.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 01/22] t4202: split testcase for invalid HEAD symref and HEAD hash","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:16Z","receivedAt":"2021-05-31T17:39:37Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nReftable will prohibit invalid hashes at the storage level, but\ngit-symbolic-ref can still create branches ending in \".lock\".\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t4202-log.sh | 10 +++++++---\n 1 file changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex 350cfa35936a..327991fcea49 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -1834,14 +1834,18 @@ test_expect_success 'log --graph --no-walk is forbidden' '\n \ttest_must_fail git log --graph --no-walk\n '\n \n-test_expect_success 'log diagnoses bogus HEAD' '\n+test_expect_success 'log diagnoses bogus HEAD hash' '\n \tgit init empty &&\n+\ttest_when_finished \"rm -rf empty\" &&\n \ttest_must_fail git -C empty log 2>stderr &&\n \ttest_i18ngrep does.not.have.any.commits stderr &&\n \techo 1234abcd >empty/.git/refs/heads/main &&\n \ttest_must_fail git -C empty log 2>stderr &&\n-\ttest_i18ngrep broken stderr &&\n-\techo \"ref: refs/heads/invalid.lock\" >empty/.git/HEAD &&\n+\ttest_i18ngrep broken stderr'\n+\n+test_expect_success 'log diagnoses bogus HEAD symref' '\n+\tgit init empty &&\n+\tgit --git-dir empty/.git symbolic-ref HEAD refs/heads/invalid.lock &&\n \ttest_must_fail git -C empty log 2>stderr &&\n \ttest_i18ngrep broken stderr &&\n \ttest_must_fail git -C empty log --default totally-bogus 2>stderr &&\n-- \ngitgitgadget\n\n"},{"id":"426031","messageId":"c898982255c19639d77c910c84557538bd104093.1622480197.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 04/22] t5601: read HEAD using rev-parse","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:19Z","receivedAt":"2021-05-31T17:39:40Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\nReviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t5601-clone.sh | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex c0688467e7c0..83c24fc97a7b 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -305,7 +305,8 @@ test_expect_success 'clone from original with relative alternate' '\n test_expect_success 'clone checking out a tag' '\n \tgit clone --branch=some-tag src dst.tag &&\n \tGIT_DIR=src/.git git rev-parse some-tag >expected &&\n-\ttest_cmp expected dst.tag/.git/HEAD &&\n+\tGIT_DIR=dst.tag/.git git rev-parse HEAD >actual &&\n+\ttest_cmp expected actual &&\n \tGIT_DIR=dst.tag/.git git config remote.origin.fetch >fetch.actual &&\n \techo \"+refs/heads/*:refs/remotes/origin/*\" >fetch.expected &&\n \ttest_cmp fetch.expected fetch.actual\n-- \ngitgitgadget\n\n"},{"id":"426032","messageId":"130099d30aba9a2f526a6ce217f18a5e235306f0.1622480197.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 03/22] t9300: check ref existence using test-helper rather than a file system check","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:18Z","receivedAt":"2021-05-31T17:39:44Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\nReviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t9300-fast-import.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh\nindex 5c47ac4465cb..1aea943bef72 100755\n--- a/t/t9300-fast-import.sh\n+++ b/t/t9300-fast-import.sh\n@@ -392,7 +392,7 @@ test_expect_success 'B: accept branch name \"TEMP_TAG\"' '\n \t\tgit gc\n \t\tgit prune\" &&\n \tgit fast-import <input &&\n-\ttest -f .git/TEMP_TAG &&\n+\ttest $(test-tool ref-store main resolve-ref TEMP_TAG 0 | cut -f1 -d \" \" ) != \"$ZERO_OID\" &&\n \ttest $(git rev-parse main) = $(git rev-parse TEMP_TAG^)\n '\n \n-- \ngitgitgadget\n\n"},{"id":"426033","messageId":"12d43ff6a9e534f3c57f2f811b8b7e1c85e26bdf.1622480197.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 05/22] t1401: use tar to snapshot and restore repo state","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:20Z","receivedAt":"2021-05-31T17:39:46Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nThis is agnostic to the ref storage format\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\n---\n t/t1401-symbolic-ref.sh | 9 ++++++++-\n 1 file changed, 8 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh\nindex a4ebb0b65fec..7a9629fb9f0e 100755\n--- a/t/t1401-symbolic-ref.sh\n+++ b/t/t1401-symbolic-ref.sh\n@@ -7,9 +7,16 @@ test_description='basic symbolic-ref tests'\n # the git repo, meaning that further tests will operate on\n # the surrounding git repo instead of the trash directory.\n reset_to_sane() {\n-\techo ref: refs/heads/foo >.git/HEAD\n+\trm -rf .git &&\n+\t\"$TAR\" xf .git.tar\n }\n \n+test_expect_success 'setup' '\n+\tgit symbolic-ref HEAD refs/heads/foo &&\n+\ttest_commit file &&\n+\t\"$TAR\" cf .git.tar .git/\n+'\n+\n test_expect_success 'symbolic-ref writes HEAD' '\n \tgit symbolic-ref HEAD refs/heads/foo &&\n \techo ref: refs/heads/foo >expect &&\n-- \ngitgitgadget\n\n"},{"id":"426034","messageId":"f6ab40c4e6599540da38ae5af8e574dc65909e79.1622480197.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 07/22] t1413: use tar to save and restore entire .git directory","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:22Z","receivedAt":"2021-05-31T17:39:50Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nThis makes the test independent of the particulars of the storage formats.\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\nReviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t1413-reflog-detach.sh | 5 ++---\n 1 file changed, 2 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t1413-reflog-detach.sh b/t/t1413-reflog-detach.sh\nindex bde05208ae6a..934688a1ee82 100755\n--- a/t/t1413-reflog-detach.sh\n+++ b/t/t1413-reflog-detach.sh\n@@ -7,8 +7,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n . ./test-lib.sh\n \n reset_state () {\n-\tgit checkout main &&\n-\tcp saved_reflog .git/logs/HEAD\n+\trm -rf .git && \"$TAR\" xf .git-saved.tar\n }\n \n test_expect_success setup '\n@@ -17,7 +16,7 @@ test_expect_success setup '\n \tgit branch side &&\n \ttest_tick &&\n \tgit commit --allow-empty -m second &&\n-\tcat .git/logs/HEAD >saved_reflog\n+\t\"$TAR\" cf .git-saved.tar .git\n '\n \n test_expect_success baseline '\n-- \ngitgitgadget\n\n"},{"id":"426035","messageId":"f05817d805650f6e8aa3a1a8e625a460f51037bb.1622480197.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 06/22] t1401-symbolic-ref: avoid direct filesystem access","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:21Z","receivedAt":"2021-05-31T17:39:52Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nUse symbolic-ref and rev-parse to inspect refs.\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\nReviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t1401-symbolic-ref.sh | 22 +++++++++-------------\n 1 file changed, 9 insertions(+), 13 deletions(-)\n\ndiff --git a/t/t1401-symbolic-ref.sh b/t/t1401-symbolic-ref.sh\nindex 7a9629fb9f0e..132a1b885acb 100755\n--- a/t/t1401-symbolic-ref.sh\n+++ b/t/t1401-symbolic-ref.sh\n@@ -17,14 +17,9 @@ test_expect_success 'setup' '\n \t\"$TAR\" cf .git.tar .git/\n '\n \n-test_expect_success 'symbolic-ref writes HEAD' '\n-\tgit symbolic-ref HEAD refs/heads/foo &&\n-\techo ref: refs/heads/foo >expect &&\n-\ttest_cmp expect .git/HEAD\n-'\n-\n-test_expect_success 'symbolic-ref reads HEAD' '\n-\techo refs/heads/foo >expect &&\n+test_expect_success 'symbolic-ref read/write roundtrip' '\n+\tgit symbolic-ref HEAD refs/heads/read-write-roundtrip &&\n+\techo refs/heads/read-write-roundtrip >expect &&\n \tgit symbolic-ref HEAD >actual &&\n \ttest_cmp expect actual\n '\n@@ -32,12 +27,13 @@ test_expect_success 'symbolic-ref reads HEAD' '\n test_expect_success 'symbolic-ref refuses non-ref for HEAD' '\n \ttest_must_fail git symbolic-ref HEAD foo\n '\n+\n reset_to_sane\n \n test_expect_success 'symbolic-ref refuses bare sha1' '\n-\techo content >file && git add file && git commit -m one &&\n \ttest_must_fail git symbolic-ref HEAD $(git rev-parse HEAD)\n '\n+\n reset_to_sane\n \n test_expect_success 'HEAD cannot be removed' '\n@@ -49,16 +45,16 @@ reset_to_sane\n test_expect_success 'symbolic-ref can be deleted' '\n \tgit symbolic-ref NOTHEAD refs/heads/foo &&\n \tgit symbolic-ref -d NOTHEAD &&\n-\ttest_path_is_file .git/refs/heads/foo &&\n-\ttest_path_is_missing .git/NOTHEAD\n+\tgit rev-parse refs/heads/foo &&\n+\ttest_must_fail git symbolic-ref NOTHEAD\n '\n reset_to_sane\n \n test_expect_success 'symbolic-ref can delete dangling symref' '\n \tgit symbolic-ref NOTHEAD refs/heads/missing &&\n \tgit symbolic-ref -d NOTHEAD &&\n-\ttest_path_is_missing .git/refs/heads/missing &&\n-\ttest_path_is_missing .git/NOTHEAD\n+\ttest_must_fail git rev-parse refs/heads/missing &&\n+\ttest_must_fail git symbolic-ref NOTHEAD\n '\n reset_to_sane\n \n-- \ngitgitgadget\n\n"},{"id":"426036","messageId":"852bc0f3055d07c0462ea6f02642a57f4a91e447.1622480197.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 08/22] t1301: fix typo in error message","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:23Z","receivedAt":"2021-05-31T17:39:55Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\nReviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t1301-shared-repo.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t1301-shared-repo.sh b/t/t1301-shared-repo.sh\nindex ac947bff9fcf..84bf1970d8bf 100755\n--- a/t/t1301-shared-repo.sh\n+++ b/t/t1301-shared-repo.sh\n@@ -124,7 +124,7 @@ test_expect_success POSIXPERM 'git reflog expire honors core.sharedRepository' '\n \t\t: happy\n \t\t;;\n \t*)\n-\t\techo Ooops, .git/logs/refs/heads/main is not 0662 [$actual]\n+\t\techo Ooops, .git/logs/refs/heads/main is not 066x [$actual]\n \t\tfalse\n \t\t;;\n \tesac\n-- \ngitgitgadget\n\n"},{"id":"426037","messageId":"e76c1e71bcb0010eb3588c1e9a005da6a9460638.1622480197.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 09/22] t5000: reformat indentation to the latest fashion","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:24Z","receivedAt":"2021-05-31T17:40:02Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\nReviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t5000-tar-tree.sh | 113 ++++++++++++++++++++++++--------------------\n 1 file changed, 62 insertions(+), 51 deletions(-)\n\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex 7204799a0b52..8c5867b6c8ae 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -111,25 +111,34 @@ test_expect_success 'setup' '\n \tEOF\n '\n \n-test_expect_success \\\n-    'populate workdir' \\\n-    'mkdir a &&\n-     echo simple textfile >a/a &&\n-     ten=0123456789 && hundred=$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten &&\n-     echo long filename >a/four$hundred &&\n-     mkdir a/bin &&\n-     test-tool genrandom \"frotz\" 500000 >a/bin/sh &&\n-     printf \"A\\$Format:%s\\$O\" \"$SUBSTFORMAT\" >a/substfile1 &&\n-     printf \"A not substituted O\" >a/substfile2 &&\n-     if test_have_prereq SYMLINKS; then\n-\tln -s a a/l1\n-     else\n-\tprintf %s a > a/l1\n-     fi &&\n-     (p=long_path_to_a_file && cd a &&\n-      for depth in 1 2 3 4 5; do mkdir $p && cd $p; done &&\n-      echo text >file_with_long_path) &&\n-     (cd a && find .) | sort >a.lst'\n+test_expect_success 'populate workdir' '\n+\tmkdir a &&\n+\techo simple textfile >a/a &&\n+\tten=0123456789 &&\n+\thundred=\"$ten$ten$ten$ten$ten$ten$ten$ten$ten$ten\" &&\n+\techo long filename >\"a/four$hundred\" &&\n+\tmkdir a/bin &&\n+\ttest-tool genrandom \"frotz\" 500000 >a/bin/sh &&\n+\tprintf \"A\\$Format:%s\\$O\" \"$SUBSTFORMAT\" >a/substfile1 &&\n+\tprintf \"A not substituted O\" >a/substfile2 &&\n+\tif test_have_prereq SYMLINKS\n+\tthen\n+\t\tln -s a a/l1\n+\telse\n+\t\tprintf %s a >a/l1\n+\tfi &&\n+\t(\n+\t\tp=long_path_to_a_file &&\n+\t\tcd a &&\n+\t\tfor depth in 1 2 3 4 5\n+\t\tdo\n+\t\t\tmkdir $p &&\n+\t\t\tcd $p\n+\t\tdone &&\n+\t\techo text >file_with_long_path\n+\t) &&\n+\t(cd a && find .) | sort >a.lst\n+'\n \n test_expect_success \\\n     'add ignored file' \\\n@@ -147,18 +156,18 @@ test_expect_success 'setup export-subst' '\n \t\t>a/substfile1\n '\n \n-test_expect_success \\\n-    'create bare clone' \\\n-    'git clone --bare . bare.git &&\n-     cp .git/info/attributes bare.git/info/attributes'\n+test_expect_success 'create bare clone' '\n+\tgit clone --bare . bare.git &&\n+\tcp .git/info/attributes bare.git/info/attributes\n+'\n \n-test_expect_success \\\n-    'remove ignored file' \\\n-    'rm a/ignored'\n+test_expect_success 'remove ignored file' '\n+\trm a/ignored\n+'\n \n-test_expect_success \\\n-    'git archive' \\\n-    'git archive HEAD >b.tar'\n+test_expect_success 'git archive' '\n+\tgit archive HEAD >b.tar\n+'\n \n check_tar b\n \n@@ -194,26 +203,28 @@ check_added with_untracked2 untracked one/untracked\n check_added with_untracked2 untracked two/untracked\n \n test_expect_success 'git archive on large files' '\n-    test_config core.bigfilethreshold 1 &&\n-    git archive HEAD >b3.tar &&\n-    test_cmp_bin b.tar b3.tar\n+\ttest_config core.bigfilethreshold 1 &&\n+\tgit archive HEAD >b3.tar &&\n+\ttest_cmp_bin b.tar b3.tar\n '\n \n-test_expect_success \\\n-    'git archive in a bare repo' \\\n-    '(cd bare.git && git archive HEAD) >b3.tar'\n+test_expect_success 'git archive in a bare repo' '\n+\tgit --git-dir bare.git archive HEAD >b3.tar\n+'\n \n-test_expect_success \\\n-    'git archive vs. the same in a bare repo' \\\n-    'test_cmp_bin b.tar b3.tar'\n+test_expect_success 'git archive vs. the same in a bare repo' '\n+\ttest_cmp_bin b.tar b3.tar\n+'\n \n-test_expect_success 'git archive with --output' \\\n-    'git archive --output=b4.tar HEAD &&\n-    test_cmp_bin b.tar b4.tar'\n+test_expect_success 'git archive with --output' '\n+\tgit archive --output=b4.tar HEAD &&\n+\ttest_cmp_bin b.tar b4.tar\n+'\n \n-test_expect_success 'git archive --remote' \\\n-    'git archive --remote=. HEAD >b5.tar &&\n-    test_cmp_bin b.tar b5.tar'\n+test_expect_success 'git archive --remote' '\n+\tgit archive --remote=. HEAD >b5.tar &&\n+\ttest_cmp_bin b.tar b5.tar\n+'\n \n test_expect_success 'git archive --remote with configured remote' '\n \tgit config remote.foo.url . &&\n@@ -224,13 +235,13 @@ test_expect_success 'git archive --remote with configured remote' '\n \ttest_cmp_bin b.tar b5-nick.tar\n '\n \n-test_expect_success \\\n-    'validate file modification time' \\\n-    'mkdir extract &&\n-     \"$TAR\" xf b.tar -C extract a/a &&\n-     test-tool chmtime --get extract/a/a >b.mtime &&\n-     echo \"1117231200\" >expected.mtime &&\n-     test_cmp expected.mtime b.mtime'\n+test_expect_success 'validate file modification time' '\n+\tmkdir extract &&\n+\t\"$TAR\" xf b.tar -C extract a/a &&\n+\ttest-tool chmtime --get extract/a/a >b.mtime &&\n+\techo \"1117231200\" >expected.mtime &&\n+\ttest_cmp expected.mtime b.mtime\n+'\n \n test_expect_success \\\n     'git get-tar-commit-id' \\\n-- \ngitgitgadget\n\n"},{"id":"426038","messageId":"3e748285876b41104d54ebc2dd54b103dbaa5385.1622480197.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 10/22] t5000: inspect HEAD using git-rev-parse","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:25Z","receivedAt":"2021-05-31T17:40:07Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\nReviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t5000-tar-tree.sh | 9 +++++----\n 1 file changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex 8c5867b6c8ae..2c88d1c15962 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -243,10 +243,11 @@ test_expect_success 'validate file modification time' '\n \ttest_cmp expected.mtime b.mtime\n '\n \n-test_expect_success \\\n-    'git get-tar-commit-id' \\\n-    'git get-tar-commit-id <b.tar >b.commitid &&\n-     test_cmp .git/$(git symbolic-ref HEAD) b.commitid'\n+test_expect_success 'git get-tar-commit-id' '\n+\tgit get-tar-commit-id <b.tar >actual &&\n+\tgit rev-parse HEAD >expect &&\n+\ttest_cmp expect actual\n+'\n \n test_expect_success 'git archive with --output, override inferred format' '\n \tgit archive --format=tar --output=d4.zip HEAD &&\n-- \ngitgitgadget\n\n"},{"id":"426039","messageId":"a0605387d1537d1bfd7727fb7dfed838ae690f59.1622480197.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 11/22] t7003: use rev-parse rather than FS inspection","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:26Z","receivedAt":"2021-05-31T17:40:13Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\nReviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t7003-filter-branch.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex 1349e5b2321c..cf30055c88dd 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -395,7 +395,7 @@ test_expect_success '--prune-empty is able to prune root commit' '\n test_expect_success '--prune-empty is able to prune entire branch' '\n \tgit branch prune-entire B &&\n \tgit filter-branch -f --prune-empty --index-filter \"git update-index --remove A.t B.t\" prune-entire &&\n-\ttest_path_is_missing .git/refs/heads/prune-entire &&\n+\ttest_must_fail git rev-parse refs/heads/prune-entire &&\n \ttest_must_fail git reflog exists refs/heads/prune-entire\n '\n \n-- \ngitgitgadget\n\n"},{"id":"426040","messageId":"c12406ac9655d45a6eb3f408805d2a5db1c63bfa.1622480197.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 12/22] t5304: restyle: trim empty lines, drop ':' before >","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:27Z","receivedAt":"2021-05-31T17:40:16Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\nReviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t5304-prune.sh | 74 +++++++++++++-----------------------------------\n 1 file changed, 20 insertions(+), 54 deletions(-)\n\ndiff --git a/t/t5304-prune.sh b/t/t5304-prune.sh\nindex 3475b06aeb26..15d56d3d8791 100755\n--- a/t/t5304-prune.sh\n+++ b/t/t5304-prune.sh\n@@ -22,30 +22,25 @@ add_blob() {\n }\n \n test_expect_success setup '\n-\n-\t: > file &&\n+\t>file &&\n \tgit add file &&\n \ttest_tick &&\n \tgit commit -m initial &&\n \tgit gc\n-\n '\n \n test_expect_success 'prune stale packs' '\n-\n \torig_pack=$(echo .git/objects/pack/*.pack) &&\n-\t: > .git/objects/tmp_1.pack &&\n-\t: > .git/objects/tmp_2.pack &&\n+\t>.git/objects/tmp_1.pack &&\n+\t>.git/objects/tmp_2.pack &&\n \ttest-tool chmtime =-86501 .git/objects/tmp_1.pack &&\n \tgit prune --expire 1.day &&\n \ttest_path_is_file $orig_pack &&\n \ttest_path_is_file .git/objects/tmp_2.pack &&\n \ttest_path_is_missing .git/objects/tmp_1.pack\n-\n '\n \n test_expect_success 'prune --expire' '\n-\n \tadd_blob &&\n \tgit prune --expire=1.hour.ago &&\n \tverbose test $((1 + $before)) = $(git count-objects | sed \"s/ .*//\") &&\n@@ -54,11 +49,9 @@ test_expect_success 'prune --expire' '\n \tgit prune --expire 1.day &&\n \tverbose test $before = $(git count-objects | sed \"s/ .*//\") &&\n \ttest_path_is_missing $BLOB_FILE\n-\n '\n \n test_expect_success 'gc: implicit prune --expire' '\n-\n \tadd_blob &&\n \ttest-tool chmtime =-$((2*$week-30)) $BLOB_FILE &&\n \tgit gc &&\n@@ -68,33 +61,25 @@ test_expect_success 'gc: implicit prune --expire' '\n \tgit gc &&\n \tverbose test $before = $(git count-objects | sed \"s/ .*//\") &&\n \ttest_path_is_missing $BLOB_FILE\n-\n '\n \n test_expect_success 'gc: refuse to start with invalid gc.pruneExpire' '\n-\n \tgit config gc.pruneExpire invalid &&\n \ttest_must_fail git gc\n-\n '\n \n test_expect_success 'gc: start with ok gc.pruneExpire' '\n-\n \tgit config gc.pruneExpire 2.days.ago &&\n \tgit gc\n-\n '\n \n test_expect_success 'prune: prune nonsense parameters' '\n-\n \ttest_must_fail git prune garbage &&\n \ttest_must_fail git prune --- &&\n \ttest_must_fail git prune --no-such-option\n-\n '\n \n test_expect_success 'prune: prune unreachable heads' '\n-\n \tgit config core.logAllRefUpdates false &&\n \tmv .git/logs .git/logs.old &&\n \t: > file2 &&\n@@ -104,11 +89,9 @@ test_expect_success 'prune: prune unreachable heads' '\n \tgit reset HEAD^ &&\n \tgit prune &&\n \ttest_must_fail git reset $tmp_head --\n-\n '\n \n test_expect_success 'prune: do not prune detached HEAD with no reflog' '\n-\n \tgit checkout --detach --quiet &&\n \tgit commit --allow-empty -m \"detached commit\" &&\n \t# verify that there is no reflogs\n@@ -116,75 +99,61 @@ test_expect_success 'prune: do not prune detached HEAD with no reflog' '\n \ttest_path_is_missing .git/logs &&\n \tgit prune -n >prune_actual &&\n \ttest_must_be_empty prune_actual\n-\n '\n \n test_expect_success 'prune: prune former HEAD after checking out branch' '\n-\n \thead_oid=$(git rev-parse HEAD) &&\n \tgit checkout --quiet main &&\n \tgit prune -v >prune_actual &&\n \tgrep \"$head_oid\" prune_actual\n-\n '\n \n test_expect_success 'prune: do not prune heads listed as an argument' '\n-\n-\t: > file2 &&\n+\t>file2 &&\n \tgit add file2 &&\n \tgit commit -m temporary &&\n \ttmp_head=$(git rev-list -1 HEAD) &&\n \tgit reset HEAD^ &&\n \tgit prune -- $tmp_head &&\n \tgit reset $tmp_head --\n-\n '\n \n test_expect_success 'gc --no-prune' '\n-\n \tadd_blob &&\n \ttest-tool chmtime =-$((5001*$day)) $BLOB_FILE &&\n \tgit config gc.pruneExpire 2.days.ago &&\n \tgit gc --no-prune &&\n \tverbose test 1 = $(git count-objects | sed \"s/ .*//\") &&\n \ttest_path_is_file $BLOB_FILE\n-\n '\n \n test_expect_success 'gc respects gc.pruneExpire' '\n-\n \tgit config gc.pruneExpire 5002.days.ago &&\n \tgit gc &&\n \ttest_path_is_file $BLOB_FILE &&\n \tgit config gc.pruneExpire 5000.days.ago &&\n \tgit gc &&\n \ttest_path_is_missing $BLOB_FILE\n-\n '\n \n test_expect_success 'gc --prune=<date>' '\n-\n \tadd_blob &&\n \ttest-tool chmtime =-$((5001*$day)) $BLOB_FILE &&\n \tgit gc --prune=5002.days.ago &&\n \ttest_path_is_file $BLOB_FILE &&\n \tgit gc --prune=5000.days.ago &&\n \ttest_path_is_missing $BLOB_FILE\n-\n '\n \n test_expect_success 'gc --prune=never' '\n-\n \tadd_blob &&\n \tgit gc --prune=never &&\n \ttest_path_is_file $BLOB_FILE &&\n \tgit gc --prune=now &&\n \ttest_path_is_missing $BLOB_FILE\n-\n '\n \n test_expect_success 'gc respects gc.pruneExpire=never' '\n-\n \tgit config gc.pruneExpire never &&\n \tadd_blob &&\n \tgit gc &&\n@@ -192,17 +161,14 @@ test_expect_success 'gc respects gc.pruneExpire=never' '\n \tgit config gc.pruneExpire now &&\n \tgit gc &&\n \ttest_path_is_missing $BLOB_FILE\n-\n '\n \n test_expect_success 'prune --expire=never' '\n-\n \tadd_blob &&\n \tgit prune --expire=never &&\n \ttest_path_is_file $BLOB_FILE &&\n \tgit prune &&\n \ttest_path_is_missing $BLOB_FILE\n-\n '\n \n test_expect_success 'gc: prune old objects after local clone' '\n@@ -222,16 +188,16 @@ test_expect_success 'gc: prune old objects after local clone' '\n test_expect_success 'garbage report in count-objects -v' '\n \ttest_when_finished \"rm -f .git/objects/pack/fake*\" &&\n \ttest_when_finished \"rm -f .git/objects/pack/foo*\" &&\n-\t: >.git/objects/pack/foo &&\n-\t: >.git/objects/pack/foo.bar &&\n-\t: >.git/objects/pack/foo.keep &&\n-\t: >.git/objects/pack/foo.pack &&\n-\t: >.git/objects/pack/fake.bar &&\n-\t: >.git/objects/pack/fake.keep &&\n-\t: >.git/objects/pack/fake.pack &&\n-\t: >.git/objects/pack/fake.idx &&\n-\t: >.git/objects/pack/fake2.keep &&\n-\t: >.git/objects/pack/fake3.idx &&\n+\t>.git/objects/pack/foo &&\n+\t>.git/objects/pack/foo.bar &&\n+\t>.git/objects/pack/foo.keep &&\n+\t>.git/objects/pack/foo.pack &&\n+\t>.git/objects/pack/fake.bar &&\n+\t>.git/objects/pack/fake.keep &&\n+\t>.git/objects/pack/fake.pack &&\n+\t>.git/objects/pack/fake.idx &&\n+\t>.git/objects/pack/fake2.keep &&\n+\t>.git/objects/pack/fake3.idx &&\n \tgit count-objects -v 2>stderr &&\n \tgrep \"index file .git/objects/pack/fake.idx is too small\" stderr &&\n \tgrep \"^warning:\" stderr | sort >actual &&\n@@ -250,12 +216,12 @@ EOF\n test_expect_success 'clean pack garbage with gc' '\n \ttest_when_finished \"rm -f .git/objects/pack/fake*\" &&\n \ttest_when_finished \"rm -f .git/objects/pack/foo*\" &&\n-\t: >.git/objects/pack/foo.keep &&\n-\t: >.git/objects/pack/foo.pack &&\n-\t: >.git/objects/pack/fake.idx &&\n-\t: >.git/objects/pack/fake2.keep &&\n-\t: >.git/objects/pack/fake2.idx &&\n-\t: >.git/objects/pack/fake3.keep &&\n+\t>.git/objects/pack/foo.keep &&\n+\t>.git/objects/pack/foo.pack &&\n+\t>.git/objects/pack/fake.idx &&\n+\t>.git/objects/pack/fake2.keep &&\n+\t>.git/objects/pack/fake2.idx &&\n+\t>.git/objects/pack/fake3.keep &&\n \tgit gc &&\n \tgit count-objects -v 2>stderr &&\n \tgrep \"^warning:\" stderr | sort >actual &&\n-- \ngitgitgadget\n\n"},{"id":"426041","messageId":"57fcd175fa723cec194ddf776d6e209ae0f27d74.1622480197.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 15/22] t1407: require REFFILES for for_each_reflog test","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:30Z","receivedAt":"2021-05-31T17:40:20Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nAdd extensive comment why this test needs a REFFILES annotation.\n\nI tried forcing universal reflog creation with core.logAllRefUpdates=true, but\nthat apparently also doesn't cause reflogs to be created for pseudorefs\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\nReviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t1407-worktree-ref-store.sh | 9 ++++++++-\n 1 file changed, 8 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t1407-worktree-ref-store.sh b/t/t1407-worktree-ref-store.sh\nindex d3fe77751122..ad8006c81397 100755\n--- a/t/t1407-worktree-ref-store.sh\n+++ b/t/t1407-worktree-ref-store.sh\n@@ -52,7 +52,14 @@ test_expect_success 'create_symref(FOO, refs/heads/main)' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'for_each_reflog()' '\n+# Some refs (refs/bisect/*, pseudorefs) are kept per worktree, so they should\n+# only appear in the for-each-reflog output if it is called from the correct\n+# worktree, which is exercised in this test. This test is poorly written (and\n+# therefore marked REFFILES) for mulitple reasons: 1) it creates invalidly\n+# formatted log entres. 2) it uses direct FS access for creating the reflogs. 3)\n+# PSEUDO-WT and refs/bisect/random do not create reflogs by default, so it is\n+# not testing a realistic scenario.\n+test_expect_success REFFILES 'for_each_reflog()' '\n \techo $ZERO_OID > .git/logs/PSEUDO-MAIN &&\n \tmkdir -p     .git/logs/refs/bisect &&\n \techo $ZERO_OID > .git/logs/refs/bisect/random &&\n-- \ngitgitgadget\n\n"},{"id":"426042","messageId":"496796d4e0845516bcd971312e060507d1db3d41.1622480197.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 17/22] t2017: mark --orphan/logAllRefUpdates=false test as REFFILES","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:32Z","receivedAt":"2021-05-31T17:40:27Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nIn reftable, there is no notion of a per-ref 'existence' of a reflog. Each\nreflog entry has its own key, so it is not possible to distinguish between\n{reflog doesn't exist,reflog exists but is empty}. This makes the logic\nin log_ref_setup() (file refs/files-backend.c), which depends on the existence\nof the reflog file infeasible.\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\nReviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t2017-checkout-orphan.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t2017-checkout-orphan.sh b/t/t2017-checkout-orphan.sh\nindex c7adbdd39ab9..88d6992a5e1f 100755\n--- a/t/t2017-checkout-orphan.sh\n+++ b/t/t2017-checkout-orphan.sh\n@@ -76,7 +76,7 @@ test_expect_success '--orphan makes reflog by default' '\n \tgit rev-parse --verify delta@{0}\n '\n \n-test_expect_success '--orphan does not make reflog when core.logAllRefUpdates = false' '\n+test_expect_success REFFILES '--orphan does not make reflog when core.logAllRefUpdates = false' '\n \tgit checkout main &&\n \tgit config core.logAllRefUpdates false &&\n \tgit checkout --orphan epsilon &&\n-- \ngitgitgadget\n\n"},{"id":"426043","messageId":"8c552699fdbcebe645d860a1048d1e1d5f268831.1622480197.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 14/22] test-lib: provide test prereq REFFILES","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:29Z","receivedAt":"2021-05-31T17:40:32Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nREFFILES can be used to mark tests that are specific to the packed/loose ref\nstorage format and its limitations. Marking such tests is a preparation for\nintroducing the reftable storage backend.\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\nReviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/README      | 6 ++++++\n t/test-lib.sh | 2 ++\n 2 files changed, 8 insertions(+)\n\ndiff --git a/t/README b/t/README\nindex 1a2072b2c8a2..9e7012230203 100644\n--- a/t/README\n+++ b/t/README\n@@ -1126,6 +1126,12 @@ use these, and \"test_set_prereq\" for how to define your own.\n \n    Git wasn't compiled with NO_PTHREADS=YesPlease.\n \n+ - REFFILES\n+\n+   Test is specific to packed/loose ref storage, and should be\n+   disabled for other ref storage backends\n+\n+\n Tips for Writing Tests\n ----------------------\n \ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex adaf03543e81..76929a886fbf 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -1488,6 +1488,8 @@ parisc* | hppa*)\n \t;;\n esac\n \n+test_set_prereq REFFILES\n+\n ( COLUMNS=1 && test $COLUMNS = 1 ) && test_set_prereq COLUMNS_CAN_BE_1\n test -z \"$NO_PERL\" && test_set_prereq PERL\n test -z \"$NO_PTHREADS\" && test_set_prereq PTHREADS\n-- \ngitgitgadget\n\n"},{"id":"426044","messageId":"c9d199b84499e7b114ba369d7c561cff03ee073d.1622480197.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 18/22] t1404: mark tests that muck with .git directly as REFFILES.","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:33Z","receivedAt":"2021-05-31T17:40:40Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nThe packed/loose ref storage is an overlay combination of packed-refs (refs and\ntags in a single file) and one-file-per-ref. This creates all kinds of edge\ncases related to directory/file conflicts, (non-)empty directories, and the\nlocking scheme, none of which applies to reftable.\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\nReviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t1404-update-ref-errors.sh | 30 +++++++++++++++---------------\n 1 file changed, 15 insertions(+), 15 deletions(-)\n\ndiff --git a/t/t1404-update-ref-errors.sh b/t/t1404-update-ref-errors.sh\nindex 8b51c4efc135..b729c1f48030 100755\n--- a/t/t1404-update-ref-errors.sh\n+++ b/t/t1404-update-ref-errors.sh\n@@ -189,7 +189,7 @@ test_expect_success 'one new ref is a simple prefix of another' '\n \n '\n \n-test_expect_success 'empty directory should not fool rev-parse' '\n+test_expect_success REFFILES 'empty directory should not fool rev-parse' '\n \tprefix=refs/e-rev-parse &&\n \tgit update-ref $prefix/foo $C &&\n \tgit pack-refs --all &&\n@@ -199,7 +199,7 @@ test_expect_success 'empty directory should not fool rev-parse' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'empty directory should not fool for-each-ref' '\n+test_expect_success REFFILES 'empty directory should not fool for-each-ref' '\n \tprefix=refs/e-for-each-ref &&\n \tgit update-ref $prefix/foo $C &&\n \tgit for-each-ref $prefix >expected &&\n@@ -209,14 +209,14 @@ test_expect_success 'empty directory should not fool for-each-ref' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'empty directory should not fool create' '\n+test_expect_success REFFILES 'empty directory should not fool create' '\n \tprefix=refs/e-create &&\n \tmkdir -p .git/$prefix/foo/bar/baz &&\n \tprintf \"create %s $C\\n\" $prefix/foo |\n \tgit update-ref --stdin\n '\n \n-test_expect_success 'empty directory should not fool verify' '\n+test_expect_success REFFILES 'empty directory should not fool verify' '\n \tprefix=refs/e-verify &&\n \tgit update-ref $prefix/foo $C &&\n \tgit pack-refs --all &&\n@@ -225,7 +225,7 @@ test_expect_success 'empty directory should not fool verify' '\n \tgit update-ref --stdin\n '\n \n-test_expect_success 'empty directory should not fool 1-arg update' '\n+test_expect_success REFFILES 'empty directory should not fool 1-arg update' '\n \tprefix=refs/e-update-1 &&\n \tgit update-ref $prefix/foo $C &&\n \tgit pack-refs --all &&\n@@ -234,7 +234,7 @@ test_expect_success 'empty directory should not fool 1-arg update' '\n \tgit update-ref --stdin\n '\n \n-test_expect_success 'empty directory should not fool 2-arg update' '\n+test_expect_success REFFILES 'empty directory should not fool 2-arg update' '\n \tprefix=refs/e-update-2 &&\n \tgit update-ref $prefix/foo $C &&\n \tgit pack-refs --all &&\n@@ -243,7 +243,7 @@ test_expect_success 'empty directory should not fool 2-arg update' '\n \tgit update-ref --stdin\n '\n \n-test_expect_success 'empty directory should not fool 0-arg delete' '\n+test_expect_success REFFILES 'empty directory should not fool 0-arg delete' '\n \tprefix=refs/e-delete-0 &&\n \tgit update-ref $prefix/foo $C &&\n \tgit pack-refs --all &&\n@@ -252,7 +252,7 @@ test_expect_success 'empty directory should not fool 0-arg delete' '\n \tgit update-ref --stdin\n '\n \n-test_expect_success 'empty directory should not fool 1-arg delete' '\n+test_expect_success REFFILES 'empty directory should not fool 1-arg delete' '\n \tprefix=refs/e-delete-1 &&\n \tgit update-ref $prefix/foo $C &&\n \tgit pack-refs --all &&\n@@ -466,7 +466,7 @@ test_expect_success 'incorrect old value blocks indirect no-deref delete' '\n \ttest_cmp expected output.err\n '\n \n-test_expect_success 'non-empty directory blocks create' '\n+test_expect_success REFFILES 'non-empty directory blocks create' '\n \tprefix=refs/ne-create &&\n \tmkdir -p .git/$prefix/foo/bar &&\n \t: >.git/$prefix/foo/bar/baz.lock &&\n@@ -485,7 +485,7 @@ test_expect_success 'non-empty directory blocks create' '\n \ttest_cmp expected output.err\n '\n \n-test_expect_success 'broken reference blocks create' '\n+test_expect_success REFFILES 'broken reference blocks create' '\n \tprefix=refs/broken-create &&\n \tmkdir -p .git/$prefix &&\n \techo \"gobbledigook\" >.git/$prefix/foo &&\n@@ -504,7 +504,7 @@ test_expect_success 'broken reference blocks create' '\n \ttest_cmp expected output.err\n '\n \n-test_expect_success 'non-empty directory blocks indirect create' '\n+test_expect_success REFFILES 'non-empty directory blocks indirect create' '\n \tprefix=refs/ne-indirect-create &&\n \tgit symbolic-ref $prefix/symref $prefix/foo &&\n \tmkdir -p .git/$prefix/foo/bar &&\n@@ -524,7 +524,7 @@ test_expect_success 'non-empty directory blocks indirect create' '\n \ttest_cmp expected output.err\n '\n \n-test_expect_success 'broken reference blocks indirect create' '\n+test_expect_success REFFILES 'broken reference blocks indirect create' '\n \tprefix=refs/broken-indirect-create &&\n \tgit symbolic-ref $prefix/symref $prefix/foo &&\n \techo \"gobbledigook\" >.git/$prefix/foo &&\n@@ -543,7 +543,7 @@ test_expect_success 'broken reference blocks indirect create' '\n \ttest_cmp expected output.err\n '\n \n-test_expect_success 'no bogus intermediate values during delete' '\n+test_expect_success REFFILES 'no bogus intermediate values during delete' '\n \tprefix=refs/slow-transaction &&\n \t# Set up a reference with differing loose and packed versions:\n \tgit update-ref $prefix/foo $C &&\n@@ -600,7 +600,7 @@ test_expect_success 'no bogus intermediate values during delete' '\n \ttest_must_fail git rev-parse --verify --quiet $prefix/foo\n '\n \n-test_expect_success 'delete fails cleanly if packed-refs file is locked' '\n+test_expect_success REFFILES 'delete fails cleanly if packed-refs file is locked' '\n \tprefix=refs/locked-packed-refs &&\n \t# Set up a reference with differing loose and packed versions:\n \tgit update-ref $prefix/foo $C &&\n@@ -616,7 +616,7 @@ test_expect_success 'delete fails cleanly if packed-refs file is locked' '\n \ttest_cmp unchanged actual\n '\n \n-test_expect_success 'delete fails cleanly if packed-refs.new write fails' '\n+test_expect_success REFFILES 'delete fails cleanly if packed-refs.new write fails' '\n \t# Setup and expectations are similar to the test above.\n \tprefix=refs/failed-packed-refs &&\n \tgit update-ref $prefix/foo $C &&\n-- \ngitgitgadget\n\n"},{"id":"426045","messageId":"5fe2dc0efce99a64222e1e479b9475fde4a607d2.1622480197.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 16/22] t1414: mark corruption test with REFFILES","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:31Z","receivedAt":"2021-05-31T17:40:46Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nThe test checks what happens if reflog and ref database disagree on the state of\nthe latest commit. This seems to require accessing reflog storage directly.\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\nReviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t1414-reflog-walk.sh | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t1414-reflog-walk.sh b/t/t1414-reflog-walk.sh\nindex 80d94704d012..ea64cecf47bf 100755\n--- a/t/t1414-reflog-walk.sh\n+++ b/t/t1414-reflog-walk.sh\n@@ -119,7 +119,9 @@ test_expect_success 'min/max age uses entry date to limit' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success 'walk prefers reflog to ref tip' '\n+# Create a situation where the reflog and ref database disagree about the latest\n+# state of HEAD.\n+test_expect_success REFFILES 'walk prefers reflog to ref tip' '\n \thead=$(git rev-parse HEAD) &&\n \tone=$(git rev-parse one) &&\n \tident=\"$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE\" &&\n-- \ngitgitgadget\n\n"},{"id":"426046","messageId":"ff86cf916943e188e6d4324ad0e35932b743c0e4.1622480198.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 21/22] t4202: mark bogus head hash test with REFFILES","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:36Z","receivedAt":"2021-05-31T17:40:53Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nIn reftable, hashes are correctly formed by design.\n\nSplit off test for git-log in empty repo.\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\nReviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t4202-log.sh | 12 +++++++++---\n 1 file changed, 9 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t4202-log.sh b/t/t4202-log.sh\nindex 327991fcea49..39e746fbcbe2 100755\n--- a/t/t4202-log.sh\n+++ b/t/t4202-log.sh\n@@ -1834,14 +1834,20 @@ test_expect_success 'log --graph --no-walk is forbidden' '\n \ttest_must_fail git log --graph --no-walk\n '\n \n-test_expect_success 'log diagnoses bogus HEAD hash' '\n+test_expect_success 'log on empty repo fails' '\n \tgit init empty &&\n \ttest_when_finished \"rm -rf empty\" &&\n \ttest_must_fail git -C empty log 2>stderr &&\n-\ttest_i18ngrep does.not.have.any.commits stderr &&\n+\ttest_i18ngrep does.not.have.any.commits stderr\n+'\n+\n+test_expect_success REFFILES 'log diagnoses bogus HEAD hash' '\n+\tgit init empty &&\n+\ttest_when_finished \"rm -rf empty\" &&\n \techo 1234abcd >empty/.git/refs/heads/main &&\n \ttest_must_fail git -C empty log 2>stderr &&\n-\ttest_i18ngrep broken stderr'\n+\ttest_i18ngrep broken stderr\n+'\n \n test_expect_success 'log diagnoses bogus HEAD symref' '\n \tgit init empty &&\n-- \ngitgitgadget\n\n"},{"id":"426047","messageId":"9ede1b73d5238d62faea395f1154af9e02e11b4c.1622480197.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 13/22] t5304: use \"reflog expire --all\" to clear the reflog","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:28Z","receivedAt":"2021-05-31T17:41:01Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nThis test checks that unreachable objects are really removed. For the test to\nwork, it has to ensure that no reflog retain any reachable objects.\n\nPreviously, it did this by manipulating the file system to remove reflog in the\nfirst test, and relying on git not updating the reflog if the relevant logfile\ndoesn't exist in follow-up tests.\n\nNow, explicitly clear the reflog using 'reflog expire'. This reduces the\ndependency between test functions. It also is more amenable to use with\nreftable, which has no concept of (non)-existence of a reflog\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\nReviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t5304-prune.sh | 9 ++++-----\n 1 file changed, 4 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t5304-prune.sh b/t/t5304-prune.sh\nindex 15d56d3d8791..7cabb85ca6e1 100755\n--- a/t/t5304-prune.sh\n+++ b/t/t5304-prune.sh\n@@ -81,12 +81,12 @@ test_expect_success 'prune: prune nonsense parameters' '\n \n test_expect_success 'prune: prune unreachable heads' '\n \tgit config core.logAllRefUpdates false &&\n-\tmv .git/logs .git/logs.old &&\n-\t: > file2 &&\n+\t>file2 &&\n \tgit add file2 &&\n \tgit commit -m temporary &&\n \ttmp_head=$(git rev-list -1 HEAD) &&\n \tgit reset HEAD^ &&\n+\tgit reflog expire --all &&\n \tgit prune &&\n \ttest_must_fail git reset $tmp_head --\n '\n@@ -94,9 +94,7 @@ test_expect_success 'prune: prune unreachable heads' '\n test_expect_success 'prune: do not prune detached HEAD with no reflog' '\n \tgit checkout --detach --quiet &&\n \tgit commit --allow-empty -m \"detached commit\" &&\n-\t# verify that there is no reflogs\n-\t# (should be removed and disabled by previous test)\n-\ttest_path_is_missing .git/logs &&\n+\tgit reflog expire --all &&\n \tgit prune -n >prune_actual &&\n \ttest_must_be_empty prune_actual\n '\n@@ -104,6 +102,7 @@ test_expect_success 'prune: do not prune detached HEAD with no reflog' '\n test_expect_success 'prune: prune former HEAD after checking out branch' '\n \thead_oid=$(git rev-parse HEAD) &&\n \tgit checkout --quiet main &&\n+\tgit reflog expire --all &&\n \tgit prune -v >prune_actual &&\n \tgrep \"$head_oid\" prune_actual\n '\n-- \ngitgitgadget\n\n"},{"id":"426048","messageId":"6919c15e5f9800c6f52e575f8b62993c000843ea.1622480197.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 19/22] t7900: stop checking for loose refs","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:34Z","receivedAt":"2021-05-31T17:41:07Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nGiven that git-maintenance simply calls out git-pack-refs, it seems superfluous\nto test the functionality of pack-refs itself, as that is covered by\nt3210-pack-refs.sh.\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\nReviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t7900-maintenance.sh | 2 --\n 1 file changed, 2 deletions(-)\n\ndiff --git a/t/t7900-maintenance.sh b/t/t7900-maintenance.sh\nindex b93ae014ee58..58f46c77e666 100755\n--- a/t/t7900-maintenance.sh\n+++ b/t/t7900-maintenance.sh\n@@ -356,8 +356,6 @@ test_expect_success 'pack-refs task' '\n \tdone &&\n \tGIT_TRACE2_EVENT=\"$(pwd)/pack-refs.txt\" \\\n \t\tgit maintenance run --task=pack-refs &&\n-\tls .git/refs/heads/ >after &&\n-\ttest_must_be_empty after &&\n \ttest_subcommand git pack-refs --all --prune <pack-refs.txt\n '\n \n-- \ngitgitgadget\n\n"},{"id":"426049","messageId":"73f89faa3b0a45cf4ab7388b6dfeaf4d7bd881c6.1622480197.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 20/22] t7003: check reflog existence only for REFFILES","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:35Z","receivedAt":"2021-05-31T17:41:14Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\nReviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t7003-filter-branch.sh | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t7003-filter-branch.sh b/t/t7003-filter-branch.sh\nindex cf30055c88dd..e18a21895238 100755\n--- a/t/t7003-filter-branch.sh\n+++ b/t/t7003-filter-branch.sh\n@@ -396,7 +396,10 @@ test_expect_success '--prune-empty is able to prune entire branch' '\n \tgit branch prune-entire B &&\n \tgit filter-branch -f --prune-empty --index-filter \"git update-index --remove A.t B.t\" prune-entire &&\n \ttest_must_fail git rev-parse refs/heads/prune-entire &&\n-\ttest_must_fail git reflog exists refs/heads/prune-entire\n+\tif test_have_prereq REFFILES\n+\tthen\n+\t\ttest_must_fail git reflog exists refs/heads/prune-entire\n+\tfi\n '\n \n test_expect_success '--remap-to-ancestor with filename filters' '\n-- \ngitgitgadget\n\n"},{"id":"426050","messageId":"cbcbb2d78fc939e968347c2dc2ac079ab6771e97.1622480198.git.gitgitgadget@gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"[PATCH v3 22/22] t1415: set REFFILES for test specific to storage format","fromName":"Han-Wen Nienhuys via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-05-31T16:56:37Z","receivedAt":"2021-05-31T17:41:19Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"From: Han-Wen Nienhuys <hanwen@google.com>\n\nPacking refs (and therefore checking that certain refs are not packed)\nis a property of the packed/loose ref storage. Add a comment to explain\nwhat the test checks.\n\nSigned-off-by: Han-Wen Nienhuys <hanwen@google.com>\nReviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t1415-worktree-refs.sh | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t1415-worktree-refs.sh b/t/t1415-worktree-refs.sh\nindex 7ab91241ab7c..66f27d0fdfc9 100755\n--- a/t/t1415-worktree-refs.sh\n+++ b/t/t1415-worktree-refs.sh\n@@ -16,7 +16,10 @@ test_expect_success 'setup' '\n \tgit -C wt2 update-ref refs/worktree/foo HEAD\n '\n \n-test_expect_success 'refs/worktree must not be packed' '\n+# The 'packed-refs' file is stored directly in .git/. This means it is global\n+# to the repository, and can only contain refs that are shared across all\n+# worktrees.\n+test_expect_success REFFILES 'refs/worktree must not be packed' '\n \tgit pack-refs --all &&\n \ttest_path_is_missing .git/refs/tags/wt1 &&\n \ttest_path_is_file .git/refs/worktree/foo &&\n-- \ngitgitgadget\n"},{"id":"426083","messageId":"87sg221nb0.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"CAFQ2z_N=RtSeD6f3a2VPVdDUBxFS1ekC=na=5iVcsWOpkDdORw@mail.gmail.com","subject":"Re: [PATCH v2 21/21] t1415: set REFFILES for test specific to storage format","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-05-31T23:36:10Z","receivedAt":"2021-05-31T23:44:09Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, May 31 2021, Han-Wen Nienhuys wrote:\n\n> On Thu, May 20, 2021 at 5:51 PM Ævar Arnfjörð Bjarmason\n> <avarab@gmail.com> wrote:\n>> > -test_expect_success 'refs/worktree must not be packed' '\n>> > +# The 'packed-refs' files is stored directly in .git/. This means it is global\n>> > +# to the repository, and can only contain refs that are shared across all\n>> > +# worktrees.\n>> > +test_expect_success REFFILES 'refs/worktree must not be packed' '\n>> >       git pack-refs --all &&\n>> >       test_path_is_missing .git/refs/tags/wt1 &&\n>> >       test_path_is_file .git/refs/worktree/foo &&\n>>\n>> Nit but also chicken & egg: Let's keep the \"pack-refs --all\" though\n>> under reftable in its own test, and do the test_path_* assertions just\n>> under REFFILES, i.e. does/should pack-refs warn/error under reftable as\n>> redundant, succeed silently?\n>\n> I don't understand your comment. This test is checking constraints on\n> worktrees that are only relevant for loose/packed storage. In fact,\n> under reftable, there is no such thing as a \"packed ref\" storage\n> class. This test is just not relevant for reftable, and I tried\n> explaining in the comment why this is so. Happy to hear how to further\n> clarify this comment.\n\nThe chicken & egg part is that reftable isn't landed in-tree yet, so\nit's probably pointless to discuss at this point.\n\nBut what I was getting at is that while the test when written was trying\nto test that the file backend is doing some particular thing, when we go\nthrough our tests to find those cases we should at least make a mental\nnote (hence my E-Mail) to eventually positively assert the new behavior.\n\nI.e. if pack-refs is a noop shouldn't it warn or something, and then the\ntests should check if reftable warn, else do_old_stuff().\n\nIn this case one can imagine that e.g. a naïve buggy implementation\nwould check if .git/reftable or whatever exists, which of course with\n\".git\" being a plain file in worktrees won't work, so testing this\nparticular case somewhere in the worktree tests is probably prudent...\n"},{"id":"426084","messageId":"87pmx61mfp.fsf@evledraar.gmail.com","threadId":"55516","inReplyTo":"pull.1008.v3.git.git.1622480197.gitgitgadget@gmail.com","subject":"Re: [PATCH v3 00/22] Prepare tests for reftable backend","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2021-05-31T23:57:51Z","receivedAt":"2021-06-01T00:02:58Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Mon, May 31 2021, Han-Wen Nienhuys via GitGitGadget wrote:\n\n> Rewrites some tests to avoid direct filesystem access.\n>\n> Introduces the test prereq REFFILES to mark other tests that depend on\n> specifics of the files ref backend.\n>\n> changes in v3 (relative to v2 from Apr 27)\n>\n>  * address avarab's feedback.\n\nI've looked this v3 over, and I think this is ready to go, and would\nlike to see this get merged down to next etc. Any minor quibbles I might\nhave are far outweighed by a desire to get this whole topic back on\ntrack.\n\nA bit more detail:\n\nPer my feedback on v2 I'm not sure we're getting the right trade-off of\nover skipping tests v.s. asserting new behavior, but as noted there\nwe've got the chicken & egg problem that we don't have reftable yet, so\nwe can't assert the new behavior, just discuss it in the abstract.\n\nSo our goal with this shouldn't be to get this perfect, but just get the\ntests closer to not being file-backend specific.\n\nOnce we have this topic in \"master\" and a re-rolled reftable on top we\ncan always (and I plan to do this) see where exactly we end up differing\nunder reftable v.s. file backend.\n\nMaybe that'll result in a different approach for a few tests being\nchanged here.\n"},{"id":"426094","messageId":"51a802ff-0789-4051-6d45-5b9c6e55ba8a@gmail.com","threadId":"55516","inReplyTo":"f6ab40c4e6599540da38ae5af8e574dc65909e79.1622480197.git.gitgitgadget@gmail.com","subject":"Re: [PATCH v3 07/22] t1413: use tar to save and restore entire .git directory","fromName":"Bagas Sanjaya","fromEmail":"bagasdotme@gmail.com","sentAt":"2021-06-01T04:55:37Z","receivedAt":"2021-06-01T04:55:46Z","isPatch":true,"sender":{"key":"bagasdotme@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40219486?v=4"},"body":"Hi,\n\nOn 31/05/21 23.56, Han-Wen Nienhuys via GitGitGadget wrote:\n> diff --git a/t/t1413-reflog-detach.sh b/t/t1413-reflog-detach.sh\n> index bde05208ae6a..934688a1ee82 100755\n> --- a/t/t1413-reflog-detach.sh\n> +++ b/t/t1413-reflog-detach.sh\n> @@ -7,8 +7,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n>   . ./test-lib.sh\n>   \n>   reset_state () {\n> -\tgit checkout main &&\n> -\tcp saved_reflog .git/logs/HEAD\n> +\trm -rf .git && \"$TAR\" xf .git-saved.tar\n>   }\n>   \n\nWhy do you do rm -rf git directory then extract tar archive to reset?\n\n-- \nAn old man doll... just what I always wanted! - Clara\n"},{"id":"426102","messageId":"CAFQ2z_O2t2cDvTs0aNqB+9FVSy51CKrJxxdvu9WGg1s6gZziHw@mail.gmail.com","threadId":"55516","inReplyTo":"51a802ff-0789-4051-6d45-5b9c6e55ba8a@gmail.com","subject":"Re: [PATCH v3 07/22] t1413: use tar to save and restore entire .git directory","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-06-01T09:23:08Z","receivedAt":"2021-06-01T09:23:23Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Tue, Jun 1, 2021 at 6:55 AM Bagas Sanjaya <bagasdotme@gmail.com> wrote:\n>\n> On 31/05/21 23.56, Han-Wen Nienhuys via GitGitGadget wrote:\n> > diff --git a/t/t1413-reflog-detach.sh b/t/t1413-reflog-detach.sh\n> > index bde05208ae6a..934688a1ee82 100755\n> > --- a/t/t1413-reflog-detach.sh\n> > +++ b/t/t1413-reflog-detach.sh\n> > @@ -7,8 +7,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n> >   . ./test-lib.sh\n> >\n> >   reset_state () {\n> > -     git checkout main &&\n> > -     cp saved_reflog .git/logs/HEAD\n> > +     rm -rf .git && \"$TAR\" xf .git-saved.tar\n> >   }\n> >\n>\n> Why do you do rm -rf git directory then extract tar archive to reset?\n\nI'm not sure I understand your question. Are you asking why we have to\ndo a reset, or why we'd use rm + tar? The rm + tar restores the former\nstate reliably, so we can be sure it is correct. It's also independent\nof the storage format details.\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\nRegistergericht und -nummer: Hamburg, HRB 86891\nSitz der Gesellschaft: Hamburg\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"},{"id":"426158","messageId":"xmqqeedls4ak.fsf@gitster.g","threadId":"55516","inReplyTo":"CAFQ2z_O2t2cDvTs0aNqB+9FVSy51CKrJxxdvu9WGg1s6gZziHw@mail.gmail.com","subject":"Re: [PATCH v3 07/22] t1413: use tar to save and restore entire .git directory","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-06-01T20:44:51Z","receivedAt":"2021-06-01T20:44:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Han-Wen Nienhuys <hanwen@google.com> writes:\n\n> On Tue, Jun 1, 2021 at 6:55 AM Bagas Sanjaya <bagasdotme@gmail.com> wrote:\n>>\n>> On 31/05/21 23.56, Han-Wen Nienhuys via GitGitGadget wrote:\n>> > diff --git a/t/t1413-reflog-detach.sh b/t/t1413-reflog-detach.sh\n>> > index bde05208ae6a..934688a1ee82 100755\n>> > --- a/t/t1413-reflog-detach.sh\n>> > +++ b/t/t1413-reflog-detach.sh\n>> > @@ -7,8 +7,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n>> >   . ./test-lib.sh\n>> >\n>> >   reset_state () {\n>> > -     git checkout main &&\n>> > -     cp saved_reflog .git/logs/HEAD\n>> > +     rm -rf .git && \"$TAR\" xf .git-saved.tar\n>> >   }\n>> >\n>>\n>> Why do you do rm -rf git directory then extract tar archive to reset?\n>\n> I'm not sure I understand your question. Are you asking why we have to\n> do a reset, or why we'd use rm + tar? The rm + tar restores the former\n> state reliably, so we can be sure it is correct. It's also independent\n> of the storage format details.\n\nI think a short answer is \"without rm -rf .git, a stale file in that\ndirectory will stay there when .git-saved.tar gets extracted\", but\nthe whole arrangement makes me worried what would happen if somebody\nmanages to interrupt \"rm -rf\" without killing the whole test\nframework (or letting the when-finished handlers run).  The test\nframework thinks it is working in a throw-away repository but the\n$TRASH_DIRECTORY that was supposed to be removed and extracted but\nfailed to do so due to interruption in the middle may not look like\na git repository, in which case it may try to do the usual repository\ndiscovery and trash the git project repository instead.\n"},{"id":"426205","messageId":"CAFQ2z_N8L43KeWTr76Noschxi6jPdjWt_k_0EJthE51+vhb4Mg@mail.gmail.com","threadId":"55516","inReplyTo":"xmqqeedls4ak.fsf@gitster.g","subject":"Re: [PATCH v3 07/22] t1413: use tar to save and restore entire .git directory","fromName":"Han-Wen Nienhuys","fromEmail":"hanwen@google.com","sentAt":"2021-06-02T07:49:32Z","receivedAt":"2021-06-02T07:49:48Z","isPatch":true,"sender":{"key":"hanwen@google.com","avatar":"https://avatars.githubusercontent.com/u/31547?v=4"},"body":"On Tue, Jun 1, 2021 at 10:44 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Han-Wen Nienhuys <hanwen@google.com> writes:\n>\n> > On Tue, Jun 1, 2021 at 6:55 AM Bagas Sanjaya <bagasdotme@gmail.com> wrote:\n> >>\n> >> On 31/05/21 23.56, Han-Wen Nienhuys via GitGitGadget wrote:\n> >> > diff --git a/t/t1413-reflog-detach.sh b/t/t1413-reflog-detach.sh\n> >> > index bde05208ae6a..934688a1ee82 100755\n> >> > --- a/t/t1413-reflog-detach.sh\n> >> > +++ b/t/t1413-reflog-detach.sh\n> >> > @@ -7,8 +7,7 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n> >> >   . ./test-lib.sh\n> >> >\n> >> >   reset_state () {\n> >> > -     git checkout main &&\n> >> > -     cp saved_reflog .git/logs/HEAD\n> >> > +     rm -rf .git && \"$TAR\" xf .git-saved.tar\n> >> >   }\n> >> >\n> >>\n> >> Why do you do rm -rf git directory then extract tar archive to reset?\n> >\n> > I'm not sure I understand your question. Are you asking why we have to\n> > do a reset, or why we'd use rm + tar? The rm + tar restores the former\n> > state reliably, so we can be sure it is correct. It's also independent\n> > of the storage format details.\n>\n> I think a short answer is \"without rm -rf .git, a stale file in that\n> directory will stay there when .git-saved.tar gets extracted\", but\n> the whole arrangement makes me worried what would happen if somebody\n> manages to interrupt \"rm -rf\" without killing the whole test\n> framework (or letting the when-finished handlers run).  The test\n> framework thinks it is working in a throw-away repository but the\n> $TRASH_DIRECTORY that was supposed to be removed and extracted but\n> failed to do so due to interruption in the middle may not look like\n> a git repository, in which case it may try to do the usual repository\n> discovery and trash the git project repository instead.\n\nSimilar problems could occur if a developer is trying out a change to\nthe Git source code and makes an error. It's also easy to mess up the\ncheck-out by doing a \"cd ..\" too many in a shell test under\ndevelopment.\n\nI don't understand why the temp directories for tests are inside the\nsource tree. Every other project that I've worked on uses mktemp -d\nfor temporary directories instead.\n\nFor the problem you describe here, using atomic rename won't work,\nbecause we want to swap out a complete directory. So we'd need a\ncommand that replicates a source into a destination tree, using atomic\nrename. Maybe rsync --delete might do the trick, but I don't think\nwe'd want that as a dependency?\n\n-- \nHan-Wen Nienhuys - Google Munich\nI work 80%. Don't expect answers from me on Fridays.\n--\nGoogle Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich\nRegistergericht und -nummer: Hamburg, HRB 86891\nSitz der Gesellschaft: Hamburg\nGeschäftsführer: Paul Manicle, Halimah DeLaine Prado\n"}]}