Bug 2104 - Implement --only-write-batch=FILE
Implement --only-write-batch=FILE
Status: CLOSED FIXED
Product: rsync
Classification: Unclassified
Component: core
2.6.4
All All
: P3 enhancement
: ---
Assigned To: Wayne Davison
Rsync QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-11-30 13:58 UTC by Wayne Davison
Modified: 2005-06-03 01:39 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wayne Davison 2004-11-30 13:58:47 UTC
Make the combination of --write-batch with --dry-run create a batch file without
actually updating the destination.  (The current behavior is to complain if the
user tries to combine these options.)

The implementation would require rsync to do more work in --dry-run mode than
normal when --write-batch is specified (i.e. generating checksums, computing
diffs), but still not send the update-data to the receiver (just to write it to
the batch file).  This _might_ be fairly easy, but I haven't checked yet to be sure.

(Suggested by Peter Hartley.)
Comment 1 Wayne Davison 2005-02-12 15:01:32 UTC
This should not be that hard.  The generator would need to be modified so that
it actually computes the checksums and sends them to the sender in this mode and
(for a push) the sender would need to be enhanced to output its changes to the
batch fd instead of the socket, or (for a pull) the sender would need to go
ahead and send its update data down the socket while the receiver would just
throw away the update data after recording it.  Also, the --write-batch option
would need to be sent to a server sender (which it is not currently) to trigger
the right mode (when pulling files).  Care needs to be taken to test for
compatibilty problems in this regard (since we currently avoid sending
--write-batch to the server for compatibility reasons).
Comment 2 Wayne Davison 2005-03-28 09:36:39 UTC
I want --dry-run to always indicate that no changes will be made whatsoever, so
I'm changing the summary of this bug to correspond with a new option that now
has a diff in the "patches" dir of CVS:  --only-write-batch=FILE.  This option
accomplishes the functionality you requested, while both avoiding the
aforementioned compatibility problem that using --write-batch would entail, and
allowing --dry-run to be fixed to work properly with --write-batch/--read-batch
(which is now the case in CVS -- this combo just reports what would happen
without --dry-run).

Note that 2.6.4 won't have this new option because the patch still needs some
more testing (and the option name may change before the dust settles).
Comment 3 Wayne Davison 2005-04-17 23:01:40 UTC
I added the --only-write-batch option to CVS a little while ago (including some
fixes not present in the patch).