forked from sharkdp/fd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add flag --no-require-git to always respect gitignore files
Summary: Currently, `--ignore-vcs` only serves to unset `--no-ignore-vcs`. There is currently no way to tell fd to respect gitignore files when not in a git repository. This commit adds the flag `--no-require-git` to make fd always respect all gitignore files. This behaves the same as the `--no-require-git` option in [ripgrep](https://github.com/BurntSushi/ripgrep/blob/3bb71b0cb8727ac43237af78ba5c707298de0128/crates/core/app.rs#L2214-L2226) Test Plan: `tests/tests.rs` Background: I am using [Sapling](https://sapling-scm.com/docs/introduction/) for working with git repositories (including this commit☺️ ). Since Sapling uses `.sl` instead of `.git`, tools using the `ignore` crate (rg and fd) would show gitignored files. I made a patch (vegerot/ripgrep@ebf17ee) to `ignore` to respect gitignores with _either_ `.git` or `.sl`. However, @BurntSushi said he did not want to merge that patch and instead suggested I use `--no-require-git` (BurntSushi/ripgrep#2374). This works fine, but I couldn't use this workaround for my other favorite tool! That's what this patch is for 😁 (a follow-up patch will add a similar `FD_CONFIG_PATH` environment variable like `RG_CONFIG_PATH`)
- Loading branch information
Showing
5 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters