From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org, Han-Wen Nienhuys <hanwen@google.com>
Subject: Re: [PATCH 05/11] t: convert tests to not access symrefs via the filesystem
Date: Fri, 20 Oct 2023 12:52:36 -0700 [thread overview]
Message-ID: <xmqq4jilqdff.fsf@gitster.g> (raw)
In-Reply-To: <1ac120368c6cd995841c28bde7542e882ec7b04f.1697607222.git.ps@pks.im> (Patrick Steinhardt's message of "Wed, 18 Oct 2023 07:35:24 +0200")
Patrick Steinhardt <ps@pks.im> writes:
> @@ -164,9 +164,9 @@ test_expect_success 'rev-parse skips symref pointing to broken name' '
> test_expect_success 'for-each-ref emits warnings for broken names' '
> test-tool ref-store main update-ref msg "refs/heads/broken...ref" $main_sha1 $ZERO_OID REF_SKIP_REFNAME_VERIFICATION &&
> test_when_finished "test-tool ref-store main delete-refs REF_NO_DEREF msg refs/heads/broken...ref" &&
> - printf "ref: refs/heads/broken...ref\n" >.git/refs/heads/badname &&
> + test-tool ref-store main create-symref refs/heads/badname refs/heads/broken...ref &&
I am of two minds here. While it certainly smells nicer because we
can test ref backends other than the files backend with this change,
we are forcing all ref backends to support creating a symbolic ref
with invalid name, because otherwise "test-tool" would not be able
to do this. Newer more database-oriented ref backends should be
allowed to implement their file format in which it is imposssible to
store such a bad name, but this makes it impossible.
I guess it is OK, because we would introduce some new prerequisite
(i.e. REF_BACKEND_ALLOWS_BROKEN_REFS) to skip this test on certain
ref backend where making invalid refs is impossible.
Other kind of changes in this patch, e.g., ...
> @@ -315,7 +325,9 @@ test_expect_success 'defaulted HEAD uses remote branch if available' '
> git -c init.defaultBranch=branchwithstuff -c protocol.version=2 \
> clone "file://$(pwd)/file_unborn_parent" \
> file_unborn_child 2>stderr &&
> - grep "refs/heads/branchwithstuff" file_unborn_child/.git/HEAD &&
> + echo "refs/heads/branchwithstuff" >expect &&
> + git -C file_unborn_child symbolic-ref HEAD >actual &&
> + test_cmp expect actual &&
> test_path_is_file file_unborn_child/stuff.t &&
> ! grep "warning:" stderr
> '
> diff --git a/t/t9133-git-svn-nested-git-repo.sh b/t/t9133-git-svn-nested-git-repo.sh
> index d8d536269cf..8ca24670acb 100755
> --- a/t/t9133-git-svn-nested-git-repo.sh
> +++ b/t/t9133-git-svn-nested-git-repo.sh
> @@ -11,7 +11,7 @@ test_expect_success 'setup repo with a git repo inside it' '
> (
> cd s &&
> git init &&
> - test -f .git/HEAD &&
> + git symbolic-ref HEAD &&
> > .git/a &&
> echo a > a &&
> svn_cmd add .git a &&
... all looked sensible, though.
Thanks.
next prev parent reply other threads:[~2023-10-20 19:52 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-18 5:35 [PATCH 00/11] t: reduce direct disk access to data structures Patrick Steinhardt
2023-10-18 5:35 ` [PATCH 01/11] t: add helpers to test for reference existence Patrick Steinhardt
2023-10-18 16:06 ` Junio C Hamano
2023-10-23 13:58 ` Patrick Steinhardt
2023-10-18 17:08 ` Eric Sunshine
2023-10-23 13:58 ` Patrick Steinhardt
2023-10-18 5:35 ` [PATCH 02/11] t: allow skipping expected object ID in `ref-store update-ref` Patrick Steinhardt
2023-10-18 16:08 ` Junio C Hamano
2023-10-23 13:58 ` Patrick Steinhardt
2023-10-23 19:06 ` Junio C Hamano
2023-10-18 5:35 ` [PATCH 03/11] t: convert tests to use helpers for reference existence Patrick Steinhardt
2023-10-18 16:28 ` Junio C Hamano
2023-10-18 5:35 ` [PATCH 04/11] t: convert tests to not write references via the filesystem Patrick Steinhardt
2023-10-18 18:34 ` Junio C Hamano
2023-10-23 13:58 ` Patrick Steinhardt
2023-10-23 19:10 ` Junio C Hamano
2023-10-18 21:18 ` Junio C Hamano
2023-10-23 13:58 ` Patrick Steinhardt
2023-10-18 5:35 ` [PATCH 05/11] t: convert tests to not access symrefs " Patrick Steinhardt
2023-10-20 19:52 ` Junio C Hamano [this message]
2023-10-18 5:35 ` [PATCH 06/11] t: convert tests to not access reflog " Patrick Steinhardt
2023-10-21 23:13 ` Junio C Hamano
2023-10-18 5:35 ` [PATCH 07/11] t1450: convert tests to remove worktrees via git-worktree(1) Patrick Steinhardt
2023-10-18 5:35 ` [PATCH 08/11] t4207: delete replace references via git-update-ref(1) Patrick Steinhardt
2023-10-18 13:27 ` Han-Wen Nienhuys
2023-10-23 13:58 ` Patrick Steinhardt
2023-10-23 16:42 ` Taylor Blau
2023-10-24 6:42 ` Patrick Steinhardt
2023-10-18 5:35 ` [PATCH 09/11] t7300: assert exact states of repo Patrick Steinhardt
2023-10-18 5:35 ` [PATCH 10/11] t7900: assert the absence of refs via git-for-each-ref(1) Patrick Steinhardt
2023-10-18 5:35 ` [PATCH 11/11] t: mark several tests that assume the files backend with REFFILES Patrick Steinhardt
2023-10-18 5:39 ` [PATCH 00/11] t: reduce direct disk access to data structures Patrick Steinhardt
2023-10-18 23:40 ` Junio C Hamano
2023-10-23 11:57 ` Patrick Steinhardt
2023-10-18 15:32 ` Junio C Hamano
2023-10-19 10:13 ` Han-Wen Nienhuys
2023-10-19 17:55 ` Junio C Hamano
2023-10-23 13:58 ` Patrick Steinhardt
2023-10-24 14:04 ` [PATCH v2 0/9] " Patrick Steinhardt
2023-10-24 14:04 ` [PATCH v2 1/9] t: allow skipping expected object ID in `ref-store update-ref` Patrick Steinhardt
2023-10-24 14:04 ` [PATCH v2 2/9] t: convert tests to not write references via the filesystem Patrick Steinhardt
2023-10-24 14:05 ` [PATCH v2 3/9] t: convert tests to not access symrefs " Patrick Steinhardt
2023-10-24 14:05 ` [PATCH v2 4/9] t: convert tests to not access reflog " Patrick Steinhardt
2023-10-24 14:05 ` [PATCH v2 5/9] t1450: convert tests to remove worktrees via git-worktree(1) Patrick Steinhardt
2023-10-27 2:42 ` Eric Sunshine
2023-10-24 14:05 ` [PATCH v2 6/9] t4207: delete replace references via git-update-ref(1) Patrick Steinhardt
2023-10-24 14:05 ` [PATCH v2 7/9] t7300: assert exact states of repo Patrick Steinhardt
2023-10-24 14:05 ` [PATCH v2 8/9] t7900: assert the absence of refs via git-for-each-ref(1) Patrick Steinhardt
2023-10-24 14:05 ` [PATCH v2 9/9] t: mark several tests that assume the files backend with REFFILES Patrick Steinhardt
2023-11-02 8:46 ` [PATCH v3 0/9] t: reduce direct disk access to data structures Patrick Steinhardt
2023-11-02 8:46 ` [PATCH v3 1/9] t: allow skipping expected object ID in `ref-store update-ref` Patrick Steinhardt
2023-11-02 8:46 ` [PATCH v3 2/9] t: convert tests to not write references via the filesystem Patrick Steinhardt
2023-11-02 8:46 ` [PATCH v3 3/9] t: convert tests to not access symrefs " Patrick Steinhardt
2023-11-02 8:46 ` [PATCH v3 4/9] t: convert tests to not access reflog " Patrick Steinhardt
2023-11-02 8:46 ` [PATCH v3 5/9] t1450: convert tests to remove worktrees via git-worktree(1) Patrick Steinhardt
2023-11-02 8:47 ` [PATCH v3 6/9] t4207: delete replace references via git-update-ref(1) Patrick Steinhardt
2023-11-02 8:47 ` [PATCH v3 7/9] t7300: assert exact states of repo Patrick Steinhardt
2023-11-02 8:47 ` [PATCH v3 8/9] t7900: assert the absence of refs via git-for-each-ref(1) Patrick Steinhardt
2023-11-02 8:47 ` [PATCH v3 9/9] t: mark several tests that assume the files backend with REFFILES Patrick Steinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq4jilqdff.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=hanwen@google.com \
--cc=ps@pks.im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).