Re: [PATCH] clone: --dissociate option to mark that reference is only temporary

2014-10-17 Thread Jakub Narębski
On 2014-10-16 17:26, Marc Branchaud wrote: 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

Re: [PATCH] clone: --dissociate option to mark that reference is only temporary

2014-10-16 Thread Marc Branchaud
On 14-10-15 05:50 PM, Junio C Hamano wrote: Marc Branchaud marcn...@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

Re: [PATCH] clone: --dissociate option to mark that reference is only temporary

2014-10-16 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Marc Branchaud marcn...@xiplink.com writes: I think things would be more understandable if the option was --dissociate repository and was an explicit alternative to --reference: [[--reference | --dissociate] repository] I'm still not liking the

Re: [PATCH] clone: --dissociate option to mark that reference is only temporary

2014-10-15 Thread Marc Branchaud
On 14-10-14 03:57 PM, Junio C Hamano wrote: While use of the --reference option to borrow objects from an existing local repository of the same project is an effective way to reduce traffic when cloning a project over the network, it makes the resulting borrowing repository dependent on the

Re: [PATCH] clone: --dissociate option to mark that reference is only temporary

2014-10-15 Thread Junio C Hamano
Marc Branchaud marcn...@xiplink.com writes: I think things would be more understandable if the option was --dissociate repository and was an explicit alternative to --reference: [[--reference | --dissociate] repository] I'm still not liking the name --dissociate though. The original

Re: [PATCH] clone: --dissociate option to mark that reference is only temporary

2014-10-15 Thread Johannes Sixt
Am 14.10.2014 um 21:57 schrieb Junio C Hamano: +static void dissociate_from_references(void) +{ + struct child_process cmd; + + memset(cmd, 0, sizeof(cmd)); We have CHILD_PROCESS_INIT these days. + argv_array_pushl(cmd.args, repack, -a, -d, NULL); + cmd.git_cmd = 1; +

Re: [PATCH] clone: --dissociate option to mark that reference is only temporary

2014-10-15 Thread Marc Branchaud
On 14-10-15 01:29 PM, Junio C Hamano wrote: Marc Branchaud marcn...@xiplink.com writes: I think things would be more understandable if the option was --dissociate repository and was an explicit alternative to --reference: [[--reference | --dissociate] repository] I'm still not liking

Re: [PATCH] clone: --dissociate option to mark that reference is only temporary

2014-10-15 Thread Junio C Hamano
Marc Branchaud marcn...@xiplink.com writes: On 14-10-15 01:29 PM, Junio C Hamano wrote: $ git clone \ --reference=/local/pool/linux.git \ --borrow=../my/neighbour/linux-hack.git \ git://git.kernel.org/./linux.git With do the usual --reference thing, but

Re: [PATCH] clone: --dissociate option to mark that reference is only temporary

2014-10-15 Thread Junio C Hamano
Johannes Sixt j...@kdbg.org writes: Unless you have a secret plan, you can do it even shorter with our helpers: Thanks. No there isn't a secret plan. It was just me being rusty. diff --git a/builtin/clone.c b/builtin/clone.c index 8649090..81efb07 100644 --- a/builtin/clone.c +++

Re: [PATCH] clone: --dissociate option to mark that reference is only temporary

2014-10-15 Thread Marc Branchaud
On 14-10-15 05:33 PM, Junio C Hamano wrote: Marc Branchaud marcn...@xiplink.com writes: On 14-10-15 01:29 PM, Junio C Hamano wrote: $ git clone \ --reference=/local/pool/linux.git \ --borrow=../my/neighbour/linux-hack.git \ git://git.kernel.org/./linux.git

Re: [PATCH] clone: --dissociate option to mark that reference is only temporary

2014-10-15 Thread Junio C Hamano
Marc Branchaud marcn...@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

[PATCH] clone: --dissociate option to mark that reference is only temporary

2014-10-14 Thread Junio C Hamano
While use of the --reference option to borrow objects from an existing local repository of the same project is an effective way to reduce traffic when cloning a project over the network, it makes the resulting borrowing repository dependent on the borrowed repository. After running git