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:50 PM, Avery Pennarun <apenwarr@xxxxxxxxx> wrote:
> On Mon, May 25, 2009 at 5:33 AM, Asger Ottar Alstrup <asger@xxxxxxxx> wrote:
>> 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.)

OK, so git subtree is not usable as it is for this. Instead, it seems
a new system has to be developed which would be similar to git subtree
in spirit, except that it worked at a file-level. Of course, the git
merge subtree strategy can not be used, so merging has to be done
differently.

So a poor mans system could work like this:

- A reduced repository is defined by a list of paths in a file, I
guess with a format similar to .gitignore

- To extract: A copy of the original repository is made. This copy is
reduced using git filter-branch. Is there some way of turning a
.gitignore syntax file into a concrete list of files? Also, can this
entire step be done in one step without the copy? Having to copy the
entire project first seems excessive. Will filter-branch preserve
and/or prune pack files intelligently?

- To merge from the reduced to the original: The very simple version
is just to copy all the files from the reduced repository into a
checkout of the original repository, and then merge. This would not
support removal (or renaming) of files, but that might be ok in my
setup. If this needs to be more intelligent, the list of files in the
reduced repository could be compared with the list of paths that was
used to reduce it originally. This can be used to detect removals and
additions of files.

- To merge from the original to the reduced: First merge the other
way, and then extract again.

I am new to git, so please excuse me if this design is mentally unsound.

Regards,
Asger
--
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]