Branch Switching Plugin
The Branch Switching plugin lets each conversation work on a different git (or SVN) branch. When Workspace Isolation is active, checkout happens inside that conversation's sandbox and does not change the host working copy.
Requirements
- Workspace Isolation is required for checkout. Without it, branch selection is stored but checkout is skipped and a warning is logged — the host working copy is never changed.
- Git must be on
PATH(andsvnif you switch SVN repos; see SVN).
Configuration
plugins:
- module: codumentor.plugins.branch_switching
class: BranchSwitchingPlugin
args:
enabled: true
overlay_indexing: true # default: true
overlay_sweep_interval_seconds: 900 # default: 900; 0 disables
| Parameter | Type | Default | Description |
|---|---|---|---|
enabled | bool | true | Whether the plugin is active. |
overlay_indexing | bool | true | Build a branch-specific search overlay of files that differ from the default branch, so semantic search reflects the selected branch without re-indexing the whole repository. Disable to save disk and compute; search on non-default branches then uses the default-branch index. |
overlay_sweep_interval_seconds | int | 900 | How often overlays are re-checked for staleness and rebuilt if the branch or base commit has moved. 0 disables the periodic sweep (overlays still rebuild after ingest/fetch). |
How it works
Branch selection
Users pick a branch per repository from the Branch Selector on the welcome / repos panel. The choice is stored with the conversation. A Branch Banner in the conversation header shows the active branch. Permalink uses that branch when it builds links.
Isolated checkout
When the conversation starts:
- With workspace isolation: checkout runs inside the sandbox overlay. Other conversations and the host checkout are unaffected. For git, HEAD is pinned to a private per-session branch so later host commits do not leak into the overlay as staged changes. SVN has no local refs of that kind, so it switches the working copy URL directly.
- Without isolation: checkout is skipped.
Overlay indexing
When overlay_indexing is true, a per-branch search overlay is built in the background and rebuilt when the branch tip or the default-branch base commit changes. Overlays unused for 7 days are cleaned up. At most one build runs per (repo, branch) at a time.
Admins can inspect, force-rebuild, bulk-rebuild stale/errored, or delete overlays from Branch Overlays at the bottom of the Ingestion page (/admin/ingest).
Interrupted builds (server restart while a build was in progress) are recovered on the next startup.
See also
- Workspace Isolation — required for safe isolated checkouts
- SVN — SVN branch listing and switching
- Permalink — uses the conversation's active branch in generated links