Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import: behave like add, move #3304

Closed
jorgeorpinel opened this issue Feb 11, 2020 · 3 comments · Fixed by #3312
Closed

import: behave like add, move #3304

jorgeorpinel opened this issue Feb 11, 2020 · 3 comments · Fixed by #3312
Assignees
Labels
bug Did we break something? enhancement Enhances DVC p0-critical Critical issue. Needs to be fixed ASAP.

Comments

@jorgeorpinel
Copy link
Contributor

jorgeorpinel commented Feb 11, 2020

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.

@jorgeorpinel jorgeorpinel added the enhancement Enhances DVC label Feb 11, 2020
@efiop efiop added bug Did we break something? p0-critical Critical issue. Needs to be fixed ASAP. labels Feb 11, 2020
@efiop
Copy link
Contributor

efiop commented Feb 11, 2020

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). 😕 Will take a look.

@pared pared self-assigned this Feb 12, 2020
@pared
Copy link
Contributor

pared commented Feb 12, 2020

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

@pared
Copy link
Contributor

pared commented Feb 12, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Did we break something? enhancement Enhances DVC p0-critical Critical issue. Needs to be fixed ASAP.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants