From: Jonathan Nieder <jrnieder@gmail.com>
To: Phillip Susi <psusi@cfl.rr.com>
Cc: Jeff King <peff@peff.net>,
git@vger.kernel.org, Christian Couder <chriscool@tuxfamily.org>,
Stephen Bash <bash@genarts.com>
Subject: Re: clone breaks replace
Date: Tue, 11 Jan 2011 12:22:25 -0600 [thread overview]
Message-ID: <20110111182225.GE15133@burratino> (raw)
In-Reply-To: <4D2C7948.6080304@cfl.rr.com>
Hi,
Thoughts on use cases. Jeff already explained the main protocol
problem to be solved very well (thanks!).
Phillip Susi wrote:
> 1) Those tracking your repo don't have breakage when they next fetch
> because the chain of commits they were tracking has been destroyed and
> replaced by a completely different one.
This does not require transport respecting replacements. Just start
a new line of history and teach "git pull" to pull replacement refs
first when requested in the refspec.
It could work like this:
alice$ git branch historical
alice$ git checkout --orphan newline
alice$ git branch newroot
alice$ ... hack hack hack ...
alice$ git replace newroot historical
alice$ git push world refs/replace/* +HEAD:master
bob$ git remote show origin
URL: git://git.alice.example.com/project.git
Ref specifier: refs/replace/*:refs/replace/* refs/heads/*:refs/remotes/origin/*
HEAD branch: master
Remote branch:
master tracked
Local branch configured for 'git pull':
master merges with remote master
bob$ git pull
remote: Counting objects: 18, done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 11 (delta 8), reused 0 (delta 0)
Unpacking objects: 100% (11/11), done.
From git://git.alice.example.com/project.git
* [new replacement] 87a8c7yc65c87c98c87c6a87c8a -> replace/87a8c7yc65c87c98c87c6a87c8a
a78c9df..8c98df9 master -> origin/master
> 2) It is obvious when a replace has been done, and the original is
> still available. This is good for auditing and traceability. Paper
> trails are good.
With the method you are suggesting, others do _not_ always have the
original still available. After I fetch from you with
--respect-hard-replacements, then while I am on an airplane I will
have this hard replacement ref staring at me that I cannot remove.
If the original goes missing or gets corrupted on the few machines
that had it, the hard replacement ref is permanent.
> 3) Inserting a replace record takes a lot less cpu and IO than
> filter-branch rewriting the entire chain.
If the modified history is much shorter than the original (as in the
use case you described), would building it really take so much CPU and
I/O? Moreover, is the extra CPU time to keep checking all the
replacements on the client side worth saving that one-time CPU time
expenditure on the server?
If (and only if) so then I see how that could be an advantage.
Sorry for the longwinded message. Hope that helps,
Jonathan
next prev parent reply other threads:[~2011-01-11 18:22 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
2011-01-11 6:52 ` Jonathan Nieder
2011-01-11 15:37 ` Phillip Susi
2011-01-11 18:22 ` Jonathan Nieder [this message]
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=20110111182225.GE15133@burratino \
--to=jrnieder@gmail.com \
--cc=bash@genarts.com \
--cc=chriscool@tuxfamily.org \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--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).