Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Follow-up to:
#120955: Integrate Diff into Core
Steps
- Compare DiffEngine.php with PhpWiki's original diff*.php files. Document all differences.
- Compare and merge DiffEngine.php with improvements in MediaWiki's DairikiDiff.php.
- Commit combined improvements.
Postponed until feature freeze. No reason to work on that before.
Comments
Comment #1
Alan D. CreditAttribution: Alan D. commentedThe only change of significance that I could see with the core Diff classes is below. I only compared the classes from the introduction of the file in 4.7. This was added between 7.x-2.x and 7.x-3.x and was done to introduce a way to count lines across multiple calls to the DiffFormatter class
As far as I could tell, all other changes were done in relation to coding standards, minor notices such as non-initialised variables, etc.
Comment #2
Alan D. CreditAttribution: Alan D. commentedFlagged #1826156: Move to Text_Diff library as a duplicate from the Diff module queue.
Links to http://dev.horde.org/api/master/lib/Text_Diff/
Comment #2.0
Alan D. CreditAttribution: Alan D. commentedUpdated issue summary.
Comment #3
mgiffordWe're at Beta1 so assume this is a good time.
Comment #7
apadernoThe link given in the OP (https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=history;f=i...) returns a not found string. Does anybody know the correct link?
Comment #8
Alan D. CreditAttribution: Alan D. commentedUpdated, found link on https://www.mediawiki.org/wiki/Manual:DairikiDiff.php
Comment #10
apadernoInstead of integrating code that should then be still maintained, why don't we integrate classes that can be loaded with Composer? Even if there would be the need to write a class that extend the new class(es), the code to maintain would be less than actually is.
Comment #11
neclimdulsounds like a fine 9 plan but the classes are an 8 interface we'll have to continue to maintain.
Comment #12
apadernoI was thinking more of changing just the class doing the job. There would be a proxy class that calls the appropriate methods of that class, so the interface to the world would not change.
Comment #13
neclimdulas I remember the implementation is pretty granular and most of the classes are data objects so I'm not sure how realistic that would be.
Comment #14
neclimdulOf note, there is sort of already another diff library in vendor. Sebastian has a diff library phpunit uses so it gets pulled in through our dev deps. I think we looked at it when moving stuff to libraries but it was different enough the upgrade process was going to be complicated and time was spent else where. If your interested it might be a good place to start though.
Comment #23
longwaveWe have deprecated this code for removal in Drupal 11 in #3299678: Deprecate DiffEngine and replace with sebastian/diff
Closing this as won't fix.