https://github.com/containers/tar-diff
https://github.com/containers/tar-diff
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/containers/tar-diff
- Owner: containers
- License: apache-2.0
- Created: 2020-04-27T08:32:56.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-08-06T17:08:51.000Z (over 1 year ago)
- Last Synced: 2025-04-26T10:34:18.846Z (8 months ago)
- Language: Go
- Size: 239 KB
- Stars: 54
- Watchers: 7
- Forks: 15
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE-OF-CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
tar-diff
==
`tar-diff` is a golang library and set of commandline tools to diff and patch tar files.
`pkg/tar-diff` and the `tar-diff` takes two (optionally compressed) tar files and generates a single file representing the delta between them.
`pkg/tar-patch` takes a tardiff and the uncompressed contents (such as an extracted directory) of the first tarfile and reconstructs (binary identically) the second tarfile (uncompressed).
Example:
```
$ tar-diff old.tar.gz new.tar.gz delta.tardiff
$ tar xf old.tar.gz -C extracted/
$ tar-patch delta.tardiff extracted/ reconstructed.tar
$ zcat new.tar.gz | shasum
$ shasum reconstructed.tar
```
The main usecase for tar-diff is for more efficient distribution of [OCI images](https://github.com/opencontainers/image-spec).
These images are typically transferred as compressed tar files, but the content is refered to and validated by the checksum of
the uncomressed content. This makes it possible to use an extracted earlier version of and image in combination with a tardiff
to reconstruct and validate the current version of the image.
Delta compression is based on [bsdiff](http://www.daemonology.net/bsdiff/) and [zstd compression](https://facebook.github.io/zstd/).
The tar-diff file-format is described in [file-format.md](file-format.md)
License
-
tar-diff is licensed under the Apache License, Version 2.0. See
[LICENSE](LICENSE) for the full license text.