summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2012-01-07 00:57:29 +0100
committerBruno Haible <bruno@clisp.org>2012-01-08 21:26:27 +0100
commite3324651cc1f9f116754a4713e08bfb0bac50150 (patch)
tree071413c474e5e9764891135a33adf1fb7fd20860 /doc
parent45110a7927df633cb3235d4fee3d84b0b6d26a96 (diff)
downloaddiffutils-e3324651cc1f9f116754a4713e08bfb0bac50150.tar.gz
New option --no-dereference.
* src/diff.h (no_dereference_symlinks): New variable. * src/diff.c: Include xreadlink.h. (longopts): Add --no-dereference option. (main): Accept --no-dereference option. (option_help_msgid): Mention the --no-dereference option. (compare_files): If no_dereference_symlinks is true, use lstat() instead of stat(). Compare symbolic links by comparing their values. * bootstrap.conf (gnulib_modules): Add lstat, stat, xreadlink. * doc/diffutils.texi (Comparing Directories, diff Options): Mention the --no-dereference option. * tests/no-dereference: New file. * tests/Makefile.am (TESTS): Add it.
Diffstat (limited to 'doc')
-rw-r--r--doc/diffutils.texi10
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/diffutils.texi b/doc/diffutils.texi
index 5aff3c3..58b140c 100644
--- a/doc/diffutils.texi
+++ b/doc/diffutils.texi
@@ -1846,6 +1846,13 @@ is specified while the @option{--ignore-file-name-case} option is in
effect, case is ignored when excluding file names matching the
specified patterns.
+To avoid that @command{diff} follows symbolic links, use the
+@c later: @option{--no-dereference} (@option{-P}).
+@option{--no-dereference}.
+When this option is in use,
+symbolic links will be treated like a special kind of files, rather than
+comparing the target of each symbolic link.
+
@node Adjusting Output
@chapter Making @command{diff} Output Prettier
@@ -3848,6 +3855,9 @@ file in if-then-else format. @xref{Line Group Formats}.
Use @var{format} to output a line taken from just the second file in
if-then-else format. @xref{Line Formats}.
+@item --no-dereference
+Act on symbolic links themselves instead of what they point to.
+
@item --old-group-format=@var{format}
Use @var{format} to output a group of lines taken from just the first
file in if-then-else format. @xref{Line Group Formats}.