On Mar 25, 2014, at 6:17 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote: > Junio C Hamano <gitster@xxxxxxxxx> writes: > >> Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> writes: >> >>>> 1) Introduce '--borrow' to `git-fetch`. This would behave similarly >>> to '--reference', except that it operates on a temporary basis, and >>> does not assume that the reference repository will exist after the >>> operation completes, so any used objects are copied into the local >>> objects database. In theory, this mechanism would be distinct from >>> --reference', so if both are used, some objects would be copied, and >>> some objects would be accessible via a reference repository referenced >>> by the alternates file. >>> >>> Isn't this the same as git clone --reference <path> --no-hardlinks >>> <url> ? >>> >>> Also without --no-hardlinks we're not assuming that the other repo >>> doesn't go away (you could rm-rf it), just that the files won't be >>> *modified*, which Git won't do, but you could manually do with other >>> tools, so the default is to hardlink. >> >> I think that the standard practice with the existing toolset is to >> clone with reference and then repack. That is: >> >> $ git clone --reference <borrowee> git://over/there mine >> $ cd mine >> $ git repack -a -d >> >> And then you can try this: >> >> $ mv .git/objects/info/alternates .git/objects/info/alternates.disabled >> $ git fsck >> >> to make sure that you are no longer borrowing anything from the >> borrowee. Once you are satisfied, you can remove the saved-away >> alternates.disabled file. > > Oh, I forgot to say that I am not opposed if somebody wants to teach > "git clone" a new option to copy its objects from two places, > (hopefully) the majority from near-by reference repository and the > remainder over the network, without permanently relying on the > former via the alternates mechanism. The implementation of such a > feature could even literally be "clone with reference first and then > repack" at least initially but even in the final version. That was actually one of my first ideas - adding some sort of '--auto-repack' option to git-clone. It's a relatively small change, and would work. However, keeping in mind my end goal of automating the feature to the point where you could run simply 'git clone <url>', an '--auto-repack' option is more difficult to undo. You would need a new parameter to disable the automatic adding of reference repositories, and a new parameter to undo '--auto-repack', and you'd have to remember to actually undo both of those settings. In contrast, if the new feature was '--borrow', and the evolution of the feature was a global configuration 'fetch.autoBorrow', then to turn it off temporarily, one only needs a single new parameter '--no-auto-borrow'. I think this is a cleaner approach than the former, although much more work. Thanks, - Andrew Keller -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html