-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Double-star in ignore glob patterns does not work #530
Comments
Same for me in 0.26 |
Yes, this requires some changes to the ignoring code to work correctly. I don't use double-stars in my gitignores, so I've kinda neglected it. Sorry. :( Note: The "ignore" label is for issues with git/hg/ag-ignores. It doesn't mean I'm going to ignore the issue. |
😆 re the explanation of the ignore tag, thanks for the clarification :) |
As noted in #594 (comment), this could be solved for git by using |
I wired up Jason's suggestion, here. Not tested on Unix. Works for me on Windows. |
Any update on this issue? |
I have added note about this issue in the wiki. |
I just use |
Are single asterisks not supported either? I'm trying a pattern like |
I know this is an old issue, but is it likely to ever be fixed? If it might be fixable via PR, can you give a pointer to where in the code this pattern matching happens? |
It would be nice if this got fixed. I was quite disappointed to discover that even though the readme says Reading @decaff's published fix this doesn't seem too hard to implement. @ggreer would you consider a PR for this? |
This is making ag basically unusable for me, I use double-stars heavily in my .gitignore files. It seems to be a regression since (at least) version 0.31, as I discovered when upgrading to ubuntu 18.04 from 16.04. And as @fabiospampinato mentioned, it's misleading and frustrating to find that the readme is incorrect. |
Would definitely like this :) big fan of ag, my hands are trained on it! |
Because patterns with double-star globs in .ignore files doesn't work with ag: ggreer/the_silver_searcher#530
This is similar for leading backslashes. In .NET projects, |
Just to throw up another use case:
for allowing "mock modules". This rule makes ag search all node_modules, making it kind of useless |
Workaround:
|
using
in my |
Update vim's fzf plugin to use rg (ripgrep) instead of ag (silversearcher) to perform searches inside files, using [1] as a guide. rg is faster than ag [2] which makes it perform better on larger repositories. The former also has better support for ignore files: * It is able to fully respect (i.e. ignore) files ignored by .gitignore and .hgignore, unlike ag [3]. * Its --ignore-file flag can accept an ignore file that has the same syntax as .gitignore, .hgignore, etc. [1] https://github.com/junegunn/fzf.vim#example-rg-command-with-preview-window [2] https://github.com/BurntSushi/ripgrep#quick-examples-comparing-tools [3] https://github.com/ggreer/the_silver_searcher/wiki/Advanced-Usage#ignoring-files [4] ggreer/the_silver_searcher#530 (comment)
I have a rule
/public/**/*.js
in my.gitignore
file, which means ignore any file ending in.js
which is in/public
or any subdirectory of/public
. Ag is still giving results from such files.The text was updated successfully, but these errors were encountered: