From: Jeff King <peff@peff.net>
To: Phillip Susi <psusi@cfl.rr.com>
Cc: Simon Brenner <olsner@gmail.com>, git@vger.kernel.org
Subject: Re: [RFC] deprecating and eventually removing "git relink"?
Date: Mon, 21 Nov 2011 17:19:34 -0500 [thread overview]
Message-ID: <20111121221934.GA21882@sigill.intra.peff.net> (raw)
In-Reply-To: <4ECACC13.7050507@cfl.rr.com>
On Mon, Nov 21, 2011 at 05:09:23PM -0500, Phillip Susi wrote:
> I hacked together a setup a few weeks ago that doesn't suffer from
> that problem. I had two repos that had considerable shared history (
> one forked from the other ), so I created a temporary repository and
> pointed its alternates to the other two. I then did some shell magic
> to generate a list of all objects shared by both repos, and sent that
> list to git-pack-objects. This gave me a pack file in the temp repo
> that contained all of the shared objects. I then made a .keep file
> and hard linked this pack file ( and index, and .keep file ) into
> both original repos, deleted the temp repo, and then repacked both
> original repos. This left them both with two pack files: one that is
> shared, and one that is all of the objects specific to that repo.
>
> Because the shared objects are in a pack file that both repos hard
> link to, neither one will break if I (re)move the other.
Yes, that is one way to do it. The big drawback there is that by using
hard links, you can only share objects between repos within the same
filesystem.
I think the presence of the '.keep' files should make "git gc" do the
right thing, and not waste space. The relinking procedure is a little
more complex, but that's not a big deal. It's just a periodic
maintenance thing that will happen inside a script (and you would want
to do the periodic maintenance as often as you would with the shared
repo approach).
Nothing is maintaining the list of "here are all of the related repos
that are sharing objects". Which is a feature in some ways, because you
don't have to care if repos go away or move. But when your periodic "git
relink" comes around, the burden is on the user to redecide the set of
related repos.
So unlike with the shared repo, where "git gc" in a child repo could say
"Oh, I have a shared parent; I should go there and do the parent-gc
there", relinking would be a more manual thing. On the other hand,
nothing is stopping you from building something more automated around
this relink-repos-together building block.
So yeah, I think it's a perfectly reasonable approach, if you don't mind
the hard link requirement, and your relink is something like "git relink
~/linux-repos/*".
Patches? :)
-Peff
next prev parent reply other threads:[~2011-11-21 22:19 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-14 0:38 [RFC] deprecating and eventually removing "git relink"? Junio C Hamano
2011-11-14 6:06 ` Miles Bader
2011-11-14 6:27 ` Junio C Hamano
2011-11-14 9:03 ` Chris Packham
2011-11-14 8:48 ` Simon Brenner
2011-11-14 10:34 ` Jeff King
2011-11-14 20:18 ` Junio C Hamano
2011-11-14 20:25 ` Jeff King
2011-11-14 22:08 ` Junio C Hamano
2011-11-15 4:48 ` Miles Bader
2011-11-21 22:09 ` Phillip Susi
2011-11-21 22:19 ` Jeff King [this message]
2011-11-22 1:58 ` Phillip Susi
2011-11-14 10:24 ` Junio C Hamano
2011-11-15 4:40 ` Miles Bader
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=20111121221934.GA21882@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=olsner@gmail.com \
--cc=psusi@cfl.rr.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).