git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Timur Delahaye <timur.delahaye@corpowerocean.com>
To: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: git submodule init initialises submodules for which active=false has been defined
Date: Wed, 18 Mar 2020 12:50:36 +0000	[thread overview]
Message-ID: <HE1PR04MB2987A255BC327320D1DDFE6692F70@HE1PR04MB2987.eurprd04.prod.outlook.com> (raw)

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


             reply	other threads:[~2020-03-18 12:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-18 12:50 Timur Delahaye [this message]
2020-10-06  0:25 ` git submodule init initialises submodules for which active=false has been defined Philippe Blain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=HE1PR04MB2987A255BC327320D1DDFE6692F70@HE1PR04MB2987.eurprd04.prod.outlook.com \
    --to=timur.delahaye@corpowerocean.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).