From: Jeff King <peff@peff.net>
To: Phillip Susi <psusi@cfl.rr.com>
Cc: Jonathan Nieder <jrnieder@gmail.com>,
git@vger.kernel.org, Christian Couder <chriscool@tuxfamily.org>,
Stephen Bash <bash@genarts.com>
Subject: Re: clone breaks replace
Date: Tue, 11 Jan 2011 00:47:35 -0500 [thread overview]
Message-ID: <20110111054735.GC10094@sigill.intra.peff.net> (raw)
In-Reply-To: <4D27B33C.2020907@cfl.rr.com>
On Fri, Jan 07, 2011 at 07:43:40PM -0500, Phillip Susi wrote:
> >Based on previous discussions, I think the answer to the first is no.
> >The resulting repo violates a fundamental assumption of git. Yes,
> >because of the replacement object, many things will still work. But many
> >parts of git intentionally do not respect replacement, and they will be
> >broken.
>
> What parts do not respect replacement? More importantly, what parts
> will be broken? The man page seems to indicate that about the only
> thing that does not by default is reachability testing, which to me
> means fsck and prune. It seems to be the purpose of replace to
> /prevent/ breakage and be respected by default, unless doing so would
> cause harm, which is why fsck and prune do not.
Off the top of my head, I don't know. I suspect it would take somebody
writing a patch to create such an incomplete repository (or making one
manually) and seeing how badly things broke. Maybe nothing would, and I
am being overly conservative. It just makes me nervous to start
violating what has always been a fundamental assumption about the object
database (though as I pointed out, we did start violating it with
shallow clones, so maybe it is not so bad).
> >Instead, I think of replacements as a specific view into history, not a
> >fundamental history-changing operation itself. Which means you can never
> >save bandwidth or space by truncating history with replacements. You can
> >only give somebody the full history, and share with them your view. If
> >you want to truncate, you must rewrite history[1].
>
> Right, but if you only care about that view, then there is no need to
> waste bandwidth fetching the original one. It goes without saying
> that people pulling from the repository mainly care about the view
> upstream chooses to publish. Upstream can choose to rewrite, which
> will cause breakage and is a sort of sneaky way to hide the original
> history, or they can use replace, which avoids the breakage and gives
> the client the choice of which view to use.
Once you have fetched with that view, how locked into that view are you?
Certainly you can never push to or be the fetch remote for another
repository that does not want to respect that view, because you simply
don't have the objects to complete the history for them.
But what about deepening your own repo? In your proposal, I contact the
server and ask for the replacement refs along with the branch refs. For
the history of the branches, it gives me the truncated version with the
replacement objects, right? Now how do I go back later and say "I'm
interested in getting the rest of history, give me the real one"?
I guess you can get the parent pointer from the real, "non-replaced"
object and ask for it. But you can't ask for a specific commit, so for
every such truncation, the parent needs to publish an extra ref (but
_not_ make it one of the ones fetched by default, or it would nullify
your original shallow fetch), and we need to contact them and find that
ref.
So I guess it's do-able, but there are a few interesting corners. I
think somebody would need to whip up a proof of concept patch to explore
those corners.
-Peff
next prev parent reply other threads:[~2011-01-11 5:47 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-06 21:00 clone breaks replace Phillip Susi
2011-01-06 21:33 ` Jonathan Nieder
2011-01-06 21:59 ` Junio C Hamano
2011-01-07 19:43 ` Phillip Susi
2011-01-07 20:51 ` Jonathan Nieder
2011-01-07 21:15 ` Stephen Bash
2011-01-07 21:34 ` Jonathan Nieder
2011-01-07 21:44 ` Phillip Susi
2011-01-07 21:49 ` Jonathan Nieder
2011-01-07 22:09 ` Phillip Susi
2011-01-07 22:09 ` Jeff King
2011-01-07 22:58 ` Junio C Hamano
2011-01-11 5:36 ` Jeff King
2011-01-11 17:40 ` Junio C Hamano
2011-01-11 17:50 ` Jeff King
2011-01-11 17:56 ` Jonathan Nieder
2011-01-11 18:03 ` Jeff King
2011-01-11 19:32 ` Christian Couder
2011-01-08 0:43 ` Phillip Susi
2011-01-11 5:47 ` Jeff King [this message]
2011-01-11 6:52 ` Jonathan Nieder
2011-01-11 15:37 ` Phillip Susi
2011-01-11 18:22 ` Jonathan Nieder
2011-01-11 18:42 ` Phillip Susi
2011-01-11 15:24 ` Phillip Susi
2011-01-11 17:39 ` Jeff King
2011-01-11 19:48 ` Johannes Sixt
2011-01-11 19:51 ` Jeff King
2011-01-11 20:00 ` Johannes Sixt
2011-01-11 20:22 ` Phillip Susi
2011-01-11 20:50 ` Jonathan Nieder
2011-01-12 0:59 ` Phillip Susi
2011-01-14 20:53 ` small downloads and immutable history (Re: clone breaks replace) Jonathan Nieder
2011-01-15 5:27 ` Phillip Susi
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=20110111054735.GC10094@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=bash@genarts.com \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=jrnieder@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).