dvc move path/to/some.tgz path/to/dir/
See original GitHub issue👉 dvc 0.23.2 installed via pip on ubuntu
dvc move path/to/some.tgz path/to/dir/
did something rather strange and unintuitive when I tried to move a file to a destination directory (without re-specifying the destination filename).
I expected it to behave like unix’s mv
, which moves a file into the destination directory while keeping the same name, when a directory (with trailing slash) is specified as the destination, e.g. mv thing.txt path/to/dir/
results in path/to/dir/thing.txt
.
So I started with directory structure:
data/some.tgz
data/some.tgz.dvc
sub/data/
And I ran the command:
$ dvc move data/some.tgz sub/data/
I ended up with the directory structure:
data/.dvc
data/sub/data
sub/data/
… which looks kind of like the directory data/
is now under dvc control, and the some.tgz
was renamed to data/sub/data
(a file with no extension). du -sh data/sub
shows that data/sub/data
is of the same file size as the original .tgz
.
What I expected to end up with:
data/
sub/data/some.tgz
sub/data/some.tgz.dvc
I think that there are at least a couple bugs here.
- It is clear in my syntax that I intended the destination to be a directory. dvc doesn’t seem to handle that syntax. It would be great if dvc could be updated to support this syntax — or, at the very least, to detect this syntax and give an error message to prevent the current behavior, which I can’t imagine is desired.
- Might be irrelevant if you fix the first bug, but it seems something weird is happening with the paths here. How did the destination path (
sub/data/
) get somehow combined with the src path (data/some.tgz
) to producedata/sub/data
? 🤔
I was able to get myself out of this miss by dvc move data/sub/data data/some.tgz
, which resulted in:
data/data/some.tgz
data/.dvc
Then I renamed data/.dvc
to data/data/some.tgz.dvc
and updated its path
property to some.tgz
. Then, finally, I ran dvc move data/data/some.tgz ../../sub/data/some.tgz
, which is still running now, but I think might get me where I wanted to go in the first place. 🤞
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
@colllin 0.24.0 is out. Please feel free to upgrade 🙂
@colllin Sorry for the delay, we are preparing to release 0.24.0 with it this week. For now, you could try installing an upstream version with
pip uninstall dvc && pip install git+https://github.com/iterative/dvc
.