Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle combined diff format and merge conflicts #812

Merged
merged 8 commits into from
Dec 5, 2021

Conversation

dandavison
Copy link
Owner

@dandavison dandavison commented Nov 30, 2021

With this commit combined diff format (https://git-scm.com/docs/git-diff#_combined_diff_format) is handled appropriately, and merge conflicts are rendered using delta's standard diff styles.

Fixes #189
Fixes #736

cc @th1000s this branch makes rather a large refactoring in order to start handling merge commits; if you happened to take a look any opinions would be welcomed. Since merge commits have multiple parents, the prefix is no longer simply - or + and hence the branch ends up storing the prefix as part of the state and generally making the enums modeling line state more complicated.

I'm not sure how merge conflicts should be styled and welcome suggestions. Here's what this branch is doing currently. It's intended for users who have set merge.conflictstyle = diff3: it diffs the ancestral commit against the two derived commits in turn.

image

Combined diff handling looks like this (note the 2-char-wide prefixes):

image

@dandavison dandavison force-pushed the 189-combined-diff-and-conflicts branch 6 times, most recently from 484afd7 to b2b28c8 Compare December 4, 2021 02:36
@dandavison dandavison changed the title Handle combined diff format Handle combined diff format and merge conflicts Dec 4, 2021
@dandavison dandavison force-pushed the 189-combined-diff-and-conflicts branch 17 times, most recently from ce4fb98 to d636f58 Compare December 5, 2021 16:24
With this commit combined diff
format (https://git-scm.com/docs/git-diff#_combined_diff_format) is
handled appropriately. However, there is no special handling of merge
conflict markers.

Fixes #189, #736
This allows keep-plus-minus-markers=false to be honored inside merge
conflicts but not honored for combined diff regions outside merge
conflicts.
@dandavison dandavison force-pushed the 189-combined-diff-and-conflicts branch from d636f58 to fe9ea7b Compare December 5, 2021 16:24
@dandavison dandavison merged commit 6f5090b into master Dec 5, 2021
@dandavison dandavison deleted the 189-combined-diff-and-conflicts branch December 5, 2021 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant