Hi,
I've got a unified diff file (say my_diff.diff), containing comparison of several files from a project.
What would be the best way to review all the code changes in a nice visual format, for example, using meld or vimdiff?
I have figured out the way how to do it for a single diff file (ie. containing comparison of just two files). It'd be something along the lines:
patch -o /tmp/temp_file -i my_diff.diff ./target_file.ext
gvimdiff /tmp/temp_file ./target_file.ext
Which essentially applies the patch, but stores the result in a temp file, and then compares that file to the original one.
I have also found filterdiff utility, which can extract portions of unified diff segments relevant to a file. Potentially it can be used with code example above in some sort of hack shell scripting, in which I am not so advanced.
I would envisage the process happening like that though:
- Scan unified diff for changed file names
- For each file name, extract the diff portion
- For each portion, run script quoted in the beginning of the question.
Is there anyone with shell scripting skills? :)
A