Artifact dd120069d53867b77b7356a11af6caa60858957a18bc917c0494bcf1c1a5f446:
- File
cli/json.go
— part of check-in
[beed361c03]
at
2026-10-19 20:17:37
on branch feat/cli-snapshot
— feat(cli): checkout-free snapshot, per-path log, cat --at and diff --json
repo snapshot commits one file's bytes onto trunk with no checkout, a no-op when they equal the tip. repo log --path lists the check-ins that changed a path, repo cat --at reads a file as a version holds it, and repo diff --json A B [PATH] diffs two versions. Exit 2 means not found. A snapshot re-checks the check-in stamp inside its write transaction and retries, so concurrent processes build one linear trunk.
Tracked in #451 (user: [email protected], size: 403) [annotate] [blame] [check-ins using] [more...]
package cli import ( "encoding/json" "os" ) // writeJSON prints v to stdout as one line of JSON. The shapes it prints are // the machine interface of snapshot, log and diff, documented in // docs/site/content/docs/cli-embedding.md; a field is never renamed or // removed, only added. func writeJSON(v any) error { enc := json.NewEncoder(os.Stdout) enc.SetEscapeHTML(false) return enc.Encode(v) }