Skip to content

Conversation

@igor-makarov
Copy link
Contributor

@igor-makarov igor-makarov commented Sep 19, 2020

This year, git and GitHub have added support for sparse checkouts and partial clones.
This PR adds support for these features in the spec repos. If a spec repo is added as a sparse checkout, (addition is handled in CocoaPods#10069), only the pods the user requests are fetched/checked out.

def pod_path(name)
specs_dir.join(*metadata.path_fragment(name))
path = specs_dir.join(*metadata.path_fragment(name))
add_to_sparse_checkout(path) if sparse_checkout?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it feels very weird to me that simply querying for the path would have side effects

Copy link
Contributor Author

@igor-makarov igor-makarov Sep 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it helps to view it as a "lazy" repo - the code simply ensures that the path can be queried correctly.
If viewed this way, it's not a "side effect" but a necessary implementation detail.

Another way to do this is to add the call to #add_to_sparse_checkout everywhere the path is being queried, but that increases the risk of bugs. My proposition seems more robust to me.

@dnkoutso dnkoutso removed this from the 1.11.0 milestone Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants