Repository navigation
Jujutsu support after V2: direction and scope for a focused stack #18468
Replies: 2 comments 7 replies
|
@juliusmarminge @omarshaarawi this is mostly my original #11373 to #11384 stack, rebased onto current main and corrected against what's changed since and the review feedback on #13816 and #16380, now up as draft PRs: #20749 #20750 #20751 #20752 #20753 #20754 #20755 #20756. It follows Omar's plan here, and knocking4thcylinder's and Omar's fixes are credited on the commits that use them. Omar, this isn't meant to step on you picking it up, happy for you to drive review or take over any of the PRs. Where it differs from the proposal:
Typed |
|
I've proposed a much smaller opt-in alternative in #21171, in case native jj takes a while. Happy to drop it if your stack lands first. |
Uh oh!
There was an error while loading. Please reload this page.
@juliusmarminge when you closed #2461 you said to port jj to V2 once #2829 merged, and to ping you. #2829 merged on Oct 2. Since then you closed #13816 for missing approval, and #16380 has had no commits since Oct 6 and now conflicts with main. I'm picking this up and will stay on it through review. Before I write code, I'd like your sign-off on the direction and scope below, per the prior-approval rule in CONTRIBUTING.
Every PR in the stack keeps the original authorship from Jacob Sanderson's #11373, #11382, #11383 and #11384, knocking4thcylinder's #13816, and gergesh's #16380. The tracking issue is #1126.
Scope
In scope:
.git, so diffs, checkpoint refs and hosting keep using git. When a jj repo has no reachable.gitorjjis older than 0.42, the driver reports the repo as unsupported and gives the reason. It never falls back to treating the repo as git.vcs: { kind, unsupportedReason? }field on status. The server omits it for git, so a newer client treats an older server's status as git.Out of scope unless you want it:
jj git init --colocate. It's a new workflow, and your close note on feat(jj): support colocated Jujutsu repositories #13816 named it. It can be its own proposal.Architecture
This section answers the four blockers from your second review on #2461.
A typed jj service.
VcsDriverstays the generic driver for detection, files, remotes, ignores, checkpoints and diff preview. jj gets its own service, which includes everything inVcsDriverand adds jj operations. Code that needs jj behavior yieldsJjVcsDriverdirectly, so the compiler enforces it and no capability flag is involved.The workflow layer above the drivers stays as it is. Git and jj each implement
VcsWorkflowOps, which already defines every action the clients send, and the workflow service picks an implementation per call from the detected kind. When a call names a workspace path, the path's kind wins over the project's, so a git worktree created before jj detection stays removable. Op log and evolution methods go onJjVcsDriverwhen a feature needs them, and not before.Capability flags. Nothing on main reads
supportsWorktrees,supportsBookmarks,supportsAtomicSnapshotorsupportsPushDefaultRemote. I'd delete them in the first PR instead of adding jj values to flags with no API behind them.kindandignoreClassifierstay.Ignore rules.
JjVcsDriver.filterIgnoredPathsrunsgit check-ignore --no-indexagainst the colocated git dir and reportsignoreClassifier: "git-compatible-fallback". In a colocated repo jj and git read the same.gitignorefiles, so the result matches jj's own rules. No other jj code calls git for ignores.Effect services. The driver uses
FileSystem,Pathand the sharedVcsProcess. Every jj call setsgit.abandon-unreachable-commits=false, so a background read can never abandon a commit. Reads that don't need a fresh snapshot pass--ignore-working-copy.Landing plan
Each PR targets
main, merges on its own, and runs focused tests against a realjjbinary that CI installs with asetup-jjaction. Line counts come from the #16380 diff and include tests. The server-side jj code alone is about 9k lines, so I split it into five PRs.setup-jj. Auto-detection keeps preferring git, so users see no change.CheckpointStore.supportsCheckpointsinorchestration-v2/CheckpointService. About 1.6k lines.currentChangesnapshots the working copy, so every status poll of an open jj repo spawnsjj. This PR will include a measured comparison against git's poll cost, and will poll with--ignore-working-copyif snapshotting on every poll costs too much.Ask
Please approve or decline this direction and scope. One design point needs your call before PR 1. Your second review on #2461 asked for "a typed JJ extension service or extension registry shape". This proposal uses the first. If you want a registry of per-kind extensions instead, I'll build that.
All reactions