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

Re: [PATCH v3 2/3] Add the 'fetch.recurseSubmodules' config setting

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Nov 12, 2010, 15:52 UTC
Message-ID
<20101112155210.GA15141@burratino>
In-Reply-To
<4CDD2AF9.6040403@web.de>
Jens Lehmann wrote:
> Am 11.11.2010 20:00, schrieb Jonathan Nieder:
Show 21 quoted lines
>> Yes, that makes some sense to me.  Except wouldn't it be a single
>> configuration item?  "These submodules should be checked out in all
>> but unusual situations, so check them out automatically and keep them
>> updated."
>
> Hmm, but we have at least three modes of how to update them:
>
> 1) Never fetch the submodule (to get new commits the user has to run
>    "git fetch --recurse-submodules" by hand)
>
> 2) Fetch the submodule each time you fetch the superproject (Which is
>    really handy when you do development in the submodule too but can
>    be really inconvenient when you don't)
>
> 3) Update submodules only when new recorded commits are fetched in
>    the superproject (This mode is not added with the current patch
>    series but will be in one of the next)
>
> So you would need a config option for that anyway, no? And that is why
> I'd rather like to have a separate fetch option to control that behavior
> instead of an implicit "if-it's-to-be-checked-out-fetch-it-too" approach.
I still think I am missing something.

Traditionally, git has been a _content_ tracker. The configuration that gets transmitted (.gitignore, .gitattributes, .gitmodules) would only represent basic information needed for that content to remain usable and sensible.

In the case of .gitmodules, it seems that two concepts are being conflated:

 A. Configuration based on the user's preferences.  Absolutely, a person
    deserves to be able to easily choose between (1), (2), and (3) as
    described above.
 B. Metadata about the content that should be shared.  For example, "this
    submodule would be checked out in all but unusual circumstances" is a
    useful thing to be able to declare.

Probably I am missing something big, but fetchsubmodules as currently defined seem like something in category A and not in category B. Partially because if we ever implement option (3), that is what almost _every_ casual consumer will want. So why should they be stuck with these configuration files specifying (1) and (2) when they check out old revisions?

All that said, I do not think it is unreasonable in some situations for a project to want to share configuration of type (A) between members of a project; for example, lots of projects share hooks and that's great. I just don't think git should set it up automatically --- better to require an explicit user action like "sh useprojectconfiguration.sh" (an action more explicit than "please initialize and checkout all relevant submodules") for such cases.

Hoping that is clearer, Jonathan

Previous: Jens LehmannNext: Jens Lehmann
Message 10 of 24 in “Teach fetch and pull to recursively fetch submodules”
  1. 0/3 Teach fetch and pull to recursively fetch submodulesJens Lehmann, Nov 10, 2010
  2. 1/3 fetch/pull: Add the --recurse-submodules optionJens Lehmann, Nov 10, 2010
  3. 2/3 Add the 'fetch.recurseSubmodules' config settingJens Lehmann, Nov 10, 2010
  4. Jonathan NiederNov 11, 2010
  5. Jens LehmannNov 11, 2010
  6. Jonathan NiederNov 11, 2010
  7. Junio C HamanoNov 11, 2010
  8. Jonathan NiederNov 11, 2010
  9. Jens LehmannNov 12, 2010
  10. Jonathan NiederNov 12, 2010
  11. Jens LehmannNov 12, 2010
  12. Jonathan NiederNov 12, 2010
  13. Jens LehmannNov 12, 2010
  14. Jens LehmannNov 12, 2010
  15. 3/3 Submodules: Add the "fetchRecurseSubmodules" config optionJens Lehmann, Nov 10, 2010
  16. Jonathan NiederNov 11, 2010
  17. Jens LehmannNov 11, 2010
  18. 1/3 fetch/pull: Add the --recurse-submodules optionJens Lehmann, Nov 12, 2010
  19. Jonathan NiederNov 12, 2010
  20. Jens LehmannNov 12, 2010
  21. Junio C HamanoDec 9, 2010
  22. Jens LehmannDec 9, 2010
  23. Junio C HamanoDec 10, 2010
  24. Jens LehmannDec 10, 2010

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.