-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge: fix a problem with unmatchable hunks.
If the patch contains hunks that cannot be matched, wiggle cannot to anything really useful, but sometimes it does something bad and produces a badly formatted result. In these cases, the hunk must get placed somewhere, and it is possible that two hunks could line up with different places in the same line of the original. As wiggle normally expands conflicts to cover whole lines, to display this coherently, you would need something like <<< chosen line |||| hunk1- before hunk2- before === hunk1- after hunk2- after >>> But wiggle assumes that a hunk header marks the end of a conflict, so bad things happen here. I don't want to display the hunk header, so I think the best option is <<< chosen line ||| hunk1- before === hunk1- after >>> <<< ||| hunk2- before === hunk2- after >>> To achieve this, we don't stop collecting a conflict when we hit a hunk-header moving forward, but when we print the conflict out, we detect those hunk headers, and do the above. If the final hunk doesn't actually contain any differences, don't bother printing it. Signed-off-by: NeilBrown <[email protected]>
- Loading branch information
Showing
6 changed files
with
2,559 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.