snapdir diff

Compare two sides, each a set of manifests, reporting file-level differences.

diff reads MANIFESTS ONLY: it compares manifest entries without downloading the content objects those manifests reference. That makes it useful for scheduled inventory comparisons, release deltas, and audit workflows where object pools may be large or remote.

Usage

snapdir diff [OPTIONS]

Options

Option Description
--from <REF> FROM-side ref. Repeatable; refs are unioned into the FROM side.
--to <REF> TO-side ref. Repeatable; refs are unioned into the TO side.
--id <ID> Pin each side to this single manifest ID instead of unioning the whole store.
--all Also emit unchanged = paths.
--json Emit a JSON array of {status, path} objects instead of porcelain lines.
--exit-code Exit 1 when any difference is found, like git diff --exit-code.
--on-conflict <POLICY> Intra-side path collision policy: error (default) or last-wins.

Statuses are A for added, D for deleted, and M for modified. With --all, unchanged paths are emitted as =.

Examples

Compare two manifest stores:

snapdir diff --from s3://inventory/prod --to gs://inventory/dr

Compare a single pinned manifest ID on each side and fail the command when any difference exists:

snapdir diff --id 1220abc... --from s3://inventory/a --to s3://inventory/b --exit-code

Emit JSON for tooling:

snapdir diff --from file:///srv/before --to file:///srv/after --json

Resolve same-path collisions within a side by letting the last repeated ref win:

snapdir diff --from s3://old-a --from s3://old-b --to s3://new --on-conflict last-wins

See also