Andreas Gruenbacher wrote:
> I wonder if comparing symlinks (instead of what they point to) shouldn't
> become the default once diff supports it. At the very least, diff
> should warn when following symlinks though.
I disagree. --dereference should stay the default, for two reasons:
1) Unix philosophy: By default, symlinks are followed. This is a
general principle. It starts with open() and fopen() and continues
through most command-line utilities.
2) What are the use-cases for "diff"?
- Compare files coming from two different users.
- Comparing the new state of a directory with a backup.
- Compating the new state of a partition with a backup.
In the first two cases, --dereference is desired. In the third case,
--no-dereference is desired.
The first two cases are the most frequent ones.
In other words, while you personally may be working frequently at
the partition level, many users who put a symbolic link want it to be
followed automatically.
See also the discussion at
<https://lists.gnu.org/archive/html/bug-gnu-utils/2011-10/msg00011.html>
<https://lists.gnu.org/archive/html/bug-gnu-utils/2011-10/msg00013.html>
Bruno