-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Copy branch url to clipboard #3343
Open
skolj
wants to merge
12
commits into
jesseduffield:master
Choose a base branch
from
skolj:copy-branch-url-to-clipboard
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
3476858
add branch url to definitions
skolj 7d4e8de
add localized strings
skolj 0964316
consider upstream remote when checking if remote branch exists
skolj 1f6d83f
add get branch url helpers
skolj fd32f17
replace CopyPullRequestURL config option with CopyBranchAttributeToCl…
skolj e5371cc
add copy to clipboard menu for branches view
skolj 6821eed
update cheatsheets
skolj 7cea446
disable copy options for branches with no remotes
skolj b499c5f
reuse CopyToClipboard action string
skolj 7f6cfa7
fix yaml field tag
skolj b22b795
update cheatsheets
skolj 9e10655
Merge branch 'master' into copy-branch-url-to-clipboard
skolj 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
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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 |
---|---|---|
|
@@ -15,6 +15,7 @@ var githubServiceDef = ServiceDefinition{ | |
pullRequestURLIntoDefaultBranch: "/compare/{{.From}}?expand=1", | ||
pullRequestURLIntoTargetBranch: "/compare/{{.To}}...{{.From}}?expand=1", | ||
commitURL: "/commit/{{.CommitSha}}", | ||
branchURL: "/tree/{{.BranchName}}", | ||
regexStrings: defaultUrlRegexStrings, | ||
repoURLTemplate: defaultRepoURLTemplate, | ||
} | ||
|
@@ -24,6 +25,7 @@ var bitbucketServiceDef = ServiceDefinition{ | |
pullRequestURLIntoDefaultBranch: "/pull-requests/new?source={{.From}}&t=1", | ||
pullRequestURLIntoTargetBranch: "/pull-requests/new?source={{.From}}&dest={{.To}}&t=1", | ||
commitURL: "/commits/{{.CommitSha}}", | ||
branchURL: "/src/{{.BranchName}}", | ||
regexStrings: []string{ | ||
`^(?:https?|ssh)://.*/(?P<owner>.*)/(?P<repo>.*?)(?:\.git)?$`, | ||
`^.*@.*:(?P<owner>.*)/(?P<repo>.*?)(?:\.git)?$`, | ||
|
@@ -36,6 +38,7 @@ var gitLabServiceDef = ServiceDefinition{ | |
pullRequestURLIntoDefaultBranch: "/-/merge_requests/new?merge_request[source_branch]={{.From}}", | ||
pullRequestURLIntoTargetBranch: "/-/merge_requests/new?merge_request[source_branch]={{.From}}&merge_request[target_branch]={{.To}}", | ||
commitURL: "/-/commit/{{.CommitSha}}", | ||
branchURL: "/-/tree/{{.BranchName}}", | ||
regexStrings: defaultUrlRegexStrings, | ||
repoURLTemplate: defaultRepoURLTemplate, | ||
} | ||
|
@@ -45,6 +48,7 @@ var azdoServiceDef = ServiceDefinition{ | |
pullRequestURLIntoDefaultBranch: "/pullrequestcreate?sourceRef={{.From}}", | ||
pullRequestURLIntoTargetBranch: "/pullrequestcreate?sourceRef={{.From}}&targetRef={{.To}}", | ||
commitURL: "/commit/{{.CommitSha}}", | ||
branchURL: "?version=GB{{.BranchName}}", | ||
regexStrings: []string{ | ||
`^[email protected].*/(?P<org>.*)/(?P<project>.*)/(?P<repo>.*?)(?:\.git)?$`, | ||
`^https://.*@dev.azure.com/(?P<org>.*?)/(?P<project>.*?)/_git/(?P<repo>.*?)(?:\.git)?$`, | ||
|
@@ -57,6 +61,7 @@ var bitbucketServerServiceDef = ServiceDefinition{ | |
pullRequestURLIntoDefaultBranch: "/pull-requests?create&sourceBranch={{.From}}", | ||
pullRequestURLIntoTargetBranch: "/pull-requests?create&targetBranch={{.To}}&sourceBranch={{.From}}", | ||
commitURL: "/commits/{{.CommitSha}}", | ||
branchURL: "/browse?at=refs/heads/{{.BranchName}}", | ||
regexStrings: []string{ | ||
`^ssh://git@.*/(?P<project>.*)/(?P<repo>.*?)(?:\.git)?$`, | ||
`^https://.*/scm/(?P<project>.*)/(?P<repo>.*?)(?:\.git)?$`, | ||
|
@@ -69,6 +74,7 @@ var giteaServiceDef = ServiceDefinition{ | |
pullRequestURLIntoDefaultBranch: "/compare/{{.From}}", | ||
pullRequestURLIntoTargetBranch: "/compare/{{.To}}...{{.From}}", | ||
commitURL: "/commit/{{.CommitSha}}", | ||
branchURL: "/src/branch/{{.BranchName}}", | ||
regexStrings: defaultUrlRegexStrings, | ||
repoURLTemplate: defaultRepoURLTemplate, | ||
} | ||
|
This file contains 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 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 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 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
Oops, something went wrong.
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.
I take it these are correct because I've only checked for
github
.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.
I couldn't verify the branch URL for bitbucket server. The others should be correct.