# Git shallow clone branch doesn't work with recursive submodules cloning

6 messages from 2016-08-15 to 2016-08-15. Participants: Arkady Shapkin, Jeff King.
Thread: https://gitlist.dev/t/43851

## Arkady Shapkin, 2016-08-15 11:20

Subject: Git shallow clone branch doesn't work with recursive submodules cloning
Message-ID: <CAB-zwL28qUBO5PrRznH9KmLJZUHO65_J-DxvPP+NHZEuofKh9Q@mail.gmail.com>
URL: https://gitlist.dev/e/CAB-zwL28qUBO5PrRznH9KmLJZUHO65_J-DxvPP%2BNHZEuofKh9Q%40mail.gmail.com

```
Hi,

I am trying clone repository by tag with recursive submodules init,
but for one submodule it doesn't work.
What I'm doing wrong?

>git clone https://github.com/grpc/grpc.git --recursive --depth 1 dsad5

Cloning into 'dsad5'...
remote: Counting objects: 7475, done.
remote: Compressing objects: 100% (4695/4695), done.
remote: Total 7475 (delta 2593), reused 5610 (delta 1265), pack-reused 0
Receiving objects: 100% (7475/7475), 4.85 MiB | 2.55 MiB/s, done.
Resolving deltas: 100% (2593/2593), done.
Checking connectivity... done.
Checking out files: 100% (6820/6820), done.
Submodule 'third_party/boringssl'
(https://github.com/google/boringssl.git) registered for path
'third_party/boringssl'
Submodule 'third_party/gflags' (https://github.com/gflags/gflags.git)
registered for path 'third_party/gflags'
Submodule 'third_party/googletest'
(https://github.com/google/googletest.git) registered for path
'third_party/googletest'
Submodule 'third_party/nanopb' (https://github.com/nanopb/nanopb.git)
registered for path 'third_party/nanopb'
Submodule 'third_party/protobuf'
(https://github.com/google/protobuf.git) registered for path
'third_party/protobuf'
Submodule 'third_party/zlib' (https://github.com/madler/zlib)
registered for path 'third_party/zlib'
Cloning into 'D:/Work/conan-packages/dsad5/third_party/boringssl'...
Cloning into 'D:/Work/conan-packages/dsad5/third_party/gflags'...
Cloning into 'D:/Work/conan-packages/dsad5/third_party/googletest'...
Cloning into 'D:/Work/conan-packages/dsad5/third_party/nanopb'...
Cloning into 'D:/Work/conan-packages/dsad5/third_party/protobuf'...
Cloning into 'D:/Work/conan-packages/dsad5/third_party/zlib'...
error: no such remote ref c880e42ba1c8032d4cdde2aba0541d8a9d9fa2e9
Fetched in submodule path 'third_party/boringssl', but it did not
contain c880e42ba1c8032d4cdde2aba0541d8a9d9fa2e9. Direct fetching of
that commit failed.

>git --version
git version 2.9.0.windows.1

-- 
WBR,
Arkady Shapkin

```

## Jeff King, 2016-08-15 12:04

Subject: Re: Git shallow clone branch doesn't work with recursive submodules cloning
Message-ID: <20160815120441.nwtdqfgcv3ljt4vl@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20160815120441.nwtdqfgcv3ljt4vl%40sigill.intra.peff.net
In-Reply-To: <CAB-zwL28qUBO5PrRznH9KmLJZUHO65_J-DxvPP+NHZEuofKh9Q@mail.gmail.com>

```
On Mon, Aug 15, 2016 at 02:20:27PM +0300, Arkady Shapkin wrote:

> I am trying clone repository by tag with recursive submodules init,
> but for one submodule it doesn't work.
> What I'm doing wrong?

Nothing. See 18a74a0 (clone: do not let --depth imply
--shallow-submodules, 2016-06-19).

> >git --version
> git version 2.9.0.windows.1

The fix is in v2.9.1.

-Peff

```

## Arkady Shapkin, 2016-08-15 12:29

Subject: Re: Git shallow clone branch doesn't work with recursive submodules cloning
Message-ID: <CAB-zwL2oFMBFjkkoh1EhSD7FCK_1wVV+whu8uxTKTHQKJgNzrQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAB-zwL2oFMBFjkkoh1EhSD7FCK_1wVV%2Bwhu8uxTKTHQKJgNzrQ%40mail.gmail.com
In-Reply-To: <20160815120441.nwtdqfgcv3ljt4vl@sigill.intra.peff.net>

```
Thank you, after updating to "2.9.3.windows.1" options "--recursive
--depth 1" now works.

But "--recursive --shallow-submodules" and "--recursive
--shallow-submodules --depth 1" still doesn't work.

2016-08-15 15:04 GMT+03:00 Jeff King <peff@peff.net>:
> On Mon, Aug 15, 2016 at 02:20:27PM +0300, Arkady Shapkin wrote:
>
>> I am trying clone repository by tag with recursive submodules init,
>> but for one submodule it doesn't work.
>> What I'm doing wrong?
>
> Nothing. See 18a74a0 (clone: do not let --depth imply
> --shallow-submodules, 2016-06-19).
>
>> >git --version
>> git version 2.9.0.windows.1
>
> The fix is in v2.9.1.
>
> -Peff



-- 
WBR,
Arkady Shapkin aka Dragon

```

## Jeff King, 2016-08-15 12:47

Subject: Re: Git shallow clone branch doesn't work with recursive submodules cloning
Message-ID: <20160815124725.t6bo5fv4lbbnqnfo@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20160815124725.t6bo5fv4lbbnqnfo%40sigill.intra.peff.net
In-Reply-To: <CAB-zwL2oFMBFjkkoh1EhSD7FCK_1wVV+whu8uxTKTHQKJgNzrQ@mail.gmail.com>

```
On Mon, Aug 15, 2016 at 03:29:14PM +0300, Arkady Shapkin wrote:

> Thank you, after updating to "2.9.3.windows.1" options "--recursive
> --depth 1" now works.
> 
> But "--recursive --shallow-submodules" and "--recursive
> --shallow-submodules --depth 1" still doesn't work.

It does "work", but the server hosting your submodule may not be
configured to allow you to access the reachable-but-non-tip sha1
directly. So it's not a bug, but rather a configuration issue (and the
"fix" in v2.9.1 is to be less aggressive about enabling
shallow-submodules, since the default server configuration does not
allow it to work well).

More discussion is in:

  http://public-inbox.org/git/OFE09D48F2.D1D14F49-ONC2257FD7.00280736-C2257FD7.0028245A@notes.na.collabserv.com/t/#u

-Peff

```

## Arkady Shapkin, 2016-08-15 12:53

Subject: Re: Git shallow clone branch doesn't work with recursive submodules cloning
Message-ID: <CAB-zwL2P08YC=3Ube8mkZ=mB4xpW6TUnG2gEZKtvRU03eE6ALA@mail.gmail.com>
URL: https://gitlist.dev/e/CAB-zwL2P08YC%3D3Ube8mkZ%3DmB4xpW6TUnG2gEZKtvRU03eE6ALA%40mail.gmail.com
In-Reply-To: <20160815124725.t6bo5fv4lbbnqnfo@sigill.intra.peff.net>

```
So it will work only if github update their server configuration
(boringssl submodule on github)?

2016-08-15 15:47 GMT+03:00 Jeff King <peff@peff.net>:
> On Mon, Aug 15, 2016 at 03:29:14PM +0300, Arkady Shapkin wrote:
>
>> Thank you, after updating to "2.9.3.windows.1" options "--recursive
>> --depth 1" now works.
>>
>> But "--recursive --shallow-submodules" and "--recursive
>> --shallow-submodules --depth 1" still doesn't work.
>
> It does "work", but the server hosting your submodule may not be
> configured to allow you to access the reachable-but-non-tip sha1
> directly. So it's not a bug, but rather a configuration issue (and the
> "fix" in v2.9.1 is to be less aggressive about enabling
> shallow-submodules, since the default server configuration does not
> allow it to work well).
>
> More discussion is in:
>
>   http://public-inbox.org/git/OFE09D48F2.D1D14F49-ONC2257FD7.00280736-C2257FD7.0028245A@notes.na.collabserv.com/t/#u
>
> -Peff



-- 
WBR,
Arkady Shapkin aka Dragon

```

## Jeff King, 2016-08-15 13:03

Subject: Re: Git shallow clone branch doesn't work with recursive submodules cloning
Message-ID: <20160815130347.3isxpdlnuy7nldmk@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20160815130347.3isxpdlnuy7nldmk%40sigill.intra.peff.net
In-Reply-To: <CAB-zwL2P08YC=3Ube8mkZ=mB4xpW6TUnG2gEZKtvRU03eE6ALA@mail.gmail.com>

```
On Mon, Aug 15, 2016 at 03:53:48PM +0300, Arkady Shapkin wrote:

> So it will work only if github update their server configuration
> (boringssl submodule on github)?

Correct.

-Peff

```
