From: Junio C Hamano <junkio@cox.net>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: RFE: git relink
Date: Fri, 10 Jun 2005 20:44:01 -0700 [thread overview]
Message-ID: <7vy89h36da.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <42A88C07.5050907@pobox.com> (Jeff Garzik's message of "Thu, 09 Jun 2005 14:35:51 -0400")
>>>>> "JG" == Jeff Garzik <jgarzik@pobox.com> writes:
JG> It would be nice if somebody were motivated enough to create a command
JG> that functions like:
JG> git relink repoA repoB repoC repoD... repoX
JG> which would examine
JG> repoA/.git
JG> repoB/.git
JG> repoC/.git
JG> repoD/.git
JG> and verify (updating, if necessary) that each of the A/B/C/D repos are
JG> hardlinked to repoX.
Whoever is doing this script needs to be a bit careful.
If you end up unlinking a full object and hard-linking a
deltified object representation (delta) in its place, the
repository can get corrupted, because it might not have the
necessary base object for the delta.
There are two strategies to solve this. Either (1) the relinker
refuses to replace a full object with a delta, or (2) the
relinker notices a delta, and makes an additional hard link to
the base object when replacing a full object with a delta (this
needs to be done recursively until you hit a full base object).
(1) is simpler and cleaner, but does not get full advantage of
the delta compression. (2) gives you delta compression but it
will add possibly "unwanted" objects to a repository that
happens to slurp in a delta (fsck would not complain, though).
My knee-jerk vote goes to (1), but in either case the relinker
needs to check if it is dealing with a delta; this cannot be
done with git-cat-file -t AFAIK.
Ryan Anderson code will notice delta vs full object case most of
the time because it checks and makes sure the sizes of
corresponding files from two repositories match. The problem
with the code is that it dies, instead of just ignoring, when
size differs. Dying is good for ordinary case (two full object
representations of the same file should not have different
sizes), but it is not the right thing to do when it sees one
side using the full object representation and the other side
using a delta.
prev parent reply other threads:[~2005-06-11 3:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-09 18:35 RFE: git relink Jeff Garzik
2005-06-09 19:15 ` Ryan Anderson
2005-06-09 19:29 ` Ryan Anderson
2005-06-11 3:44 ` Junio C Hamano [this message]
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=7vy89h36da.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=jgarzik@pobox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.