git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fredrik Gustafsson <iveqy@iveqy.com>
To: Istvan Zakar <istvan.zakar@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Problem with --shallow-submodules option
Date: Wed, 22 Jun 2016 17:31:45 +0200	[thread overview]
Message-ID: <20160622153145.GB16644@paksenarrion.iveqy.com> (raw)
In-Reply-To: <loom.20160620T145755-931@post.gmane.org>

On Mon, Jun 20, 2016 at 01:06:39PM +0000, Istvan Zakar wrote:
> I'm working on a relatively big project with many submodules. During 
> cloning for testing I tried to decrease the amount of data need to be 
> fetched from the server by using --shallow-submodules option in the clone 
> command. It seems to check out the tip of the remote repo, and if it's not 
> the commit registered in the superproject the submodule update fails 
> (obviously). Can I somehow tell to fetch that exact commit I need for my 
> superproject?

Maybe. http://stackoverflow.com/questions/2144406/git-shallow-submodules
gives a good overview of this problem.

git fetches a branch and is shallow from that branch, which might be an
other sha1 than the one the submodule points to, (as you say). This
is/was one of the drawbacks with this method. However the since git 2.8,
git will try to fetch the sha1 direct (and not the branch). So then it
will work, if(!), the server supports direct access to sha1. This was
previously not allowed due to security concerns (if I recall correctly).

So the answer is, yes this will work if you've a recent version of git
and support on the server side for doing this. Unfortunately I'm not
sure which git version is needed on the server side for this to work.

-- 
Fredrik Gustafsson

phone: +46 733-608274
e-mail: iveqy@iveqy.com
website: http://www.iveqy.com

  parent reply	other threads:[~2016-06-22 15:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20 13:06 Problem with --shallow-submodules option Istvan Zakar
2016-06-20 17:45 ` Stefan Beller
2016-06-21  6:32   ` Istvan Zakar
2016-06-21 20:35     ` Stefan Beller
2016-06-22 15:31 ` Fredrik Gustafsson [this message]
2016-06-30 13:27   ` Istvan Zakar
2016-06-30 20:57     ` Stefan Beller
2016-06-30 21:04       ` Istvan Zakar

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

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

  git send-email \
    --in-reply-to=20160622153145.GB16644@paksenarrion.iveqy.com \
    --to=iveqy@iveqy.com \
    --cc=git@vger.kernel.org \
    --cc=istvan.zakar@gmail.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.
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 NNTP newsgroup(s).