git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Eric Sunshine <sunshine@sunshineco.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 5/6] t5526: break test submodule differently
Date: Wed, 10 Jan 2024 08:41:25 +0100	[thread overview]
Message-ID: <ZZ5KJX4tC0UIX00j@tanuki> (raw)
In-Reply-To: <CAPig+cTB5OH1hCD-EagxNAcaw1=RR7yCeeZ_AzeqHtFTGxT-0g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3458 bytes --]

On Tue, Jan 09, 2024 at 02:23:55PM -0500, Eric Sunshine wrote:
> On Tue, Jan 9, 2024 at 7:17 AM Patrick Steinhardt <ps@pks.im> wrote:
> > In 10f5c52656 (submodule: avoid auto-discovery in
> > prepare_submodule_repo_env(), 2016-09-01) we fixed a bug when doing a
> > recursive fetch with submodule in the case where the submodule is broken
> > due to whatever reason. The test to exercise that the fix works breaks
> > the submodule by deleting its `HEAD` reference, which will cause us to
> > not detect the directory as a Git repository.
> >
> > While this is perfectly fine in theory, this way of breaking the repo
> > becomes problematic with the current efforts to introduce another refdb
> > backend into Git. The new reftable backend has a stub HEAD file that
> > always contains "ref: refs/heads/.invalid" so that tools continue to be
> > able to detect such a repository. But as the reftable backend will never
> > delete this file even when asked to delete `HEAD` the current way to
> > delete the `HEAD` reference will stop working.
> 
> This patch is not the appropriate place to bikeshed (but since this is
> the first time I've read or paid attention to it), if I saw "ref:
> refs/heads/.invalid", the word ".invalid" would make me think
> something was broken in my repository. Would it make sense to use some
> less alarming word, such as perhaps ".placeholder", ".stand-in",
> ".synthesized" or even the name of the non-file-based backend in use?

Well, something _is_ broken in your repository in case Git ever tries to
read the "HEAD" placeholder in a reftable-enabled repository. But I
guess you rather come from the angle of using `cat HEAD` as a user. I do
agree that using a better hint could help users, but this detail has
already been recorded as such in "Documentation/technical/reftable.txt".

We can of course change this to be "ref: refs/heads/.reftable", but as
you already say this is something that should be discussed in a separate
thread.

> > Adapt the code to instead delete the objects database. Going back with
> > this new way to cuase breakage confirms that it triggers the infinite
> > recursion just the same, and there are no equivalent ongoing efforts to
> > replace the object database with an alternate backend.
> 
> s/cuase/cause/
> 
> > Signed-off-by: Patrick Steinhardt <ps@pks.im>
> > ---
> > diff --git a/t/t5526-fetch-submodules.sh b/t/t5526-fetch-submodules.sh
> > @@ -771,7 +771,7 @@ test_expect_success 'fetching submodule into a broken repository' '
> >         # Break the receiving submodule
> > -       test-tool -C dst/sub ref-store main delete-refs REF_NO_DEREF msg HEAD &&
> > +       rm -r dst/sub/.git/objects &&
> 
> If there is no guarantee that .git/objects will exist when any
> particular backend is in use, would it be more robust to use -f here,
> as well?
> 
>     rm -rf dst/sub/.git/objects &&

`.git/objects` always exists in a healthy repository. If it doesn't,
then `is_git_directory()` would return a false-ish value and we wouldn't
recognize the repository as such. Or are you saying that this could
potentially change in the future if there was ever to be an alternate
ODB format? If so that is a valid remark, but the test would break
regardless of whether we use `-f` or not: if a missing ".git/objects"
directory does not lead to a corrupted repository then the whole premise
of the test is broken.

Patrick

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-01-10  7:41 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 12:17 [PATCH 0/6] t: mark "files"-backend specific tests Patrick Steinhardt
2024-01-09 12:17 ` [PATCH 1/6] t1300: mark tests to require default repo format Patrick Steinhardt
2024-01-09 18:41   ` Taylor Blau
2024-01-10  7:15     ` Patrick Steinhardt
2024-01-09 19:35   ` Eric Sunshine
2024-01-10  7:17     ` Patrick Steinhardt
2024-01-09 12:17 ` [PATCH 2/6] t1301: mark test for `core.sharedRepository` as reffiles specific Patrick Steinhardt
2024-01-09 12:17 ` [PATCH 3/6] t1302: make tests more robust with new extensions Patrick Steinhardt
2024-01-09 18:43   ` Taylor Blau
2024-01-09 12:17 ` [PATCH 4/6] t1419: mark test suite as files-backend specific Patrick Steinhardt
2024-01-09 19:40   ` Eric Sunshine
2024-01-10  7:30     ` Patrick Steinhardt
2024-01-10 16:27       ` Junio C Hamano
2024-01-11  5:05         ` Patrick Steinhardt
2024-01-09 12:17 ` [PATCH 5/6] t5526: break test submodule differently Patrick Steinhardt
2024-01-09 19:23   ` Eric Sunshine
2024-01-10  7:41     ` Patrick Steinhardt [this message]
2024-01-09 12:17 ` [PATCH 6/6] t: mark tests regarding git-pack-refs(1) to be backend specific Patrick Steinhardt
2024-01-10  9:01 ` [PATCH v2 0/6] t: mark "files"-backend specific tests Patrick Steinhardt
2024-01-10  9:01   ` [PATCH v2 1/6] t1300: make tests more robust with non-default ref backends Patrick Steinhardt
2024-01-23 13:41     ` Toon Claes
2024-01-23 15:22       ` Patrick Steinhardt
2024-01-23 16:43         ` Justin Tobler
2024-01-23 16:15     ` Christian Couder
2024-01-24  8:52       ` Patrick Steinhardt
2024-01-29 10:32         ` Christian Couder
2024-01-29 10:49           ` Patrick Steinhardt
2024-01-10  9:01   ` [PATCH v2 2/6] t1301: mark test for `core.sharedRepository` as reffiles specific Patrick Steinhardt
2024-01-10  9:01   ` [PATCH v2 3/6] t1302: make tests more robust with new extensions Patrick Steinhardt
2024-01-23 14:08     ` Toon Claes
2024-01-23 15:18       ` Patrick Steinhardt
2024-01-23 16:15     ` Christian Couder
2024-01-24  8:52       ` Patrick Steinhardt
2024-01-10  9:01   ` [PATCH v2 4/6] t1419: mark test suite as files-backend specific Patrick Steinhardt
2024-01-10  9:01   ` [PATCH v2 5/6] t5526: break test submodule differently Patrick Steinhardt
2024-01-10  9:01   ` [PATCH v2 6/6] t: mark tests regarding git-pack-refs(1) to be backend specific Patrick Steinhardt
2024-01-23 16:20   ` [PATCH v2 0/6] t: mark "files"-backend specific tests Christian Couder
2024-01-24  8:45 ` [PATCH v3 " Patrick Steinhardt
2024-01-24  8:45   ` [PATCH v3 1/6] t1300: make tests more robust with non-default ref backends Patrick Steinhardt
2024-01-24  8:45   ` [PATCH v3 2/6] t1301: mark test for `core.sharedRepository` as reffiles specific Patrick Steinhardt
2024-01-24  8:45   ` [PATCH v3 3/6] t1302: make tests more robust with new extensions Patrick Steinhardt
2024-01-24  8:45   ` [PATCH v3 4/6] t1419: mark test suite as files-backend specific Patrick Steinhardt
2024-01-24  8:45   ` [PATCH v3 5/6] t5526: break test submodule differently Patrick Steinhardt
2024-01-24  8:45   ` [PATCH v3 6/6] t: mark tests regarding git-pack-refs(1) to be backend specific Patrick Steinhardt
2024-01-29 11:07 ` [PATCH v4 0/6] t: mark "files"-backend specific tests Patrick Steinhardt
2024-01-29 11:07   ` [PATCH v4 1/6] t1300: make tests more robust with non-default ref backends Patrick Steinhardt
2024-01-29 12:00     ` Christian Couder
2024-01-29 11:07   ` [PATCH v4 2/6] t1301: mark test for `core.sharedRepository` as reffiles specific Patrick Steinhardt
2024-01-29 11:07   ` [PATCH v4 3/6] t1302: make tests more robust with new extensions Patrick Steinhardt
2024-01-29 11:07   ` [PATCH v4 4/6] t1419: mark test suite as files-backend specific Patrick Steinhardt
2024-01-29 11:07   ` [PATCH v4 5/6] t5526: break test submodule differently Patrick Steinhardt
2024-01-29 11:07   ` [PATCH v4 6/6] t: mark tests regarding git-pack-refs(1) to be backend specific Patrick Steinhardt
2024-01-29 12:03   ` [PATCH v4 0/6] t: mark "files"-backend specific tests Christian Couder
2024-01-29 20:38     ` Junio C Hamano

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZZ5KJX4tC0UIX00j@tanuki \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=sunshine@sunshineco.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).