Skip to content

docs: prefer jj over git for VCS operations#12

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

docs: prefer jj over git for VCS operations#12
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 contributor documentation instructing agents to use jj commands for common VCS workflows and fall back to git only when necessary.

Note

Prefer jj over git for VCS operations in developer docs

Adds a 'Version Control: Prefer jj' section to CLAUDE.md with guidance on using Jujutsu (jj) commands for common operations (status, diff, log, commit, rebase, etc.), with git as a fallback. Also adds .jj/ to .gitignore to exclude the Jujutsu metadata directory.

Macroscope summarized dadcbf9.

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 team-wide preference to use the jj (Jujutsu) CLI instead of git for version control operations, including common workflows and a fallback rule for unsupported operations.

Flow diagram for choosing jj vs git for VCS operations

flowchart TD
  A_Start["Start VCS operation"] --> B_CheckSupport["Is the desired operation supported in jj?"]
  B_CheckSupport -->|Yes| C_UseJJ["Use jj command for this operation"]
  C_UseJJ --> D_End["Operation complete"]
  B_CheckSupport -->|No| E_FallbackGit["Fallback: use git command for this operation"]
  E_FallbackGit --> D_End

  subgraph Common_jj_workflows
    F_Status["Inspect: jj status / jj diff / jj log"]
    G_ChangeLifecycle["Change lifecycle: jj new → jj describe → jj commit → jj push"]
    H_History["History manipulation: jj squash / jj rebase / jj edit"]
  end

  C_UseJJ --> F_Status
  C_UseJJ --> G_ChangeLifecycle
  C_UseJJ --> H_History
Loading

File-Level Changes

Change Details Files
Document jj (Jujutsu) as the preferred VCS tool and outline its usage for common workflows.
  • Add a new 'Version Control: Prefer jj' section after the issue tracking section in CLAUDE documentation.
  • Specify jj commands for repository inspection (status, diff, log).
  • Specify jj commands for starting and describing changes (new, describe).
  • Specify jj commands for committing and pushing changes (commit, push).
  • Specify jj commands for history manipulation (squash, rebase, edit).
  • Clarify that git should be used only as a fallback for operations not 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

@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 reviewed your changes and they look great!


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.

@TSavo TSavo added this pull request to the merge queue Mar 11, 2026
@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 12 minutes and 25 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: 4cdb665e-0e63-4951-8cc1-6b286f377446

📥 Commits

Reviewing files that changed from the base of the PR and between a4876e6 and dadcbf9.

📒 Files selected for processing (2)
  • .gitignore
  • 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.

@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 Claude agents to use Jujutsu (jj) instead of git for VCS operations in this repository. The listed jj commands are accurate, but the push workflow is incomplete for a git-backed repository.

  • The commands for inspection (jj status, jj diff, jj log), change authoring (jj new, jj describe, jj commit), and history manipulation (jj squash, jj rebase, jj edit) are all correct.
  • The jj push instruction omits the mandatory bookmark-creation step (jj bookmark create <name>). In jj, pushing to a git remote requires a named bookmark to be set on the change first; without it, jj push fails with "nothing to push", which would cause agent workflows to break at the push step.

Confidence Score: 4/5

  • Safe to merge after addressing the incomplete jj push workflow — the missing bookmark step will cause agent push failures.
  • Documentation-only change with accurate jj commands, minus one practical gap in the push workflow that would cause agent failures in real usage.
  • CLAUDE.md — the jj push section needs a bookmark creation step added before agents can successfully push changes.

Important Files Changed

Filename Overview
CLAUDE.md Adds a "Version Control: Prefer jj" section with basic jj command equivalents. The listed commands are valid, but the push workflow is incomplete — it omits the required bookmark creation step needed before jj push in a git-backed repository.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Agent starts work] --> B[jj new\nstart a new change]
    B --> C[Make code changes]
    C --> D[jj describe\nset commit message]
    D --> E[jj commit\nfinalize change]
    E --> F{Need to push?}
    F -->|Yes| G[jj bookmark create branch-name\n⚠️ MISSING from guide]
    G --> H[jj push --bookmark branch-name]
    F -->|No| I[jj squash / rebase / edit\nhistory manipulation]
    H --> J[Open PR on GitHub]
    K[Operation not in jj?] --> L[Fall back to git]
Loading

Last reviewed commit: 980e5f7

CLAUDE.md Outdated
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 step for jj push

In a git-backed repository like this one, jj push requires a named bookmark (jj's equivalent of a git branch) to be set on the change before pushing. Without it, jj push will have nothing to push and will report an error. An agent following this guide as-is will fail at the push step.

The complete push workflow needs a bookmark creation step:

Suggested change
- `jj commit` to commit, `jj push` to push
- `jj squash`, `jj rebase`, `jj edit` for history manipulation
- `jj bookmark create <branch-name>` to create a branch, then `jj push --bookmark <branch-name>` to push

Alternatively, the guide could note that jj push --change @ can be used in newer versions of jj to auto-create a bookmark for the current change.

Prompt To Fix With AI
This is a comment left during a code review.
Path: CLAUDE.md
Line: 70

Comment:
**Missing bookmark step for `jj push`**

In a git-backed repository like this one, `jj push` requires a named bookmark (jj's equivalent of a git branch) to be set on the change before pushing. Without it, `jj push` will have nothing to push and will report an error. An agent following this guide as-is will fail at the push step.

The complete push workflow needs a bookmark creation step:

```suggestion
- `jj squash`, `jj rebase`, `jj edit` for history manipulation
- `jj bookmark create <branch-name>` to create a branch, then `jj push --bookmark <branch-name>` to push
```

Alternatively, the guide could note that `jj push --change @` can be used in newer versions of jj to auto-create a bookmark for the current change.

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

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 contributor guidance to prefer the Jujutsu (jj) CLI for version control operations in this repository.

Changes:

  • Add a “Version Control: Prefer jj” section to CLAUDE.md.
  • Document common jj commands for status/diff/log, starting work, committing, pushing, and history manipulation.

💡 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.

CLAUDE.md Outdated
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

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

The workflow list says jj push to push. In Jujutsu’s Git integration the push command is typically jj git push (and similarly jj git fetch), so jj push may be an invalid/unsupported command depending on the installed jj version. Update the docs to the correct command(s) for pushing to Git remotes, or clarify which jj version/workflow this repo expects.

Suggested change
- `jj commit` to commit, `jj push` to push
- `jj commit` to commit, `jj git push` to push to Git remotes

Copilot uses AI. Check for mistakes.
- `jj squash`, `jj rebase`, `jj edit` for history manipulation

Fall back to `git` only for operations not yet supported by `jj`.

Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

This doc now recommends using jj, but the repo’s .gitignore currently doesn’t ignore Jujutsu’s .jj/ metadata directory. That makes it easy for contributors to accidentally stage/commit .jj files. Consider either updating .gitignore to exclude .jj/ or adding an explicit note here to never commit .jj/ (and how to clean it up if it appears in git status).

Suggested change
**Important:** Jujutsu stores local metadata in a `.jj/` directory. This must **never** be committed.
- If `.jj/` shows up in `git status` or staged changes, unstage it:
- `git restore --staged -r .jj`
- If `.jj/` somehow became tracked, remove it from the index:
- `git rm -r --cached .jj`
- Ensure your ignores are set up so `.jj/` is excluded from future commits.

Copilot uses AI. Check for mistakes.
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 11, 2026
@TSavo
Copy link
Contributor Author

TSavo commented Mar 11, 2026

wopr-auto review: ISSUES FOUND.

Two issues in the new jj section:

  1. jj push is not a valid command in a git-backed jj repository. The correct command is jj git push (and jj git fetch for fetching). Greptile and Copilot both flagged this.

  2. Missing .jj/ in .gitignore — contributors using jj will have a .jj/ metadata directory created locally. Without a .gitignore entry, it risks being accidentally staged/committed. Add .jj/ to .gitignore.

Fixer should correct jj pushjj git push in CLAUDE.md and add .jj/ to .gitignore.

@TSavo
Copy link
Contributor Author

TSavo commented Mar 11, 2026

wopr-auto review: LGTM. Both previous findings resolved: jj git push is correct in CLAUDE.md and .jj/ is in .gitignore. CI green. Awaiting human approval to enter merge queue.

@TSavo TSavo added this pull request to the merge queue Mar 11, 2026
Merged via the queue into main with commit c78d053 Mar 11, 2026
9 checks passed
@TSavo TSavo deleted the chore/jj-vcs-rule branch March 11, 2026 22:53
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