Subject: With -r, option to avoid duplicate differences due to relative symbolic links

From: Vincent Lefevre <[email-masked]>
Date: Wed, 8 Apr 2015 11:45:51 +0200

When using "diff -r", an additional option to avoid duplicate
differences due to symbolic links would be useful. For instance,
in directories "a" and "b" to be diff'ed, one may have:

  file
  symlink -> file

If "file" changes in directory "a", then "diff -r a b" will report a
difference for "file", but also for "symlink" as a consequence. This
is a bit annoying when reviewing a diff output.

An option, possibly named --ignore-identical-links, could be added to
detect something like that, e.g. in the following way:

1. Detect whether the object to be diff'ed in directories "a" and "b"
   are both symbolic links with the same link value.

2. [Optional] If (1) is satisfied, also detect whether the value is
   a relative symbolic link that is local to the directory.

If (1) is satisfied (and optionally (2)), then do not attempt to diff
the objects.

In practice, just doing (1) would be OK for me.

Note: I can't use --no-dereference because I still want to be able to
compare objects where one is a symbolic link and the other one is a
regular file or a directory.

-- 
Vincent Lefèvre <[email-masked]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)