git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git submodule init initialises submodules for which active=false has been defined
@ 2020-03-18 12:50 Timur Delahaye
  2020-10-06  0:25 ` Philippe Blain
  0 siblings, 1 reply; 2+ messages in thread
From: Timur Delahaye @ 2020-03-18 12:50 UTC (permalink / raw)
  To: git@vger.kernel.org

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-10-06  0:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-18 12:50 git submodule init initialises submodules for which active=false has been defined Timur Delahaye
2020-10-06  0:25 ` Philippe Blain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).