Repository navigation
worktree checkout improvements - #3056
Conversation
cc45747 to
917e4b9
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 917e4b9ece
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".
917e4b9 to
d21b83d
Compare
Looked at everything carefully, but was despite test refactoring, I went through those more quickly. The benchmark I only skimmed. <!-- agent --> Adding a linked worktree from a sparse checkout copied its configuration without its patterns, then materialized the entire target tree. Copy active `info/sparse-checkout` patterns from the source worktree's private Git directory during preparation, including when checkout is deferred. Missing patterns are skipped, empty files are retained, and copy failures roll back registration. Expose pattern loading and full-index selection through `gix_worktree::sparse`. Initial checkout in `gix` reads the destination's current patterns and marks excluded target-tree entries with `SKIP_WORKTREE` and `EXTENDED` before writing files and persisting the index. Support cone and non-cone patterns, case folding, invalid-cone fallback, root entries, and directory pruning. Sparse index generation and updates to existing checkouts remain outside this API. Reuse matching decisions for shared directory ancestors with storage bounded by path depth, and skip index traversal for a validated full-cone selection. Cover pattern matching with 18 Git-generated baseline scenarios, regression tests for cache boundaries and ordering, and integration tests for main and linked sources, deferred checkout, missing or disabled patterns, and rollback. Add Criterion benchmarks for cone and non-cone selection on synthetic indices with 20,000 to 200,000 entries, checking membership and flags before timing. Breaking change: `gix_worktree::add::prepare()` now accepts the destination first, followed by an `add::Context` containing the common Git directory and an optional source private Git directory, then its existing options. Use `add::Context::new(common_dir)` when pattern inheritance is not wanted. Assisted-by: GPT 6.1 Sol Co-authored-by: GPT 6.1 Sol <codex@openai.com>
d21b83d to
d471c0b
Compare
Non-cone directory-only patterns should treat gitlinks as directories on every host, including when the destination is initially empty. The original matcher instead hardcoded them as non-directories, reproducing the result of Git's little-endian `ce_to_dtype()` bug. Expose `gix_index::entry::Mode::is_dir_for_git_matching()` using decoded modes directly, and document why Git's extra `ntohl()` conversion is wrong. Use this classification for sparse matching, so `/*/` includes an absent gitlink and `!/module/` excludes it consistently across hosts. Keep Git-generated baselines while working around its conversion bug: pre-create the empty gitlink directory only for the reference operation, allowing Git's filesystem fallback to recover its intended classification. The gix index-only regression and initial checkout still start without it. Check included gitlinks as directories rather than reading them as files. Assisted-by: GPT 6.1 Sol Co-authored-by: GPT 6.1 Sol <codex@openai.com>
Tasks