Skip to content

feat(vcs): add read-only jj repository support#31

Merged
mabd-dev merged 5 commits into
mabd-dev:feat/jjSupportfrom
frittlechasm:feat/jjsupport
May 2, 2026
Merged

feat(vcs): add read-only jj repository support#31
mabd-dev merged 5 commits into
mabd-dev:feat/jjSupportfrom
frittlechasm:feat/jjsupport

Conversation

@frittlechasm
Copy link
Copy Markdown
Contributor

Adds read-only support for scanning jj repositories alongside Git repositories.

Changes include:

  • Created a VCS abstraction so RepoScan can handle more than Git.
  • Added Git and jj providers under internal/vcs.
  • Detects jj repositories by .jj directories.
  • Scans jj repos without mutating them.
  • Reports jj repo metadata:
    • path
    • repo name
    • VCS type ( in JSON report )
    • bookmark/change display
    • uncommitted file summaries
    • outgoing tracked bookmark commits
  • Maps jj outgoing commit count into RemoteStatus.Ahead, so dirty and unpushed filters work for jj repos.
  • Shows jj outgoing commits in stdout/TUI details.
  • Handles missing jj binary with a warning instead of crashing.
  • Added test coverage for jj detection, provider routing, dirty jj repos, outgoing commits, and missing binary behavior.
  • go test ./... passes.

Copy link
Copy Markdown
Owner

@mabd-dev mabd-dev left a comment

Choose a reason for hiding this comment

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

thank you for the contribution. Overall the code look clean and well made

Comment thread internal/vcs/types.go Outdated
Comment thread pkg/report/report.go Outdated
VCSType string `json:"vcsType"`
Branch string `json:"branch"`
UncommitedFiles []string `json:"uncommitedFiles"`
OutgoingCommits []string `json:"outgoingCommits"`
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

why this exists here? i don't like the idea that only support jj. same thing if we have a variable here that is only supported by git.
Maybe this struct can be remodeled to handle both jj and git repo. For now, it's this is fine. Will look into it later

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In jj, a commit is the unit of work so more than looking at uncommitted files , being able to see the number of outgoing commits makes more sense.

I can either remove OutgoingCommits entirely for now and use RemoteStatus.Ahead which should give us the count of number of commits which are ahead. OutgoingCommits would have actually shown what those commits are.
Another approach is to add GIT support for Outgoing Commits. This way there will be no variables that are vcs specific.

Let me know which approach you think is best here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It might more sense to add OutgoingCommits to RemoteStatus instead of Repostate as conceptually it belongs near sync state.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Making git support outgoing commits make sense. And yes, I do agree that OutgoingCommits should be in RemoteStatus not RepoState

Comment thread internal/vcs/git/git.go Outdated
}

func (p *Provider) CheckRepoState(path string) (report.RepoState, []string) {
state, warnings := gitx.CheckRepoState(path)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

hmm, should we move all gitx package files to vcs/git package?
I guess this is the right thing to do, since they will only be used in here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Makes sense I will move the gitx package files to internal/vcs/git ..
I will keep the internal/render/tui as is for now as we have no jj actions.
Let me know if that's okay.

If not I will create interfaces similar to internal/vcs/provider.go for the various actions.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

yes, keep internal/render/tui as is for now

Comment thread internal/vcs/concurrent.go
@frittlechasm
Copy link
Copy Markdown
Contributor Author

updated the PR with the relevant changes

Copy link
Copy Markdown
Owner

@mabd-dev mabd-dev left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you for you work @frittlechasm

@mabd-dev mabd-dev merged commit 0d5e7c0 into mabd-dev:feat/jjSupport May 2, 2026
1 check passed
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.

Feature Request: Add Jujutsu (jj) repository support

2 participants