From: Han-Wen Nienhuys via GitGitGadget <hidden> Date: 2021-12-22 10:59:48
this is an assorted set of fixes to make some tests pass with reftable.
Han-Wen Nienhuys (4):
t5540: require REFFILES
t5550: require REFFILES
t7004: create separate tags for different tests
t7004: use "test-tool ref-store" for reflog inspection
t/t5540-http-push-webdav.sh | 6 ++++++
t/t5550-http-fetch-dumb.sh | 7 +++++++
t/t7004-tag.sh | 22 +++++++++++-----------
3 files changed, 24 insertions(+), 11 deletions(-)
base-commit: 69a9c10c95e28df457e33b3c7400b16caf2e2962
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1168%2Fhanwen%2Freftable-test-fixes-20211221-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1168/hanwen/reftable-test-fixes-20211221-v1
Pull-Request: https://github.com/git/git/pull/1168
--
gitgitgadget
From: Han-Wen Nienhuys via GitGitGadget <hidden> Date: 2021-12-22 10:59:50
From: Han-Wen Nienhuys <redacted>
The dumb HTTP protocol exposes ref storage details as part of the protocol,
so it only works with the FILES refstorage backend
Signed-off-by: Han-Wen Nienhuys <redacted>
---
t/t5540-http-push-webdav.sh | 6 ++++++
1 file changed, 6 insertions(+)
From: Han-Wen Nienhuys via GitGitGadget <hidden> Date: 2021-12-22 10:59:53
From: Han-Wen Nienhuys <redacted>
The dumb HTTP protocol exposes ref storage details as part of the protocol,
so it only works with the FILES refstorage backend
Signed-off-by: Han-Wen Nienhuys <redacted>
---
t/t5550-http-fetch-dumb.sh | 7 +++++++
1 file changed, 7 insertions(+)
From: Han-Wen Nienhuys via GitGitGadget <hidden> Date: 2021-12-22 10:59:54
From: Han-Wen Nienhuys <redacted>
Reftable intentionally keeps reflog data for deleted refs.
This breaks tests that delete and recreate "refs/tags/tag_with_reflog" as traces
of the deletion are left in reflog. To resolve this, use a differently named ref
for each test case.
Signed-off-by: Han-Wen Nienhuys <redacted>
---
t/t7004-tag.sh | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
@@ -94,10 +94,10 @@ test_expect_success 'creating a tag with --create-reflog should create reflog' 'gitlog-1\--format="format:tag: tagging %h (%s, %cd)%n"\--date=format:%Y-%m-%d>expected&&-test_when_finished"git tag -d tag_with_reflog"&&-gittag--create-reflogtag_with_reflog&&-gitreflogexistsrefs/tags/tag_with_reflog&&-sed-e"s/^.* //".git/logs/refs/tags/tag_with_reflog>actual&&+test_when_finished"git tag -d tag_with_reflog1"&&+gittag--create-reflogtag_with_reflog1&&+gitreflogexistsrefs/tags/tag_with_reflog1&&+sed-e"s/^.* //".git/logs/refs/tags/tag_with_reflog1>actual&&test_cmpexpectedactual'
@@ -105,10 +105,10 @@ test_expect_success 'annotated tag with --create-reflog has correct message' 'gitlog-1\--format="format:tag: tagging %h (%s, %cd)%n"\--date=format:%Y-%m-%d>expected&&-test_when_finished"git tag -d tag_with_reflog"&&-gittag-m"annotated tag"--create-reflogtag_with_reflog&&-gitreflogexistsrefs/tags/tag_with_reflog&&-sed-e"s/^.* //".git/logs/refs/tags/tag_with_reflog>actual&&+test_when_finished"git tag -d tag_with_reflog2"&&+gittag-m"annotated tag"--create-reflogtag_with_reflog2&&+gitreflogexistsrefs/tags/tag_with_reflog2&&+sed-e"s/^.* //".git/logs/refs/tags/tag_with_reflog2>actual&&test_cmpexpectedactual'
@@ -118,10 +118,10 @@ test_expect_success '--create-reflog does not create reflog on failure' '' test_expect_success'option core.logAllRefUpdates=always creates reflog''-test_when_finished"git tag -d tag_with_reflog"&&+test_when_finished"git tag -d tag_with_reflog3"&&test_configcore.logAllRefUpdatesalways&&-gittagtag_with_reflog&&-gitreflogexistsrefs/tags/tag_with_reflog+gittagtag_with_reflog3&&+gitreflogexistsrefs/tags/tag_with_reflog3' test_expect_success'listing all tags if one exists should succeed''
From: Han-Wen Nienhuys via GitGitGadget <hidden> Date: 2021-12-22 10:59:56
From: Han-Wen Nienhuys <redacted>
This makes the test work with reftable.
Signed-off-by: Han-Wen Nienhuys <redacted>
---
t/t7004-tag.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -97,7 +97,7 @@ test_expect_success 'creating a tag with --create-reflog should create reflog' 'test_when_finished"git tag -d tag_with_reflog1"&&gittag--create-reflogtag_with_reflog1&&gitreflogexistsrefs/tags/tag_with_reflog1&&-sed-e"s/^.* //".git/logs/refs/tags/tag_with_reflog1>actual&&+test-toolref-storemainfor-each-reflog-entrefs/tags/tag_with_reflog1|sed-e"s/^.* //">actual&&test_cmpexpectedactual'
@@ -108,7 +108,7 @@ test_expect_success 'annotated tag with --create-reflog has correct message' 'test_when_finished"git tag -d tag_with_reflog2"&&gittag-m"annotated tag"--create-reflogtag_with_reflog2&&gitreflogexistsrefs/tags/tag_with_reflog2&&-sed-e"s/^.* //".git/logs/refs/tags/tag_with_reflog2>actual&&+test-toolref-storemainfor-each-reflog-entrefs/tags/tag_with_reflog2|sed-e"s/^.* //">actual&&test_cmpexpectedactual'
On Fri, Dec 24, 2021 at 6:14 AM Bagas Sanjaya [off-list ref] wrote:
On 22/12/21 17.59, Han-Wen Nienhuys via GitGitGadget wrote:
quoted
+if test_have_prereq !REFFILES
+then
+ skip_all='skipping test; dumb HTTP protocol not supported with reftable.'
+ test_done
+fi
+
Did you mean reftable doesn't support dumb HTTP protocol or vice versa?
AFAIK, the 'dumb protocol' isn't really a protocol, but is simply
exposing the file system over HTTP.
I suppose we could expose the reftable files over HTTP, but that means
we have to rewrite the client to understand reftable files if they are
served. However, I get the impression that nobody really uses the dumb
protocol anymore, so is it worth trying to make this work for
reftable?
--
Han-Wen Nienhuys - Google Munich
I work 80%. Don't expect answers from me on Fridays.
--
Google Germany GmbH, Erika-Mann-Strasse 33, 80636 Munich
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Paul Manicle, Halimah DeLaine Prado