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
Open from clipboard url #1771
Merged
Merged
Open from clipboard url #1771
Changes from 1 commit
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
1de94ef
Add GitHub.OpenFromUrl command
jcansdale 516128a
Update UriString to handle extended GitHub URLs
jcansdale 7071b43
Support opening target from GitHub URL
jcansdale 199a79f
Allow navigating to URL from clipboard
jcansdale 134f6a8
Checkout or open using default path
jcansdale d5b833d
Don't open folder if current solution is inside it
jcansdale c097098
Add support for navigating to a PR URL
jcansdale 12eb8d5
Open at line number from GitHub URL
jcansdale 9399711
Add Open from GitHub command to File > Open
jcansdale 89484dc
Merge branch 'master' into fixes/1757-open-from-url
jcansdale 0aade59
Update UriString to allow http URLs with owner
jcansdale 70d9d90
Find GitHub context from Chrome window title
jcansdale a82390f
Add support for opening from topmost browser
jcansdale c4cac4d
Support syncing the file open in topmost browser
jcansdale d1b0231
Ask user before cloning or opening a repository
jcansdale 0d264d5
Factor GitHub URL parsing into FindContextFromUrl
jcansdale 19249b0
Convert from GitHub to Visual Studio line numbers
jcansdale 9b0fe66
Add support for file links that use a commit SHA
jcansdale 7320235
Fix a few typos
jcansdale e900d7d
Update title regex to work with Firefox
jcansdale 5019370
Detect repository home with no description
jcansdale 90c0aa9
Use regex for matching line
jcansdale 0bed9b2
Find line end from GitHub URL
jcansdale 0aae4ca
Add support for navigating to a range of lines
jcansdale 0fc10b7
Highlight line when single line is selected
jcansdale cfdf410
Select just the target lines
jcansdale 55b1570
Stop the tuple madness
jcansdale cb7816c
Explicitly match CommitSha in blob URLs
jcansdale 2243891
Add ResolvePath to resolve Treeish + BlobName
jcansdale 39f3a54
Rename Treeish to TreeishPath
jcansdale d06ba40
First try opening in active repository
jcansdale d9ce6f5
Add separate `GitHub.OpenFromClipboard` command
jcansdale dbcb792
Simplify OpenFromClipboardCommand
jcansdale 8e968cc
Show alert when no GitHub URL in clipboard
jcansdale b31b14f
Add ResolveGitObject to find local object from URL
jcansdale 5b16030
Merge branch 'master' into fixes/1757-open-from-url
jcansdale 92ffa39
Show message when there is no repo to navigate
jcansdale 1f0f5fb
Return commitish and path from ResolveGitObject
jcansdale 1d468d9
Let ResolveGitObject resolve commit without path
jcansdale 5058564
Warn user when changes in local version of file
jcansdale bc780c4
If target blob has changed then show AnnotateFile
jcansdale c175d97
Don't throw when navigating to non-blob
jcansdale 7784364
Rename ResolveGitObject to ResolveBlob
jcansdale 6a3d8e4
Remove legacy ResolvePath method
jcansdale 11866fb
Remove Open from GitHub... from File > Open menu
jcansdale c5c493d
Warn when user isn't in target repository
jcansdale 36d6b0b
Merge branch 'master' into feature/open-from-clipboard-url
jcansdale 3029ccd
Merge branch 'feature/open-from-clipboard-url' of https://github.com/…
jcansdale de5726f
Make ResolveBlob return if commitish is a SHA
jcansdale ab3e7e9
Change ResolveBlob to resolve remote refs
jcansdale 19be672
Return commit SHA from ResolveBlob
jcansdale 381806b
Add support for resolving tags
jcansdale f81fb36
Warn if URL owner is different to current owner
jcansdale e1bfa23
Allow repository names to differ in case
jcansdale fd0f835
Merge branch 'master' into feature/open-from-clipboard-url
jcansdale c429d76
Show dialog when attempting to open non-blob URL
jcansdale 9ad3ba7
We don't support vpath in a URL
jcansdale 81b6d8a
Lose the App form GitHub.App.Services
jcansdale f651b19
Clean up and xmldoc the AnnotateFile method
jcansdale f12ab09
Remove FindContextFromBrowser from hidden command
jcansdale 057a77f
Add xmldocs for GitHubContext
jcansdale 513b562
Add xmldocs for GitHubContextService
jcansdale b26b2a9
Merge branch 'master' into feature/open-from-clipboard-url
jcansdale 83610bf
Only show command when in context of git repo
jcansdale bec5eca
Add more xmldocs
jcansdale ce68103
Lazy initialize the UIContext
jcansdale e88a3e4
Merge branch 'master' into feature/open-from-clipboard-url
grokys 22ec886
Use <inheritdoc/> on members not classes!
jcansdale edbec49
Make <summary> xmldoc elements a single sentence
jcansdale File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update UriString to allow http URLs with owner
The following URL will now have an owner of "owner": https://github.com/owner Previously it would make a repository name of "owner".
- Loading branch information
commit 0aade5901fc5df9a770046e83bf8a68b62f2cf01
There are no files selected for viewing
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,12 +25,15 @@ public class TheConstructor : TestBaseClass | |
[TestCase("jane;fingerprint=9e:1a:5e:27:16:4d:2a:13:90:2c:64:41:bd:25:fd:[email protected]:github/Windows.git", | ||
"foo.com", "github", "Windows")] | ||
[TestCase("https://[email protected]/haacked/test-mytest.git", "bitbucket.org", "haacked", "test-mytest")] | ||
[TestCase("https://git01.codeplex.com/nuget", "git01.codeplex.com", null, "nuget")] | ||
[TestCase("https://git01.codeplex.com/nuget", "git01.codeplex.com", "nuget", null, | ||
Description = "We assume the first component is the owner")] | ||
[TestCase("https://example.com/vpath/foo/bar", "example.com", "vpath", "foo")] | ||
[TestCase("https://example.com/vpath/foo/bar.git", "example.com", "vpath", "foo")] | ||
[TestCase("https://github.com/github/Windows.git?pr=24&branch=pr/23&filepath=relative/to/the/path.md", | ||
"github.com", "github", "Windows")] | ||
[TestCase("https://github.com/github/VisualStudio/blob/master/src/code.cs", "github.com", "github", "VisualStudio")] | ||
[TestCase("https://github.com/github", "github.com", "github", null)] | ||
[TestCase("https://github.com", "github.com", null, null)] | ||
public void ParsesWellFormedUrlComponents(string url, string expectedHost, string owner, string repositoryName) | ||
{ | ||
var cloneUrl = new UriString(url); | ||
|
@@ -71,13 +74,17 @@ public void ParsesLocalFileUris(string path) | |
[TestCase("http://example.com", "example.com", null, null)] | ||
[TestCase("http://example.com?bar", "example.com", null, null)] | ||
[TestCase("https://example.com?bar", "example.com", null, null)] | ||
[TestCase("ssh://[email protected]/Windows.git", "example.com", null, "Windows")] | ||
[TestCase("ssh://[email protected]/Windows.git", "example.com", "Windows.git", null, | ||
Description = "We assume the first component is the owner even if it ends with .git")] | ||
[TestCase("[email protected]:/", "bar.com", null, null)] | ||
[TestCase("[email protected]/", "bar.com", null, null)] | ||
[TestCase("[email protected]", "bar.com", null, null)] | ||
[TestCase("[email protected]:/Windows.git", "bar.com", null, "Windows")] | ||
[TestCase("[email protected]/Windows.git", "baz.com", null, "Windows")] | ||
[TestCase("ssh://[email protected]:github/Windows.git", "github.com", "github", "Windows")] | ||
|
||
// NOTE: Used by LocalRepositoryModelTests.GenerateUrl but I don't think it's a legal URL | ||
[TestCase("[email protected]/foo/bar", "github.com", null, "foo/bar")] | ||
public void ParsesWeirdUrlsAsWellAsPossible(string url, string expectedHost, string owner, string repositoryName) | ||
{ | ||
var cloneUrl = new UriString(url); | ||
|
@@ -202,21 +209,6 @@ public void ConvertsWithNewOwner(string uriString, string expected, string owner | |
[TestCase("[email protected]:org/repo.git", "https://example.com/org/repo")] | ||
[TestCase("ssh://[email protected]:443/shana/cef", "https://github.com/shana/cef")] | ||
[TestCase("ssh://[email protected]:23/haacked/encourage", "https://example.com:23/haacked/encourage")] | ||
|
||
[TestCase("asdf", null)] | ||
[TestCase("", null)] | ||
[TestCase("file:///C:/dev/exp/foo", "file:///C:/dev/exp/foo")] | ||
[TestCase("http://example.com/", "http://example.com/")] | ||
[TestCase("http://[email protected]/foo/bar", "http://example.com/foo/bar")] | ||
[TestCase("https://github.com/github/Windows", "https://github.com/github/Windows")] | ||
[TestCase("https://github.com/github/Windows.git", "https://github.com/github/Windows")] | ||
[TestCase("https://[email protected]/github/Windows.git", "https://github.com/github/Windows")] | ||
[TestCase("http://example.com:4000/github/Windows", "http://example.com:4000/github/Windows")] | ||
[TestCase("[email protected]:github/Windows.git", "https://192.168.1.2/github/Windows")] | ||
[TestCase("[email protected]:org/repo.git", "https://example.com/org/repo")] | ||
[TestCase("ssh://[email protected]:443/shana/cef", "https://github.com/shana/cef")] | ||
[TestCase("ssh://[email protected]:23/haacked/encourage", "https://example.com:23/haacked/encourage")] | ||
|
||
public void ShouldNeverThrow(string url, string expected) | ||
{ | ||
Uri uri; | ||
|
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.
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.
vpath
here suggests "virtual path" which I assume is because enterprise installations can have a virtual path before the owner? I this PR changes the parsing of this to not work with vpaths, but maybe we should change the stringvpath
to something else here?