Skip to content

feature: Create PR's between branches for common git platforms - #2802

Open
bertyhell wants to merge 6 commits into
sourcegit-scm:developfrom
bertyhell:feature/create-pr-dialog
Open

bertyhell wants to merge 6 commits into
sourcegit-scm:developfrom
bertyhell:feature/create-pr-dialog

Conversation

@bertyhell

Copy link
Copy Markdown

What

Right-click another branch → Create PR: current → remote/branch... now opens a dialog instead of jumping straight to the browser.

image image image

The dialog lets you:

  • see the source branch (the current one) and pick the target from a searchable list of remote branches
  • edit the title and description, which are prefilled from the commits in target..source:
    • single commit: its subject and body
    • several commits: the branch name as the title, and a list of commit subjects as the body
  • pick a PR/MR template found in the target branch (.github/pull_request_template.md, .github/PULL_REQUEST_TEMPLATE/*.md, .gitlab/merge_request_templates/*.md, .gitea/, .azuredevops/, docs/, ...)
  • push the source branch first, if it has no upstream or has unpushed commits. For a new branch you choose the remote, which defaults to DefaultRemote, then a remote other than the target's (your fork)

OK opens the platform's "create pull request" page with source, target, title and description prefilled. Nothing is created through an API, and no tokens are needed.

Entry points:

  • branch tree: remote branch context menu, and Create PR for upstream ... on local branches (now opens the dialog)
  • history graph: branch submenus of the commit context menu

Platforms

Platform Target branch Title / body prefill Cross-fork PR
GitHub / GitHub Enterprise ✔ ✔ ✔ (owner:branch)
GitLab / self-managed ✔ ✔ ✔ (opened from the fork project)
Gitea ✔ ✔ ✔
Forgejo / Codeberg ✔ clipboard ✔
Bitbucket Cloud ✔ clipboard –
Azure DevOps ✔ clipboard –
Gitee ✔ clipboard –

When a platform can't prefill a field, or the URL would get too long (> 7000 chars), the title and description are copied to the clipboard and a notification says so.

For self-hosted servers whose host name doesn't reveal the platform, the dialog shows a Platform dropdown. The choice is saved per remote in sourcegit.settings.

Also fixed

Web URLs of SSH remotes:

  • ssh://[user@]host[:port]/path and user@host:path remotes are now converted, not just git@host:path.git
  • Azure DevOps SSH remotes (v3/{org}/{project}/{repo}) map to their web URL
  • the HTTPS check for SSH hosts runs again: HTTPSValidator.Add stopped being called in 582c1a2, so SSH remotes always got http://

Notes

  • Only en_US strings were added.
  • Text.BranchCM.CreatePR now takes two arguments (Create PR: ${0}$ → ${1}$...). Other locales keep showing their existing "Create PR..." text until translated.
  • Remote.TryGetCreatePullRequestURL is replaced by Models.PullRequestPlatform.

bertyhell and others added 6 commits October 14, 2026 08:10
- Support `ssh://[user@]host[:port]/path` and `user@host:path` remotes (not only `git@host:path.git`)
- Map Azure DevOps SSH remotes (`v3/{org}/{project}/{repo}`) to their web URL
- Restore the HTTPS probe for SSH hosts (`HTTPSValidator.Add` was no longer called since 582c1a2) and treat well-known hosts as HTTPS

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- `Models.PullRequestPlatform` detects GitHub, GitLab, Gitea, Forgejo/Codeberg, Bitbucket Cloud, Azure DevOps and Gitee, and builds the create-PR page URL with source, target, and (where supported) title/body, including cross-fork PRs
- Per-remote platform override stored in `sourcegit.settings` for self-hosted servers that can not be detected by host name
- `Commands.QueryRemoteHead` to resolve a remote's default branch

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Right-click a remote branch while on another branch: `Create PR: <current> → <remote/branch>...`
- `Create PR for upstream ...` (local branch, or the upstream remote branch of current) opens the same dialog, targeting the remote's default branch
- Dialog with searchable target branch, title and description prefilled from commits and the repository's PR/MR templates
- Optionally push the source branch first (with `-u` and a remote choice when it has no upstream)
- Opens the platform's prefilled create page; fields the platform can not prefill are copied to the clipboard
- Asks for the hosting platform when it can not be detected from host name and remembers it per remote

Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch has not been deployed

No deployments
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.

1 participant