-
Notifications
You must be signed in to change notification settings - Fork 230
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
Add flag --unlock-transitive
to pub upgrade
#4403
Add flag --unlock-transitive
to pub upgrade
#4403
Conversation
This is a bit confusing, because:
|
Well, So it is the same rule we apply. But we could disallow |
Let's call it |
This will not work in cases where the latest version of the upgraded package has more dependencies than the current. Then they will not be unlocked. Say: foo 1.0.0 has dependencies:
# no dependencies foo 1.5.0 has dependencies:
bar: ^1.0.0 And the main pubspec.yaml looks like dependencies:
foo: ^1.0.0
bar: ^1.0.0 # bar will not be unlocked by `pub upgrade foo --unlock-transitive` We have agreed that is a relatively rare case, and we can live with it. |
--transitive
to pub upgrade
--unlock-transitive
to pub upgrade
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.
Please add the negatable: false
, if we want the negatable variant I think we should call it --lock-transitive
rather than --nounlock-transitive
🤣
argParser.addFlag( | ||
'unlock-transitive', | ||
help: 'Also upgrades the transitive dependencies ' | ||
'of the listed [dependencies]', | ||
); |
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.
argParser.addFlag( | |
'unlock-transitive', | |
help: 'Also upgrades the transitive dependencies ' | |
'of the listed [dependencies]', | |
); | |
argParser.addFlag( | |
'unlock-transitive', | |
help: 'Also upgrades the transitive dependencies ' | |
'of the listed [dependencies]', | |
negatable: false, | |
); |
@@ -10,6 +10,7 @@ Usage: pub upgrade [dependencies...] | |||
-n, --dry-run Report what dependencies would change but don't change any. | |||
--[no-]precompile Precompile executables in immediate dependencies. | |||
--tighten Updates lower bounds in pubspec.yaml to match the resolved version. | |||
--[no-]transitive Also upgrades the transitive dependencies of the listed [dependencies] |
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.
--[no-]transitive Also upgrades the transitive dependencies of the listed [dependencies] | |
--transitive Also upgrades the transitive dependencies of the listed [dependencies] |
I disagree. The negations are useful if we ever change the default. And in that case they should also be present from the beginning. I think |
Seems like I merged this by accident... Will revert. |
pub upgrade x y z
will only unlock x, y and z, but with the new flagpub upgrade --transitive x y z
will unlock those packages and their transitive dependencies.Same for
--major-versions
.Fixes #3504
We could also consider making this the default behavior - it is most likely what people expect.