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

Filepicker follows gitignored symlinks (in whitelisted folder) #12451

Open
Familex opened this issue Jan 7, 2025 · 1 comment
Open

Filepicker follows gitignored symlinks (in whitelisted folder) #12451

Familex opened this issue Jan 7, 2025 · 1 comment
Labels
C-bug Category: This is a bug

Comments

@Familex
Copy link

Familex commented Jan 7, 2025

Summary

Setup is a little tricky, I made repository for reproduction steps.

Similar situation occurs when using gitignore as whitelist with direnv (use flake):

  1. root .gitignore in the repo contains * and !*/ lines, which is usually enough to ignore all files unless whitelisted.
  2. direnv copies current repo (indexed files) to .direnv/flake-inputs/XXXX-source/ subfolder.
  3. Because of this, the file .direnv/flake-inputs/XXXX-source/.gitignore appears (same as .gitignore).
  4. This file whitelist all files in .direnv/flake-inputs/XXX-source/ and they are listed in the filepicker.

Git ignores this files, unlike helix.

Reproduction Steps

  1. clone https://github.com/Familex/helix-gitignore-issue.git.
  2. cd into folder-A.
  3. run hx.
  4. press space + F.

Filepicker lists files under ignored symlink.

Helix log

Result of hx -vvv --config /dev/null --log log.log: log.log

Log follows reproduction steps

Platform

Linux

Terminal Emulator

alacritty

Installation Method

flake

Helix Version

helix 25.1 (3531760)

@Familex Familex added the C-bug Category: This is a bug label Jan 7, 2025
@pascalkuthe
Copy link
Member

Git status does not follow symlinsk in general AFAIK bit helix does so that's why helix does not behave like git. This is pretty convoluted but on first glance it seems like helix is behaving correctly. We sue the ignore crate for walking files which is part of rupgrep and the logic there is well established.

If you don't want thenfilepikcer to follow symlinks you can turn that off in your config.

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

2 participants