Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rooted gitignore patterns in global ignore list show up in file picker #12604

Open
kmicklas opened this issue Jan 19, 2025 · 1 comment
Open
Labels
C-bug Category: This is a bug

Comments

@kmicklas
Copy link
Contributor

Summary

By default Helix reads both the project-local .gitignore patterns and the global ~/.config/git/ignore patterns, and suppresses files matching them from appearing in the file picker.

Ignore patterns can be restricted to the repo root by prefixing them with /. For example /.envrc only matches a file called .envrc in the repo root. This appears to work correctly with the file picker when written in the project-local .gitignore. However when written in the global ignore list, it doesn't seem to have any effect.

Reproduction Steps

  1. Add a rooted pattern, for example /a to ~/.config/git/ignore
  2. Create a file called a in the root of a repo
  3. See that a appears in the picker
  4. Add /a to .gitignore in the repo
  5. See that a does not appear in the picker

Helix log

No response

Platform

Linux

Terminal Emulator

alacritty

Installation Method

nixpkgs

Helix Version

helix 25.1

@kmicklas kmicklas added the C-bug Category: This is a bug label Jan 19, 2025
kmicklas added a commit to kmicklas/config that referenced this issue Jan 19, 2025
@kmicklas
Copy link
Contributor Author

From a brief look at the code I suspected that this behavior comes from ignore, but interestingly ripgrep does not have the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

1 participant