feat: add copy branch URL keybinding to branches panel#5333
Open
tiwari91 wants to merge 1 commit intojesseduffield:masterfrom
Open
feat: add copy branch URL keybinding to branches panel#5333tiwari91 wants to merge 1 commit intojesseduffield:masterfrom
tiwari91 wants to merge 1 commit intojesseduffield:masterfrom
Conversation
Add a new keybinding (<c-u>) in the branches panel to copy the branch's web URL to the clipboard (e.g. https://github.com/user/repo/tree/branch). Follows the same pattern as the existing "copy pull request URL" feature. Supports GitHub, GitLab, Bitbucket, Azure DevOps, Bitbucket Server, Gitea, and Codeberg. Closes jesseduffield#1959
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 free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
<c-u>) in the branches panel to copy the selected branch's web URL to the clipboard/tree/), GitLab (/-/tree/), Bitbucket (/src/), Azure DevOps (?version=GB), Bitbucket Server (/browse?at=), Gitea (/src/branch/), and Codeberg (/src/branch/)<c-y>) featureCloses #1959
Changes
definitions.go— addedbranchURLtemplate to all 7 service definitionshosting_service.go— addedbranchURLfield,getBranchURLonService,GetBranchURLonHostingServiceMgrhost_helper.go— addedGetBranchURLhelperuser_config.go— addedCopyBranchURLconfig with default<c-u>english.go— added translation strings (description, toast, action, keybinding label)branches_controller.go— registered keybinding andcopyBranchURL()handlerhosting_service_test.go— addedTestGetBranchURLwith 13 scenarios covering all servicesTest plan
go test ./pkg/commands/hosting_service/...passesgo build ./...succeeds<c-u>— branch URL should be copied and a toast shown