Page 1 of 1

(Solved) diff wordpress theme for volunteer website.

Posted: 7. Apr 2012, 13:59
by globetrotterdk
I have recently been doing some volunteer work for an NGO, maintaining their website. The friend of the guy that formerly maintained the site made some changes to the WordPress theme called Aureol that the website uses. Now the NGO needs to upgrade from WordPress version 2.7 to 3.3.1 and I need to to be able to compare the code between the files in what I believe to be the original theme version and the modified theme version. Each resides in its own directory, but as nobody at the NGO has any idea what was modified, I need some way to compare the content of the files in the one directory to the content of the files in the other directory, to find where the modifications were made. I was thinking of using diff – from-file to-file, but that seems to be the long way around. Most of the files seem to be written in PHP, but there are some files with CSS as well. Anyone have any ideas how I can leverage the power of Linux to solve this problem?

Re: diff wordpress theme for volunteer website maintainance.

Posted: 7. Apr 2012, 14:41
by gapan
For a diff with a gui tool that can also work on entire directory triess, try meld, installed by default in a full mode installation.

A crash course on git, would also help you a lot in merging any changes from the old version to the new.

Re: diff wordpress theme for volunteer website maintainance.

Posted: 7. Apr 2012, 17:06
by globetrotterdk
Many thanks for the quick reply. Meld is very cool. I also found that I have Kompare already installed on my system. It turns out that the guy may have gotten inspiration from a WordPress theme, but I can now see that he in actuality used a WordPress theme generator, so he wasn't as much of a guru as he apparently pretended to be :lol: That also means that the two versions aren't class enough for me to get a quick overview of what was changed.

Re: (Solved) diff wordpress theme for volunteer website.

Posted: 7. Apr 2012, 18:44
by Shador
Who says that diff doesn't work on directories? Just run:

Code: Select all

diff -uNr wp-orig wp > changes.diff
You should be able to apply it again to wp-orig like this:

Code: Select all

cd wp-orig
patch -p1 -i ../changes.diff
If you use another version than the original one for wp-orig, you might get some rejects though depending on their changes.

Re: (Solved) diff wordpress theme for volunteer website.

Posted: 8. Apr 2012, 07:14
by globetrotterdk
Thanks Shador, the command seemed to work fine.

Code: Select all

$ diff -uNr dir_1 dir_2 > changes.diff
However, when I open the resulting "changes.diff" file, I get the following error: "The diff is malformed. Some lines could not be parsed and will not be displayed in the diff view." If I open the file from the command line I get the following:

Code: Select all

$ kompare changes.diff
kompare(4261)/kdecore (KLibrary) findLibraryInternal: plugins should
not have a 'lib' prefix: "libkomparepart.so"
kompare(4261)/kdecore (KLibrary) findLibraryInternal: plugins should
not have a 'lib' prefix: "libkomparenavtreepart.so"
I am of course wondering about what doesn't get displayed in Kompare.

Re: (Solved) diff wordpress theme for volunteer website.

Posted: 8. Apr 2012, 08:18
by Shador
I'm sure the diff is fine. Just try opening it with a text editor. Maybe the tool you're usung only supports the '><' format and not the '+-' one. Removing the uN flag should disable that. But diff's generated with uNr are common practice.

Re: (Solved) diff wordpress theme for volunteer website.

Posted: 8. Apr 2012, 11:03
by globetrotterdk
Cheers. The .diff file looks fine.