BigDiff compares two directory trees and writes a third tree containing only the differences, with inline annotations directly in the files. This repository hosts both official implementations:
- Rust (
src/+Cargo.toml): fast, standalone binary. - Python (
bigdiff/+bigdiff.py): easy to run/extend; CLI output/messages remain in Portuguese to preserve the original UX.
Choose a version by running its entrypoint; there is no wrapper that forces a selection.
- Recursively compares Base (A) vs Target (B) and writes results to Output (C).
- New files get a
.newsuffix; deleted files get.deleted. - Modified files get
.modifiedwith inline diff:- Deleted lines are preserved as comments marked
DELETED. - Added lines are marked
NEW. - Comment syntax matches the file type (C-like, Python, HTML, etc.).
- Deleted lines are preserved as comments marked
- Binary or oversized files are copied as
.modifiedwith a companion<file>.modified.NOTE.txtexplaining why text diff was skipped. - Supports glob ignores, EOL normalization, and
--dry-runto preview the plan.
src/,Cargo.toml: Rust implementation and dependencies.bigdiff/,bigdiff.py: Python package and compatibility wrapper.target/: Rust build artifacts (generated by cargo).- Shared project metadata:
README.md,.gitignore,.gitattributes,LICENSE.
Prerequisite: Rust toolchain (cargo + rustc).
Build:
cargo build --release
# binary at target/release/bigdiffRun:
cargo run -- [OPTIONS] <base_dir> <target_dir> <output_dir>Notable options:
-i, --ignore <glob>(repeatable or comma-separated)-E, --normalize-eolnormalize CRLF/LF before comparing text-S, --max-text-size <size>text diff limit (e.g., 5MB)--dry-runprint the plan without writing files
Example:
cargo run -- ./v1 ./v2 ./diff_out --ignore "node_modules" --ignore "*.log" --normalize-eolPrerequisite: Python 3.8+.
Run:
python -m bigdiff FOLDER1 FOLDER2 FOLDER3 [options]
# compatibility wrapper:
python bigdiff.py FOLDER1 FOLDER2 FOLDER3 [options]Options (CLI strings are in Portuguese):
--ignore, -iglob patterns (repeatable or comma-separated)--normalize-eol, -Enormalize CRLF/LF before comparing text--max-text-size, -Stext diff limit (default5MB)--dry-runshow the summary only
name.ext.newfor files only in the target tree.name.ext.deletedfor files only in the base tree.name.ext.modifiedfor files that differ, with inline annotations.name.ext.modified.NOTE.txtexplains when text diff was skipped.
MIT – see LICENSE.