-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows: Forward slash paths in .gitignore are not matched against backslash paths #127
Comments
I think the problem here is that I tried too hard to support both Rust's |
Another solution is to make the glob implementation aware of this. Namely, any time a pattern has a |
fixed in |
I have some
.gitignore
entries like this/*/Dependencies/
that are not working with ripgrep on Windows systems, ripgrep will list files in those directories.Here is a test that will fail on Windows. Note, this will also fail on non-Windows systems but that is just because of the back slashes in the expected output (really nice test DSL by the way!).
test output:
I guess this is because there is no path separator normalization in the matching code so
foo\\sherlock
does not matchfoo/sherlock
. Not sure what the best plan to fix it is. I did some searching around rust libs to see if there is anything that will normalize path separators but I have not found anything yet. Personally I'd be happy if command line tools like ripgrep always dealt with forward slash paths (most Windows APIs and Powershell work fine with forward slash paths) but I fully understand the need to support cmd.exe and the like.Normalizing the paths and then converting to system appropriate paths on output seems like the sensible choice but looking at
gitignore.rs
, it would probably not be too horrid to make it handle both separators - not sure how well that would scale once you start on other ignore formats like Mercurial.The text was updated successfully, but these errors were encountered: