fix(highlight_duplicate_signatures): don't remove separators if no conflict was built #211
No reviewers
Labels
No labels
Compat/Breaking
Kind
Bad merge
Kind
Bug
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
New language
Kind
Security
Kind
Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: mergiraf/mergiraf#211
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ada4a/mergiraf:208"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
conflict_add_separator
and the surrounding comments suggest thatwhat we're expecting here is to build a conflict between the duplicated signatures.
Because of that, when we're creating
conflict_add_separator
and seeadd_separator=AtEnd
,we command to remove the next separator, since we plan to have it inside the conflict sides
(so that when the conflict is resolved, we don't end up with duplicated separators).
But
merge_same_sigs
has another, happier path, where it realizes that the 2 nodeswith duplicated signatures are actually isomorphic. In that case, it just resolves the conflict.
And herein lies the problem: the fact that the conflict didn't get constructed after all
isn't taken into account by the caller -- it'll still remove the next separator
(and will have removed the previous separator, if we had
add_separator=AtBeginning
) all the same.The reason why this wasn't caught by any of the tests before is that until now,
whenever we arrived at this happy path,
add_separator
has beenOnlyInside
--so no erroneous separator removal happened. But that's seemingly because
OnlyInside
is just what we have most of the time.So the fix for this is not that complicated. We:
conflict_add_separator
merge_same_sigs
whether the happiest path was takenFixes #208
I've decided to pretty much keep the quick-and-dirty fix as is for now; I hope to do an overhaul of
highlight_duplicate_signatures
tomorrow.Very cool that you figured this out! Perhaps it would be useful to move the failing test that motivated the fix to the
working
directory, to demonstrate the fix?working
@wetneb wrote in #211 (comment):
Of course 😅 Thank you for catching the silly oversights I make sometimes:)
Somewhat related -- I did want to add a bunch of unit tests to this, but it's kind of hard to get one's hands on
MergedTree
s. I guess one could split the post-processing step off ofthree_way_merge
, and use the rest to generateMergedTree
s from source strings