Skip to content

feature: drag a branch onto another branch to open a context menu with actions between them - #2884

Open
bertyhell wants to merge 3 commits into
sourcegit-scm:developfrom
bertyhell:feature/drag-branch-onto-branch
Open

bertyhell wants to merge 3 commits into
sourcegit-scm:developfrom
bertyhell:feature/drag-branch-onto-branch

Conversation

@bertyhell

Copy link
Copy Markdown

Summary

Drag a branch onto another branch to open a context menu with only the actions between those two branches.

  • Works in the branch trees and on branch labels in the commit graph (also across them)
  • Menu: Compare, Merge (when the target is checked out), Rebase / Interactive rebase (when the dragged branch is checked out), Create PR (local branches resolve to their upstream; cross-fork supported on GitHub)
  • While dragging: the dragged branch is faded, the branch under the pointer is highlighted, and a source → target label follows the pointer
  • Shared logic lives in BranchDragDrop; Remote.TryGetCreatePullRequestURL gained an overload with an explicit target branch

Screenshots

Dragging feature/drag-branch-onto-branch onto master in the graph:

Dragging a branch in the graph

The resulting menu:

Menu after dropping

Merge is greyed out here because master is not checked out; Create PR is greyed out because the dragged branch had not been pushed yet.

🤖 Generated with Claude Code

bertyhell and others added 3 commits November 11, 2026 14:12
…h actions between them

- Dropping branch S onto branch T opens a menu with: compare S with T, merge S
  into T (when T is current), rebase / interactive rebase S on T (when S is
  current) and create a PR from S into T (local branches resolve to their upstream)
- Works within and across the local and remote branch trees
- While dragging, the source row is faded, the row under the pointer is
  highlighted and a label (`source → target`) follows the pointer
- Add `Remote.TryGetCreatePullRequestURL` overload with an explicit target
  branch (cross-fork PRs supported for GitHub)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nches

- Branch labels in the commit graph can be dragged onto other branch labels in
  the graph or onto branches in the branch trees (and vice versa), opening the
  same context menu with the actions between the two branches
- While dragging, the dragged label in the graph is faded and the label under
  the pointer is highlighted
- Move the drag state, pointer label and branch-pair context menu out of
  `BranchTree` into a shared `BranchDragDrop` helper
- Add `CommitRefsPresenter.HitTestDecorator` for precise label hit-testing

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

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