From: Phillip Susi <psusi@cfl•rr.com>
To: Jeff King <peff@peff•net>
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:09:23 -0500 [thread overview]
Message-ID: <4ECACC13.7050507@cfl.rr.com> (raw)
In-Reply-To: <20111114103451.GA10847@sigill.intra.peff.net>
On 11/14/2011 5:34 AM, Jeff King wrote:
> One issue with this scheme (or most similar schemes) is that child repos
> are uniquely identified by their directory name. In the absence of
> alternates, it's perfectly reasonable to do:
>
> git init; hack hack hack; commit commit commit
> cd .. ; mv project new-project-name
>
> but here it would break the shared repo's link to the child (which is
> not just inconvenient, but dangerous, as we will not respect its refs
> when pruning). Probably the "warning" above should actually error out
> and force the user to say "yes, I deleted this child" or "no, I moved it
> here".
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. It would be nice if
git relink could be enhanced to do this, then you can just periodically
run relink with a list of repos and it could hard link all of the shared
data into a big shared pack file, with no need to have a "master" repo
that requires special handling.
next prev parent reply other threads:[~2011-11-21 22:09 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 [this message]
2011-11-21 22:19 ` Jeff King
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=4ECACC13.7050507@cfl.rr.com \
--to=psusi@cfl$(echo .)rr.com \
--cc=git@vger$(echo .)kernel.org \
--cc=olsner@gmail$(echo .)com \
--cc=peff@peff$(echo .)net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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