Skip to content

Honor dirconfig keep entries under alien indexing#2109

Merged
bbatsov merged 1 commit into
masterfrom
fix/keep-entries-under-alien
Jul 21, 2026
Merged

Honor dirconfig keep entries under alien indexing#2109
bbatsov merged 1 commit into
masterfrom
fix/keep-entries-under-alien

Conversation

@bbatsov

@bbatsov bbatsov commented Jul 21, 2026

Copy link
Copy Markdown
Owner

alien ignored + keep entries outright and said nothing about it, which is worst in exactly the monorepo case most likely to use them. The plumbing to restrict the walk already existed and hybrid used it - projectile-dir-files-alien and friends take a SUBDIRS argument, and projectile--ext-command-line appends them as pathspecs with an fd --search-path special case - so alien simply never passed them along.

Looking at that turned up a live bug on master. Appending pathspecs to a shell pipeline doesn't restrict anything, it breaks the command: the svn, fossil and pijul recipes and the plain find fallback all end in a tr stage, so the paths land on tr.

find . -type f | cut -c3- | tr '\n' '\0' src/ tests/

hybrid with two or more keep entries hits this on any of those tools, which includes anyone without fd installed - indexing fails with a user-error rather than degrading. Commands that can't take path arguments now run unrestricted and get their output filtered by path prefix, which is exact and costs one pass.

Verified across native, hybrid, alien+git, alien+fd and both pipeline cases; all six return the same file set for a project mixing + keeps with a - ignore. The docs said + was hybrid/native only in three places, including the WARNING added a couple of hours ago - all updated, and the indexing comparison table now says Yes.

Two things, the second found while looking at the first.

Alien ignored `+' keep entries entirely: it walked the whole root and
said nothing about it. The plumbing to restrict the walk already
existed and hybrid used it - projectile-dir-files-alien and friends
take a SUBDIRS argument, projectile--ext-command-line appends them as
pathspecs with an fd --search-path special case - so alien just never
passed them. Now it does.

The other half is that appending pathspecs to a shell pipeline is
broken. The svn, fossil and pijul recipes and the plain find fallback
all end in a `tr' stage, so the paths landed on `tr' instead of the
lister and the command exited non-zero:

  find . -type f | cut -c3- | tr '\n' '\0' src/ tests/

That is a live bug on master, not something alien introduced: hybrid
with two or more keep entries hits it on any of those tools, which
includes anyone without fd installed. Commands that can't take path
arguments now run unrestricted and have their output filtered by path
prefix instead, which is exact and cheap.

Verified across native, hybrid, alien+git, alien+fd and both pipeline
cases: all six now return the same file set.
@bbatsov
bbatsov merged commit 6a70735 into master Jul 21, 2026
10 checks passed
@bbatsov
bbatsov deleted the fix/keep-entries-under-alien branch July 21, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant