-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Failure to pull after importing a git repo #3377
Comments
Script to reproduce:
|
Thanks for the bug report @charlesbaynham ! We'll take a look ASAP. |
@jorgeorpinel, @efiop, how should this behave for git repo? Not pull at all or like |
Am I right in thinking that dvc repos don't put imported files into their cache / remote? So a pull will always need to access the original source? |
@charlesbaynham it actually does put it in the cache. Continuing your script: $ cat a_dir.dvc
...
repo:
url: ../git_repo
rev_lock: 314393c2a7b82004302d5b7f219e724522db88ca
outs:
- md5: 59446444eae8d3c063f64fefd37b43b5
...
$ tree .dvc/cache
.dvc/cache
├── 59
│ └── 446444eae8d3c063f64fefd37b43b5.dir
└── d4
└── 1d8cd98f00b204e9800998ecf8427e
$ cat .dvc/cache/59/446444eae8d3c063f64fefd37b43b5.dir
[{"md5": "d41d8cd98f00b204e9800998ecf8427e", "relpath": "test.txt"}] But shouldn't push it to the remote storage, indeed. @skshetry in this case, I don't understand why I think that's the current
|
It actually doesn't, just that |
@skshetry It should git clone (as we usually do) and just copy stuff over, same as if you would've re-imported it again. |
OK. But in my script you can see that both |
Able to reproduce with following tests: def test_pull_imports(tmp_dir, dvc, scm, git_dir):
with git_dir.chdir():
git_dir.scm_gen("foo", "foo", commit="first version")
dvc.imp(fspath(git_dir), "foo")
dvc.pull()
def test_pull_imports_erepo_dvc(tmp_dir, dvc, scm, erepo_dir):
with erepo_dir.chdir():
erepo_dir.dvc_gen("foo", "foo", commit="first version")
dvc.imp(fspath(erepo_dir), "foo")
dvc.pull() Looks like it never worked before. |
@jorgeorpinel, current Do we need to support this? Or, we should delegate it to |
How else can the bug be fixed? If theres something in the middle that would probably be a good start. Maybe just make pull ignore import stages? I'm not sure tbh, please check with @efiop and @shcheklein. Do we want pull to treat import stages like any other stages? I'm guessing yes if possible. |
Shouldn't it be that |
@charlesbaynham, #3503 implemented exactly how you described. |
Works like a charm |
Please provide information about your setup
DVC version(i.e.
dvc --version
), Platform and method of installation (pip, homebrew, pkg Mac, exe (Windows), DEB(Linux), RPM(Linux))DVC 0.86.4, conda installation, Windows.
See https://discuss.dvc.org/t/importing-from-a-git-repo-then-pulling/320 for background.
After
import
ing a directory from a git repository (not a dvc repository),dvc pull
fails withERROR: unexpected error - 'ExternalGitRepo' object has no attribute 'cache'
.The text was updated successfully, but these errors were encountered: