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

git submodule init initialises submodules for which active=false has been defined

From
TDTimur Delahaye <timur.delahaye@corpowerocean.com>
Date
Mar 18, 2020, 12:50 UTC
Message-ID
<HE1PR04MB2987A255BC327320D1DDFE6692F70@HE1PR04MB2987.eurprd04.prod.outlook.com>
Hello,

I am trying to prevent git clone --recurse-submodules from installing some of the submodules of the repo that are not necessary to most users.

Here is what I did: In my main-project

git submodule add --name one url1 git submodule add --name two url2

Then I edited .gitmodules as follows
[submodule "one"]
 active = false
 url = url1
[submodule "two"]
 active = true
 url = url2
commited and pushed.

From a fresh folder when I run git clone --recurse-submodules main-repo-url both "one" and "two" get installed

Likewise if I do git clone main-repo-url git submodule init both "one" and "two" are installed and appear in .git/config as well as .git/modules/

From reading https://git-scm.com/docs/gitsubmodules/2.25.0 my understanding was that both procedures should have installed only "two" and that I should have needed to do git submodule init one in order to force the local installation of the inactive module "one".

Either I misunderstood the manual or there is a bug with git submodule init

I am using git version 2.17.1 on Ubuntu 18.04
If this is not a bug but an error on my side, I would really appreciate some explanation about the active=false flag so I can achieve my purpose.
Faithfully yours,
Timur
Next: Philippe Blain
Message 1 of 2 in “git submodule init initialises submodules for which active=false has been defined”
  1. Timur DelahayeMar 18, 2020
  2. Philippe BlainOct 6, 2020

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.