Repository navigation
fix: derive extra path repository names from portable paths - #90
Open
markmybytes wants to merge 1 commit into
Open
markmybytes wants to merge 1 commit into
markmybytes wants to merge 1 commit into
Conversation
Extra path and extra secret repository names previously encoded the machine-local absolute source path, so every machine or platform switch renamed all entries under config/extra/ and secrets/extra/. Names now derive from the portable path form (config-relative, home-relative, or absolute fallback, lowercased), so the same logical file maps to the same repository path on every machine. Repository names must fold case (full Unicode, because Windows normalizes resolved paths with a Unicode lowercase) and Unicode normalization (NFC, because macOS stores decomposed names) for the same file to map to the same repository path on both case-insensitive and case-sensitive platforms. As a consequence, distinct POSIX paths that differ only by case (Foo.md and foo.md, or É.md and é.md) now fail fast with a clear error instead of syncing as separate repository entries; case-sensitive setups with such extra paths must rename or drop one of them. The check covers a single machine's declarations: case variants declared on different machines still fold to one repository entry and share content. The error stops every command that builds a sync plan, including pulls, so a fleet stays affected until one declaration is renamed or removed. Pull-side manifest matching folds case and normalization the same way and restores each entry to the machine's own resolved path, so Windows-pushed entries (whose manifest source paths arrive folded) restore on case-sensitive platforms instead of being silently skipped. Manifest source paths keep the pushing machine's spelling, so that field may still flip case when pushes alternate between platforms; repository paths and restores stay stable. Absolute out-of-home declarations keep their absolute portable form and stay stable only when the declared path itself is not machine-specific. Duplicate declarations that resolve to the same file still collapse to a single entry. Existing manifests keep applying unchanged; the first push after this upgrade rewrites entries to the stable names.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Extra path repository names are derived from the machine-local absolute source path, so the same file ends up with a different name under
config/extra/(andsecrets/extra/) depending on which machine pushes. Windows and Linux disagree on top of that, since Windows resolves paths case-insensitively.I believe stabilizing these names is the right move — the same logical file should map to the same repository path on every machine. This PR makes that hold.
What this PR does
Foo.mdvsfoo.md, orÉ.mdvsé.md) — the message says to rename or drop one. Since the declarations live in the synced config itself, the error shows up on any sync command until resolved.Migration is free: old manifests keep applying, and the first push after upgrading rewrites entries to the stable names — push already fully rewrites the extra directory. 213 tests pass, with new coverage for cross-machine name equality, case folding, dedup, and the collision error.