Closed navarr closed 8 years ago
:+1:
Navarr, I'm a bit new to this utility but have recently came across this same issue you're addressing. Thanks for submitting this!
Am I correct that the core of your update here is that you're taking the output of file_get_contents and then replacing whitepsaces, tabs, new lines and carriage returns in that output so that they are normalized before passed to the subsequent shellexec call to diff in getFileDiff() ?
This actually isn't touched by getFileDiff. For the part of the program that determines whether or not the files have any differences a simple string comparison is done.
Instead of normalizing I completely remove all whitespace. Which could theoretically not show certain diffs in strings that are whitespace related.
On Fri, Jun 5, 2015, 12:42 Bryan Hoffpauir (BJ Hoffpauir) - Chief Technology Officer notifications@github.com wrote:
Navarr, I'm a bit new to this utility but have recently came across this same issue you're addressing. Thanks for submitting this!
Am I correct that the core of your update here is that you're taking the output of file_get_contents and then replacing whitepsaces, tabs, new lines and carriage returns in that output so that they are normalized before passed to the subsequent shellexec call to diff in getFileDiff() ?
— Reply to this email directly or view it on GitHub https://github.com/AOEpeople/mpmd/pull/7#issuecomment-109358263.
@fbrnc I've updated the PR with the better whitespace normalization we discussed (and fixed a bug I accidentally introduced when I tried to pretty up the commit history for this PR - whoops!)
@fbrnc Anything else missing from this? It's been a few months :stuck_out_tongue:
Sorry for the delay. Just merged your code. Thank you!
This removes spam from whitespace changes between the fresh copy and the existing copy.
Example:
So much nicer than having 13724 "diferentFileContent" with blank diffs.