projectile-dir-files-alien returning deleted but unstaged files from git
git ls-files does not have the ability to remove deleted but unstaged files from the result, but does have the ability to only show deleted but unstaged files. projectile-dir-files-alien and projectile-get-sub-projects-files need to remove deleted but unstaged files before returning the result.
Steps to reproduce the problem
- Make sure fd is not in PATH
- git init repo
- cd repo
- echo "hello world" > greeting.txt
- git commit -m "greeting" greeting.txt
- rm greeting.txt
- M-x eval-expression RET (projectile-dir-files (projectile-project-root)) -> ("greeting.txt")
Expectation:
nil should be returned
Environment & Version information
git version 2.45.2
Projectile version information
Projectile 20240212.1100
Emacs version
29.4
Operating system
macOS
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed soon if no further activity occurs. Thank you for your contribution and understanding!
@bbatsov any ideas what the best approach is to solving this problem?
One option would be to tweak projectile-git-command (see https://github.com/bbatsov/projectile/blob/master/projectile.el#L698). Alternatively there's projectile-git-use-fd (see https://github.com/bbatsov/projectile/blob/master/projectile.el#L689).