Re: git subtree as a solution to partial cloning?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 25, 2009 at 5:33 AM, Asger Ottar Alstrup <asger@xxxxxxxx> wrote:
> On Mon, May 25, 2009 at 9:59 AM, Avery Pennarun <apenwarr@xxxxxxxxx> wrote:
>> On Mon, May 25, 2009 at 3:21 AM, Asger Ottar Alstrup <asger@xxxxxxxx> wrote:
>>> Does git subtree support splitting at the file level, or only at directory
>>> level?
>>
>> Currently only at the directory level.  In theory, there's nothing
>> stopping us from working with any subset of files... but it's really
>> much simpler this way (both to code and to explain) so I'd much rather
>> leave it as is.  Can you reorganize your tree so that you divide the
>> needed files into different subdirectories?
>
> No, that is unfortunately not so easy. If we could, I suppose we could
> use submodules instead.

Your only option may be to use git filter-branch then.  It lets you do
pretty much anything you want, although merging it back together again
could be entertaining.  (Making it correctly mergeable is by far the
trickiest part of git-subtree.)

> Are the subtree split and merge operations effective? I.e. how do they
> scale with the size of the original and reduced repositories? I.e. is
> it feasible to use hooks to automate the splitting and merging
> whenever there are changes in the original or reduced repositories?

git subtree manipulates only commit objects (and a reference to the
single tree object representing the subtree in each commit) so it's
very fast and doesn't depend on file sizes or number of files.
Basically git subtree split is O(n) in the number of *commits* since
the most recent split.

Have fun,

Avery
--
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

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]