[Top][All Lists]

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

Re: diff: bad treatment of symlinks

From: Andries E. Brouwer
Subject: Re: diff: bad treatment of symlinks
Date: Wed, 19 Oct 2011 09:59:55 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

On Wed, Oct 19, 2011 at 09:41:07AM +0200, Andreas Schwab wrote:
> "Andries E. Brouwer" <address@hidden> writes:
> > You are mistaken: diff -r tree1 tree2 operates on filesystem trees
> > containing all kinds of files.
> When both files with the same name are plain files then diff shall
> display their differences in contents.  Since plain diff always follows
> symlinks, it makes more sense for diff -r to do it too (POSIX makes this
> implementation-defined though).
> Andreas.

"it makes more sense"? No.

There are important differences between a file and a symlink to a file.
(If I copy a tree using scp then symlinks are replaced by actual files.
That is very bad for many reasons. For example, when there are several
links to one file, then a single update changes all. Synchronization
is lost when the links are replaced by copies of the files themselves.
I already mentioned other things, like the different interpretation of .. .)

If diff -r shows the differences between two trees, it must show these
differences. A copy made with scp is corrupt, and diff -r should show that.

Anyway, yesterday evening I wrote cmptree, and it does what diff -r
should have done.


reply via email to

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