git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Vadim Eisenberg <VADIME@il.ibm.com>
Cc: Stefan Beller <sbeller@google.com>, git@vger.kernel.org
Subject: Re: [BUG REPORT] git 2.9.0 clone --recursive fails on cloning a submodule
Date: Sun, 19 Jun 2016 06:00:51 -0400	[thread overview]
Message-ID: <20160619100051.GA14584@sigill.intra.peff.net> (raw)
In-Reply-To: <OFE09D48F2.D1D14F49-ONC2257FD7.00280736-C2257FD7.0028245A@notes.na.collabserv.com>

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) 
> 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 
> 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

  reply	other threads:[~2016-06-19 10:00 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <OFC76C15DC.FC882C57-ONC2257FD7.00261552-C2257FD7.002660FC@LocalDomain>
2016-06-19  7:17 ` [BUG REPORT] git 2.9.0 clone --recursive fails on cloning a submodule Vadim Eisenberg
2016-06-19 10:00   ` Jeff King [this message]
2016-06-19 13:07     ` Vadim Eisenberg
2016-06-19 14:46       ` Jeff King
2016-06-19 20:51     ` Junio C Hamano
2016-06-20  0:13       ` Jeff King
2016-06-20  1:09         ` Stefan Beller
2016-06-20  3:01           ` Vadim Eisenberg
2016-06-20  5:31           ` Dennis Kaarsemaker
2016-06-20 10:02           ` Jeff King
2016-06-20 16:59       ` [PATCH] shallow clone to not imply shallow submodules Stefan Beller
2016-06-20 17:13         ` Jeff King
2016-06-20 17:14           ` Stefan Beller
2016-06-20 17:18             ` Jeff King
2017-04-19 11:30       ` [BUG REPORT] git 2.9.0 clone --recursive fails on cloning a submodule Ævar Arnfjörð Bjarmason
2017-04-19 18:54         ` Stefan Beller
2016-06-21 16:48     ` Duy Nguyen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160619100051.GA14584@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=VADIME@il.ibm.com \
    --cc=git@vger.kernel.org \
    --cc=sbeller@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).