Skip to content

rebase ignore crate from 0.4.24 to 0.4.33 - #20409

Merged
RobinMalfait merged 1 commit into
mainfrom
chore/update-ignore-crate
Aug 13, 2026
Merged

rebase ignore crate from 0.4.24 to 0.4.33#20409
RobinMalfait merged 1 commit into
mainfrom
chore/update-ignore-crate

Conversation

@RobinMalfait

Copy link
Copy Markdown
Member

This PR updates the vendored ignore/ crate to make use of the upstream improvements.

We can't fully use the native ignore crate yet because of the missing functionality that we added ourselves. Our own changes are still marked as CHANGED:

Test plan

  1. All tests should still pass [ci-all]

Stack created with GitHub Stacks CLIGive Feedback 💬

@RobinMalfait
RobinMalfait requested a review from a team as a code owner August 12, 2026 16:06
@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (2): Last reviewed commit: "rebase `ignore` crate from 0.4.24 to 0.4..." | Re-trigger Greptile

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The ignore crate is updated to version 0.4.33 with Rust edition 2024 and Rust 1.88. It adds IncrementalIgnore and IncrementalMatch for cached root-relative matching. Matcher state now supports shared parent caches with root-specific paths. Git configuration discovery and default file types are expanded. Walk builders support multiple roots, prebuilt matchers, depth-aware loading, collected filesystem errors, and panic-safe parallel workers. Hidden-path handling and error context are updated.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: rebasing the vendored ignore crate from version 0.4.24 to 0.4.33.
Description check ✅ Passed The description explains the crate update, retained project-specific changes, and expected test coverage.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (2)
crates/ignore/src/walk.rs (1)

328-335: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Duplicate WithDepth wrapper in two DirEntryRaw constructors. Both sites call .with_depth(depth) and then wrap the result in a second Error::WithDepth with the same depth, producing WithDepth { WithPath { WithDepth { Io } } }. No public accessor changes behavior, because Error::depth reads the outermost WithDepth and Display for WithDepth delegates to the inner error. The extra layer is still redundant, and it is inconsistent with from_path at Line 395, which wraps once.

  • crates/ignore/src/walk.rs#L328-L335: in from_entry, drop the Error::WithDepth { depth, err: Box::new(err) } line and return Error::Io(err).with_depth(depth).with_path(ent.path()) directly.
  • crates/ignore/src/walk.rs#L345-L348: in the Windows from_entry_os, apply the same change so the metadata error is wrapped once.
crates/ignore/src/pathutil.rs (1)

19-39: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Rename the parameter and document the Windows stat cost.

Two small points on is_hidden_path:

  1. The parameter is named dent but its type is &Path. The name is a copy of the is_hidden_entry signature. The inner imp already uses path.
  2. On Windows this function calls path.metadata(), which is a real syscall. is_hidden_entry documents that its metadata is already cached by the traverser and is therefore "free". is_hidden_path has no such note, and incremental.rs calls it per intermediate directory at Line 379 and per matched path at Line 407.

Both call sites guard on mat.is_none(), and the IncrementalIgnore docs already warn about extra per-path work, so no behavior change is needed. Add a note so future readers do not assume the two functions cost the same.

♻️ Proposed fix
 /// ## All other platforms
 ///
 /// This only returns true if the base name of the path starts with a `.`.
-pub(crate) fn is_hidden_path(dent: &Path) -> bool {
+///
+/// Note that on Windows this performs a `stat` call to read the file
+/// attributes. Prefer [`is_hidden_entry`] when a directory entry is
+/// available, since its metadata is already cached by the traverser.
+pub(crate) fn is_hidden_path(path: &Path) -> bool {
     #[cfg(not(windows))]
     fn imp(path: &Path) -> bool {
         is_hidden_path_only(path)
     }
 
     #[cfg(windows)]
     fn imp(path: &Path) -> bool {
         use std::os::windows::fs::MetadataExt;
         use winapi_util::file;
 
         if let Ok(md) = path.metadata() {
             if file::is_hidden(md.file_attributes() as u64) {
                 return true;
             }
         }
         is_hidden_path_only(path)
     }
 
-    imp(dent)
+    imp(path)
 }

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: de182fdf-0d87-4efa-b4f9-56d8ca0ca638

📥 Commits

Reviewing files that changed from the base of the PR and between b86a6e0 and cde1db8.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (12)
  • crates/ignore/Cargo.toml
  • crates/ignore/examples/walk.rs
  • crates/ignore/src/default_types.rs
  • crates/ignore/src/dir.rs
  • crates/ignore/src/gitignore.rs
  • crates/ignore/src/incremental.rs
  • crates/ignore/src/lib.rs
  • crates/ignore/src/overrides.rs
  • crates/ignore/src/pathutil.rs
  • crates/ignore/src/types.rs
  • crates/ignore/src/walk.rs
  • crates/ignore/tests/gitignore_matched_path_or_any_parents_tests.rs

Comment thread crates/ignore/src/gitignore.rs
Comment thread crates/ignore/src/gitignore.rs
Comment thread crates/ignore/src/walk.rs
Comment thread crates/ignore/src/walk.rs
@RobinMalfait
RobinMalfait force-pushed the chore/update-ignore-crate branch from cde1db8 to a4d3f80 Compare August 13, 2026 09:44
@RobinMalfait
RobinMalfait merged commit 606438c into main Aug 13, 2026
24 checks passed
@RobinMalfait
RobinMalfait deleted the chore/update-ignore-crate branch August 13, 2026 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant