Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Sparse checkout for repository subdirectories #2

Open
GoogleCodeExporter opened this issue May 10, 2015 · 9 comments
Open

Sparse checkout for repository subdirectories #2

GoogleCodeExporter opened this issue May 10, 2015 · 9 comments

Comments

@GoogleCodeExporter
Copy link

Sometimes there may be a very large repository in HG & Git in which one wants 
to open source only one certain directory, such as a sub-project or particular 
library.

As far as I can tell, currently the only way to do this is to write a bunch of 
editors which delete all folders that aren't being open sourced. This is far 
from optimal, as fetching the other folders could be expensive operation, and 
writing scrubbers for very complicated (dozens of folders) repositories for 
every open source project is error prone. It would be easier to limit a 
repository to a certain path.


Enhancement: Sparse checkout

Include an optional "path" field in the repository JSON object in the config 
file:
"internal": {
  "type": "hg",
  "url":  "file:///home/mbethencourt/work/test_repos/hg_0",
  "project_space": "internal",
  "path": "subproject/libraryname"
},

* Without a "path", MOE falls back to old behavior (operating on entire repo).
* With a path, MOE tries to use "sparse" checkout feature. A "renamer" 
translator will still probably be used to make the layout match external layout.

Sparse checkouts would be implemented a little differently for each client:
* Git would use the sparse checkout feature ( 
http://blog.quilitz.de/2010/03/checkout-sub-directories-in-git-sparse-checkouts/
 )
* SVN would use either "--non-recursive" or "--depth empty", and then "update" 
or "--depth infinite" the specified path
* HG, unfortunately, does not seem to have a sparse checkout feature. It can 
still be imitated however by cobbling together a few commands.

Original issue reported on code.google.com by [email protected] on 23 Aug 2011 at 9:15

cgruber referenced this issue in cgruber/MOE Feb 18, 2019
Use proper substitution segments for autofactory and autovalue as well.
cgruber referenced this issue in geekinasuit/moe Jun 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants
@GoogleCodeExporter and others