Bug 1433 - The --dry-run (-n) option doesn't report some directory changes
Summary: The --dry-run (-n) option doesn't report some directory changes
Status: CLOSED FIXED
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 2.5.7
Hardware: All All
: P5 minor (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-05 11:32 UTC by Wayne Davison
Modified: 2005-04-01 11:24 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wayne Davison 2004-06-05 11:32:35 UTC
Joe Harrington writes:

The -vn option lists all files to be copied or deleted, including
symlinks, but it does not appear to list empty directories to be
copied, even tough it copies them.  It does list empty directories to
be deleted.  The -v option does list and copy empty directories.  -v
should behave the same in both instances, and the desired behavior is
to report the copy of the empty directory.

Consider the following tree:

drwxr-xr-x    4 jh       jh           4096 Jan 14 15:50 .
drwxr-xr-x    2 jh       jh           4096 Jan 14 15:45 ./baz
-rw-r--r--    1 jh       jh              0 Jan 14 15:45 ./baz/glup
drwxr-xr-x    3 jh       jh           4096 Jan 14 15:50 ./foo
drwxr-xr-x    2 jh       jh           4096 Jan 14 15:31 ./foo/bar
-rw-r--r--    1 jh       jh              0 Jan 14 15:44 ./foo/quux
lrwxrwxrwx    1 jh       jh              3 Jan 14 15:50 ./foo/wrt -> spl

rsync -aHSvn --delete foo/ baz/
building file list ... done
deleting glup
quux
wrt -> spl
wrote 133 bytes  read 24 bytes  314.00 bytes/sec
total size is 3  speedup is 0.02

Here it should have said it would copy bar.

rsync -aHSvn --delete baz/ foo/
building file list ... done
deleting wrt
deleting quux
deleting directory bar
glup
wrote 96 bytes  read 24 bytes  240.00 bytes/sec
total size is 0  speedup is 0.00

Here we did hear about bar, correctly.

rsync -aHSv --delete foo/ baz/
building file list ... done
deleting glup
./
bar/
quux
wrt -> spl
wrote 165 bytes  read 36 bytes  402.00 bytes/sec
total size is 3  speedup is 0.01

Without -n, we hear about bar, correctly, as well, and it is copied:

drwxr-xr-x    4 jh       jh           4096 Jan 14 15:50 .
drwxr-xr-x    3 jh       jh           4096 Jan 14 15:50 ./baz
drwxr-xr-x    2 jh       jh           4096 Jan 14 15:31 ./baz/bar
-rw-r--r--    1 jh       jh              0 Jan 14 15:44 ./baz/quux
lrwxrwxrwx    1 jh       jh              3 Jan 14 15:53 ./baz/wrt -> spl
drwxr-xr-x    3 jh       jh           4096 Jan 14 15:50 ./foo
drwxr-xr-x    2 jh       jh           4096 Jan 14 15:31 ./foo/bar
-rw-r--r--    1 jh       jh              0 Jan 14 15:44 ./foo/quux
lrwxrwxrwx    1 jh       jh              3 Jan 14 15:50 ./foo/wrt -> spl

Please send any replies personal, as I am not on the list.
Comment 1 Wayne Davison 2004-06-09 15:03:38 UTC
We'll reopen this bug later.
Comment 2 Wayne Davison 2004-09-17 18:25:31 UTC
I decided I don't like a "resolve later" idiom, so I'll leave this open awaiting
that future time when this will be fixed.
Comment 3 Wayne Davison 2005-01-20 19:32:16 UTC
This is now fixed in the CVS version, as well as a few other --dry-run
inaccuracies.  Testers welcomed -- let me know if there are any remaining
problems or any weird side-effects to my changes.