git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [BUG REPORT] git 2.9.0 clone --recursive fails on cloning a submodule

From
VEVadim Eisenberg <vadime@il.ibm.com>
Date
Jun 19, 2016, 13:07 UTC
Message-ID
<OFC46A8782.5F47CDBA-ONC2257FD7.00475209-C2257FD7.00483117@notes.na.collabserv.com>
In-Reply-To
<20160619100051.GA14584@sigill.intra.peff.net>

The problem is with other tools that use git, like Swift Package Manager - https://swift.org/package-manager/. Versions of git before 2.9.0 have no option --no-shallow-submodules. So the tools that use git would have to check if the version of git is greater than or equal 2.9.0 to know to specify that option.

Best Regards, Vadim

Jeff King <peff@peff.net> wrote on 06/19/2016 01:00:51 PM:
Show 19 quoted lines
> From: Jeff King <peff@peff.net>
> To: Vadim Eisenberg/Haifa/IBM@IBMIL
> Cc: Stefan Beller <sbeller@google.com>, git@vger.kernel.org
> Date: 06/19/2016 01:01 PM
> Subject: Re: [BUG REPORT] git 2.9.0 clone --recursive fails on 
> cloning a submodule
> 
> On Sun, Jun 19, 2016 at 10:17:36AM +0300, Vadim Eisenberg wrote:
> 
> > /usr/local/bin/git clone --recursive --depth 10 
> > https://github.com/IBM-Swift/Kitura-net.git
> > Cloning into 'Kitura-net'...
> > remote: Counting objects: 253, done.
> > remote: Compressing objects: 100% (142/142), done.
> > remote: Total 253 (delta 134), reused 188 (delta 86), pack-reused 0
> > Receiving objects: 100% (253/253), 63.28 KiB | 0 bytes/s, done.
> > Resolving deltas: 100% (134/134), done.
> > Checking connectivity... done.
> > Submodule 'Kitura-Build' (
https://github.com/IBM-Swift/Kitura-Build.git) 
Show 5 quoted lines
> > registered for path 'Kitura-Build'
> > Cloning into '/home/vadime/Kitura-net/Kitura-Build'...
> > error: no such remote ref d0d9d6c739a79627641e6438fe4f39bd0eba83bb
> > Fetched in submodule path 'Kitura-Build', but it did not contain 
> > d0d9d6c739a79627641e6438fe4f39bd0eba83bb. Direct fetching of that 
commit 
Show 20 quoted lines
> > failed.
> 
> The problem seems to be the shallow clone. The super-project points to a
> commit in the submodule that is not near the tip of any branch, so
> shallow-cloning the submodule means we don't get that commit. Prior to
> d22eb04 (clone: add `--shallow-submodules` flag, 2016-04-25), submodules
> were _always_ cloned fully.
> 
> The immediate workaround is to add "--no-shallow-submodules" to your
> clone invocation.
> 
> Stefan, I think it might be worth revisiting the default set by d22eb04
> to propagate shallowness from the super-project clone. In an ideal
> world, we would be asking each submodule for the actual commit we are
> interested in, and shallowness would not matter. But until
> uploadpack.allowReachableSHA1InWant works everywhere, I suspect this is
> going to be a problem.
> 
> -Peff
> 
Previous: Jeff KingNext: Jeff King
Message 3 of 17 in “[BUG REPORT] git 2.9.0 clone --recursive fails on cloning a submodule”
  1. Vadim EisenbergJun 19, 2016
  2. Jeff KingJun 19, 2016
  3. Vadim EisenbergJun 19, 2016
  4. Jeff KingJun 19, 2016
  5. Junio C HamanoJun 19, 2016
  6. Jeff KingJun 20, 2016
  7. Stefan BellerJun 20, 2016
  8. Vadim EisenbergJun 20, 2016
  9. Dennis KaarsemakerJun 20, 2016
  10. Jeff KingJun 20, 2016
  11. shallow clone to not imply shallow submodulesStefan Beller, Jun 20, 2016
  12. Jeff KingJun 20, 2016
  13. Stefan BellerJun 20, 2016
  14. Jeff KingJun 20, 2016
  15. Ævar Arnfjörð BjarmasonApr 19, 2017
  16. Stefan BellerApr 19, 2017
  17. Duy NguyenJun 21, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.