[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

diff: bad treatment of symlinks

From: Andries E. Brouwer
Subject: diff: bad treatment of symlinks
Date: Tue, 18 Oct 2011 11:44:17 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

A symlink is a small file that contains a filename.

Some people like to pretend that a symlink is the same as
its target, but it is not, and pretending only leads to pain.

This means that diff should never use the contents of the
symlink target. (Maybe when the two files to be compared
are given as command parameters, depending on option flags,
but certainly not in a recursive diff of two trees.)

This means that diff must report a difference when comparing
a file to a symlink, even when the symlink points to a file
with the same contents.

For example, tar will create symlinks as empty mode 0 files,
only to fix them later. If the tar crashes, there will be
many empty mode 0 files. A diff between the original hierarchy
and the untarred hierarchy must not mention the contents of
the symlink target, but just say

a/foo is an empty mode 0 file while b/foo is a symlink to bar.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]