From: Jens Lehmann <Jens.Lehmann@web.de>
To: Samuel Maftoul <samuel.maftoul@gmail.com>
Cc: git <git@vger.kernel.org>
Subject: Re: git clone submodules recursive and reference
Date: Mon, 23 Apr 2012 23:20:06 +0200 [thread overview]
Message-ID: <4F95C786.40901@web.de> (raw)
In-Reply-To: <CAFj+z05G_LLLc=OqZiqKCJPpTZ21Y4W6HTJ6ZitraVZXEQ50-A@mail.gmail.com>
Am 23.04.2012 10:06, schrieb Samuel Maftoul:
>>> I'm sharing objects between repositories by creating a bare
>>> repository, adding the remotes for the repositories and fetch them in
>>> this bare repo.
>>
>> This sounds like a cool way to reduce the disk footprint of the
>> repos on our Jenkins server.
>
> I'm not using --reference for reducing disk footprint, but rather for
> caching git repos and reducing the impact of slow networks !
> Why would it reduce the disk footprint ?
Because the object store of the referenced repo is reused, the cloned
.git directory takes up less space (I think that is why the man page
talks about "reducing network and local storage costs").
>>> So for me, it makes sense to pass the "--reference" to the submodules
>>> clone, if submodules remotes are added to this reference bare repo and
>>> objects are already fetched (and I'm in this case, as I use a lot of
>>> different projects that shares the same set of submodules).
>>
>> How do you fetch then, do you fetch into the referenced repo first
>> and then do a fetch in the clones afterwards to just update the refs
>> there? Or is the bare repo just a starting point for the initial
>> clone?
>
> You need to fetch first in the bare repo, than in your clones. When
> you use --reference, the reference leaves untouched, it's your job to
> update the reference (would be nice to have options that allows to
> update the reference at the same time that the clone updates, so no
> need to connect twice to the remote repository).
I think you could also just fetch in the cloned repos, but then you'll
have to download the objects over the network for each clone and also
won't share the new objects. So I think your approach makes lots of
sense, now I'll just have to tune our Jenkins scripts a bit. ;-)
next prev parent reply other threads:[~2012-04-24 3:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-20 15:12 git clone submodules recursive and reference Samuel Maftoul
2012-04-20 18:59 ` Jens Lehmann
2012-04-20 19:26 ` Samuel Maftoul
2012-04-21 13:45 ` Jens Lehmann
2012-04-23 8:06 ` Samuel Maftoul
2012-04-23 21:20 ` Jens Lehmann [this message]
2012-06-29 20:19 ` Phil Hord
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=4F95C786.40901@web.de \
--to=jens.lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=samuel.maftoul@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).