From: Marc Branchaud <marcnarc@xiplink.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] clone: --dissociate option to mark that reference is only temporary
Date: Thu, 16 Oct 2014 11:26:54 -0400 [thread overview]
Message-ID: <543FE3BE.9010307@xiplink.com> (raw)
In-Reply-To: <xmqqfvepuhmy.fsf@gitster.dls.corp.google.com>
On 14-10-15 05:50 PM, Junio C Hamano wrote:
> Marc Branchaud <marcnarc@xiplink.com> writes:
>
>> Yes, but we're cloning gko, not the neighbour. Doesn't that mean that the
>> clone operation won't know about any of the neighbour's refs?
>
> No. --reference (and a natural implementation of --borrow, I would imagine)
> peeks the refs of the repository we borrow from and that is how
> clone can say "I already have objects reachable from these refs, so
> please send me the remainder" to the repository it is cloning from.
By "know about" I meant "want to use". Sorry for being a bit dense about
this; let me try again.
(BTW, it occurs to me that your patch -- if I read it right -- doesn't
fulfill your scenario since it disassociates the clone from all repos,
regardless of whether they are specified with --reference or --borrow. In
the following I assume a --borrow that only disassociates from the specified
repo and leaves the --reference repo(s) alone.)
Since we're cloning gko's refs, all of the neighbour's unique refs and
objects can be ignored. Even though paths to the neighbour and the local
pool will be in the clone's alternates file, any refs the clone operation
creates won't need to use any objects from the neighbour. The clone
operation gives us no way to refer to the neighbour's unique objects.
I just don't see what difference the --borrow option makes. Consider the two
cases:
With just --reference=/local/pool/linux.git:
1. Set up the alternates file with that path.
2. Copy gko's refs into refs/remotes/origin/.
3. Set up refs/heads/master to refer to gko's HEAD.
4. Checkout refs/heads/master (uses objects from local pool).
With both that --reference and --borrow=../my/neighbour/linux-hack.git:
1. Set up the alternates file with both paths.
2. Copy gko's refs into refs/remotes/origin/.
3. Set up refs/heads/master to refer to gko's HEAD.
4. Checkout refs/heads/master (uses objects from local pool).
5. Disassociate ourselves from the neighbour repo.
In both cases the first four actions have no need of the neighbour repo. The
second case's fifth action surgically removes the neighbour as an alternate
object store, and we're left with the same clone we got in the first case.
What was the point?
It seems that in order to make something like --borrow useful, "git clone"
would somehow need to know which of the neighbour's refs you want to *also*
clone, then copy any unique objects from the neighbour before disassociating
from it.
M.
next prev parent reply other threads:[~2014-10-16 15:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-14 19:57 [PATCH] clone: --dissociate option to mark that reference is only temporary Junio C Hamano
2014-10-15 14:34 ` Marc Branchaud
2014-10-15 17:29 ` Junio C Hamano
2014-10-15 20:51 ` Marc Branchaud
2014-10-15 21:33 ` Junio C Hamano
2014-10-15 21:44 ` Marc Branchaud
2014-10-15 21:50 ` Junio C Hamano
2014-10-16 15:26 ` Marc Branchaud [this message]
2014-10-17 12:47 ` Jakub Narębski
2014-10-16 19:27 ` Junio C Hamano
2014-10-15 19:44 ` Johannes Sixt
2014-10-15 21:33 ` Junio C Hamano
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=543FE3BE.9010307@xiplink.com \
--to=marcnarc@xiplink.com \
--cc=git@vger.kernel.org \
--cc=gitster@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 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).