This repository was archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Warn when no origin remote #2026
Merged
Merged
Conversation
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
This is a façade for the internal SVsTippingService on Visual Studio 2015 and 2017.
cc0998b
to
e25a915
Compare
Show 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
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
jnm2
reviewed
Nov 21, 2018
jnm2
reviewed
Nov 21, 2018
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.
@jnm2 thanks for the review! I think I've implemented all of your suggestions. |
jnm2
reviewed
Nov 21, 2018
Update: fixed. A strange issue with |
|
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
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.
Looking great! Just one thing, and a question.
src/GitHub.VisualStudio.UI/Views/GitHubPane/NoRemoteOriginView.xaml
Outdated
Show resolved
Hide resolved
Add RepositoriesMustHaveRemoteOriginHowToFix resource string. Add Margin="4" to TextBlocks to make them appear as paragraphs.
grokys
approved these changes
Nov 29, 2018
Sign up for free
to 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, theGitHub
pane will open with an option to edit their remotes.TippingService
for displaying call-out notifications on Visual Studio 2015, 2017 and 2019NoRemoteOriginView
onGitHub
pane when there are no remotes namedorigin
ShowRepositorySettingsRemotesAsync
toITeamExplorerServices
GetSessionInternal
when repositoryCloneUrl
changes to nullGitService
(that use a real repository)HasRemotesButNoOrigin
property toLocalRepositoryModel
CantFindGitHubUrlForRepository
andRepositoriesMustHaveRemoteOrigin
toResources
TrackedRemoteName
toBranchModel
NoRemoteOriginView
might 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
GitHub
pane, which will show the following message. Alternatively, clickingAlways ignore
will cause the call-out notification to never show again.Clicking the
Edit Remotes
button will open theRepository Settings
page with theRemotes
section visible. This lets the user rename one of their remotes toorigin
.To do
How to test
git remote rename origin porigin
GitHub
pane to appear with no "origin" messageEdit Remotes
buttonRepository Settings
page with theRemotes
section visibleporigin
rename and rename it toorigin
GitHub
paneRelated
Fixes #1729