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

Loosen strict handling of missing --ignore-file? #280

Closed
mqudsi opened this issue Apr 4, 2018 · 5 comments
Closed

Loosen strict handling of missing --ignore-file? #280

mqudsi opened this issue Apr 4, 2018 · 5 comments

Comments

@mqudsi
Copy link
Contributor

mqudsi commented Apr 4, 2018

Another FZF-prompted question: in some repositories, I have a .ignore file to help rg ignore files included in the git repo but not intended to be searched. I would like fd to use .ignore when it is present in $PWD, but unfortunately if the file does not exist fd throws an error:

mqudsi@Blitzkrieg /m/d/rand> fd --ignore-file .ignore hello
Error while parsing custom ignore file '.ignore': entity not found.

For cases where an ignore file is appended programmatically, it would be helpful to either (not necessarily silently?) ignore missing --ignore-file parameters or to otherwise support some sort of --maybe-ignore-file or --ignore-file xxx --ignore-missing-ignore-file.

This doesn't just apply to fzf, in my case I would like to alias fd to fd --ignore-file .ignore, too.

@sharkdp
Copy link
Owner

sharkdp commented Apr 6, 2018

Hi, thank you for your feedback!

I wasn't sure if raising an error would be the right thing to do. I think we should definitely downgrade this message to a warning. I would also be okay with adding a (possibly hidden?) --ignore-missing-ignore-file flag.

Also, note that fd supported .ignore files up to v6.3.0. It has just recently been changed to .fdignore. The reasoning is that there might be files that you would not want to search through via rg/ag/.. but might still very well try to find with fd. So another option would be to create a dedicated .fdignore file (or symlink .ignore to .fdignore) in your repositories.

Yet another option would be to make it possible to re-enable .ignore files in fd - although I haven't thought about this in detail.

@remexre
Copy link

remexre commented Jul 28, 2018

I'd be in favor of reenabling .ignore, possibly with a --dont-use-ignore-file or something similar.

@sharkdp
Copy link
Owner

sharkdp commented Oct 1, 2018

I think we should move forward by downgrading the error to a warning. We have just recently introduced a print_error function that doesn't exit fd, so this should be really easy to implement.

@sharkdp
Copy link
Owner

sharkdp commented Oct 8, 2018

I'd be in favor of reenabling .ignore, possibly with a --dont-use-ignore-file or something similar.

@remexre See #156 (comment)

@sharkdp
Copy link
Owner

sharkdp commented Oct 27, 2018

Fixed in fd-7.2.0. .ignore has also been added again.

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

No branches or pull requests

3 participants