From: Maxime Viargues <maxime.viargues@serato.com>
To: git@vger.kernel.org
Subject: Bug? git submodule update --reference doesn't use the referenced repository
Date: Mon, 3 Apr 2017 15:13:07 +1200 [thread overview]
Message-ID: <35343b75-0aa7-3477-888b-3af5024ae7dd@serato.com> (raw)
Hi there,
I have been trying to use the --reference option to clone a big
repository using a local copy, but I can't manage to make it work using
sub-module update. I believe this is a bug, unless I missed something.
I am on Windows, Git 2.12.0
So the problem is as follow:
- I have got a repository with multiple sub-modules, say
main
lib1
sub-module1.git
lib2
sub-module2.git
- The original repositories are in GitHub, which makes it slow
- I have done a normal git clone of the entire repository (not bare) and
put it on a file server, say \\fileserver\ref_repo\
(Note that the problem also happens with local copy)
So if I do a clone to get the repo and all the submodules with...
git clone --reference-if-able \\fileserver\ref-repo --recursive
git@github.com:company/main
...then it all works, all the sub-modules get cloned and the it's fast.
Now in my case I am working with Jenkins jobs and I need to first do a
clone, and then get the sub-modules, but if I do...
git clone --reference-if-able \\fileserver\ref-repo
git@github.com:company/main (so non-recursive)
cd main
git submodule update --init --reference \\fileserver\ref-repo
... then this takes ages, as it would normally do without the use of
--reference. I suspect it's not actually using it.
The git clone documentation mentions that the reference is then passed
to the sub-module clone commands, so I would expect "git clone
--recursive" to work the same as "git submodule update", as far as
--reference is concerned.
I noticed for a single module, doing a...
git submodule update --init --reference
\\fileserver\ref-repo\lib1\sub-module1 -- lib1/sub-module1
...i.e. adding the sub-module path to the reference path, works. Which
kind of make sense but then how do you do to apply it to all the
sub-modules? (without writing a script to do that)
If someone can confirm the problem or explain me what I am dong wrong
that would be great.
Maxime
next reply other threads:[~2017-04-03 3:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-03 3:13 Maxime Viargues [this message]
2017-04-03 16:32 ` Bug? git submodule update --reference doesn't use the referenced repository Stefan Beller
2017-04-04 2:15 ` Maxime Viargues
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=35343b75-0aa7-3477-888b-3af5024ae7dd@serato.com \
--to=maxime.viargues@serato.com \
--cc=git@vger.kernel.org \
/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).