feat: add --ignore-parent option to override --no-ignore-parent

Add the --ignore-parent flag, mirroring the existing pattern where
--ignore-vcs overrides --no-ignore-vcs. This lets users undo
--no-ignore-parent in aliases or config files.

Closes #1958
This commit is contained in:
Trevin Chow
2026-04-06 00:53:39 -07:00
parent a665a3bba9
commit 72ff3cf694
2 changed files with 8 additions and 0 deletions
+3
View File
@@ -1,5 +1,8 @@
# Unreleased
## Features
- Add `--ignore-parent` option to override `--no-ignore-parent`, see #1958 (@tmchow)
## Bugfixes
- Handle invalid working directories gracefully when using `--full-path`, see #1900 (@Xavrir).
+5
View File
@@ -102,6 +102,7 @@ pub struct Opts {
/// Show search results from files and directories that would otherwise be
/// ignored by '.gitignore', '.ignore', or '.fdignore' files in parent directories.
/// The flag can be overridden with --ignore-parent.
#[arg(
long,
hide_short_help = true,
@@ -110,6 +111,10 @@ pub struct Opts {
)]
pub no_ignore_parent: bool,
/// Overrides --no-ignore-parent
#[arg(long, overrides_with = "no_ignore_parent", hide = true, action = ArgAction::SetTrue)]
ignore_parent: (),
/// Do not respect the global ignore file
#[arg(long, hide = true)]
pub no_global_ignore_file: bool,