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

Re: 2.46 submodule breakage

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 7, 2024, 16:09 UTC
Message-ID
<xmqq7ccspb54.fsf@gitster.g>
In-Reply-To
<ZrMkje9VugtKz-gB@tanuki>
Patrick Steinhardt <ps@pks.im> writes:
Show 5 quoted lines
> For the record, the fix is as simple as the below diff. We indeed end up
> initializing submodule ref stores with the parent ref storage format,
> not with the one of the subrepo. I'll spend some more time though to
> check whether other commands are impacted, as well, and write some more
> tests.

I think allowing separate ref format in submodules is a very sensible thing to do. The containing superproject should not even have to know what ref backend is in use in the submodule, unlike the object format used there, which it has to know in order to store the name of commit objects in its tree entries as gitlinks.

And the preimage of this particular change does look wrong to blindly reuse the format used in the superproject.

Thanks.
Show 13 quoted lines
> diff --git a/refs.c b/refs.c
> index 915aeb4d1d..e4b1f4f8b1 100644
> --- a/refs.c
> +++ b/refs.c
> @@ -2011,7 +2011,7 @@ struct ref_store *repo_get_submodule_ref_store(struct repository *repo,
>         free(subrepo);
>         goto done;
>     }
> -	refs = ref_store_init(subrepo, the_repository->ref_storage_format,
> +	refs = ref_store_init(subrepo, subrepo->ref_storage_format,
>                   submodule_sb.buf,
>                   REF_STORE_READ | REF_STORE_ODB);
>     register_ref_store_map(&repo->submodule_ref_stores, "submodule",
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 6 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.