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

Re: [PATCH 1/6] builtin/submodule: allow cloning with different ref storage format

From
Patrick Steinhardt <ps@pks.im>
Date
Aug 8, 2024, 16:19 UTC
Message-ID
<E664DE72-49F5-4AFC-ACDB-0BB60A6C34C2@pks.im>
In-Reply-To
<xmqqsevfj8v2.fsf@gitster.g>
On August 8, 2024 6:08:01 PM GMT+02:00, Junio C Hamano <gitster@pobox.com> wrote:
Show 28 quoted lines
>Patrick Steinhardt <ps@pks.im> writes:
>
>>> Presumably, if the named submodule has already been initialized, we
>>> are not converting its ref backend with --ref-format=<format> option
>>> when "git submodule update --ref-format=<format>" is run.  Would it
>>> make sense to say it is an error to give it without "--init", I
>>> wonder.  If so, we probably would need to see if other existing
>>> options like "--filter" also need a similar sanity check, if not
>>> already done.
>>
>> Well, even when "--init" was given it is not sure whether the ref
>> storage format will actually end up being used, because that option only
>> tells us to initialize uninitialized submodules. So if the submodule was
>> initialized already, then the ref storage format won't be used.
>>
>> We probably could add such a sanity check. But as you say, other options
>> like "--filter", "--depth", "--reference" and "--recommend-shallow"
>> don't have that check, either, so it would feel a bit like opening a can
>> of worms. So personally, I'd rather defer this to another day where we
>> then implement the check for all of these options.
>
>I am perfectly fine if we stopped by clearly documenting that these
>options can be no-op when the submodule repository already exists.
>Failing the operation in the name of "sanity check" at this point,
>especially for existing options, does not sound like a sensible
>change.
>
>Thanks.

The documentation already points this out, as we explicitly say that it only has an impact on newly cloned submodules:

> If `--ref-format <format>`  is specified, the ref storage format of newly
cloned submodules will be set accordingly.

I'm happy to make this more explicit though, in case you don't think this is sufficient.

Patrick 
Previous: Junio C HamanoNext: Junio C Hamano
Message 13 of 35 in “2.46 submodule breakage”
  1. Jeppe ØlandAug 5, 2024
  2. Jeppe ØlandAug 6, 2024
  3. Eric SunshineAug 6, 2024
  4. Patrick SteinhardtAug 7, 2024
  5. Patrick SteinhardtAug 7, 2024
  6. Junio C HamanoAug 7, 2024
  7. 0/6 Improvements for ref storage formats with submodulesPatrick Steinhardt, Aug 7, 2024
  8. 1/6 builtin/submodule: allow cloning with different ref storage formatPatrick Steinhardt, Aug 7, 2024
  9. Jeppe ØlandAug 7, 2024
  10. Junio C HamanoAug 7, 2024
  11. Patrick SteinhardtAug 8, 2024
  12. Junio C HamanoAug 8, 2024
  13. Patrick SteinhardtAug 8, 2024
  14. Junio C HamanoAug 8, 2024
  15. 2/6 builtin/clone: propagate ref storage format to submodulesPatrick Steinhardt, Aug 7, 2024
  16. Junio C HamanoAug 7, 2024
  17. 3/6 refs: fix ref storage format for submodule ref storesPatrick Steinhardt, Aug 7, 2024
  18. 4/6 submodule: fix leaking fetch tasksPatrick Steinhardt, Aug 7, 2024
  19. 5/6 submodule: fix leaking seen submodule namesPatrick Steinhardt, Aug 7, 2024
  20. 6/6 object: fix leaking packfiles when closing object storePatrick Steinhardt, Aug 7, 2024
  21. Patrick SteinhardtAug 7, 2024
  22. Junio C HamanoAug 8, 2024
  23. Patrick SteinhardtAug 8, 2024
  24. 0/8 Improvements for ref storage formats with submodulesPatrick Steinhardt, Aug 8, 2024
  25. 1/8 git-submodule.sh: break overly long command linesPatrick Steinhardt, Aug 8, 2024
  26. 2/8 builtin/submodule: allow cloning with different ref storage formatPatrick Steinhardt, Aug 8, 2024
  27. 3/8 builtin/clone: propagate ref storage format to submodulesPatrick Steinhardt, Aug 8, 2024
  28. Kristoffer HaugsbakkAug 8, 2024
  29. Patrick SteinhardtAug 8, 2024
  30. 4/8 refs: fix ref storage format for submodule ref storesPatrick Steinhardt, Aug 8, 2024
  31. 5/8 builtin/submodule: allow "add" to use different ref storage formatPatrick Steinhardt, Aug 8, 2024
  32. 6/8 submodule: fix leaking fetch tasksPatrick Steinhardt, Aug 8, 2024
  33. 7/8 submodule: fix leaking seen submodule namesPatrick Steinhardt, Aug 8, 2024
  34. 8/8 object: fix leaking packfiles when closing object storePatrick Steinhardt, Aug 8, 2024
  35. Junio C HamanoAug 8, 2024

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.