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

projectile-generic-command will try to use fd even if projectile-fd-executable is set to nil #1853

Closed
Liorst4 opened this issue Jul 13, 2023 · 0 comments · Fixed by #1865
Closed

Comments

@Liorst4
Copy link
Contributor

Liorst4 commented Jul 13, 2023

projectile-generic-command is set to use fd or fdfind if they are available, without checking that the user didn't explicitly ask to not use them.

projectile/projectile.el

Lines 754 to 768 in 31b8715

(defcustom projectile-generic-command
(cond
;; we prefer fd over find
;; note that --strip-cwd-prefix is only available in version 8.3.0+
((executable-find "fd")
"fd . -0 --type f --color=never --strip-cwd-prefix")
;; fd's executable is named fdfind is some Linux distros (e.g. Ubuntu)
((executable-find "fdfind")
"fdfind . -0 --type f --color=never --strip-cwd-prefix")
;; with find we have to be careful to strip the ./ from the paths
;; see https://stackoverflow.com/questions/2596462/how-to-strip-leading-in-unix-find
(t "find . -type f | cut -c3- | tr '\\n' '\\0'"))
"Command used by projectile to get the files in a generic project."
:group 'projectile
:type 'string)

I used projectile on a machine with Ubuntu 20.04, it had fd 7.4.0, which complained about the --strip-cwd-prefix flag.
I tried to work around that by setting projectile-fd-executable to nil, but projectile kept using fdfind.

Workaround

Explicitly set projectile-generic-command to a command that doesn't use fd or fdfind

Expected behavior

  • Set projectile-fd-executable to nil
  • projectile will not try to use fd or fdfind

Actual behavior

  • Set projectile-fd-executable to nil
  • projectile will try to use fd or fdfind
miles170 added a commit to miles170/projectile that referenced this issue Oct 11, 2023
…e-fd-executable` to find the path for fd
bbatsov pushed a commit that referenced this issue Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants