feat(vcs): let Git worktrees and Jujutsu workspaces coexist - #22
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Jujutsu status failures are masked as clean state, and several repository identity, configuration-write, and mobile terminology paths remain incorrect.
Review effort: Balanced
Findings: 2
Open (5)
What changed in this PR
Ports Jujutsu support while preserving existing Git worktrees and enabling gradual, backend-aware migration.
Changes:
- Adds Jujutsu detection, workspace lifecycle, checkpoints, diffs, remotes, and publishing.
- Propagates VCS terminology and agent hints across server, web, and mobile.
- Adds CI setup and architecture/user documentation.
| File | Description |
|---|---|
wiki/upstream-integration.md |
Records the selective upstream port. |
wiki/log.md |
Logs the compatibility update. |
packages/shared/src/vcs.ts |
Defines shared VCS terminology. |
packages/shared/src/git.ts |
Preserves VCS metadata in streamed status. |
packages/shared/src/git.test.ts |
Tests status metadata merging. |
packages/shared/package.json |
Exports the VCS helper. |
packages/contracts/src/settings.ts |
Adds configurable VCS agent hints. |
packages/contracts/src/provider.ts |
Carries per-turn VCS hints. |
packages/contracts/src/git.ts |
Adds VCS status metadata. |
docs/user/source-control.md |
Documents Jujutsu usage. |
docs/README.md |
Links Jujutsu internals. |
docs/internals/jujutsu.md |
Documents architectural constraints. |
apps/web/src/shared/hooks/useGitStatus.ts |
Exposes VCS-aware status. |
apps/web/src/settings/model.ts |
Models the hint setting. |
apps/web/src/components/settings/SourceControlSettings.tsx |
Adds global hint controls. |
apps/web/src/components/settings/ProjectSettings.tsx |
Adds project overrides. |
apps/web/src/components/git/useGitActions.ts |
Routes VCS-aware actions. |
apps/web/src/components/git/GitResetDialog.tsx |
Adapts reset terminology. |
apps/web/src/components/git/GitPublishDialog.tsx |
Adapts publishing terminology. |
apps/web/src/components/git/GitPullDialog.tsx |
Adapts pull terminology. |
apps/web/src/components/git/GitInitDialog.tsx |
Supports Jujutsu initialization. |
apps/web/src/components/git/GitCreateBranchDialog.tsx |
Supports bookmark creation. |
apps/web/src/components/git/GitCommitDialog.tsx |
Adapts commit terminology. |
apps/web/src/components/git/GitActionDialogs.tsx |
Propagates VCS context. |
apps/web/src/components/git/ChangedFilesList.tsx |
Uses VCS-aware labels. |
apps/web/src/components/chat/WorktreeSetupCard.tsx |
Updates setup presentation. |
apps/web/src/components/ThreadPanel.tsx |
Propagates thread VCS state. |
apps/web/src/components/ReviewPanel.tsx |
Adapts review terminology. |
apps/web/src/components/GitStatusPanel.tsx |
Adds Jujutsu-aware controls. |
apps/web/src/components/GitStatusButton.tsx |
Reflects VCS state. |
apps/web/src/components/GitStatusBadge.tsx |
Reflects VCS state. |
apps/web/src/components/GitInitPopup.tsx |
Offers Jujutsu setup. |
apps/web/src/components/GitBranchSelector.tsx |
Supports bookmark terminology. |
apps/web/src/components/GitBranchIndicator.tsx |
Displays VCS-aware refs. |
apps/web/src/components/GitBranchActionButton.tsx |
Adapts ref actions. |
apps/web/src/App.tsx |
Integrates VCS-aware UI state. |
apps/server/src/vcs/VcsTypes.ts |
Defines driver interfaces. |
apps/server/src/vcs/VcsProcess.ts |
Provides VCS command execution. |
apps/server/src/vcs/VcsDriverRegistry.ts |
Detects and selects drivers. |
apps/server/src/vcs/VcsStatusBroadcaster.ts |
Streams VCS-aware status. |
apps/server/src/vcs/VcsProjectConfig.ts |
Resolves project VCS selection. |
apps/server/src/vcs/VcsGit.ts |
Implements the Git driver. |
apps/server/src/vcs/VcsCommandService.ts |
Routes VCS commands. |
apps/server/src/vcs/WorkspaceOwnership.ts |
Persists workspace backend ownership. |
apps/server/src/vcs/JjWorkspaceIdentity.ts |
Resolves Jujutsu workspace identity. |
apps/server/src/jj/JjTypes.ts |
Defines Jujutsu-specific types. |
apps/server/src/jj/JjStatus.ts |
Implements Jujutsu status. |
apps/server/src/jj/JjReviewDiff.ts |
Produces Jujutsu review diffs. |
apps/server/src/jj/JjRemotes.ts |
Handles Jujutsu remotes and publishing. |
apps/server/src/jj/JjRepo.ts |
Resolves colocated repositories. |
apps/server/src/jj/JjRevisions.ts |
Resolves Jujutsu revisions. |
apps/server/src/jj/JjProcess.ts |
Runs Jujutsu commands. |
apps/server/src/jj/JjOperations.ts |
Implements Jujutsu operations. |
apps/server/src/vcs/JjCheckpoints.ts |
Captures and restores checkpoints. |
apps/server/src/jj/JjChangeAttribution.ts |
Attributes Jujutsu changes. |
apps/server/src/sourceControl/SourceControlRepositoryService.ts |
Adds Jujutsu publishing paths. |
apps/server/src/serverRuntimeStartup.ts |
Registers VCS services. |
apps/server/src/project/RepositoryIdentityResolver.ts |
Resolves Jujutsu repository identity. |
apps/server/src/provider/Layers/OpenCodeAdapter.ts |
Injects VCS agent hints. |
apps/server/src/provider/Layers/CodexAdapter.ts |
Refreshes Codex VCS hints. |
apps/server/src/orchestration/Layers/ProviderCommandReactor.ts |
Resolves hints per turn. |
apps/server/src/orchestration/Layers/CheckpointReactor.ts |
Reports checkpoint exclusions. |
apps/server/src/orchestration/ThreadCommandDispatcher.ts |
Propagates backend selection. |
apps/server/src/jj/JjWorkspaces.ts |
Manages Jujutsu workspaces. |
apps/server/src/git/GitWorkflowService.ts |
Routes mixed-backend lifecycle operations. |
apps/server/src/git/GitStatus.ts |
Integrates driver status. |
apps/server/src/git/GitWorktreeService.ts |
Preserves Git worktree behavior. |
apps/server/src/git/GitReviewDiff.ts |
Resolves VCS-aware revisions. |
apps/server/src/git/Git.ts |
Integrates VCS services. |
apps/server/src/checkpointing/CheckpointService.ts |
Delegates checkpoint operations. |
apps/server/src/__tests__/testServerHarness.ts |
Supports VCS integration tests. |
apps/mobile/src/features/settings/settings.ts |
Models mobile VCS settings. |
apps/mobile/src/features/settings/SettingsSourceControlScreen.tsx |
Adds mobile hint controls. |
apps/mobile/src/features/review/reviewModel.ts |
Adds VCS-aware review labels. |
apps/mobile/src/features/review/ReviewSections.tsx |
Renders VCS terminology. |
apps/mobile/src/features/threads/worktree-setup-card.tsx |
Adds setup terminology support. |
apps/mobile/src/features/threads/ThreadGitControls.tsx |
Adds Jujutsu-aware controls. |
apps/mobile/src/features/threads/GitOverviewSheet.tsx |
Adapts mobile status UI. |
apps/mobile/src/features/threads/ThreadDetailScreen.tsx |
Resolves thread terminology. |
apps/mobile/src/features/projects/ProjectsScreen.tsx |
Adds Jujutsu project actions. |
apps/mobile/src/features/newThread/NewThreadScreen.tsx |
Inherits project backends. |
apps/mobile/src/features/more/MoreScreen.tsx |
Exposes source-control settings. |
apps/mobile/src/components/CloneRepositoryDialog.tsx |
Supports VCS-aware cloning. |
apps/mobile/src/app/RootNavigator.tsx |
Registers source-control navigation. |
.github/workflows/ci.yml |
Installs Jujutsu for CI. |
.github/actions/setup-jj/action.yml |
Defines pinned Jujutsu installation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+75
to
+82
| const write = (key: string, value: string) => | ||
| JjProcess.colocatedGitCommand( | ||
| process, | ||
| "JjRemotes.writeBookmarkUpstreamConfig", | ||
| { gitDir, cwd: input.cwd }, | ||
| ["config", key, value], | ||
| { allowNonZeroExit: true, timeoutMs: 10_000 }, | ||
| ).pipe(Effect.ignore); |
Comment on lines
+308
to
+318
| const readings = yield* Effect.all({ | ||
| change: driver.currentChange(input.cwd), | ||
| segment: driver.currentSegment(input.cwd), | ||
| }).pipe(Effect.option); | ||
|
|
||
| if (readings._tag === "None") { | ||
| return { isRepo: true, vcs: { kind: "jj" as const }, ...EMPTY_LOCAL_STATUS }; | ||
| } | ||
|
|
||
| const refName = yield* resolveWorkspaceRefName(driver, input.cwd, readings.value.segment); | ||
| const files = readings.value.change.fileStats |
Comment on lines
+128
to
+129
| export function resolveRepositoryRootFromMarkers(cwd: string): string | null { | ||
| let current = cwd; |
Comment on lines
+127
to
+129
| function workingTreeSubtitle(terminology: VcsTerminology): string { | ||
| return `Tracked, staged, and untracked ${terminology.workspaceNoun} changes`; | ||
| } |
Comment on lines
17
to
+18
| export interface WorktreeSetupCardProps { | ||
| vcsTerminology?: VcsTerminology; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Moving a project to Jujutsu needs to be gradual: existing Git worktree threads must keep working while new threads use Jujutsu workspaces. Cleanup, restart, rewind, and publishing must preserve the original workspace backend and its work.
Selectively port upstream #13816, preserving the fork's configured workspace layout, discovery, review authorization, and provider behavior. Record workspace ownership in shared Git config, recover through the original backend, and preserve recreation refs before removal. Resolve Jujutsu revisions before Git history reads and explicitly synchronize named refs for hosting operations.
Checkpoints include new files up to 10 MiB and report unexpected exclusions in thread activities. Web, desktop, and mobile expose Jujutsu-aware source-control actions and an inheritable VCS-agent-hints setting; hints refresh for existing/resumed sessions and Codex compaction. New isolated threads inherit the project backend automatically.
Test plan
jj 0.45.1./Users/nicholas/Documents/Projects/t3code. Verified that/Applications/T3 Code (Alpha).appresolves to the rebuilt app, packaged as version0.0.44witht3codeCommitHash: 103232e31592.Rollout note
Merged into fork
mainat103232e31592. The normal local checkout and this OpenCode session are onmain; the desktop artifact is ready for the next app restart. GitHub CI jobs were still queued when the PR merged; the completed verification above was run locally.Requires a Git-colocated main checkout and
jj >= 0.42.0on each server host. Secondary Jujutsu workspaces need no.git. Existing Git threads remain Git after cleanup/recreation and phase out as they finish. Remote runtime deployment is a separate coordinated restart.Implemented with GPT-6.1 Sol (
openai/gpt-6.1-sol) in the OpenCode harness.