From 0e890aecdcd5e9d36cd1a7cddb245d63fe55ab6c Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Wed, 26 Aug 2026 15:13:46 +0200 Subject: [PATCH] Update README where the fixes changed documented behaviour diff now reports snapshot:line: field for a malformed record instead of failing with a bare errno, and accepts an empty snapshot. The build already uses -O2, so drop it from the roadmap. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_018KyCHPAxWzqa3vHKdXJkgx --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4cec39f..1ae8489 100644 --- a/README.md +++ b/README.md @@ -122,8 +122,9 @@ pathname: | `L` | Symlink target is the only differing field after the other compared fields match | | `M` | Any other difference, including type, owner, size, time, or fingerprint | -`diff` does not print a line number or field name when an input snapshot is -malformed; it fails with `EINVAL`. +`diff` reports a malformed input the way `list` does, as +`snapshot:line: invalid ` or `snapshot:line: unparsable line`, and +returns `128` internally; `main` maps it to exit status `1`. ## Behaviour worth knowing @@ -154,7 +155,9 @@ malformed; it fails with `EINVAL`. rejects out-of-range values (`ERANGE`), negative `uid`/`gid`, and any leading whitespace or `+` sign, rather than letting `strtoumax` wrap them. - **An empty snapshot is valid.** `create` produces a zero-byte file for an - empty directory, and `list` accepts it silently with exit `0`. + empty directory, `list` accepts it silently with exit `0`, and `diff` treats + it as carrying no records, so every entry on the other side is reported as + added or deleted. ## Known limitations @@ -202,8 +205,7 @@ Rough order of intent, no timeline: filesystem, distinguishing `ENOENT`, `EACCES`, `ENOTDIR` and `ELOOP` rather than collapsing them ([SPEC.md](SPEC.md) ยง18). - [ ] Honour `TMPDIR` instead of hardcoding `/tmp`. -- [ ] Add a test suite and wire it into the `Makefile`; build with `-O2` so the - compiler's flow analysis is actually enabled. +- [ ] Add a test suite and wire it into the `Makefile`. - [ ] Add an `install` target. ## License