Skip to content

Conflicts should not include lines common to all sides #7173

@9999years

Description

@9999years

Jujutsu will show me conflicts where most of the lines are identical on both sides:

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

Instead, it should show me a conflict like this, making it clear that both sides agree on 3/4 of the added lines:

a
<<<<<<< Conflict 1 of 1
%%%%%%% Changes from base to side #1
+b
>>>>>>> Conflict 1 of 1 ends
c
d

In the trivial case it's fairly easy to resolve these conflicts, but I've gotten into situations where the 'changes' show a snapshot of the entire file on each side. When that happens, I have to copy each side into a separate file and diff them manually.

A script to reproduce this conflict
cd $(mktemp -d)
jj git init --colocate
echo "a
b
c
d" > foo.txt
jj bookmark create change1 --revision=@

jj new 'root()'
echo "a
c
d" > foo.txt
jj bookmark create change2 --revision=@

jj duplicate change1 --destination=change2
jj edit @+
cat foo.txt

Related:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions