On Wed, 2007-11-07 at 00:08 -0500, [EMAIL PROTECTED] wrote:
> Then how about this:  If your patch winds up in rsync, it requires a
> patch to the manpage entry for -n that says, essentially, "You can't
> trust the actual information emitted when running with -n to match
> what gets emitted if you haven't specified -n.  Therefore, if you're
> writing things that parse rsync's output, you must ensure that your
> script works with and without -n.  Here is an itemization of those
> things that might be different in its output with and without -n:
>   (a) With -n, the speedup line will be omitted.
>   (b) ....?"
> Etc.

My proposed omission of the speedup would be far from the first
difference in output between dry and real runs.  In any event, the man
page description of --dry-run needs some serious work.  I propose the
attached patch, which even comes with a commit message:

Improve the man page and --help descriptions of --dry-run.  In particular,
make it clear that --dry-run turns off action without turning on verbosity,
and mention some statistics that are meaningless on a dry run.

Matt
Improve the man page and --help descriptions of --dry-run.  In particular,
make it clear that --dry-run turns off action without turning on verbosity,
and mention some statistics that are meaningless on a dry run.

--- old/options.c
+++ new/options.c
@@ -351,7 +351,7 @@ void usage(enum logcode F)
   rprintf(F,"     --fake-super            store/recover privileged attrs using xattrs\n");
 #endif
   rprintf(F," -S, --sparse                handle sparse files efficiently\n");
-  rprintf(F," -n, --dry-run               show what would have been transferred\n");
+  rprintf(F," -n, --dry-run               skip actual modifications to destination\n");
   rprintf(F," -W, --whole-file            copy files whole (without rsync algorithm)\n");
   rprintf(F," -x, --one-file-system       don't cross filesystem boundaries\n");
   rprintf(F," -B, --block-size=SIZE       force a fixed checksum block-size\n");
--- old/rsync.yo
+++ new/rsync.yo
@@ -352,7 +352,7 @@ to the detailed description below for a 
      --super                 receiver attempts super-user activities
      --fake-super            store/recover privileged attrs using xattrs
  -S, --sparse                handle sparse files efficiently
- -n, --dry-run               show what would have been transferred
+ -n, --dry-run               skip actual modifications to destination
  -W, --whole-file            copy files whole (without rsync algorithm)
  -x, --one-file-system       don't cross filesystem boundaries
  -B, --block-size=SIZE       force a fixed checksum block-size
@@ -1022,8 +1022,19 @@ NOTE: Don't use this option when the des
 filesystem. It doesn't seem to handle seeks over null regions
 correctly and ends up corrupting the files.
 
-dit(bf(-n, --dry-run)) This tells rsync to not do any file transfers,
-instead it will just report the actions it would have taken.
+dit(bf(-n, --dry-run)) This makes rsync go through the motions of a copy
+(and produce mostly the same output) but skip the actual modifications to
+the destination.  It is most commonly used in combination with bf(--verbose)
+and/or bf(--itemize-changes) to see what an rsync command is going to do
+before one actually runs it.
+
+The output of bf(--itemize-changes) is supposed to be exactly the same on a
+dry run and a subsequent real run (barring intentional trickery and system
+call failures); if it isn't, that's a bug.  Other output is the same to the
+extent practical but may differ in some areas.  Notably, a dry run does not
+send the actual data for file transfers, so bf(--progress) has no effect,
+the "bytes sent", "bytes received", "literal data", and "matched data"
+statistics are too small, and the "speedup" is meaningless.
 
 dit(bf(-W, --whole-file)) With this option the delta transfer algorithm
 is not used and the whole file is sent as-is instead.  The transfer may be
-- 
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to