Skip to content

v1.8.1 - tracked file attributes and modes

Choose a tag to compare

@VectorSophie VectorSophie released this 14 Sep 05:01
· 43 commits to main since this release

A .hgitattributes file (same directory, same glob grammar as .hgitignore) declares a tracked file's real mode — TempleOS has no Unix permission bits or execute bit, so text/binary/executable are only ever set explicitly, never guessed for executable:

*.png binary
*.HC text,executable
build/* binary

Binary detection otherwise falls back to Git's own real NUL-byte-in-the-first-8000-bytes heuristic for any file no rule matches.

Mode is stored as a commit-level side-channel (a new OBJ_ATTRS object, entity-ID-keyed) rather than embedded in tree entries — a deliberate choice after measuring the alternative's real blast radius (8 files hand-parse tree-entry bytes; only 3 call CommitEncode). Costs nothing for a repo where every file is plain text and non-executable.

  • status/statustree and diff surface a pure mode change (no content edit) independently of the existing UNCHANGED/MODIFIED verdict: STATUS_MODE_CHANGED/DIFF_MODE_CHANGED <path> <old> -> <new>.
  • check validates the mode list's own referential integrity the same way it does every other object reference (a real gap found and fixed along the way: the reachability walk didn't know about attrs_hash at all, so every repo's own attrs object showed up as a false CHECK_DANGLING).
  • format_version bumped 2 → 3 — additive, no migration needed; an older commit correctly reports "no attrs" via a real bounds check, not a version branch.

Full design: docs/adr/0015-file-attributes-and-modes.md. Roadmap context: docs/ROADMAP-v1.8.md.