Skip to content

Conversation

@calobozan
Copy link

Summary

Adds a new keybinding (ctrl+u by default) to copy the branch URL to the clipboard, similar to the existing 'copy pull request URL' feature.

Closes #1959

Changes

  • Add branchURL template to ServiceDefinition for all supported providers:
    • GitHub: /tree/{{.BranchName}}
    • GitLab: /-/tree/{{.BranchName}}
    • Bitbucket: /src/{{.BranchName}}
    • Azure DevOps: ?version=GB{{.BranchName}}
    • Bitbucket Server: /browse?at={{.BranchName}}
    • Gitea: /src/branch/{{.BranchName}}
    • Codeberg: /src/branch/{{.BranchName}}
  • Add GetBranchURL method to HostingServiceMgr and HostHelper
  • Add copyBranchURL handler in BranchesController
  • Add keybinding config (Branches.CopyBranchURL)
  • Add translations for UI strings
  • Add tests for GetBranchURL

Testing

  • All existing tests pass
  • Added new tests for GetBranchURL covering GitHub, GitLab, Bitbucket, Gitea, and Codeberg

Adds a new keybinding (ctrl+u by default) to copy the branch URL to the
clipboard, similar to the existing 'copy pull request URL' feature.

Closes jesseduffield#1959

- Add branchURL template to ServiceDefinition for all supported providers:
  - GitHub: /tree/{{.BranchName}}
  - GitLab: /-/tree/{{.BranchName}}
  - Bitbucket: /src/{{.BranchName}}
  - Azure DevOps: ?version=GB{{.BranchName}}
  - Bitbucket Server: /browse?at={{.BranchName}}
  - Gitea: /src/branch/{{.BranchName}}
  - Codeberg: /src/branch/{{.BranchName}}
- Add GetBranchURL method to HostingServiceMgr and HostHelper
- Add copyBranchURL handler in BranchesController
- Add keybinding config (Branches.CopyBranchURL)
- Add translations for UI strings
- Add tests for GetBranchURL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copy branch URL to clipboard

1 participant