Skip to content

Commit 72ff3cf

Browse files
committed
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
1 parent a665a3b commit 72ff3cf

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Unreleased
22

3+
## Features
4+
- Add `--ignore-parent` option to override `--no-ignore-parent`, see #1958 (@tmchow)
5+
36
## Bugfixes
47
- Handle invalid working directories gracefully when using `--full-path`, see #1900 (@Xavrir).
58

src/cli.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ pub struct Opts {
102102

103103
/// Show search results from files and directories that would otherwise be
104104
/// ignored by '.gitignore', '.ignore', or '.fdignore' files in parent directories.
105+
/// The flag can be overridden with --ignore-parent.
105106
#[arg(
106107
long,
107108
hide_short_help = true,
@@ -110,6 +111,10 @@ pub struct Opts {
110111
)]
111112
pub no_ignore_parent: bool,
112113

114+
/// Overrides --no-ignore-parent
115+
#[arg(long, overrides_with = "no_ignore_parent", hide = true, action = ArgAction::SetTrue)]
116+
ignore_parent: (),
117+
113118
/// Do not respect the global ignore file
114119
#[arg(long, hide = true)]
115120
pub no_global_ignore_file: bool,

0 commit comments

Comments
 (0)