Dvc: Use a DVC command, but without having to change directories (like git -C <dir>)

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

Similar to: Starting git 1.8.5 (Q4 2013), you will be able to "use a Git command, but without having to change directories. Just like "make -C ", "git -C ..." tells Git to go there before doing anything else.

Could a similar to Git and Make '-C' option be added to DVC?

The particular use case I have in mind, if DVC is used from Jupyter, spurious %cd - add quite a bit of clutter:

   %cd  $datasets
   !dvc pull --force --recursive xxxx --quiet
   %cd -

You can end up in a wrong directory and then things fail. Much nicer, if one will be able to write:

   !dvc -C $datasets pull --force --recursive xxxx --quiet
feature request help wanted p3-nice-to-have

Most helpful comment

If @dchichkov doesn鈥檛t want to implement, I鈥檇 like the chance.

All 3 comments

Hi @dchichkov !

Great request! We actually have one -C in dvc repro. It has been there for a long time, but we haven't heard any requests about other commands (nor about that one, really) ever, so it is interesting to get this feature request :slightly_smiling_face: The implementation should be pretty simple: we'd need to add -C to the parent parser https://github.com/iterative/dvc/blob/1.0.0a11/dvc/cli.py#L123 and chdir in dvc/command/base.py:CmdBase accordingly.

Maybe you would like to give a shot implementing it? :slightly_smiling_face: We'll try to help with everything we can.

If @dchichkov doesn鈥檛t want to implement, I鈥檇 like the chance.

@JosephTLucas Sounds great! Please feel free! :pray:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Suor picture Suor  路  39Comments

drorata picture drorata  路  46Comments

gvyshnya picture gvyshnya  路  36Comments

dmpetrov picture dmpetrov  路  35Comments

pared picture pared  路  73Comments