Add switch branch (b): stage the tip and restore to it

b opens a centered popup with a search line and the local and remote
branches of the selection. Enter stages the branch tip as the pin of a
submodule, restores it (and everything below) to it, and puts HEAD on the
branch; a remote branch gets a local tracking branch unless one exists
elsewhere. Works on the superproject too. Losses are asked like restore.
The backdrop behind the popup is dimmed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 14:18:49 +02:00
co-authored by Claude Opus 5.5
parent b9f6055759
commit 2b6b781826
21 changed files with 1311 additions and 43 deletions
+2 -1
View File
@@ -111,6 +111,7 @@ files.
| `/` | Filter |
| `!` | Problems only |
| `c` | Copy path |
| `b` | Switch branch: pick a local or remote branch; its tip is staged and the repository restored to it |
| `x` | Restore: make the worktree exactly what git records (asks if work would be lost) |
| `f` / `r` | Fetch / reload |
| `?` | Full help |
@@ -121,7 +122,7 @@ The mouse works too: click to select, click `▸` to toggle, wheel to move.
## Status
A prototype. Browsing is complete, and `x` restores a submodule or the whole
superproject. More write actions (stage pin) are being specified in
superproject, and `b` switches its branch. More write actions (stage pin) are being specified in
[docs/actions.md](docs/actions.md).
## Documentation