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, 12:29 UTC
Message-ID
<220627.864k06i8im.gmgdl@evledraar.gmail.com>
In-Reply-To
<xmqqr13fxc5l.fsf@gitster.g>
On Thu, Jun 23 2022, Junio C Hamano wrote:
Show 27 quoted lines
> Æ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/
Previous: Junio C HamanoNext: Junio C Hamano
Message 7 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.