git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: ab/test-without-templates

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jun 27, 2022, 18:23 UTC
Message-ID
<220627.86zghygdtd.gmgdl@evledraar.gmail.com>
In-Reply-To
<xmqqbkueqe5z.fsf@gitster.g>
On Mon, Jun 27 2022, Junio C Hamano wrote:
Show 12 quoted lines
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>> 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.
>
> It's like arguing "this series is a bugfix, so what it fixes are by
> definition bugs", isn't it?

No, I don't think the test code is buggy as it stands now, but relying on our default templates is making it easy to introduce new bugs in code that doesn't handle other templates than the default.

This series doesn't get us all the way to running without that template for all tests, but I have follow-up patches that do that, after these changes that's a mostly a small matter of flipping the default, these were most of the changes required in the test logic.

Show 8 quoted lines
>> I really don't disagree with you per-se about us defining some minimum
>> viable template,...
>
> Well then it becomes debatable if it is a "bug" not to handle
> missing .git/info that needs "fixing" by this series, and it also
> makes it debatable if 7f44842a (sparse-checkout: create leading
> directory, 2022-01-21) was also a "bugfix", or just tightening
> against environment the end-user broke, no?

I don't think it's a broken environment. If you e.g. move .git/objects to .git/objects.new you can't expect your repository to work, but we've never implied or documented that about e.g. .git/hooks, .git/info etc.

And indeed almost all parts of git create the required paths on demand and/or handle missing paths gracefully.

I don't see why we should take some stance that we're going to be unhelpfully pedantic about repositories we find on-disk, even if we had never had a "--template" option for "git init" to create such repositories. I think 7f44842a was the right thing to do.

Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 9 of 13 in “What's cooking in git.git (Jun 2022, #07; Wed, 22)”
  1. Junio C HamanoJun 22, 2022
  2. en/merge-tree (Was: Re: What's cooking in git.git (Jun 2022, #07; Wed, 22))Elijah Newren, Jun 22, 2022
  3. Junio C HamanoJun 22, 2022
  4. Johannes SchindelinJun 23, 2022
  5. ab/test-without-templates (was: What's cooking in git.git (Jun 2022, #07; Wed, 22))Ævar Arnfjörð Bjarmason, Jun 23, 2022
  6. Junio C HamanoJun 23, 2022
  7. Ævar Arnfjörð BjarmasonJun 27, 2022
  8. Junio C HamanoJun 27, 2022
  9. Ævar Arnfjörð BjarmasonJun 27, 2022
  10. hx/unpack-streaming (was: What's cooking in git.git (Jun 2022, #07; Wed, 22))Ævar Arnfjörð Bjarmason, Jun 23, 2022
  11. Junio C HamanoJun 23, 2022
  12. gc/submodule-update (was Re: What's cooking in git.git (Jun 2022, #07; Wed, 22))Glen Choo, Jun 24, 2022
  13. Junio C HamanoJun 24, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.