Repository navigation
feat(worktree)!: keep worktree records beside git, drop the global store - #34
Merged
Merged
Conversation
meta recorded every worktree set in ~/.meta/worktree.json behind worktree.lock. Each linked worktree meta creates now gets a record in git's own admin directory for it (<repo>/.git/worktrees/<id>/meta-worktree.json), which git deletes with the worktree. remove and prune prove ownership from those records; list reads TTL, ephemeral and custom metadata from them; prune finds sets under the worktree root and through the records in the workspace's repositories. The store, its lock and the lock module are deleted. Sets created by an older meta have no record: remove and prune refuse them, as they refused unrecorded sets before. Implements [[tasks/harmony-2765]]
… live record - add, list and prune read records through one check (member_record), so a record outside <repo git dir>/worktrees is never copied or used - a worktree git has locked blocks removal up front - prune decides with the record the set's own worktrees hold and needs the removal check to see that same record; an orphaned-repos verdict is re-checked with every repo the full scan finds; records it cannot read are reported as kept (so --strict fails); forgetting a missing set deletes only the records prune read Refs [[tasks/harmony-2765]]
…orts unlistable records - when the full scan shows a set is not orphaned after all, prune still checks its TTL - a .git/worktrees directory or worktree root prune cannot list is reported as kept, so --strict fails instead of finding nothing Refs [[tasks/harmony-2765]]
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
A nested .meta that fails to parse stops the walk over the workspace's repositories; prune now lists that as kept (so --strict fails) instead of only warning. Refs [[tasks/harmony-2765]]
…ved sets and every repo layout - records are written with a plain atomic write into the existing admin dir, without the data dir's privacy check: a git dir inherits its checkout's ACL (on Windows under C:\ any signed-in user may change files), and that check made create fail there - prune finds the git dir of --separate-git-dir repos and reports repos it cannot inspect; aliases are /-separated on every platform - records whose worktree is still checked out elsewhere (a moved set) are not forgotten; stale records under a reused path are left to git; a recorded path that became a link is still checked and reported - remove says when a record names a set path that is gone - tests for these, for record-write failures in create and add, and the dangling-link test keeps its record again Refs [[tasks/harmony-2765]]
…leaves partly moved sets - only a missing commondir means a --separate-git-dir checkout; any other read error is reported as kept, so --strict fails - a bare source repository is its own git dir, so its sets are found - a set whose directory is gone is forgotten only when every one of its worktrees is gone - remove says what to do with a refused directory that holds no worktrees Refs [[tasks/harmony-2765]]
A record that cannot be read blocks remove and prune, as proof of ownership, but no longer stops a failed create from deleting the set it claimed itself. The record-failure test now checks the rollback. Refs [[tasks/harmony-2765]]
…o its git dir Refs [[tasks/harmony-2765]]
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.
create/add/list/remove/prune use the records instead of the store: remove requires a record naming the set; add copies the set's record; list reads TTL/ephemeral/custom from records; prune finds sets under the worktree root and through records in the workspace's repos, judges each by its live record, and reports records it can't read as kept. Tests in
tests/safety.rsadapted and added.Part of gitkb/meta#126, which has the full description, the investigation and how it was verified. Merge together with it (same branch name, so CI builds them together).
Implements [[tasks/harmony-2765]]