The inline-compare
script is a Go program designed to compare files in two directories by generating and comparing checksums. It allows users to specify various options such as line limits for large files, file size limits, and whether to use cached checksum files.
Script was created to compare 2 dumps of the same database, it outputs differences in a new directory.
- Generate checksums for files in two directories.
- Compare files based on their checksums.
- Generate a CSV file with differences.
- Compare large files by their last lines if they exceed a specified size limit.
- Option to use existing checksum CSV files to speed up the comparison process.
-
Clone the repository:
git clone [email protected]:bmxmale/inline-compare.git cd inline-compare
-
Build the script:
# Build for Linux GOOS=linux GOARCH=amd64 go build -o bin/inline-compare inline-compare.go # Build for macOS with Apple M3 processor GOOS=darwin GOARCH=arm64 go build -o bin/inline-compare inline-compare.go
-
Run the script:
./inline-compare [options] <dir1> <dir2>
-
Options:
-lines
: Number of lines to compare for large files (default: 50).-size
: File size limit in MB for comparing last lines (default: 100).-use-cache
: Use existing checksum CSV files instead of regenerating new ones.-debug
: Enable debug mode to display additional information.
- Lines: Number of lines to compare for large files.
- Size: File size limit in MB for comparing last lines.
- Use Cache: Use existing checksum CSV files to speed up the comparison process.
- Debug: Enable debug mode to display additional information during execution.
This software was created with the strong support of GitHub Copilot ❤️, an AI-powered code completion tool that helps developers write code faster and with greater accuracy.
With ❤️ from Poland 🇵🇱.