Skip to content
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

Directory separators not normalised on Windows #711

Closed
mrmonday opened this issue Dec 11, 2017 · 2 comments
Closed

Directory separators not normalised on Windows #711

mrmonday opened this issue Dec 11, 2017 · 2 comments
Labels
duplicate An issue that is duplicative of another. question An issue that is lacking clarity on one or more points. wontfix A feature or bug that is unlikely to be implemented or fixed.

Comments

@mrmonday
Copy link

Using either cmd or git bash on windows:

$ rg --version
ripgrep 0.6.0
-AVX -SIMD

$ find .
.
./a
./a/c
./a/c/b
$ cat a/c/b
aaaa
bbbb
cccc

$ rg aa a/
a/c\b
1:aaaa

Here the output mixed / and \ as directory separators - they should be normalised for consistency.

@BurntSushi
Copy link
Owner

This looks like a duplicate of #275. In particular, what should the paths be normalized to? Does --path-separator fix this issue for you?

@BurntSushi BurntSushi added duplicate An issue that is duplicative of another. question An issue that is lacking clarity on one or more points. labels Dec 11, 2017
@mrmonday
Copy link
Author

That works, I'll set up an alias.

I thought it might be good to normalise by default, so I did a little investigation:

  • grep in git bash (find does similarly):
    $ grep -r aa 'a\'
    a\/c/b:aaaa
    $ grep -r aa 'a/'
    a/c/b:aaaa
    
  • findstr in cmd: I couldn't find a way to make it recurse, but it prints exactly as passed
  • dir in cmd: This always normalises to \
  • Get-ChildItem a/ -Recurse in powershell normalises to \

I'm no expert in Window's command line utilities, but my minor investigation reveals quite a mixed bag of results - there's no definitive "ripgrep should do this because it's what everything else does".

I'll close this, since --path-separator is a sufficient workaround. Thanks.

@BurntSushi BurntSushi added the wontfix A feature or bug that is unlikely to be implemented or fixed. label Dec 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate An issue that is duplicative of another. question An issue that is lacking clarity on one or more points. wontfix A feature or bug that is unlikely to be implemented or fixed.
Projects
None yet
Development

No branches or pull requests

2 participants