-
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
gc: make it safer by only activating by use of certain flags #3363
Conversation
7f0b07c
to
60ee6b3
Compare
@@ -47,6 +56,7 @@ def run(self): | |||
force=self.args.force, | |||
jobs=self.args.jobs, | |||
repos=self.args.repos, | |||
workspace=self.args.workspace, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A general thought, not about this PR, - we should stop automatically making command line options into boolean kwargs, e.g. using set()
would be more appropriate here.
6408c82
to
3ff044f
Compare
Previous plain `gc` is now not supported. The same behavior can be trigger by `gc -w` or `gc --workspace`. When `--all-{tags, commits, branches}` are specified, it will work as if `-w` is also specified (same as before).
3ff044f
to
1f1cc11
Compare
class InvalidArgumentError(ValueError, DvcException): | ||
"""Thrown if arguments are invalid.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice one! Should we use it in otherplaces like dvc/repo/__init__.py
and dvc/repo/reproduce.py
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd opt for it on a different PR. 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@skshetry Sure, let's not forget about it though 🙂
@skshetry Let's not forget about docs, please :) |
@efiop, I have created an issue in iterative/dvc.org#1013 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Previous plain
gc
is now not supported. The same behavior can be trigger bygc -w
orgc --workspace
. When--all-{tags, commits, branches}
arespecified, it will work as if
-w
is also specified (same as before).❗ Have you followed the guidelines in the Contributing to DVC list?
📖 Check this box if this PR does not require documentation updates, or if it does and you have created a separate PR in dvc.org with such updates (or at least opened an issue about it in that repo). Please link below to your PR (or issue) in the dvc.org repo.
iterative/dvc.org#1013
Thank you for the contribution - we'll try to review it as soon as possible. 🙏
Related to #2325