Skip to content

merge.conflictStyle diff3 makes [b] "pick both" also add the deleted merge-base lines #5486

@ohAitch

Description

@ohAitch

I think it would be better if "pick all" was still "pick both"... and was only picking top and bottom, but not the middle hunk. When solving merge conflicts with the diff3 style, the middle hunk is the common base. But the common base has been modified in both the remote and local branches. It doesn't make sense to pick it together with the other changes.

In general "pick both" / "pick all" only really makes sense for added lines. Modified lines would be duplicated. And by definition lines in "base" (i.e. the middle hunk) are never "added".

Does that make any sense?

Originally posted by @wolfgangwalther in #1447 (comment)

Looks like there's an unaddressed PR comment on the original diff3 support. I agree with the comment: a diff3 conflict

<<<
Replacement
||||
Modifi
===
Modification
>>>

is composed of the following two hunks:

+Replacement
-Modifi
-Modifi
+Modification

but adding "all" hunks seems to be interpreting it as containing a

+Modifi

line. It's still the same conflict as in normal two-section conflict style, adding both changes should add two changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions