Skip to content

VCS branch switcher #142

Closed as not planned
Closed as not planned

Description

@joelmoss

Wherever the branch/bookmark is mentioned (terminal pane footer, VCS sidebar header), allow a click to open a branch selector, and to click any branch in that list to switch the current branch in the selected workroom.

Activity

  1. joelmoss commented on Aug 14, 2026

    @joelmoss
    OwnerAuthor

    Conflicts with a decision made 5 days before this issue was filed. Commit a9838620 ("add a VCS toolbar to the top of the inspector") deliberately removed in-place branch switching from VCSToolbar.swift, with this doc comment on VCSBranchSegment:

    Workrooms are branches — a workroom's identity is its directory name, with no branch field anywhere in the config — so switching a workroom's branch would make its name permanently wrong, and the jj equivalent (jj new <bookmark>) was reproduced removing a file from the working copy and orphaning the workroom's commit. With switching gone there is no action left that belongs on the branch name, so this is a label: no Button, no hover well, no chevron.

    Two concrete blockers found for literal in-place switching, as requested here:

    1. git — internal/config has no branch field. A workroom's directory name is its identity (set at git worktree add -b time). Switching branch in place leaves the dir name permanently stale, with nothing to reconcile it.
    2. jj — jj new <bookmark> onto the bookmark the toolbar displays was measured to remove a file from the working copy and orphan the workroom's commit as a nameless dangling head, silently (no UI signal).

    TODOS.md:929-959 already tracks the sanctioned successor: "New workroom from branch…" — pick a local/remote branch from the toolbar's branch segment (or ⌘O) and create a new workroom checked out to it, instead of mutating an existing one. That reuses:

    • Views/OpenWorkroomDialog.swift — searchable, project-grouped picker to model the UI on
    • Go CLI's workroom create — already accepts a branch arg
    • CLIVCSWriter.gitRemoteRefsArgs — cheap remote-ref enumeration (git); no jj equivalent exists yet for listing bookmarks user-facing (only a private jjBookmarkListArgs/parseJJBookmarks pair in VCSWriting.swift used internally for ahead/behind, not exposed)

    No VCS-layer API exists today for either listing branches/bookmarks for a picker, or switching/checking out — both would be new work regardless of which direction this goes.

    Recommend closing this in favor of (or retitling to) the TODOS.md "New workroom from branch…" item, unless there's a reason to revisit the in-place-switch decision (e.g. the jj orphan bug gets root-caused and fixed, and a config branch field / rename-on-switch policy gets designed for git).

  2. joelmoss commented on Oct 7, 2026

    @joelmoss
    OwnerAuthor

    Closing as obsolete: in-place branch switching was removed on purpose. Workrooms are branches, so the branch segment in VCSToolbar.swift is display-only. Note: workroom create takes no branch argument today (cmd/create.go), so creating a workroom from an existing branch would need its own issue.

    🤖 Left by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestwontfixThis will not be worked on

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions