threads / discuss / 43851

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

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

## tl;dr

6 messages between Aug 15, 2016 and Aug 15, 2016.

replies: 5people: 2as markdown or json

Arkady Shapkin· Aug 15, 2016, 11:20 UTC · lore
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· Aug 15, 2016, 12:04 UTC · re: Arkady Shapkin · lore

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

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· Aug 15, 2016, 12:29 UTC · re: Jeff King · lore

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

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>:
Show 15 quoted lines
> 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· Aug 15, 2016, 12:47 UTC · re: Arkady Shapkin · lore

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

On Mon, Aug 15, 2016 at 03:29:14PM +0300, Arkady Shapkin wrote:
Show 5 quoted lines
> 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· Aug 15, 2016, 12:53 UTC · re: Jeff King · lore

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

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>:
Show 20 quoted lines
> 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· Aug 15, 2016, 13:03 UTC · re: Arkady Shapkin · lore

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

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

← back to recent threads