Skip to content

feat: add optional Jujutsu (jj) support [3 of 4]#96

Merged
agavra merged 1 commit intoagavra:mainfrom
martintrojer:feat/jj-support
Jan 15, 2026
Merged

feat: add optional Jujutsu (jj) support [3 of 4]#96
agavra merged 1 commit intoagavra:mainfrom
martintrojer:feat/jj-support

Conversation

@martintrojer
Copy link
Copy Markdown
Collaborator

Add jj backend using CLI commands, similar to hg support. Unify hg and jj diff parsers into shared diff_parser module with DiffFormat enum to handle format-specific differences.

Detection order: jj → git → hg (jj first since it's git-backed).

Copy link
Copy Markdown
Owner

@agavra agavra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me as well, thanks @martintrojer! Would be nice to get @YPares to confirm it works with their jj repos (I don't have any of my own to test, though when I have some time I'll spin some up to test this and hg before doing an official release)

@agavra
Copy link
Copy Markdown
Owner

agavra commented Jan 15, 2026

I'll merge this after we fix clippy problems

@YPares
Copy link
Copy Markdown
Collaborator

YPares commented Jan 15, 2026

So when running in a jj repo on an empty revision, it just displays:

Error: No changes to review

Make sure you're in a git or jujutsu repository with uncommitted changes.

whereas without the jj feature it displays me the latest commits (since it's also a git repo)

@martintrojer
Copy link
Copy Markdown
Collaborator Author

martintrojer commented Jan 15, 2026

So when running in a jj repo on an empty revision, it just displays:

Error: No changes to review

Make sure you're in a git or jujutsu repository with uncommitted changes.

whereas without the jj feature it displays me the latest commits (since it's also a git repo)

hrm, ok strange.

testing with some of my local jj repos gives me the expected tuicr ui.

Add jj backend using CLI commands, similar to hg support.
Unify hg and jj diff parsers into shared diff_parser module
with DiffFormat enum to handle format-specific differences.

Detection order: jj → git → hg (jj first since it's git-backed).
@martintrojer
Copy link
Copy Markdown
Collaborator Author

Wait, is the error specifically on an empty revision ? Maybe there is a problem in that case

@YPares
Copy link
Copy Markdown
Collaborator

YPares commented Jan 15, 2026

@martintrojer

Wait, is the error specifically on an empty revision ? Maybe there is a problem in that case

Yes, I get it specifically when I'm on an empty revision.

@agavra
Copy link
Copy Markdown
Owner

agavra commented Jan 15, 2026

I'm curious, if jj works with git whats the benefit of adding jj specific support? (I don't know much about jj at all)

@martintrojer
Copy link
Copy Markdown
Collaborator Author

I'm curious, if jj works with git whats the benefit of adding jj specific support? (I don't know much about jj at all)

Jj using git as 'blob storage' but it has many features on top

@agavra
Copy link
Copy Markdown
Owner

agavra commented Jan 15, 2026

Jj using git as 'blob storage' but it has many features on top

I'm specifically curious about how that interacts with tuicr. Do the diffs show up any differently? Is it a commit selection thing that would be different?

I'll go head and merge this change and we can follow-up with empty revision fix in the next PR.

I think once it's well tested we can remove the feature flags and include them in the main binary so people using brew can get it as well. It doesn't really add any extra dependencies so I'm fine with it (and I think the failures are silent if hg / jj command lines are not installed)

@YPares
Copy link
Copy Markdown
Collaborator

YPares commented Jan 15, 2026

@martintrojer I think @agavra was wondering about which JJ-specific features exactly tuicr could benefit. For now I believe the main point is to have tuicr work in "non-colocated" repos (ie. repos where the .git isn't exposed along with the .jj folder).

@agavra
Copy link
Copy Markdown
Owner

agavra commented Jan 15, 2026

Makes sense! Thanks for the clarification.

@agavra agavra merged commit 1bc1e74 into agavra:main Jan 15, 2026
4 checks passed
@YPares
Copy link
Copy Markdown
Collaborator

YPares commented Jan 15, 2026

Some visual aspects could change if using a JJ repo instead of a "bare" Git repo:

  • showing change ids along commit ids (or instead of commit ids)
  • showing branch names even if on detached HEAD (I saw this was already done), as JJ has no notion of "current branch" (branches are just aliases for revisions which don't move by themselves, basically they are just there for interop with Git remotes)

@martintrojer martintrojer deleted the feat/jj-support branch January 17, 2026 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants