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.
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.
2
people like this idea
I like this idea!
Tell me when this idea gets some attention.
The more people who like this idea, the more it gets noticed.
The more people who like this idea, the more it gets noticed.
-
Inappropriate?I just cleaned up the script a bit and put it here:
http://gist.github.com/200886
Let me know if you find it useful!
Loading Profile...


