jj-vcs/jj

FR: Use filesets for sparse checkouts

Open

#7.815 geöffnet am 22. Okt. 2025

Auf GitHub ansehen
 (15 Kommentare) (1 Reaktion) (0 zugewiesene Personen)Rust (1.052 Forks)batch import
enhancementđŸ—ïžgood first issue

Repository-Metriken

Stars
 (28.830 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 23T 5h) (46 gemergte PRs in 30 T)

Beschreibung

After reading the Sparse Patterns V2 design doc I was wondering why we don't use the Filesets DSL to describe paths of a sparse checkout? Is there something I am missing or was that simply not considered as a possibility? (I just did a quick search which revealed nothing, but maybe I missed the argument against it...)

Suppose I have the following files in my working copy:

project1/foo.txt
project1/bar.txt
project2/foo.txt
project2/bar.txt
...
projectN/foo.txt
projectN/bar.txt

Now I want to restrict the checked out files to */foo.txt. Since both the current implementation as well as the Sparse Patterns V2 design doc use prefix-matching only (I.e. no glob-patterns) I really have to list all the files I am interested in:

jj sparse set --clear --add 'project1/foo.txt' --add 'project2/foo.txt' ...
# for the lazy ones:
ls */foo.txt | jj sparse edit --config 'ui.editor="tee"'

However, IMHO a simple jj sparse set 'glob:"*/foo.txt"' would be the better user experience.

Would a contribution with that change be accepted?

Contributor Guide