Easier Bulk Diff?

Ovid on 2007-07-20T08:39:29

In trying to track down a bug between two subtly different branches of code, I needed to know which files are different in the two branches (information which cvs doesn't always give), so I wrote this:

for file in `find lib -name '*.pm' -print`; \
> do diff --brief $file /home/ovid/work/master/$file; done 2>&1 \
> |grep -v 'No such file'|cut -d ' ' -f 2

Surely there's a better way to get a list of which files are different in two virtually identical directory structures?


Re: Easier Bulk Diff?

jmcnamara on 2007-07-20T09:25:53

Would something like this do?

        diff -qr dir1 dir2

John.
--

Re: Easier Bulk Diff?

Ovid on 2007-07-20T09:51:54

That helps. I can use it to get that command down to this:

diff -qr kill_dh_server/lib/ shared_cp/lib/|egrep -v 'CVS|Only in'|cut -d ' ' -f 2

That let's me ignore CVS directories and files which are in one and not the other. If I want to include the latter:

diff -qrN kill_dh_server/lib/ shared_cp/lib/ | grep -v CVS | cut -d ' ' -f 2

It doesn't quite restrict me to everything I want, but it's pretty close. Thanks!

Graphical diff tool

swillert on 2007-07-20T13:40:43

When having access to a GUI, I love to use meld [http://meld.sourceforge.net/] to do the job. This tool is simply amazing.

It's a bit anemic on the command line options side, but has found me a lot of subtle bugs.

There needs to be an ackdiff

runrig on 2007-07-20T17:24:52

No, I'm not volunteering :-)

If only you used svn

Eric Wilhelm on 2007-07-21T10:17:08

http://scratchcomputing.com/svn/Module-Subversion-Juggle/trunk/bin/find_change