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
I stumbled over a case where ripgrep ignores files that are not ignored by git. I am unsure if this is actually an issue of ripgreps interpretation of the .gitignore file, something that cannot be realized without further information about the repository or even a issue of git itself. I think this is best explained by a minimal example:
$ tree
.
├── a.txt
└── sub
├── b.txt
├── c.txt
└── d.md
1 directory, 4 files
$ cat .gitignore
# Ignore everything
*
# Exceptions for txt files
!*.txt
# Apply above to subfolders
!**/
$ git status
On branch master
Initial commit
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
new file: sub/b.txt
Untracked files:
(use "git add <file>..." to include in what will be committed)
a.txt
sub/c.txt
The files b.txt and c.txt are ignored by ripgrep even tough they are not ignored by git. Since b.txt is staged it is clear that it cannot be ignored by git, but git also does not ignore c.txt which suggests to me that the 6th line of the .gitignore does what the comment says. Note that d.md is correctly ignored by both ripgreg and git.
I absolutely love ripgrep and use it everyday to quickly navigate foreign code bases --- or my own --- its often faster than waiting for the (re)indexing to complete. Thank you for sharing the project!
The text was updated successfully, but these errors were encountered:
I stumbled over a case where ripgrep ignores files that are not ignored by git. I am unsure if this is actually an issue of ripgreps interpretation of the .gitignore file, something that cannot be realized without further information about the repository or even a issue of git itself. I think this is best explained by a minimal example:
The files b.txt and c.txt are ignored by ripgrep even tough they are not ignored by git. Since b.txt is staged it is clear that it cannot be ignored by git, but git also does not ignore c.txt which suggests to me that the 6th line of the .gitignore does what the comment says. Note that d.md is correctly ignored by both ripgreg and git.
I absolutely love ripgrep and use it everyday to quickly navigate foreign code bases --- or my own --- its often faster than waiting for the (re)indexing to complete. Thank you for sharing the project!
The text was updated successfully, but these errors were encountered: