Uh oh!
There was an error while loading. Please reload this page.
This repository was archived by the owner on Jun 21, 2023. It is now read-only.
Warn when no origin remote - #2026
Merged
Merged
Conversation
This is a façade for the internal SVsTippingService on Visual Studio 2015 and 2017.
jcansdaleforce-pushed
the
fixes/1729-warn-when-no-origin
branch
from
November 8, 2018 16:41
cc0998b to
e25a915CompareShow a callout notification when we detect that the active repository has remotes, but no remote named "origin".
This isn't a built in Visual Studio service.
Keep it simple and in one place.
I think this maybe reads better.
Keep tests that mock IRepository and create a real Repository separate.
Should return same as repository with no remotes.
Add reference to UIAutomationProvider. https://stackoverflow.com/a/35580095/121348
CollaboratorAuthor
Exception thrown when renaming Edit: fixed in 835ebb1 |
Can't create a pull request session from a repository with no origin.
Check we're forwarding the correct arguments.
This is more explicit about what it actually checks.
Allow easy navigation to Repository Settings > Remotes section.
jnm2
reviewed
Nov 21, 2018
Uh oh!
There was an error while loading. Please reload this page.
jnm2
reviewed
Nov 21, 2018
Uh oh!
There was an error while loading. Please reload this page.
jnm2
reviewed
Nov 21, 2018
Uh oh!
There was an error while loading. Please reload this page.
Using the current method as a template was useful while prototyping, but it's time to lock down the parameter types.
Explicitly look for RequestCalloutDisplay on IVsTippingService rather than duck-type the service object.
These are used to find the Remotes section on the RepositorySettings page.
jcansdale
commented
Nov 21, 2018
CollaboratorAuthor
@jnm2 thanks for the review! I think I've implemented all of your suggestions. |
jnm2
reviewed
Nov 21, 2018
Uh oh!
There was an error while loading. Please reload this page.
CollaboratorAuthor
Update: fixed. A strange issue with |
jcansdale
commented
Nov 21, 2018
CollaboratorAuthor
|
ServiceProviderExports.GetService<TippingService>() was returning null on Visual Studio 2015 so, fall back to using new TippingService(...).
Don't let any exceptions here impact other functionality.
This was referenced Nov 22, 2018
Use the COM Guid rather than simple name to locate interface.
The RequestCalloutDisplay method that takes commandOption is only available on VS 2017+.
grokys
suggested changes
Nov 27, 2018
grokys
left a comment
Contributor
There was a problem hiding this comment.
Looking great! Just one thing, and a question.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Add RepositoriesMustHaveRemoteOriginHowToFix resource string. Add Margin="4" to TextBlocks to make them appear as paragraphs.
grokys
approved these changes
Nov 29, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What this PR does
If a repository doesn't have a remote named
origin, the extension doesn't know which remote to use or even if it's dealing with a GitHub repository. This PR shows a call-out notification if a repository has remotes but none of them are namedorigin. If the used clicks on the notification title, theGitHubpane will open with an option to edit their remotes.TippingServicefor displaying call-out notifications on Visual Studio 2015, 2017 and 2019NoRemoteOriginViewonGitHubpane when there are no remotes namedoriginShowRepositorySettingsRemotesAsynctoITeamExplorerServicesGetSessionInternalwhen repositoryCloneUrlchanges to nullGitService(that use a real repository)HasRemotesButNoOriginproperty toLocalRepositoryModelCantFindGitHubUrlForRepositoryandRepositoriesMustHaveRemoteOrigintoResourcesTrackedRemoteNametoBranchModelNoRemoteOriginViewmight suggest renaming the currently active remote (if any) toorigin?Reviewers
What to expect
When a repository has at least one remote, but no remotes called "origin", the following call-out notification will appear.
Clicking the bonded title will open the
GitHubpane, which will show the following message. Alternatively, clickingAlways ignorewill cause the call-out notification to never show again.Clicking the
Edit Remotesbutton will open theRepository Settingspage with theRemotessection visible. This lets the user rename one of their remotes toorigin.To do
How to test
git remote rename origin poriginGitHubpane to appear with no "origin" messageEdit RemotesbuttonRepository Settingspage with theRemotessection visibleporiginrename and rename it tooriginGitHubpaneRelated
Fixes#1729