Dvc: import: behave like `add`, `move`

Created on 11 Feb 2020  路  3Comments  路  Source: iterative/dvc

More context around https://discordapp.com/channels/485586884165107732/485596304961962003/676398069469806603

Currently dvc import has a -o option to specify where to place the downloaded data, but the DVC-file itself gets created in the CWD. It would be more intuitive to have the DVC-file in the same --out location, similar to how dvc add behaves.

This is especially strange when using dvc move on an import stage, as it moves both the data and the DVC-file into the dst location.

May apply to dvc import-url as well, haven't checked.

bug enhancement p0-critical

All 3 comments

I feel like this might be a bug that we didn't notice, as I do remember implementing this behavior for original import(now import-url). :confused: Will take a look.

As import is using imp_url fixing this issue for imp_url will probably fix it also for imp.

repro script

#!/bin/bash

rm -rf erepo repo
mkdir erepo repo
MAIN=$(pwd)

pushd erepo
git init --quiet
dvc init -q

echo data >> data
dvc add data
git add -A
git commit -am "init"

popd
pushd repo
git init --quiet && dvc init -q

mkdir dir
dvc import $MAIN/erepo data -o dir/data
ls

ls shows that data.dvc is in root project dir, while it should not be

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tc-ying picture tc-ying  路  3Comments

shcheklein picture shcheklein  路  3Comments

jorgeorpinel picture jorgeorpinel  路  3Comments

anotherbugmaster picture anotherbugmaster  路  3Comments

dnabanita7 picture dnabanita7  路  3Comments