Re:Find Files (Ff) – File Search Utility in Rust
by wst_ on Wednesday February 27, 2019 @09:25AM
(#19263375)
Someone already opened an issue to make it ignore files specified in `.gitignore`. A `fd` is doing it, `rg` is doing it, now someone wants this to behave the same. I don't know. Maybe I have some really strange expectations but when I want to find a file and nothing comes up as a result, I want to be sure nothing is there. And I want to be sure without remembering bunch of command line options or setting up aliases everywhere I log in because, guess what, maybe they invented some other file with patterns to ignore. Is it only me?
[ Parent
| on HN ]
Re:Find Files (Ff) – File Search Utility in Rust
by burntsushi on Wednesday February 27, 2019 @09:44AM
(#19263509)
That's the great thing about these tools. There is no need to serve as fundamental tools of a system that conform to some ancient spec like POSIX. There is no need for that because those tools already exist and work well. So if that's the behavior you want, then just use those tools. They work exceptionally well when called by other programs, like shell scripts, because they have reasonably standardized behavior.
But with these tools, we have the freedom to revisit old assumptions. One of those is smart filtering. I can't tell you how many people tell me that they enjoy that as a good default.
Tools should make the fact that they do smart filtering very clear, because it can be surprising if you aren't expecting it. But otherwise, I'm not particularly sympathetic to your reasoning here because: 1) what I said above about standard tools being available and 2) these tools should have ways of disabling smart filtering. So if it bites you, it should bite you only once. After that, you either learn to like it, learn to setup an alias and forget about it, or ragequit the tool.
Re:Find Files (Ff) – File Search Utility in Rust
by dangom on Wednesday February 27, 2019 @09:38AM
(#19263470)
99.99% of the times you don't want to search for files that are in .gitignore. Ignoring by default is the sane default, as it reduces the amount of false positives. If you do want to search through all files, there's probably a flag that allows you to do that. You can alias your commands to `alias tool="tool --whatever-flag"`.
Re:Find Files (Ff) – File Search Utility in Rust
by lathiat on Wednesday February 27, 2019 @01:42PM
(#19265761)
I got bitten recently by haproxy using the '!' prefix on .gitignore lines to negate previous lines. This resulted in ag silently not searching any of the code base at all. So if you're implementing .gitignore support, you may want to consider at worst bailing on files with this syntax (and perhaps other syntax that is not supported)
ag bug: https://github.com/ggreer/the_silver_searcher/issues/1233
Re:Find Files (Ff) – File Search Utility in Rust
by vishaltelangre on Thursday February 28, 2019 @11:54AM
(#19272748)
This is no longer true. `ff` searches through all files recursively by default no matter whether a file or directory is enlisted in ".gitignore" or is hidden. There are flags to change this behavior.