Skip to content

v1.22.1 — sync.py without git

Choose a tag to compare

@CesarRivasP CesarRivasP released this 06 Nov 16:37
· 56 commits to main since this release
5fdf43d

Why

Run on the set that motivated v1.22.0, sync.py exited 2: that registry is in .git/info/exclude, so git show REF:_facts.yml has nothing to return. 36 of the 64 real sets on disk keep _facts.yml out of git the same way (or have no repo), which left sync.py unusable on most of them.

What changes

  • --init-base writes _facts.synced.yml, a byte copy of the registry, beside _facts.yml. Refuses if it exists (exit 2) unless --force. Run it once, when the docs are known to match the registry.
  • The old registry is the first base that exists: --from-file PATH, --from REF, _facts.synced.yml, git HEAD (tracked and not ignored). None: exit 2 naming --init-base and --from-file. The first output line names the base used.
  • A fully clean --apply (exit 0, no ambiguous value left, no doc skipped) moves the snapshot forward, atomically. Otherwise the old snapshot stays, so the unapplied change shows again next run. A dry run never writes it.
  • Sets tracked in git with no snapshot behave exactly as in v1.22.0; no snapshot is created for them.
  • The _ prefix keeps the snapshot out of docs[] and the anchor checks; audit output on a fixture holding it is unchanged.

Verification

tests/test_sync.py 13/13 (new: a set with no git repo through init → edit → dry run → apply, init over an existing snapshot, snapshot kept when a value stays ambiguous, --from-file, snapshot wins over HEAD, no base at all). tests/test_audit.py 329/329; ship, facts, triage, render green.

On a copy of the real set: a renamed changes[].file was found and replaced in both doc lines that cited it, the Edits line printed, the snapshot moved forward; a one-character value change was refused as ambiguous and listed with its lines.

Release: v1.22.1 (README row and clone pin bumped). Merge with a merge commit.