New answers tagged

1

One approach that often works is to increase the amount of context, so that adjacent small differences will be collected into a more cohesive display. In the command-line diff, you would do this with the -C option. With vimdiff, you would do this with the diffopt setting, and the context feature, e.g., this is the implicit default: set diffopt=...


0

This is similar to rsync: show when newer file on destination is to be overwritten (asked later, though not a duplicate). As indicated in the question, "diff -q -r" may require some processing to be useful. The question did not specify the form of the output; the answers give different types of reports. rsync is a useful tool for this purpose because it ...


2

The xdelta program does exactly what you are looking for: Name : xdelta Description : Xdelta (X for XCF: the eXperimental Computing Facility at Berkeley) is a binary delta generator (like a diff program for binaries) and an RCS version control replacement library. Xdelta uses a binary file delta algorithm to replace the standard diff ...


3

You might find wdiff useful for this type of comparison; it's a front-end to diff which produces word-by-word comparisons. With your example it produces by default Insert into table1 values (101 ,"a", [-"xyz");-] {+"xyz123");+} Insert into table1 values (102 ,"b", "pqr"); It can use terminal features to make the output more legible on a terminal (wdiff -t)...


1

By definition, diff is showing differences lines by lines (see diff manual page), it will therefore not show only the differing characters. You can reduce the amount of difference by pre-processing the files, for exemple by inserting an end-of-line character after each semi-column: sed -e 's/;/;\'$'\n/g' old.sql > old.patched Then use diff on the two ...



Top 50 recent answers are included