Get your own customer support community
 

Use Changes to directly view differences described in a patch file

It would be really cool if Changes could take a single patch file and show those differences in the Changes UI. Obviously it wouldn't be able to show the full original files, but it could basically do the "Differences Only" mode. It would be nice because it would be in a left/right layout, and have inter-line changes highlighted.

I actually just wrote a little ruby script to let me do this, and it's really handy (but would be even nicer if it was built-in). Basically I just read the patch file, and stripped any line starting with '+' (and the first character of every other line) and saved that as my "original" file. Then I did the same (this time stripping lines starting with '-') for the "modified" file. Then I used Changes to compare those files. It could definitely be more sophisticated (especially around the file/line number markers in the patch file), but the general idea seems to work well.
Inappropriate?
2 people like this idea

User_default_medium