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

--smart-case ignores .ignore file when using path argument #1379

Closed
blueyed opened this issue Sep 15, 2019 · 4 comments
Closed

--smart-case ignores .ignore file when using path argument #1379

blueyed opened this issue Sep 15, 2019 · 4 comments
Labels
duplicate An issue that is duplicative of another.

Comments

@blueyed
Copy link
Contributor

blueyed commented Sep 15, 2019

Using --smart-case does not ignore a file specified in .ignore.

.ignore includes:

test/functional/fixtures/bigfile.txt
test/functional/fixtures/bigfile_oneline.txt
% /usr/bin/rg scroll -l test/functional --smart-case | grep oneline
test/functional/fixtures/bigfile_oneline.txt
% /usr/bin/rg scroll -l test/functional | grep oneline

The whole .ignore file:

src/nvim/po/*.po
luacov.report*
!local.mk
log-*

test/functional/fixtures/bigfile.txt
test/functional/fixtures/bigfile_oneline.txt

# https://github.com/BurntSushi/ripgrep/issues/1349
!/build
/build/**
!/build/src
!/build/src/nvim
!/build/src/nvim/auto
!/build/src/nvim/auto/**/*.c

This might be due to the file itself (via https://github.com/neovim/neovim/tree/b9d035a39cfcd61eab2633f55e6064460f557c69/test/functional/fixtures), I can provide more info if it is not reproducible for you.

ripgrep 11.0.2
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)

@blueyed
Copy link
Contributor Author

blueyed commented Sep 15, 2019

It only happens when specifying the dir as an arg.
With just /usr/bin/rg scroll -l it makes no difference if --smart-case is used (it is always ignored then as expected).

@blueyed blueyed changed the title --smart-case ignores .ignore file?! --smart-case ignores .ignore file when using path argument Sep 15, 2019
@BurntSushi
Copy link
Owner

I don't see what smart case has to do with this. The output you've shown is invariant with respect to whether smart case is enabled or not.

This looks like a duplicate of a big where ignore rules aren't always handled correctly when a directory is specified as an argument. But I'm on mobile, so I'm not searching for it right now.

@blueyed
Copy link
Contributor Author

blueyed commented Sep 16, 2019

Oh, sorry, edited the text - with /usr/bin/rg scroll -l test/functional --smart-case | grep oneline the output is empty, i.e. it is ignored there.

@BurntSushi
Copy link
Owner

The --smart-case behavior is easily explained. The file contains the text SCROLL, so rg scroll won't match it but rg scroll --smart-case will. This is expected and correct.

Otherwise, this looks like a duplicate of #829.

@BurntSushi BurntSushi added bug A bug. duplicate An issue that is duplicative of another. and removed bug A bug. labels Sep 16, 2019
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.
Projects
None yet
Development

No branches or pull requests

2 participants