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
cmd/update-reset: improve arg parsing #14667
Conversation
Currently, doing `brew update-reset homebrew/core` does nothing (not even return an error). If you want to `update-reset` a given tap, you must do (the equivalent of) brew update-reset "$(brew --repository owner/tap_name)" This isn't very intuitive, so let's do a bit more work in argument parsing so that the user can just pass a tap name instead of a path to a tap. Passing a path to a tap is also still supported.
Review period will end on 2023-02-17 at 16:02:18 UTC. |
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 don't think we should add this. This logic will not behave the same as the tap naming logic in Ruby and is likely to further confuse. Instead, let's error out if we get no valid arguments.
I don't follow. It does use the same tap naming logic as in Ruby. If you mean it allows you to refer to a tap as |
It's not identical logic and it's not identical code. I think this is much more easily and reliably fixed by updating documentation and error messaging rather than trying to parse a new format of input consistently. |
Review period ended. |
This reverts commit ac7dbc0.
This is based on feedback from Homebrew#14667.
Did this partially -- we now error out if any argument is invalid. We can continue if at least one argument is valid, but given that this |
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 improvements, thanks @carlocab!
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.
Oops, looks like this broke: https://github.com/Homebrew/brew/actions/runs/4293038788/jobs/7480240578#step:8:61
Well, now we know that command was quietly not doing anything! 😄 |
This command was being called with the wrong relative path, so it silently did nothing. Now that `update-reset` errors out from invalid arguments, we know that running `update-reset` here is not needed.
@@ -103,8 +103,6 @@ jobs: | |||
brew tap homebrew/portable-ruby | |||
brew tap homebrew/services | |||
|
|||
brew update-reset Library/Taps/homebrew/homebrew-bundle |
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've now removed it. I can put it back with the correct path, but given that this has been a silent no-op for a while now I suspect we don't need it.
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.
@carlocab Yup, all good, thanks!
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?Currently, doing
brew update-reset homebrew/core
does nothing (noteven return an error). If you want to
update-reset
a given tap, youmust do (the equivalent of)
This isn't very intuitive, so let's do a bit more work in argument
parsing so that the user can just pass a tap name instead of a path to a
tap.
Passing a path to a tap is also still supported.