Skip to content

fix(picker): file picker not respecting .gitignore#2177

Merged
ibhagwan merged 1 commit intoibhagwan:mainfrom
amlanjlahkar:main
Jul 16, 2025
Merged

fix(picker): file picker not respecting .gitignore#2177
ibhagwan merged 1 commit intoibhagwan:mainfrom
amlanjlahkar:main

Conversation

@amlanjlahkar
Copy link
Copy Markdown
Contributor

By default fd only respects global or local gitignore rules if searching inside a git repository. However in certain scenarios, e.g. when using jujutsu instead of git, this approach never takes effect since it can't find a .git directory in cwd.

The proposed --no-require-git flag allows fd to respect all git related ignore rules, regardless of whether it's searching inside a git repo or not.

I think it's safe to include this flag in default cmd.

By default `fd` only respects global or local gitignore rules
if searching inside a git repository. However in certain scenarios,
e.g. when using jujutsu(https://github.com/jj-vcs/jj) instead of git,
this approach never takes effect since it can't find a .git directory in cwd.

The proposed `--no-require-git` flag allows `fd` to respect all git
related ignore rules, regardless of whether it's searching inside a git repo or not.
@ibhagwan
Copy link
Copy Markdown
Owner

Tyvm @amlanjlahkar for this thoughtful PR, seems this flag existed since fd v8.7 which is old enough, so this goes in :)

https://github.com/sharkdp/fd/releases/tag/v8.7.0

@ibhagwan ibhagwan merged commit d918735 into ibhagwan:main Jul 16, 2025
@amlanjlahkar
Copy link
Copy Markdown
Contributor Author

From the release note you mentioned, this behaviour is confirmed for ripgrep as well and I guess it also should be the default for grepping in general

@ibhagwan
Copy link
Copy Markdown
Owner

From the release note you mentioned, this behaviour is confirmed for ripgrep as well and I guess it also should be the default for grepping in general

We can add it to rg as well it it makes sense and is old enough to not cause issues with older rg versions.

@ibhagwan
Copy link
Copy Markdown
Owner

Already have two issues with this, may have to revert it and you can just add this to your fd_opts instead, #2180, #2179.

ibhagwan added a commit that referenced this pull request Jul 17, 2025
ibhagwan added a commit that referenced this pull request Jul 17, 2025
@amlanjlahkar
Copy link
Copy Markdown
Contributor Author

okay, no problem

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants