# why '--init' in git-submodule update

3 messages from 2012-11-05 to 2012-11-07. Participants: Francis Moreau, Heiko Voigt.
Thread: https://gitlist.dev/t/32021

## Francis Moreau, 2012-11-05 16:30

Subject: why '--init' in git-submodule update
Message-ID: <CAC9WiBgpHWFGW-z5fnQR_EWnfGJUw+G3b7C6tYMGuVu1S-kP9A@mail.gmail.com>
URL: https://gitlist.dev/e/CAC9WiBgpHWFGW-z5fnQR_EWnfGJUw%2BG3b7C6tYMGuVu1S-kP9A%40mail.gmail.com

```
Hello,

I'm wondering why the --init option from git-submodule-update is not
at least the defaut. Or even wilder, why this option exists at all and
git-submodule-update always behave like --init was always passed.

Thanks
--
Francis

```

## Heiko Voigt, 2012-11-05 21:30

Subject: Re: why '--init' in git-submodule update
Message-ID: <20121105213004.GA2797@book.hvoigt.net>
URL: https://gitlist.dev/e/20121105213004.GA2797%40book.hvoigt.net
In-Reply-To: <CAC9WiBgpHWFGW-z5fnQR_EWnfGJUw+G3b7C6tYMGuVu1S-kP9A@mail.gmail.com>

```
Hi,

On Mon, Nov 05, 2012 at 05:30:51PM +0100, Francis Moreau wrote:
> I'm wondering why the --init option from git-submodule-update is not
> at least the defaut. Or even wilder, why this option exists at all and
> git-submodule-update always behave like --init was always passed.

That was a design decision. People may not be interested in all
submodules but just a subset they are working with. E.g. think of a
large media directory as a submodule the developers might not be
interested in having it around all the time because only the designers
are heavily working with it.

So the rationale is that you should ask for a certain submodule to be
initialized to get it. If there is demand for it we could of course think
about offering a config option in .gitmodules to allow enabling it by
default for some submodules.

Cheers Heiko

```

## Francis Moreau, 2012-11-07 07:10

Subject: Re: why '--init' in git-submodule update
Message-ID: <CAC9WiBhvEX8VCprytK8HMTdFX+iQE7K=a4cKb8MphhpDowaw6A@mail.gmail.com>
URL: https://gitlist.dev/e/CAC9WiBhvEX8VCprytK8HMTdFX%2BiQE7K%3Da4cKb8MphhpDowaw6A%40mail.gmail.com
In-Reply-To: <20121105213004.GA2797@book.hvoigt.net>

```
Hi,

On Mon, Nov 5, 2012 at 10:30 PM, Heiko Voigt <hvoigt@hvoigt.net> wrote:
> Hi,
>
> On Mon, Nov 05, 2012 at 05:30:51PM +0100, Francis Moreau wrote:
>> I'm wondering why the --init option from git-submodule-update is not
>> at least the defaut. Or even wilder, why this option exists at all and
>> git-submodule-update always behave like --init was always passed.
>
> That was a design decision. People may not be interested in all
> submodules but just a subset they are working with. E.g. think of a
> large media directory as a submodule the developers might not be
> interested in having it around all the time because only the designers
> are heavily working with it.
>

Thanks for explaining.

Another possible solution was to check if one or several submodules
are already checkout. If so then update only them. If none of them is
checkout then assume --init is passed and init all of them. Same if a
path is passed and this path corresponds to a submodule not checkout
yet.

--
Francis

```
