git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: ab/test-without-templates
Date: Mon, 27 Jun 2022 14:29:50 +0200	[thread overview]
Message-ID: <220627.864k06i8im.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <xmqqr13fxc5l.fsf@gitster.g>


On Thu, Jun 23 2022, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>> On Wed, Jun 22 2022, Junio C Hamano wrote:
>>
>>> * ab/test-without-templates (2022-06-06) 7 commits
>>>  - tests: don't assume a .git/info for .git/info/sparse-checkout
>>>  - tests: don't assume a .git/info for .git/info/exclude
>>>  - tests: don't assume a .git/info for .git/info/refs
>>>  - tests: don't assume a .git/info for .git/info/attributes
>>>  - tests: don't assume a .git/info for .git/info/grafts
>>>  - tests: don't depend on template-created .git/branches
>>>  - t0008: don't rely on default ".git/info/exclude"
>>>
>>>  Tweak tests so that they still work when the "git init" template
>>>  did not create .git/info directory.
>>>
>>>  Will merge to 'next'?
>>>  source: <cover-v2-0.7-00000000000-20220603T110506Z-avarab@gmail.com>
>>
>> Presumably the submitters vote doesn't count for much, but FWIW I think
>> it's ready & that there's nothing outstanding left to address.
>
> I do not think they make any particular test to break, but I do not
> think it is a good idea overall to give a false impression to the
> users that it is OK to use incomplete templates that lack things
> expected by Git in properly initialized repositories.  And these
> patches definitely take things in that wrong direction.

In the CL I mentioned some "future goals" goals that you may or may not
agree with, to elaborate on [1]:

 - Eventually running the whole test suite without "git init" creating
   repositories with templates.

 - Running without the bin-wrappers, which as mentions allows us to run
   faster, and improves our test coverage (it's hard to test some
   aspects of invoking "git", when really we're invoking a shellscript
   that invokes git).

 - Having some config option or other handy way to "git init" without
   templates (just formalizing the existing "--template=" invocation).

You may disagree with some or all of those, but this series doesn't try
to get you to agree with any of them. It's just making our tests more
sturdy and explicit in their intent by clearly declaring which parts of
them are relying on our default templates.

So it's helping us spot issues like the one fixed in 7f44842ac19
(sparse-checkout: create leading directory, 2022-01-21) earlier.

I really don't disagree with you per-se about us defining some minimum
viable template, and declaring that pointing --template=* to an empty
directory is unsupported.

But I think it's unarguable that the status quo is leaving our users in
limbo on that question. Neither git-init(1) nor gitrepository-layout(5)
etc. cover that question.

Now, I think based on unsubmitted patches I've wrote that just handling
those cases in code is easier. I.e. it's a small matter of adding a
"mkdir x/y" before we create "x/y", and almost all of that code is code
we have already, so we're mostly supporting the "empty dir" template
model.

But I'm not trying to argue for that here, nor is this series. What this
series does is make it easier to avoid bugs and unexpected behavior in
that are, whatever your position on the "minmum viable template"
question is.

1. https://lore.kernel.org/git/cover-v2-0.7-00000000000-20220603T110506Z-avarab@gmail.com/

  reply	other threads:[~2022-06-27 12:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-22 19:32 What's cooking in git.git (Jun 2022, #07; Wed, 22) Junio C Hamano
2022-06-22 21:16 ` en/merge-tree (Was: Re: What's cooking in git.git (Jun 2022, #07; Wed, 22)) Elijah Newren
2022-06-22 23:13   ` en/merge-tree Junio C Hamano
2022-06-23 10:02   ` en/merge-tree (Was: Re: What's cooking in git.git (Jun 2022, #07; Wed, 22)) Johannes Schindelin
2022-06-23 10:55 ` ab/test-without-templates (was: " Ævar Arnfjörð Bjarmason
2022-06-23 22:12   ` ab/test-without-templates Junio C Hamano
2022-06-27 12:29     ` Ævar Arnfjörð Bjarmason [this message]
2022-06-27 16:11       ` ab/test-without-templates Junio C Hamano
2022-06-27 18:23         ` ab/test-without-templates Ævar Arnfjörð Bjarmason
2022-06-23 10:59 ` hx/unpack-streaming (was: What's cooking in git.git (Jun 2022, #07; Wed, 22)) Ævar Arnfjörð Bjarmason
2022-06-23 22:08   ` hx/unpack-streaming Junio C Hamano
2022-06-24  3:12 ` gc/submodule-update (was Re: What's cooking in git.git (Jun 2022, #07; Wed, 22)) Glen Choo
2022-06-24 15:35   ` 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=220627.864k06i8im.gmgdl@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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 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).