-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🎨 Color moved passages differently #259
Comments
I have been thinking about this also, and miss this functionality myself but I expect it is relatively difficult to implement, particularly in the current framework and there are some subtleties involved in the definition of desired behaviour. |
I browsed through the Python's
Good questions. The easy answer would be to „just make it configurable” and use sane defaults. Off the top of my head I would introduce an absolute and a relative moving threshold. The absolute threshold would mean: „Don't consider sequences of 20 characters or less for moving”. The relative threshold would say: „If less than 10% of a moved block was also changed, still consider the whole block 'moved' and color the differences accordingly”. |
Thank you for looking into this so quickly. It will be an interesting feature but I will need a block of time to think about this and implement something, and those 'blocks of time' are hard to come by these days. |
Absolutely. No pressure, I just wanted to put this idea here so it is out there. |
Just wanted to drop by and +1 to the idea of coloring block moves differently. After playing around with getting this to work on the commandline for standard difftools, indeed As mentioned in Detecting moved sections #162, the core algorithm seems to be the Heckel diff algorithm described on the page for wikEd diff Implementation. See also Paul Heckel: A technique for isolating differences between files Here's a couple of python implementations: m-matelski/mdiff, lahwaacz/python-wikeddiff, and a Stack Overflow discussion which might be helpful: Difficulty understanding Paul Heckel's Diff Algorithm. Thanks again for working on this tool, and hope these resources will be helpful at some time in the future |
git diff --color-moved=zebra
colors moved lines differently so they don't show up as a huge amount of removed and added lines. Havinglatexdiff
also color moved passages differently (e.g. in darkgreen) would add a lot of value to the output.The text was updated successfully, but these errors were encountered: