As pointed out in discussion in #1691, we should reconsider gc implementation.
Currently, if called without any options, dvc will collect current branch dependencies and outputs checksums, and remove everything besides it. We can easily clear history of changes with this command. gc should be safer with default options. Straightforward implementation could get all outputs for all revisions in git repo and remove everything that is not on list.
As pointed out by @Suor, this approach might be slow for repository with long history.
As pointed out in discussion in #1691, we should reconsider
gcimplementation.Currently, if called without any options, dvc will collect current branch dependencies and outputs checksums, and remove everything besides it. We can easily clear history of changes with this command.
gcshould be safer with default options. Straightforward implementation could get all outputs for all revisions in git repo and remove everything that is not on list.As pointed out by @Suor, this approach might be slow for repository with long history.