-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[flutter_tools] Remove usage of globals.flutterGit from version #100744
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
Conversation
} on VersionCheckError catch (error) { | ||
if (globals.platform.environment.containsKey('FLUTTER_GIT_URL')) { | ||
globals.printWarning('Warning: the Flutter git upstream was overridden ' |
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.
Removed this message as the user will hit a similar error message when they try to upgrade, and in the case FLUTTER_GIT_URL
is set incorrectly, the upstream of the current channel has to be exactly the same for the tool to arrive at this point.
branch: '$_versionCheckRemote/$branch', | ||
); | ||
await _run(<String>['git', 'fetch', '--tags']); | ||
return _gitCommitDate(gitRef: '@{u}'); |
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.
This is a good change; however, I always need to look up @{u}
. Can you make this a constant, like:
/// A git shortcut for the branch that is being tracked by the current one.
///
/// See `man gitrevisions` for more information.
const String kGitTrackingUpstream = '@{upstream}';
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.
Done.
return _latestGitCommitDate( | ||
branch: '$_versionCheckRemote/$branch', | ||
); | ||
await _run(<String>['git', 'fetch', '--tags']); |
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.
So it sounds like git fetch
, without an explicit remote, defaults to whatever remote the current branch is tracking?
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.
If so, please leave a comment.
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.
So it sounds like
git fetch
, without an explicit remote, defaults to whatever remote the current branch is tracking?
Yes, provided the current branch tracks the said remote. Otherwise remote origin
is fetched.
The tool won't go to the second case ever, since in that case repositoryUrl
will be null
and will fail this check.
Although I only mentioned that the tool fetches from upstream, I wouldn't necessarily object if you would like to have the above info included as well.
7135fa8
to
933530e
Compare
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
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
3ebc203
to
5a10d36
Compare
5a10d36
to
5d850e4
Compare
Removes
globals.flutterGit
and its usage in version.Now that the tool only uses
FLUTTER_GIT_URL
orgithub.com/flutter/flutter
for version freshness check and updates(#97202 and #100605), we don't need to create the temporary remote anymore; instead use the tracking remote itself to fetch from upstream.Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.