Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Teach git diff --color-words to be helpful when there are merge conflicts #386

Copy link
Copy link
@dscho

Description

@dscho
Issue body actions

Note: this project is technically challenging, as it touches two complex parts of Git's code: the diff machinery and the staging area/worktree with conflicts.

The --color-words option allows visualizing differences between two file versions on a word-level (rather than a line-level).

Currently, the --color-words option is totally ignored when visualizing merge conflicts in a worktree. All conflicted lines, including the conflict markers, are marked in green, as if the --color-words option had not been present at all.

A much more useful thing to do would be to build temporary buffers from the two sides of each conflict and then present the color diff of those buffers (the first side with an implied --reverse).

In case that it is a diff3 style conflict, there are three sides in each merge conflict (the "middle" one being the base), so the first side could show a --color-words diff between base and the first side, and the last side could equally show a --color-words diff between base and the last side.

Reactions are currently unavailable

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.