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

cloning submodules with children submodules

From
PMPaul Martinolich <martinol@nrlssc.navy.mil>
Date
Nov 23, 2007, 19:17 UTC
Message-ID
<BC1DE15A-9225-41D3-A2D7-21A14DF81048@nrlssc.navy.mil>

It appears that git clone or git submodule init does not handle submodules under submodules.

Given this project tree:

modules/mod_A modules/mod_B modules/mod_b

proj_one/mod_A proj_one/mod_B proj_one/mod_B/mod_b

proj_two/mod_A proj_two/mod_B proj_two/mod_b

The cloning of proj_two works correctly. However, for proj_one, mod_b is not under mod_B:

cloned proj_one
$ ls -a ./
.  ..  .git  .gitmodules  mod_A  mod_B	project.txt
$ ls -a ./mod_A
.  ..
$ ls -a ./mod_B
.  ..
$ more .gitmodules
[submodule "mod_A"]
	path = mod_A
	url = /home/martinol/test/modules/mod_A/.git
[submodule "mod_B"]
	path = mod_B
	url = /home/martinol/test/modules/mod_B/.git
Submodule 'mod_A' (/home/martinol/test/modules/mod_A/.git) registered  
for path 'mod_A'
Submodule 'mod_B' (/home/martinol/test/modules/mod_B/.git) registered  
for path 'mod_B'
Initialized empty Git repository in /home/martinol/test/user_a/ 
proj_one/mod_A/.git/
0 blocks
Submodule path 'mod_A': checked out  
'80298817a0789d039e1fb4a73c9635fce8e7cdd2'
Initialized empty Git repository in /home/martinol/test/user_a/ 
proj_one/mod_B/.git/
0 blocks
Submodule path 'mod_B': checked out  
'21b652610f5e9085f799c424d8a7ef685f5ec440'
submodule init/update proj_one
$ ls -a ./
.  ..  .git  .gitmodules  mod_A  mod_B	project.txt
$ ls -a ./mod_A
.  ..  .git  module.txt
$ ls -a ./mod_B
.  ..  .git  module.txt
$ more .gitmodules
[submodule "mod_A"]
	path = mod_A
	url = /home/martinol/test/modules/mod_A/.git
[submodule "mod_B"]
	path = mod_B
	url = /home/martinol/test/modules/mod_B/.git
public proj_one
$ cd ~/test/proj_one
$ ls -a ./
.  ..  .git  .gitmodules  mod_A  mod_B	project.txt
$ ls -a ./mod_B
.  ..  .git  .gitmodules  mod_b  module.txt
$ more .gitmodules
[submodule "mod_A"]
	path = mod_A
	url = /home/martinol/test/modules/mod_A/.git
[submodule "mod_B"]
	path = mod_B
	url = /home/martinol/test/modules/mod_B/.git
$ more mod_B/.gitmodules
[submodule "mod_b"]
	path = mod_b
	url = /home/martinol/test/modules/mod_b/.git

$ git --version git version 1.5.3.6

I've attached a script that demonstrates this behavior.
Thanks, Paul
Next: Sven Verdoolaege
Message 1 of 3 in “cloning submodules with children submodules”
  1. Paul MartinolichNov 23, 2007
  2. Sven VerdoolaegeNov 23, 2007
  3. Paul MartinolichNov 23, 2007

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.