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

Re: [PATCH 3/3] submodule--helper: add intern-git-dir function

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 22, 2016, 17:53 UTC
Message-ID
<xmqqfumjqu4c.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAGZ79kb7062abd6Cbf-ey3u0L6PXUcRf7m-og5EyCRZencOR6g@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 25 quoted lines
> On Mon, Nov 21, 2016 at 11:07 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Stefan Beller <sbeller@google.com> writes:
>>
>>> So I guess we should test a bit more extensively, maybe
>>>
>>>     git status >expect
>>>     git submodule embedgitdirs
>>>     git status >actual
>>>     test_cmp expect actual
>>>     # further testing via
>>>     test -f ..
>>>     test -d ..
>>
>> Something along that line.  "status should succeed" does not tell
>> the readers what kind of breakage the test is expecting to protect
>> us from.  If we are expecting a breakage in embed-git-dirs would
>> somehow corrupt an existing submodule, which would lead to "status"
>> that is run in the superproject report the submodule differently,
>> then comparing output before and after the operation may be a
>> reasonable test.  Going there to the submodule working tree and
>> checking the health of the repository (of the submodule) may be
>> another sensible test.
>
> and by checking the health you mean just a status in there, or rather a
> more nuanced thing like `git rev-parse HEAD` ? I'll go with that for now.

Would fsck have caught the breakages you caused while developing it, for example?

As the core of the "embed" operation is an non-atomic "move the .git directory to .git/modules/$name in the superproject and then make a gitfile pointing at it", verifying that there is no change in the contents of .git/modules before and after the failed operation, and verifying that the submodule working tree has the embedded .git/ directory would be good enough, I would think.

Previous: Stefan BellerNext: Brandon Williams
Message 14 of 17 in “Introduce `submodule interngitdirs`”
  1. 0/3 Introduce `submodule interngitdirs`Stefan Beller, Nov 21, 2016
  2. 1/3 submodule: use absolute path for computing relative path connectingStefan Beller, Nov 21, 2016
  3. Junio C HamanoNov 21, 2016
  4. Stefan BellerNov 21, 2016
  5. Stefan BellerNov 22, 2016
  6. Junio C HamanoNov 22, 2016
  7. 2/3 test-lib-functions.sh: teach test_commit -C <dir>Stefan Beller, Nov 21, 2016
  8. Junio C HamanoNov 21, 2016
  9. 3/3 submodule--helper: add intern-git-dir functionStefan Beller, Nov 21, 2016
  10. Junio C HamanoNov 21, 2016
  11. Stefan BellerNov 22, 2016
  12. Junio C HamanoNov 22, 2016
  13. Stefan BellerNov 22, 2016
  14. Junio C HamanoNov 22, 2016
  15. Brandon WilliamsNov 21, 2016
  16. Junio C HamanoNov 21, 2016
  17. Stefan BellerNov 21, 2016

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.