diff is a program which matured for a long while, and for which
algorithms are based on computer science literature. It is a fast program.
mdiff is not more than a program kludged up rapidly
to satisfy a few precise needs. It only tries not being inordinately slow.
diff options are accepted by
mdiff under the same
short and long option names, and is able to produce resembling output,
mdiff easier to learn and less surprising to users.
Yet, some differences exist in option decoding and output format. Since
mdiff use different matching algorithms, it is
very likely that the differences will not be exactly analyzed identically.
diffoptions, which either accept no argument or require a mandatory one, are implemented in
mdiffas options accepting an optional argument. This may yield some surprises, for example, -c4bir would be accepted by
diffand rejected by
mdiff, yet it may rewritten -birc4 for both. See below.
diffask for regular context and unified context output, respectively, without specifying the number of lines in the context.
diffhas ‘-C number’ and ‘-U number’ options for asking for regular or unified context diffs with number context lines. If -c4 asks for four lines of context, the ‘4’ is not really an argument of -c, and this is really interpreted as ‘-c -4’, where -number is meant to be a deprecated option for choosing the number of context lines, option which
mdiffdoes not implement. In
mdiff, -c and -u are really two options which are allowed to receive an optional argument, so the number of lines may, or may not be given, at the choice of the user. In
mdiff, options -C and -U are completely equivalent to -c and -u, and are provided only for the sake of compatibility.
diffmeans --version, while it means --verbose in
mdiff. There is no short form for --version in