Handle combined diff format and merge conflicts #812
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.Combined diff handling looks like this (note the 2-char-wide prefixes):