You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is expected but inconsistent behavior with git. git is not "parsing" your gitignore correctly here. The issue is that git knows which files are being tracked in your index. But according to gitignore, those files would otherwise be ignored. It is very easy to confirm this:
$ touch scripts/lib/wat
$ git status
HEAD detached at 87638bf
nothing to commit, working tree clean
If your .gitignore file worked how you claimed it should, then git should report wat as an untracked file. But it doesn't, because it's ignored. So ripgrep's behavior here is correct, strictly speaking, from the perspective of your .gitignore rules. The inconsistency arises from the fact that ripgrep does not search files based on what is actually tracked in your git repository. The only way to fix this is to make your .gitignore file match the actual files being tracked or otherwise use a .ignore file somehow to override your .gitignore.
BurntSushi
changed the title
Incorrect .gitignore parsing
ripgrep does not search files tracked by git because they are ignored by gitignore
Mar 26, 2020
Wow, it's so embarrassing I haven't recognized git file-tracking behavior, even though I'm well-aware of it. Sorry for making you spend your time on this pointless issue and thank you very much for thoroughly explaining everything.
Ver:
12.0.0
OS:
Arch Linux (x86_64, linux 5.5.9.arch1-2)
Installed via:
pacman
Description
If
!/some_folder
is used alongside/**
, the folder itself will be visible for ripgrep, but its contents will be not.git
parses everything correctly.Steps to reproduce
git clone https://github.com/Vermintide-Mod-Framework/Vermintide-Mod-Builder.git .
git checkout 87638bf
(Current HEAD commit, just in case something will be changed in the future)rg rmn
Expected:
./scripts/lib/str.js
Actual:
The text was updated successfully, but these errors were encountered: