Repository navigation
fix: match rotate path order and skipped files in rotate --dry-run - #37
Merged
Merged
Conversation
`previewTree` in `src/main.zig` sorted files per directory before recursing into subdirectories, whereas the shell script sorted full paths across the whole run tree. Both `eb-keep-logs` and `src/main.zig` also listed files with an existing `.gz` sibling or `nlink > 1` that real `rotate` refuses to compress. `previewTree` now collects candidate paths across the run tree and sorts them bytewise after skipping multi-link files and existing `.gz` paths, matching `LC_ALL=C sort -z` and the same skip checks in `eb-keep-logs`. `docs/orgmode/reference/cli.org`, `COMPAT.md`, `tests/differential.sh`, and `tests/test_eb_keep_logs.sh` document and verify exact byte parity between both tools and matching counts against `rotate`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
eb-keep-logs rotate --dry-rundiverged between the shell script and the Zig binary, and both implementations reported files thatrotateskips.previewTreeinsrc/main.zigsorted files within each directory before recursing into subdirectories, whereas the shell script sorted full paths across the entire run tree. Both tools also printed and counted files whose.gzsibling already existed or whose link count exceeded one. Those paths are refused when realrotateruns.I updated
previewTreeinsrc/main.zigto gather candidate paths across the run tree, skip multi-link files and existing.gzpaths, and sort the collected paths bytewise. The shell scripteb-keep-logsnow appliesLC_ALL=C sort -zand performs the same.gzand hard-link checks.docs/orgmode/reference/cli.org,COMPAT.md,tests/differential.sh, andtests/test_eb_keep_logs.shupdate the documented contract and test raw-byte parity plus count equality againstrotate.