Skip to content

import: git sparse-checkout #3438

Closed
Closed
@casperdcl

Description

@casperdcl

dvc import https://some/git/repo/ some_file should probably do a sparse checkout.

Currently looks like it does a full clone:

self.deps[0].download(self.outs[0])
would call
def download(self, to):
with self._make_repo() as repo:
if self.def_repo.get(self.PARAM_REV_LOCK) is None:
self.def_repo[self.PARAM_REV_LOCK] = repo.scm.get_rev()
if hasattr(repo, "cache"):
repo.cache.local.cache_dir = self.repo.cache.local.cache_dir
repo.pull_to(self.def_path, to.path_info)

On a related note, is the repo locally cached by default

if hasattr(repo, "cache"):
repo.cache.local.cache_dir = self.repo.cache.local.cache_dir
so that dvc update won't re-clone?

Metadata

Metadata

Assignees

Labels

enhancementEnhances DVCp2-mediumMedium priority, should be done, but less importantperformanceimprovement over resource / time consuming tasks

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions