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

Re: [RFC PATCH 2/2] config: add 'config.superproject' file

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 9, 2021, 22:29 UTC
Message-ID
<xmqqk0pbm6qt.fsf@gitster.g>
In-Reply-To
<CAHd-oW4VoBbZHc7cLdn0LPM531qNDGOfwPZdKiKoG4BoRFaqdg@mail.gmail.com>
Matheus Tavares Bernardino <matheus.bernardino@usp.br> writes:
Show 33 quoted lines
> Hi, Emily
>
> I'm not familiar enough with this code to give a full review and I
> imagine you probably want comments more focused on the design level,
> while this is an RFC, but here are some small nitpicks I found while
> reading the patch. I Hope it helps :)
>
> On Thu, Apr 8, 2021 at 8:39 PM Emily Shaffer <emilyshaffer@google.com> wrote:
>>
>> diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt
>> index 4b4cc5c5e8..a33136fb08 100644
>> --- a/Documentation/git-config.txt
>> +++ b/Documentation/git-config.txt
>> @@ -48,7 +48,7 @@ unset an existing `--type` specifier with `--no-type`.
>>
>>  When reading, the values are read from the system, global and
>>  repository local configuration files by default, and options
>> -`--system`, `--global`, `--local`, `--worktree` and
>> +`--system`, `--global`, `--superproject`, `--local`, `--worktree` and
>>  `--file <filename>` can be used to tell the command to read from only
>>  that location (see <<FILES>>).
>>
>> @@ -127,6 +127,17 @@ rather than from all available files.
>>  +
>>  See also <<FILES>>.
>>
>> +--superproject::
>> +       For writing options: write to the superproject's
>> +       `.git/config.superproject` file, even if run from a submodule of that
>> +       superproject.
>
> Hmm, I wonder what happens if a repo is both a submodule and a
> superproject (i.e. in case of nested submodules).

Another thing I am not sure about the design is that a repository can be shared as a submodule by more than one superprojects. The superprojects may want their submodule checkouts at different submodule commits, but that is something doable by having multiple worktrees connected to a single submodule repository.

I think our design principle has been that it is perfectly OK for a superproject to be in total control if its submodules, but submodules should not even be aware of being used as a submodule by a superproject, and that allows a submodule repository to be shared by multiple superprojects. As "write to the superproject's X file" requires a submodule to know who THE superproject of itself is, this feature itself (not the implementation) feels somewhat iffy.

Previous: Matheus Tavares BernardinoNext: Emily Shaffer
Message 7 of 22 in “share a config between submodule and superproject”
  1. 0/2 share a config between submodule and superprojectEmily Shaffer, Apr 8, 2021
  2. 1/2 config: rename "submodule" scope to "gitmodules"Emily Shaffer, Apr 8, 2021
  3. 2/2 config: add 'config.superproject' fileEmily Shaffer, Apr 8, 2021
  4. Philip OakleyApr 9, 2021
  5. Emily ShafferApr 13, 2021
  6. Matheus Tavares BernardinoApr 9, 2021
  7. Junio C HamanoApr 9, 2021
  8. Emily ShafferApr 13, 2021
  9. Emily ShafferApr 13, 2021
  10. Future structure of submodules and .git/, .git/modules/* organizationÆvar Arnfjörð Bjarmason, Apr 14, 2021
  11. Emily ShafferApr 15, 2021
  12. Junio C HamanoApr 15, 2021
  13. 0/4 share a config between submodule and superprojectEmily Shaffer, Apr 23, 2021
  14. 1/4 config: rename "submodule" scope to "gitmodules"Emily Shaffer, Apr 23, 2021
  15. Phillip WoodApr 23, 2021
  16. 2/4 t1510-repo-setup: don't use exact matching on tracesEmily Shaffer, Apr 23, 2021
  17. Phillip WoodApr 23, 2021
  18. 3/4 t7006-pager.sh: more lenient trace checkingEmily Shaffer, Apr 23, 2021
  19. Phillip WoodApr 23, 2021
  20. Phillip WoodApr 23, 2021
  21. 4/4 config: add 'config.superproject' fileEmily Shaffer, Apr 23, 2021
  22. Johannes SchindelinApr 23, 2021

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.