Skip to content

docs: prefer jj over git for VCS operations#73

Merged
TSavo merged 2 commits intomainfrom
chore/jj-vcs-rule
Mar 11, 2026
Merged

docs: prefer jj over git for VCS operations#73
TSavo merged 2 commits intomainfrom
chore/jj-vcs-rule

Conversation

@TSavo
Copy link
Contributor

@TSavo TSavo commented Mar 11, 2026

Adds jj (Jujutsu) preference rule to CLAUDE.md so agents use jj instead of git.

Summary by Sourcery

Documentation:

  • Add guidance to use jj (Jujutsu) for common VCS workflows, falling back to git only when necessary.

Copilot AI review requested due to automatic review settings March 11, 2026 19:11
@TSavo TSavo enabled auto-merge March 11, 2026 19:11
@sourcery-ai
Copy link

sourcery-ai bot commented Mar 11, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Documents a project-wide preference for using the jj (Jujutsu) CLI instead of git for version-control operations in CLAUDE.md, including example commands and a fallback rule.

Flow diagram for choosing jj vs git for VCS operations

flowchart TD
  A_start["Start VCS_operation"] --> B_determine["Determine_operation_type"]
  B_determine --> C_supported{Operation_supported_by_jj}
  C_supported -- Yes --> D_use_jj["Use_jj_command"]
  D_use_jj --> D1_inspect["For_inspection_use_jj_status_jj_diff_jj_log"]
  D_use_jj --> D2_change["For_new_change_use_jj_new_and_jj_describe"]
  D_use_jj --> D3_commit["For_commit_push_use_jj_commit_and_jj_push"]
  D_use_jj --> D4_history["For_history_manipulation_use_jj_squash_jj_rebase_jj_edit"]
  D1_inspect --> E_end["Operation_complete"]
  D2_change --> E_end
  D3_commit --> E_end
  D4_history --> E_end
  C_supported -- No --> F_use_git["Fallback_to_git_for_this_operation_only"]
  F_use_git --> E_end
Loading

File-Level Changes

Change Details Files
Document jj (Jujutsu) as the preferred VCS tool over git, with concrete command guidance and fallback behavior.
  • Add a dedicated 'Version Control: Prefer jj' section to the contributor/agent guidance document.
  • List common inspection commands (status, diff, log) using jj equivalents.
  • Document workflow commands for starting, describing, committing, and pushing changes using jj.
  • Document history-manipulation commands (squash, rebase, edit) using jj.
  • Clarify that git should only be used as a fallback for operations not yet supported by jj.
CLAUDE.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the repository’s agent/developer guidance to prefer Jujutsu (jj) over git for version control operations, aligning VCS instructions in CLAUDE.md with the new workflow preference.

Changes:

  • Add a “Version Control: Prefer jj” section to CLAUDE.md.
  • Document common jj commands for inspection, starting changes, committing/pushing, and history edits.
  • Note a fallback to git for unsupported operations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

Warning

Rate limit exceeded

@TSavo has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 13 minutes and 9 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7d971181-fa6a-4728-9605-79c33de9424b

📥 Commits

Reviewing files that changed from the base of the PR and between 1b41dc0 and 41ffc25.

📒 Files selected for processing (1)
  • CLAUDE.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/jj-vcs-rule

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Consider briefly clarifying how to proceed in environments where jj is not installed (e.g., whether it’s acceptable to fall back to git by default or whether installing jj is expected).
  • It may help future readers to add a short note that jj operates on the same underlying Git repository so they understand that using jj won’t break existing Git-based workflows.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider briefly clarifying how to proceed in environments where `jj` is not installed (e.g., whether it’s acceptable to fall back to `git` by default or whether installing `jj` is expected).
- It may help future readers to add a short note that `jj` operates on the same underlying Git repository so they understand that using `jj` won’t break existing Git-based workflows.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@greptile-apps
Copy link

greptile-apps bot commented Mar 11, 2026

Greptile Summary

This PR adds a "Version Control: Prefer jj" section to CLAUDE.md, instructing AI agents to use Jujutsu (jj) instead of git for all VCS operations in this repository, with a fallback to git for unsupported operations.

  • The guidance covers inspection (jj status, jj diff, jj log), change creation (jj new, jj describe), committing/pushing (jj commit, jj push), and history manipulation (jj squash, jj rebase, jj edit)
  • The jj push instruction is incomplete for GitHub PR workflows: in Jujutsu, pushing a new branch requires first creating a named bookmark (jj bookmark create <name>), otherwise jj push silently pushes nothing for the current change and agents would need to fall back to git without understanding why

Confidence Score: 4/5

  • Safe to merge with a minor correction to the push workflow guidance for GitHub PR branch creation.
  • This is a documentation-only change with no code impact. The jj preference is a legitimate and reasonable workflow instruction for AI agents. The only gap is the missing jj bookmark create step that agents would need to successfully push a new branch for a PR, which could cause silent failures and unnecessary git fallbacks — but this doesn't block merging, it just reduces the practical effectiveness of the guideline.
  • CLAUDE.md — the jj push line needs the bookmark creation step to be actionable for new PRs.

Important Files Changed

Filename Overview
CLAUDE.md Adds a "Version Control: Prefer jj" section instructing agents to use Jujutsu (jj) over git. The guidance is mostly correct but omits the jj bookmark create step required for GitHub PR branch creation, which could cause jj push to silently push nothing for new branches.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Start new change] --> B["jj new &lt;parent&gt;"]
    B --> C[Make code edits]
    C --> D["jj describe -m 'type(scope): msg'"]
    D --> E{Pushing to GitHub?}
    E -- Yes --> F["jj bookmark create &lt;branch-name&gt;"]
    F --> G["jj push --bookmark &lt;branch-name&gt;"]
    E -- No / already has bookmark --> H["jj push"]
    G --> I[Open PR on GitHub]
    H --> I
    D --> J[History manipulation]
    J --> K["jj squash / jj rebase / jj edit"]
    K --> E
    E -- Unsupported operation --> L["Fall back to git"]
Loading

Last reviewed commit: c0433c7

Use `jj` (Jujutsu) for all VCS operations instead of `git`:
- `jj status`, `jj diff`, `jj log` for inspection
- `jj new` to start a change, `jj describe` to set the message
- `jj commit` to commit, `jj push` to push
Copy link

Choose a reason for hiding this comment

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

Missing bookmark creation step for GitHub PR workflows

In jj, pushing to a new remote branch for a GitHub PR requires creating a named bookmark first. Without it, jj push pushes all existing tracked bookmarks but does nothing for an untracked change — agents will silently fail to open a PR without falling back to git.

A typical PR workflow should include:

jj new main               # start a change on top of main
# ... make edits ...
jj describe -m "feat(scope): message"
jj bookmark create my-feature   # required before pushing a new branch
jj push --bookmark my-feature   # push that specific bookmark

Consider adding a note like:

Suggested change
- `jj commit` to commit, `jj push` to push
- `jj commit` to commit, `jj push --bookmark <name>` to push (create bookmark first with `jj bookmark create <name>`)
Prompt To Fix With AI
This is a comment left during a code review.
Path: CLAUDE.md
Line: 30

Comment:
**Missing bookmark creation step for GitHub PR workflows**

In `jj`, pushing to a new remote branch for a GitHub PR requires creating a named *bookmark* first. Without it, `jj push` pushes all existing tracked bookmarks but does **nothing** for an untracked change — agents will silently fail to open a PR without falling back to `git`.

A typical PR workflow should include:

```
jj new main               # start a change on top of main
# ... make edits ...
jj describe -m "feat(scope): message"
jj bookmark create my-feature   # required before pushing a new branch
jj push --bookmark my-feature   # push that specific bookmark
```

Consider adding a note like:

```suggestion
- `jj commit` to commit, `jj push --bookmark <name>` to push (create bookmark first with `jj bookmark create <name>`)
```

How can I resolve this? If you propose a fix, please make it concise.

@github-actions
Copy link

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 81.01% 2988 / 3688
🔵 Statements 81.01% 2988 / 3688
🔵 Functions 86.83% 211 / 243
🔵 Branches 78.83% 771 / 978
File CoverageNo changed files found.
Generated in workflow #332 for commit 41ffc25 by the Vitest Coverage Report Action

@TSavo TSavo added this pull request to the merge queue Mar 11, 2026
Merged via the queue into main with commit 2fbd73b Mar 11, 2026
11 checks 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.

2 participants