Split config manifest/state and normalize URLs#257
Open
bresilla wants to merge 2 commits intomarcosnils:masterfrom
Open
Split config manifest/state and normalize URLs#257bresilla wants to merge 2 commits intomarcosnils:masterfrom
bresilla wants to merge 2 commits intomarcosnils:masterfrom
Conversation
- Introduce `stateEntry` and `state` structs to manage per-machine mutable data. - Refactor config loading to separate manifest and state. - Implement a migration logic to split existing config into manifest and state files. - Update `write` function to `writeAll` and introduce `writeManifest` and `writeState` functions for separate persistence. - Refine `getConfigPath` logic. - Add `getStatePath` to determine the location for the state file based on OS and environment variables.
- Add `StateURL` field to `Binary` struct to persist original URLs. - Introduce URL normalization for manifest entries, converting release-specific URLs to base repository links. - Update `install` and `update` commands to utilize the new `StateURL` field.
Contributor
|
Ooh I've been having this same annoyance and just pull |
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.
I use this tool across multiple machines and keep my dotfiles under version control. The problem is that every time I update on one machine and push the dotfiles, the other machines think they already have the latest versions. This happens because the manifest mixes two things that should be separate: the repository list (portable) and the per-machine state (mutable versions).
This PR cleanly separates them. The manifest now contains only the repository names, while the per-machine version state is stored in a separate location. On Linux this follows the XDG spec in ~/.local/share/, and on Windows and macOS it follows their respective standard app-data paths. With this split, one can push git changes to without every update mutating the manifest.
Summary