How to make diff prefer modification vs add/delete?

20 views Asked by At

When I run diff a b, it prints many lines removed and many added.

However, many of these lines are actually the same line, but modified. In this case, it's a CSV with an extra field added at the end.

I think diff's algorithm probably tries to compare the lines, and if the % of matching characters is too low, considers them add/remove rather than modify. But in my case this threshold is too sensitive. Is there a way to reduce it?

Alternate diff programs are okay as well.

0

There are 0 answers