Dvc: Introduce `--purge` option for `dvc remove`

Created on 12 Jun 2018  路  4Comments  路  Source: iterative/dvc

dvc delete stage.dvc should remove outputs of the specified stage(same as dvc remove) and also delete the dvc file itself and do things like cleaning up .gitignore.

Kudos @analystanand !

enhancement

Most helpful comment

After quite an extensive discussion with @dmpetrov and @shcheklein , we have reached the consensus of adding --purge option for dvc remove(I.e. dvc remove --purge stage.dvc) and not introducing a separate command. I'll also add -o|--outs command that is currently the default behavior and we will switch from it to -p|--purge in the next major release(https://github.com/iterative/dvc/issues/763).

All 4 comments

Won't delete and remove be ambiguous? Perhaps this is more intuitive if specified with CLI flags.
But at least to me, dvc remove is a bit of a misnomer. Semantically speaking, you pass an argument to a command called remove, you expect that argument to be removed.

I'd suggest that the current behavior should be used with dvc remove file.dvc --outputs-only or something like that, and the proposed dvc delete be its default behavior.

Hi @villasv !

Yep, that would be a bit ambiguous, I agree :) Though, delete usually means something more permanent and remove is for something that can be brought back. Don't quote me on that please :) . In that semantic dvc remove is something that just removes the outputs, not removing the info and cache, but dvc delete is what really exterminates the given stage by removing all the info about it.

Unfortunately we can't switch default behavior of dvc remove in a minor release, as it will break backward compatibility that we've promised when releasing 0.9.0. Thus I think that dvc delete is the most acceptable option that will allow us to add any optional args on top and switch to any default behavior in the future major releases if we really need to.

Thanks,
Ruslan

@efiop Is there a way to introduce an option for dvc remove command?

After quite an extensive discussion with @dmpetrov and @shcheklein , we have reached the consensus of adding --purge option for dvc remove(I.e. dvc remove --purge stage.dvc) and not introducing a separate command. I'll also add -o|--outs command that is currently the default behavior and we will switch from it to -p|--purge in the next major release(https://github.com/iterative/dvc/issues/763).

Was this page helpful?
0 / 5 - 0 ratings