aboutsummaryrefslogtreecommitdiff
path: root/doc/modules/ROOT/pages/configuration.adoc
diff options
context:
space:
mode:
authorBozhidar Batsov <bozhidar@toptal.com>2026-04-26 12:30:10 +0100
committerBozhidar Batsov <bozhidar@toptal.com>2026-04-26 12:30:10 +0100
commita039e44622b644deb90893f7b27c0940c486bbb7 (patch)
treec0f515288905544ea851a166322239d7936eb7d7 /doc/modules/ROOT/pages/configuration.adoc
parent366049b8f4a14fc1842ae264e6544bdc279308b5 (diff)
Document remaining indexing semantics
Three doc gaps surfaced during the indexing review: * The `*' prefix on `projectile-globally-ignored-directories' entries is not a glob - it is what promotes a basename match from "anchored at the project root" to "anywhere in the tree", and it only takes effect under hybrid indexing. * The default `projectile-generic-command' picks `fd' when it's on PATH and falls back to a `find ... | tr ...' pipeline. The fallback does not exclude common build directories, which is a trap for non-VCS projects under alien on hosts without `fd'. * `projectile-git-use-fd' controls how Projectile handles deleted-but-unstaged files: with `fd' they disappear immediately, with `git ls-files' Projectile post-filters via `git ls-files -zd'.
Diffstat (limited to 'doc/modules/ROOT/pages/configuration.adoc')
-rw-r--r--doc/modules/ROOT/pages/configuration.adoc22
1 files changed, 18 insertions, 4 deletions
diff --git a/doc/modules/ROOT/pages/configuration.adoc b/doc/modules/ROOT/pages/configuration.adoc
index 1492633..2eada23 100644
--- a/doc/modules/ROOT/pages/configuration.adoc
+++ b/doc/modules/ROOT/pages/configuration.adoc
@@ -116,18 +116,32 @@ WARNING: If you ever decide to tweak those keep in mind that the command should
the list of files **relative** to the project root and the resulting file list should be 0-delimited
(as opposed to newline delimited).
-For non-VCS projects Projectile will invoke whatever is in `projectile-generic-command`. By default that's:
+For non-VCS projects Projectile will invoke whatever is in `projectile-generic-command`. The default chooses `fd` when it's installed and falls back to `find`:
+[source,elisp]
----
-find . -type f -print0
+;; Effective default value of projectile-generic-command, picked at load time:
+;; when fd is on PATH:
+"fd . -0 --type f --color=never --strip-cwd-prefix"
+;; otherwise:
+"find . -type f | cut -c3- | tr '\\n' '\\0'"
----
TIP: It's a great idea to install https://github.com/sharkdp/fd[fd] which is much faster than `find`.
- If `fd` is found, projectile will use it as a replacement for `find`.
+ If `fd` is found, projectile will use it as a replacement for `find` for non-VCS projects.
+
+WARNING: The `find` fallback does *not* exclude common build/cache directories
+ (`.git`, `node_modules`, `target`, `build`, …); a non-VCS project under `alien`
+ indexing on a host without `fd` will list everything. Either install `fd`,
+ switch to `hybrid` indexing so `projectile-globally-ignored-directories`
+ applies, or override `projectile-generic-command` with a tighter recipe.
By default, `fd` is also used inside Git repositories (instead of `git ls-files`),
because `git ls-files` has the limitation that it lists deleted files until the
-deletions are staged. You can control this with `projectile-git-use-fd`:
+deletions are staged. With `fd`, deleted files disappear from the listing
+immediately; with `git ls-files`, Projectile post-filters the listing against
+`git ls-files -zd` to hide deletions until they're staged. You can control this
+with `projectile-git-use-fd`:
[source,elisp]
----