google / open-vcdiff

An encoder/decoder for the VCDIFF (RFC3284) format
Apache License 2.0
187 stars 52 forks source link

Recursive directory diff support #30

Open Steelskin opened 10 years ago

Steelskin commented 10 years ago

Original issue 30 created by schmidlin on 2011-09-04T19:32:39.000Z:

Please add a feature for recursive diff between two directories, creating a single patch that describes the differences.

Steelskin commented 9 years ago

Old comments:

The encoder produces a delta file from a source (or dictionary) file and a target file. To apply VCDIFF to a directory in the file system, you might use "tar" or a similar archiving utility to gather the directory contents into a stream of bytes suitable for use as the target file.

Reply:

I already tried the tar approach, but it revealed not practical for distributing patches to end users:

  1. It requires that the end-users have tar installed. Most don't even know that this tool exist.
  2. It requires scripts to be created to (a) tar the destination directory into a file and (b) apply the patch. But different systems have different scripting shells: cmd32.exe, bash, ksh etc
  3. There's now way to assure that the user's tar will behave like my system tar and assemble the file in the same way (different implementation, different file order, username, permissions, etc)
  4. It requires me to distribute the patch without checksum checking, which means the users will have no easy way to be sure if the resulting files are correct, because they will not know if the source files were correct. This means that the users will have to manually check the entire directory checksum before applying the patch. I can't even convince the users to check a single file, what can be said about they hypothetically checking an entire directory tree? :)

We would need to find the proper semantic to do that. It is not high priority for the time being.