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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux