Open chooglen opened 1 year ago
- Odd, because there's no
-
side.
That's the normal case :) See https://github.com/martinvonz/jj/blob/main/docs/conflicts.md#conflict-markers
Well, depends on what you mean by "no -
side". It's normal that there's no -------
separator. That there are no lines in the diff prefixed by -
just means that one side added those +
lines without also removing anything.
To make this reproducible, can you share the base commit for 2dc4f2fee11cd3c5f8d390b4e44b9daf514820ac? By "base commit", I mean the common ancestor with the commit you merged with.
Oh, can you also try merging that again with git merge --diff-algorithm=histogram
? I suspect the difference lies in the diff algorithm.
I just remembered that the ort
strategy always uses histogram, and since ort
is now the default, telling git merge
to use histogram diff would make any difference.
After applying the changes in you conflicts onto bd7f72ff0348, I was able to reproduce this. I think the difference is in the diff algorithm, but a difference in my histogram implementation compared to Git's, which likely means a bug in my implementation :) I may have a fix for this in an old commit from when I initially implemented the histogram diff.
I think the difference is in the diff algorithm, but a difference in my histogram implementation compared to Git's
Have you considered writing a test that to compare Git's histogram diff implementation against your own on some set of commits? This is how I validated patch application in git-branchless: https://github.com/arxanas/git-branchless/blob/6efd6de3bd6f201cc1d511fb6c0bbbf48ea4596a/git-branchless-lib/bin/testing/regression_test_cherry_pick.rs. I ran it against gecko-dev
, but any other large repo should work, too. It found some number of bugs.
Good idea! I did lots of tests like that back when I wrote this code, but that might have been before I even added the --git
format, so I think I only compared with git diff --color-words
. Now that we have --git
, it makes sense to compare exact output. We don't have to produce exactly the same output, of course, but it's a good idea to at least compare them.
Description
Steps to Reproduce the Problem
When I pushed https://github.com/martinvonz/jj/actions/runs/3492153286/jobs/5845616235, GitHub created this merge commit https://github.com/martinvonz/jj/commit/0b2077598d9639f1ed4e24791008a0829f29f689 and didn't complain of merge conflicts.
Expected Behavior
Doing the same merge in
jj
doesn't conflict.Actual Behavior
Doing the same merge in
jj
results in a conflict:The conflicted hunks are:
Odd, because there's no
-
side.jj
seems to get confused by the single}
line, so it doesn't placefn output_guard
before andenum UiOutputPair
after (which won't conflict).enum UiOutputPair { Terminal { stdout: Stdout, stderr: Stderr },
-
impl UiOutput { fn new_terminal() -> UiOutput { UiOutput::Terminal { stdout: io::stdout(), stderr: io::stderr(), } }
}
Specifications