Closed sageserpent-open closed 6 months ago
Perhaps all moves should be reported, with any propagated details if applicable?
Yes, let’s note all moves in preparation for #30.
Sections are rendered in a more readable fashion with line number and character offset information as of Git commit SHA: 530c7d6736077152e25b6cf86229c09f45284625.
Umming and ahhing here...
Produced a fairly hokey report of moves in 343f2a5b3a7324b0f295dee0d25d92e9aaccbcc5 - this has no automated tests for either the report generation or how instances of MoveDestinations
are built up. Manual inspection of the report and of the logs shows some discrepancies, so it's worth the diligence of adding automated tests.
Another fly in the ointment is how coincident insertions / edits are reported - although the inserted sections coincide from the point of view of the merge, they are expected to lie in different locations in the left and right file. So we should show both sides of the insertion - but the API for merge.MergeAlgebra
only takes the left hand side's element.
Should MergeAlgebra
be cutover to take the element from both sides? Or should MatchesContext
consult the implied left-right match to obtain the right hand side's element, avoiding a load of upstream rework? There is a precendent for sticking with just one element in MergeAlgebra
, namely the preservation method which also takes just the left hand side's element - or should that be cutover too?
Bug in report generation fixed in 4af6bedadbd964f5ccd968678173715dd99980c2 - still missing automated tests for this, but I'm not satisfied with the design of this; need to think about what this should look like.
Bug reproduced by automated tests in: ea97c1965d6f449306d86bab49658bbf05c7ddd5 and the fix merged with the updated tests in: 99d6a81069d76bb059709de7d92ed53691c7c7a2.
Added support for showing both sides of a coincident insertion / edit in: 7a0d75d3f8f09c7d02e4092046243544240910ec. The report doesn't look stunning, but it will do for now. Feedback from the general public should guide further work on it.
For now, it's a wrap.
This went out in release 1.2.0, Git commit SHA: 4d1935beef2b5923417904895884de8c2e749c6e.
This follows from #37.
As part of this, the diverging move destinations should be reported with the side they are on, an excerpt of the text (if longer than some predefined limit) and the line number, character offset and token index of the start and the finish of the destination.
The move source should also be shown with the appropriate commit.
A subtlety is when the divergent move is part of a set of mutually ambiguous matches. What should we do there?