Dvc.org: cmd ref: update `import`: it now supports non-DVC Git repos

Created on 6 Jan 2020  路  9Comments  路  Source: iterative/dvc.org

Per iterative/dvc/pull/3020.

See https://github.com/iterative/dvc/pull/3020#issuecomment-569929346, https://github.com/iterative/dvc/pull/3020#issuecomment-570062699, and https://github.com/iterative/dvc/pull/3020#issuecomment-570649032:

Regarding documentation, I could edit https://github.com/iterative/dvc.org/blob/master/static/docs/command-reference/import.md and change "DVC repository" to "DVC or Git repository" but I'm not sure if that's really necessary.

  • [x] sounds like a good first step but I imagine there needs to be more changes, would have to read the cmd ref thoroughly and think about it. Please open the PR and we'll get that review process stated.
  • [x] Regarding docs, sure we need to note that this now works on non-dvc repos, there is no doubt about it and it is clearly necessary. 馃檪
  • [x] Yes I think docs definitely need to be updated so that the dvc import command reference reflects the changes in this PR. You can open a separate iterative/PR on dvc.org for that and we'll review it there and help finish it if necessary. Thanks for the heads up, guys.

UPDATE: Perhaps the only thing missing is to add an example specific to importing Git-tracked file. See https://github.com/iterative/dvc.org/issues/898#issuecomment-631725358

doc-content good first issue

All 9 comments

It seems this issue has been solved by a PR that may not have mentioned this issue.
The import.md page in command-reference mentions this:

Download a file or directory tracked by DVC or by Git into the workspace. It also creates a DVC-file with information about the data source, which can later be used to update the import.

In case if it needs to be more explicitly stated 'non-DVC Git repos', I'll be happy to take this up

@utkarshsingh99 thanks! Indeed this is now included in https://dvc.org/doc/command-reference/import but perhaps

  • [x] the only thing missing is to add an example specific to importing Git-tracked files.

You can try this if you wish.

Sure, I will look into it.

If a Git-tracked file is added through dvc update then it will automatically be put in .gitignore and the user might not want to do it.
So the best way for the user would have to be dvc add, right?

If a Git-tracked file is added through dvc update

dvc update does not add file. Not sure I understand you question. Did you mean dvc import?

If file (Git or DVC - tracked) is imported it is indeed by default is _cached_ (added into DVC). It's a good question if people want that or not. Let's first try to edit the .dvc file it produces and add cache: false to the specific out section, remove it from .gitignore, and see what happens + try to run dvc update. Just to see if it works or not at all right now.

Yeah, I meant dvc import there.
So here's what I did.
Changed a .dvc file's cache: true to false. Removed that file from .gitignore. Executed dvc update.
As expected, everything did work. Although, I am not sure what different command would be needed on the user's side apart from this example in the docs which imports a DVC repo:
https://dvc.org/doc/command-reference/import#examples

Changed a .dvc file's cache: true to false

How was that .dvc file produced? I'm assuming with dvc import but it would be better to see a full sequence of commands for readability. However...

This is a great question but I'm not sure how it relates to the pending task here, "add an example specific to importing Git-tracked file". I mean... I see how it relates, but can that be done without figuring out this new question first? If so, please focus on it and just open a separate issue about whether to cache or not imports in the core repo, @utkarshsingh99

Thanks

Yeah, I think it can be done.

add an example specific to importing Git-tracked

With this in context, I am not sure what different command would be needed on the user's side apart from this example in the docs which imports a DVC repo:
https://dvc.org/doc/command-reference/import#examples

Can you give me an idea about this? @jorgeorpinel

I am not sure what different command would be needed on the user's side apart from this example in the docs

Indeed. It's basically the same thing. But having a separate example with the title specifically mentioning "Git-tracked file", and clarifying some of the caveats in the example explanation could be helpful for some users and it adds explicitness to the doc. It also allows us to continue assessing your PRs. But if it seems to small feel free to pick another issue.

Was this page helpful?
0 / 5 - 0 ratings