Skip to content

Support jj 0.37+ detailed conflict marker format - #45

Merged
nilskch merged 1 commit into
nilskch:mainfrom
nertzy:support-new-conflict-markers
Mar 1, 2026
Merged

Support jj 0.37+ detailed conflict marker format#45
nilskch merged 1 commit into
nilskch:mainfrom
nertzy:support-new-conflict-markers

Conversation

@nertzy

@nertzy nertzy commented Feb 13, 2026

Copy link
Copy Markdown
Contributor

Since jj 0.37.0, conflict markers include detailed labels with change IDs, commit hashes, and descriptions instead of the previous generic side #N labels. The start/end markers also changed from uppercase Conflict to lowercase conflict. Since jj 0.25.0, markers may be longer than 7 characters.

Before (jj < 0.37):

<<<<<<< Conflict 1 of 1
%%%%%%% Changes from base to side #1
+++++++ Contents of side #2
>>>>>>> Conflict 1 of 1 ends

After (jj 0.37+):

<<<<<<< conflict 1 of 1
%%%%%%% diff from: rlvkpnrz 2f040964 (rebased revision's parent)
\\\\\\\        to: rlvkpnrz d44febc2 (rebase destination)
+++++++ zsuskuln f7705e4f (rebased revision)
>>>>>>> conflict 1 of 1 ends

Changes:

  • Case-insensitive start/end markers (conflict vs Conflict)
  • Accept any label text on %%%%%%% and +++++++ lines (not just Changes from... / Contents of...)
  • Skip \\\\\\\ continuation lines used for multi-line conflict labels
  • Support markers longer than 7 characters (e.g. <<<<<<<< for files already containing 7-char marker-like lines)

Test coverage: New test_diff_two_sides_detailed snapshot test with realistic jj 0.37+ conflict output, plus expanded regex pattern tests covering classic, detailed, and extended-length formats.

Relevant jj changelog entries:

  • 0.37.0: "Conflict labels now contain information about where the sides of a conflict came from"; "\\\\\\\ markers to indicate the continuation of a conflict label"
  • 0.25.0: "Conflict markers are now allowed to be longer than 7 characters"

@nilskch

nilskch commented Feb 17, 2026

Copy link
Copy Markdown
Owner

Thanks for working on this! I just installed jj 0.38.0 and created a simple conflict:

<<<<<<< conflict 1 of 1
%%%%%%% diff from: mntrysmr 14bb871e "Support jj 0.37+ detailed conflict marker format" (parents of rebased revision)
\\\\\\\        to: lrnzuvum fd58b68f (rebase destination)
+a
+b
+c
+d
+e
+++++++ otsmsqqu e0611812 (rebased revision)
1
2
3
4
5
6
>>>>>>> conflict 1 of 1 ends

I compiled this branch and the LSP could not find the conflict. Can you take a look at this?

@nertzy
nertzy force-pushed the support-new-conflict-markers branch 4 times, most recently from ff87bf9 to fa5aaff Compare February 27, 2026 17:50
@nertzy

nertzy commented Feb 27, 2026

Copy link
Copy Markdown
Contributor Author

@nilskch updated to better support your use case where the conflict is at the beginning of the file (there was an existing bug where the first line was not being tested).

Since jj 0.37.0, conflict markers include detailed labels with
change IDs, commit hashes, and descriptions instead of the
previous generic "side #N" labels. The markers also changed
from uppercase "Conflict" to lowercase "conflict". Since jj
0.25.0, conflict markers may be longer than 7 characters.

Update all conflict marker regexes to handle:

- Case-insensitive start/end markers (conflict vs Conflict)
- Detailed labels on %%%%%%% and +++++++ lines (e.g.
  "diff from: rlvkpnrz 2f040964 (description)")
- Multi-line labels via \\\\\\\ continuation lines
- Markers longer than 7 characters (e.g. <<<<<<<< for files
  that already contain 7-character marker-like lines)

Relevant jj changelog entries:
- 0.37.0: https://github.com/jj-vcs/jj/blob/main/CHANGELOG.md#0370---2026-01-07
  "Conflict labels now contain information about where the
  sides of a conflict came from"
  "The diff conflict marker style can now use \\\\\\\ markers
  to indicate the continuation of a conflict label"
- 0.25.0: https://github.com/jj-vcs/jj/blob/main/CHANGELOG.md#0250---2025-01-01
  "Conflict markers are now allowed to be longer than 7
  characters"
@nertzy
nertzy force-pushed the support-new-conflict-markers branch from fa5aaff to 7fc15ab Compare February 27, 2026 18:01

@nilskch nilskch left a comment

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.

Thank you and awesome catch :)

@nilskch
nilskch merged commit 775b0ac into nilskch:main Mar 1, 2026
3 checks passed
@nilskch

nilskch commented Mar 1, 2026

Copy link
Copy Markdown
Owner

I've sent you an invitation to become a collaborator. Feel free to just merge things like this in the future. I now work in a much smaller team and rarely have conflicts anymore, so I didn't notice that the conflict markers changed in recent jj versions.

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