Skip to content

fix: normalize exclude patterns in build_overrides #1926

Open
FidelSch wants to merge 1 commit intosharkdp:masterfrom
FidelSch:multi-path-exclude
Open

fix: normalize exclude patterns in build_overrides #1926
FidelSch wants to merge 1 commit intosharkdp:masterfrom
FidelSch:multi-path-exclude

Conversation

@FidelSch
Copy link
Copy Markdown
Contributor

Fixes #1919

// Always make such patterns unanchored with a "**/" prefix.
let glob = &pattern[1..]; // strip leading "!"
let normalized = if glob.contains('/') && !glob.starts_with("**/") {
format!("!**/{}", glob)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This will significantly change the behavior. That means that if you exclude something like "/a/b" that will now start also excluding

"foo/a/b" from the base directory.

I'll put some more thoughts on how we could approach solving this on the issue itself, but I don't thik this is a good solution for this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we could add a special case for root paths, or try to implement a different gitignore root for each given search path

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.

[BUG] --exclude quirk, only seems to affect first --search-path in some cases (without glob)

2 participants