bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: diff -r is not flexible in handling symlinks


From: dworley
Subject: Re: diff -r is not flexible in handling symlinks
Date: Wed, 24 Apr 2002 15:16:47 -0400

   From: Paul Eggert <address@hidden>

   > From: address@hidden
   > Date: Wed, 24 Apr 2002 10:52:14 -0400

   >    The infinite loop should be fixed in GNU diffutils 2.8.1,
   > 
   > How does it do that?

   It uses the standard algorithm for detecting infinite loops in
   directed graphs.  (Luckily this is easier than the halting problem.  :-)

   > I can't see anything in the NEWS or documentation that says that
   > there has been a change in how symlinks are handled.

   I didn't think it worth adding, since it was just a bug fix.  However,
   I'll put something into the NEWS file.  It's been there ever since
   test version 2.7.2, so it's old news.

Well, the way I look at it is this: The fact that diff -r follows
symlinks is unexpected.  (And IMHO buggy, but that's another matter.)
(For the same reason that cp -r does not follow symlinks by default.)
So it ought to be explicitly noted in the documentation that diff -r
follows symlinks.  Once you specify that, you have to add that diff -r
detects infinite loops of symlinks and then ...  Well, what *does* it
do when it finds an infinite loop?  Does it signal an error?  Does it
omit comparing files that it's already seen?  Does it omit comparing
file pairs that it has already compared?  (Which is not the same as
the previous option!)  One does not render diff's behavior predictable
without stating how it deals with symlink loops.

(What I'd really like to see is that diff compares symlinks by
extracting the contents of the links and comparing them.)

Dale



reply via email to

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