Problem
When merging two branches in a DVC repository it is possible to encounter missing cache data from previous commits. This results in errors such as:
ERROR: unexpected error - [Errno 2] No such file or directory: '~/my_repo/.dvc/cache/files/md5/xx/xxx.dir'
To resolve this, the current workaround is to run:
dvc fetch --all-commits
on both branches to ensure all required data is available locally. However, for long-lived branches like main, this can result in downloading a very large amount of data, much of which is not needed.
Proposed solution
Introduce a --num <N> option to dvc fetch, similar to the existing option in dvc gc, which limits operations to the most recent N commits.
Example:
dvc fetch --num 10
This would fetch cache data only for the latest 10 commits in the current branch, reducing unnecessary downloads.
I would be interested in contributing an implementation if this feature is considered useful.
Problem
When merging two branches in a DVC repository it is possible to encounter missing cache data from previous commits. This results in errors such as:
ERROR: unexpected error - [Errno 2] No such file or directory: '~/my_repo/.dvc/cache/files/md5/xx/xxx.dir'To resolve this, the current workaround is to run:
dvc fetch --all-commitson both branches to ensure all required data is available locally. However, for long-lived branches like main, this can result in downloading a very large amount of data, much of which is not needed.
Proposed solution
Introduce a
--num <N>option todvc fetch, similar to the existing option indvc gc, which limits operations to the most recent N commits.Example:
dvc fetch --num 10This would fetch cache data only for the latest 10 commits in the current branch, reducing unnecessary downloads.
I would be interested in contributing an implementation if this feature is considered useful.