Skip to content
New issue

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

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

Already on GitHub? # to your account

projectile-dir-files-alien returning deleted but unstaged files from git #1897

Open
wyuenho opened this issue Jul 13, 2024 · 3 comments
Open
Labels

Comments

@wyuenho
Copy link
Contributor

wyuenho commented Jul 13, 2024

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

  1. Make sure fd is not in PATH
  2. git init repo
  3. cd repo
  4. echo "hello world" > greeting.txt
  5. git commit -m "greeting" greeting.txt
  6. rm greeting.txt
  7. 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

Copy link

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!

@github-actions github-actions bot added the Stale label Jan 19, 2025
@wyuenho
Copy link
Contributor Author

wyuenho commented Jan 22, 2025

@bbatsov any ideas what the best approach is to solving this problem?

@bbatsov
Copy link
Owner

bbatsov commented Jan 22, 2025

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).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants