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

Suggestion: git clone should warn if repository has submodules

From
JSJason Sewall <jasonsewall@gmail.com>
Date
Aug 6, 2019, 14:03 UTC
Message-ID
<CADqa0D5wVWk2wa-raeVmCEhCqYznpba4TeUW_7UQOA0huR-RAg@mail.gmail.com>

Submodules are great, and I used them at work. The problem is, people wind up cloning my repos without --recursive and then nothing works for them, because the submodules weren't populated and those ultimately are needed to build my code.

I can see why --recursive isn't the default for git clone; you don't want to just blindly follow whatever urls are in .gitmodules without the user being aware of the possibility. That said, folks that are not familiar with submodules (which seems to be most of the people I work with!) wind up confused by this and don't know how to fix it.

While the burden is on the user and should remain so, it seems like having git print out a message after cloning to the effect of "there are submodules that are not populated, maybe you should look at them" would go a long way to eliminating confusion for newer users. Yes, I have put some documentation in my project that users should fetch the submodules, but if possible, I'd like lower the number of times I have to suggest that people RTFM.

Alternatively, is it preferable that I have my build system look at the submodules and inform the user more helpfully? I'm curious to know what, if any, is the recommended procedure.

Cheers, Jason

Next: Mateusz Loskot
Message 1 of 3 in “Suggestion: git clone should warn if repository has submodules”
  1. Jason SewallAug 6, 2019
  2. Mateusz LoskotAug 6, 2019
  3. Michal SuchánekAug 6, 2019

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.