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

Options no_ignore, no_ignore_parent, hidden and follow #80

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ilan-schemoul
Copy link

Add options no_ignore, no_ignore_parent, hidden and follow

These four options are brought from the find_files finder of Telescope.
Default option for no_ignore is false therefore unlike the current behaviour
all files from .gitignore will be ignored (as it is always done with Telescope
and massively improve performance)

@ilan-schemoul ilan-schemoul force-pushed the main branch 3 times, most recently from 4015a9f to 4a8861d Compare July 7, 2024 11:52
These four options are brought from the find_files finder of Telescope.
Default option for no_ignore is false therefore unlike the current behaviour
all files from .gitignore will be ignored (as it is always done with Telescope
and massively improve performance)
@danielfalk
Copy link
Owner

Apologies for the late response. I am reluctant to add a bunch of options for several reasons. It adds complexity, makes testing difficult due to all the different option combinations, it makes the docs more daunting, etc.

With that said, if the default rg options aren't suitable, I think it would be better just do have an extra_rg_args option. That way, users can override even more options if they need to and we won't have to keep propagating further options into this plugin.


For files not already in your history, smart-open uses ripgrep for scanning the current directory. (The command is roughly: `rg --files --glob-case-insensitive --hidden --ignore-file=<cwd>/.ff-ignore -g <ignore_patterns...>`).

As a result, files added to git, _but also ignored by git_, will not be included. While not common, this is something that git allows. If this becomes a problem you can work around it by either changing your git ignore patterns, editing the file in neovim in some other way, (thereby adding it to the history), or by using ripgrep's `.ignore` file for overriding git.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

afaik, this is still a limitation. Ripgrep will not list a file that is added to git if it also matches a .gitignore pattern. (I believe git ls-files does the right thing here, and would list such files.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants