jj-fix-conflicts

Resolve merge conflicts in jj changes bottom-up and verify the build.

6.2k|596|Updated May 5, 2016
One-click install
npx skills add https://github.com/RediSearch/RediSearch --skill jj-fix-conflicts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: jj-fix-conflicts
Source: https://github.com/RediSearch/RediSearch/tree/main/.skills/jj-fix-conflicts
Command: npx skills add https://github.com/RediSearch/RediSearch --skill jj-fix-conflicts

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Resolving merge conflicts across a stack of Jujutsu (jj) changes is tedious and error-prone, especially when fixing an ancestor conflict can cascade and resolve descendant conflicts. This Skill automates the detection, resolution, and build verification of conflicts across a revset.

Core Features & Use Cases

  • Conflict Detection: Finds all conflicted changes in a target revset using jj log -r '(<revset>) & conflicts()', ordered oldest to newest.
  • Bottom-Up Resolution: Creates fix changes with jj new -A, resolves jj-style conflict markers, and handles autogenerated Rust headers via make generate-rust-headers.
  • Build Verification: Runs ./build.sh FORCE RUN_RUST_TESTS or RUN_UNIT_TESTS after each fix, formats Rust code with cargo fmt, and optionally squashes fixes into their parent changes.
  • Use Case: After rebasing a branch in a jj repository, multiple changes show conflicts. Invoke this Skill to walk through each conflicted change from oldest to newest, resolve the markers, verify the build, and squash the fixes.

Quick Start

Ask the AI to fix all conflicts in the current jj branch using the jj-fix-conflicts skill with default arguments.

Frequently Asked Questions about jj-fix-conflicts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix merge conflicts in a jj change?

Run jj log -r '(<revset>) & conflicts()' to list conflicted changes, then create a fix change with jj new -A <change>, edit the conflicted files to remove markers, and describe the fix with jj describe. Verify the build after each resolution.

How do I find all conflicted changes in a jj revset?

Use jj log -r '(<target-revset>) & conflicts()' to list every conflicted change in the revset. The output shows newest changes at the top, so process conflicts starting from the bottom (oldest) upward.

What do jj conflict markers look like compared to git?

jj uses diff-style markers (<<<<<<<, %%%%%%%, +++++++, >>>>>>>) or snapshot-style markers (<<<<<<<, -------, +++++++, >>>>>>>) instead of git's standard format. Both sides' intent should be combined and all markers removed during resolution.

Why should I resolve the oldest jj conflict first?

Fixing an ancestor conflict propagates the resolution to all descendants, which may automatically resolve downstream conflicts. After each fix, re-run the conflicts query to skip changes that are no longer conflicted.

Can autogenerated Rust headers be merged manually in jj conflicts?

No, headers generated by cheadergen must never be manually merged. Resolve all other conflicted files first, restore the header from a non-conflicted ancestor, then regenerate with make generate-rust-headers.