Bug 8829 - rsync -uav --delete --dry-run prints delete file list in reverse order
rsync -uav --delete --dry-run prints delete file list in reverse order
Status: RESOLVED WONTFIX
Product: rsync
Classification: Unclassified
Component: core
3.0.9
All All
: P5 minor
: ---
Assigned To: Wayne Davison
Rsync QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-27 19:20 UTC by David C. Rankin
Modified: 2013-06-02 22:09 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 David C. Rankin 2012-03-27 19:20:18 UTC
When using: 'rsync -uav --delete --dry-run', the 'deleting ...' list displayed is output in *descending* sort order while the normal --verbose list of files is output in *ascending* sort order. This makes attempting to read and compare the files being deleted and updated very awkward.

To fix this issue, the --delete list should be presented in the same order as the --verbose list (especially when --dry-run is given). Example, currently rsync behaves like this:

rsync --delete -uavn ../dir1 desthost:~/dir2

  dir1/
  deleting dir2/file-z
  ...
  deleting dir2/file-a
  dir1/
  file-a
  ...
  file-z

For long lists, that is very awkward. Real world example:

13:50 alchemy:~/tde/pbf> rsync --delete -uavn ../pbf nirvana:~/tde
sending incremental file list
pbf/
deleting pbf/ts.txt
deleting pbf/pkgbld-notes.txt
deleting pbf/PKGBUILD-trinity-twindeco-crystal
deleting pbf/PKGBUILD-trinity-tqtinterface
deleting pbf/PKGBUILD-trinity-tqt3
deleting pbf/PKGBUILD-trinity-template-git
deleting pbf/PKGBUILD-trinity-template
deleting pbf/PKGBUILD-trinity-tdelibs
deleting pbf/PKGBUILD-trinity-tdedecor-crystal
deleting pbf/PKGBUILD-trinity-tdebase
deleting pbf/PKGBUILD-trinity-qt3
deleting pbf/PKGBUILD-trinity-pyqt3
deleting pbf/PKGBUILD-trinity-libcarddav
deleting pbf/PKGBUILD-trinity-libcaldav
deleting pbf/PKGBUILD-trinity-libart-lgpl
deleting pbf/PKGBUILD-trinity-kdelibs
deleting pbf/PKGBUILD-trinity-dbus-tqt-1
deleting pbf/PKGBUILD-trinity-dbus-tqt
deleting pbf/PKGBUILD-trinity-dbus-1-tqt
deleting pbf/PKGBUILD-trinity-dbus-1-qt3
deleting pbf/PKGBUILD-trinity-arts
deleting pbf/PKGBUILD-tde-twinstyle-crystal
deleting pbf/PKGBUILD-tde-twindeco-crystal
deleting pbf/PKGBUILD-tde-twin-style-crystal-1.0.5
deleting pbf/PKGBUILD-tde-tqt3-git
deleting pbf/PKGBUILD-tde-tdesvn-split
deleting pbf/PKGBUILD-tde-style-qtcurve
deleting pbf/PKGBUILD-tde-sip4-tqt.sav
deleting pbf/PKGBUILD-tde-kgtk-qt3-all
pbf/old/
pbf/old/PKGBUILD-tde-kgtk-qt3-all
pbf/old/PKGBUILD-tde-sip4-tqt.sav
pbf/old/PKGBUILD-tde-style-qtcurve
pbf/old/PKGBUILD-tde-tdesvn-split
pbf/old/PKGBUILD-tde-tqt3-git
pbf/old/PKGBUILD-tde-twin-style-crystal-1.0.5
pbf/old/PKGBUILD-tde-twindeco-crystal
pbf/old/PKGBUILD-tde-twinstyle-crystal
pbf/trinity/
pbf/trinity/PKGBUILD-trinity-arts
pbf/trinity/PKGBUILD-trinity-dbus-1-qt3
pbf/trinity/PKGBUILD-trinity-dbus-1-tqt
pbf/trinity/PKGBUILD-trinity-dbus-tqt
pbf/trinity/PKGBUILD-trinity-dbus-tqt-1
pbf/trinity/PKGBUILD-trinity-kdelibs
pbf/trinity/PKGBUILD-trinity-libart-lgpl
pbf/trinity/PKGBUILD-trinity-libcaldav
pbf/trinity/PKGBUILD-trinity-libcarddav
pbf/trinity/PKGBUILD-trinity-pyqt3
pbf/trinity/PKGBUILD-trinity-qt3
pbf/trinity/PKGBUILD-trinity-tdebase
pbf/trinity/PKGBUILD-trinity-tdedecor-crystal
pbf/trinity/PKGBUILD-trinity-tdelibs
pbf/trinity/PKGBUILD-trinity-template
pbf/trinity/PKGBUILD-trinity-template-git
pbf/trinity/PKGBUILD-trinity-tqt3
pbf/trinity/PKGBUILD-trinity-tqtinterface
pbf/trinity/PKGBUILD-trinity-twindeco-crystal

sent 2042 bytes  received 105 bytes  4294.00 bytes/sec
total size is 205877  speedup is 95.89 (DRY RUN)


To fix this problem, rsync should provide a consistent sort order for the deleting and transferring files:

rsync --delete -uavn ../dir1 desthost:~/dir2

  dir1/
  deleting dir2/file-a
  ...
  deleting dir2/file-z
  dir1/
  file-a
  ...
  file-z
Comment 1 Wayne Davison 2013-06-02 22:09:35 UTC
This is the expected delete order, which makes it easier for rsync to delete the directory after deleting the containing files.