Repository navigation
Copy only what a repository asks for when forking a worktree - #19
Merged
Merged
Conversation
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.
What
Rule-based copying for copy-on-write worktree forks, so a warm
agentstudio worktree newcopies what the repository asks for and nothing it shouldn't:GitWorktreeCopyRulesonGitForkWorktreeRequest.copyRules:.copyAll(previous behavior) or.copyMatching([GitPathPattern]).GitPathPattern: gitignore grammar without negation (brackets, POSIX classes,**, anchoring); a leading!is rejected. Patterns compile once.core.ignorecaseis followed.nestedWorktreesSkipped.ignoredIncludedPatterns,ignoredExcludedCount,nestedWorktreesSkipped.sourceIndexUnreadable,sourceIndexUnsupported(sparse/split index;.copyMatchingonly)..copyAlldoesn't read the source index. The app's Fork button keeps working on sparse and split-index checkouts.Contract: agentstudio Spec LR28 and Program Design "How
newcopies" (worktree-lifecycle design, r23/r29).Proof (final head f259a9a)
CI
check: green on f259a9a (Homebrew git 2.55.0), including the AddressSanitizer and ThreadSanitizer lanes and the downstream-consumer checks.Local:
mise run checkandmise run test-tsaneach ran 613 tests with 0 failed (89 suite runs).Matching follows Git exactly.
GitPathPatternis a byte-oriented port of Git's wildmatch plus thematch_pathnameone-byte prefix context (git 1940a02dc1, shipped in Git 2.52). Patterns compile once; there is no regex.Permanent native-Git differentials in the normal gates:
check-ignorecheck-rulessparse-checkout reapplyThe suites are version-aware. Below Git 2.52, the one class whose behavior changed in Git is asserted against recorded modern values.
Lead's independent harness (compiled from the committed sources): about 182k
check-ignoredecisions, 0 mismatches.Real checkout (agent-studio main, 123k files, release build):
.copyMatchingis within a few percent of.copyAll;Frameworks/GhosttyKit.xcframeworkis present;.copyAlldoesn't read the source index. The original sparse-index topology and clean-adoption proofs are byte-identical to before.Review
🤖 Generated with Claude Code