Jujutsu support#754
Conversation
|
Hi @jennings — thanks for the contribution. Reading through the diff (1617 / 387 lines, 12+ files touched) my main concern isn't the work itself but the impact surface: agent-deck has a lot of users who'll never use jj, and the changes touch generic worktree / repo-detection paths that everyone exercises. Could you reshape this as opt-in via config? Concrete asks:
If reshaping is more than you want to take on, totally understand — let me know and we can either close politely with credit (your work stays in commit history) or I can pick up the reshape with you as What sounds right to you? |
|
Hi @jennings — wanted to update my earlier review. I read the diff more carefully, and my earlier 'config-gating' ask was redundant. What you've shipped already does the right thing:
That's exactly the safety property I was asking for, expressed via auto-detection instead of explicit One remaining concern (not a blocker): detection order is jj-first. If a repo has colocated jj+git layers, jj wins silently. For paranoid git users who don't realize their repo has a jj layer, that's a sharp edge. Optional follow-up — add a Path forward:
If you've moved on to other things and won't get to the rebase in the next few days, let me know and I can rebase + force-push on your behalf with |
|
Quick honest update, @jennings: I started taking over the rebase as offered earlier, but stopped partway in. Reason: your branch references a Given that, I'll wait for you to do the rebase. The architecture review still stands (it's good) — it's just the test/field naming alignment with v1.7.70 main that needs your eyes. When you're ready:
If you've genuinely moved on, no judgment — just say so and we'll close politely with credit. Either way your work history is preserved. |
Just making sure this is clear: A git user will never have a
Talking through how my branch works today:
Given all this, I think the settings should maybe be: [vcs]
preferred_backend = "auto" (default) | "jujutsu" | "git"
# auto = use jujutsu if .jj exists, git if .git, otherwise none
jujutsu-enabled = true # whether to _ever_ use jj, or to treat jj-only repos as not version controlledWhat do you think? |
|
Fair point @jennings — you're right. |
|
Thank you. I'll look into that and rebase, I don't recall why I'd be touching |
Create an abstraction vcs.Backend which abstracts over a working copy. For now, git.GitBackend is the only implementation. Instead of calling package functions `git.Foo(repoDir)`, now we construct a `git.GitBackend` and call `b.Foo()`.
Jujutsu repositories should create a jj workspace instead of a git worktree. However, the concepts are basically the same. Jujutsu doesn't actually require creating a named bookmark (branch), but removing the assumption that every worktree has a named branch would be a lot of work. To start, we can create and advance a bookmark as we do with git, then possibly relax that later.
|
@asheshgoplani I rebased and removed all the tests that used |
Adds support for Jujutsu repositories. Jujutsu (jj) is a git-compatible version control system. It has the concept of "workspaces" which are analogous to git worktrees.
Jujutsu repositories can be colocated with git repositories (the .jj directory is a sibiling of the .git directory it uses as its backing storage), so a directory may be both a Git repository and a jj repository. If so, prefer the jj repository.
This is a reopening of #302. I've been using this for several weeks without noticing any egregious bugs.