# git --recurse-submodule does not recurse to sub-submodules (etc.)

3 messages from 2015-01-19 to 2015-01-23. Participants: Maximilian Held, Jens Lehmann.
Thread: https://gitlist.dev/t/38406

## Maximilian Held, 2015-01-19 20:19

Subject: git --recurse-submodule does not recurse to sub-submodules (etc.)
Message-ID: <CACgLhq_kMv2cj4RHr8Yx5tnYup5enCJVMrZf9Yt9Y5-bkfozLg@mail.gmail.com>
URL: https://gitlist.dev/e/CACgLhq_kMv2cj4RHr8Yx5tnYup5enCJVMrZf9Yt9Y5-bkfozLg%40mail.gmail.com

```
I have a directory with nested submodules, such as:

supermodule/submodule/sub-submodule/sub-sub-submodule

When I cd to supermodule and do:

"git push --recurse-submodule=check" (or on-demand),

git only pushes the submodule, but not the sub-submodule etc.

Maybe this is expected behavior and not a bug, but I thought it was
pretty unintuitive. I expected that git would push, well, recursively.

Best
Max

http://www.maxheld.de

```

## Jens Lehmann, 2015-01-20 21:21

Subject: Re: git --recurse-submodule does not recurse to sub-submodules (etc.)
Message-ID: <54BEC6C7.8070103@web.de>
URL: https://gitlist.dev/e/54BEC6C7.8070103%40web.de
In-Reply-To: <CACgLhq_kMv2cj4RHr8Yx5tnYup5enCJVMrZf9Yt9Y5-bkfozLg@mail.gmail.com>

```
Am 19.01.2015 um 21:19 schrieb Maximilian Held:
> I have a directory with nested submodules, such as:
>
> supermodule/submodule/sub-submodule/sub-sub-submodule
>
> When I cd to supermodule and do:
>
> "git push --recurse-submodule=check" (or on-demand),
>
> git only pushes the submodule, but not the sub-submodule etc.
>
> Maybe this is expected behavior and not a bug, but I thought it was
> pretty unintuitive. I expected that git would push, well, recursively.

I agree this is unexpected and should be fixed. I suspect the fix
would be to teach the push_submodule() function to use the same
flags that were used for the push in the superproject.

```

## Maximilian Held, 2015-01-23 22:02

Subject: Re: git --recurse-submodule does not recurse to sub-submodules (etc.)
Message-ID: <CACgLhq_V-uj1pNjKyEA8RaOtxjfNca+R0LRPp-6KgDw6NCCGpg@mail.gmail.com>
URL: https://gitlist.dev/e/CACgLhq_V-uj1pNjKyEA8RaOtxjfNca%2BR0LRPp-6KgDw6NCCGpg%40mail.gmail.com
In-Reply-To: <54BEC6C7.8070103@web.de>

```
Thanks, Jens.

Incidentally,

git submodule update --init --recursive

Does exactly what expected – it updates sub/sub/submodules, so there
is certainly some inconsistency in how the --recursive flag is handled
here.
info@maxheld.de | http://www.maxheld.de | http://www.civicon.de |
Mobil: +49 151 22958775 | Skype: maximilian.held
Bremen International Graduate School of Social Sciences | Wiener
Straße / Celsiusstraße | 28359 Bremen | Germany


On Tue, Jan 20, 2015 at 10:21 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:
> Am 19.01.2015 um 21:19 schrieb Maximilian Held:
>
>> I have a directory with nested submodules, such as:
>>
>> supermodule/submodule/sub-submodule/sub-sub-submodule
>>
>> When I cd to supermodule and do:
>>
>> "git push --recurse-submodule=check" (or on-demand),
>>
>> git only pushes the submodule, but not the sub-submodule etc.
>>
>> Maybe this is expected behavior and not a bug, but I thought it was
>> pretty unintuitive. I expected that git would push, well, recursively.
>
>
> I agree this is unexpected and should be fixed. I suspect the fix
> would be to teach the push_submodule() function to use the same
> flags that were used for the push in the superproject.

```
