Re: [PATCH] clone: --dissociate option to mark that reference is only temporary
- From
Jakub Narębski <jnareb@gmail.com>
- Date
- Oct 17, 2014, 12:47 UTC
- Message-ID
- <54410FCB.6070908@gmail.com>
- In-Reply-To
- <543FE3BE.9010307@xiplink.com>
On 2014-10-16 17:26, Marc Branchaud wrote:
Show 5 quoted lines
> 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.
x. Fetch object from origin not present in pool
Show 6 quoted lines
> 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.
x. Fetch objects from origin not present in either pool
or neighbour repo ("have" pool and neighbour)> 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.
which means roughly:
5.1. Remove neighbour repo from alternates
5.2. Fetch required objects from neighbour repo
("want" neighbour, have ???)It is possible that because of technical limitations --reference and --borrow / dissociate / --temporary-reference / --object-cache are to be mutually exclusive.
> 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?
You are missing fetching object from your list of actions.
Show 6 quoted lines
> 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.
-- Jakub Narębski