Commit e3b0bb6
feat: Jujutsu (jj) support for files and grep, auto-detecting
* fix: exclude .jj directory from file search defaults
Jujutsu (jj) stores internal data in a .jj directory. Exclude it from
the default fd_opts, rg_opts, and find_opts so .jj contents don't
appear in file picker results.
* feat: add jj_files provider for Jujutsu workspaces
Add a FzfLua jj_files command that lists tracked files using
`jj file list`, mirroring git_files but for Jujutsu repos. This
works in secondary jj workspaces that lack a .git directory.
- path.jj_root(): detects jj workspace root with fast .jj walk-up
- path.is_jj_repo(): boolean wrapper
- providers/jj.lua: jj_files provider following the git_files pattern
- defaults.lua: jj.files config with jj file list command
* feat: add vcs_files provider with jj -> git -> files fallback
Adds FzfLua vcs_files as a drop-in replacement for git_files that
auto-detects the VCS: uses jj_files in jj workspaces, git_files in
git repos, and falls back to the regular files picker otherwise.
* fix: make vcs_files self-contained to avoid E565 window error
vcs_files was delegating to git.files()/jj.files() which each call
normalize_opts and core.fzf_exec independently. This caused E565
errors when the function was invoked from a context where opening
windows isn't immediately allowed.
Instead, detect the VCS type, normalize opts with the right defaults
key, set the VCS root as cwd, and call core.fzf_exec directly.
* refactor: consolidate jj_root cmd construction into single expression
* refactor: simplify vcs_files back to delegation pattern
The E565 error was caused by hardtime.nvim + function-reference keymaps,
not by the delegation pattern. Revert to the simpler form that delegates
to jj.files()/git.files()/files() directly, avoiding duplicated logic.
* test: add unit tests for jj_root and is_jj_repo
* test: add vcs_files delegation unit tests
* fix: resolve CI lint failures and add jj documentation
- Add @param/@return annotations to is_jj_repo and jj_root to fix
redundant-parameter lint warnings
- Add diagnostic disable for duplicate-set-field in vcs_files tests
(intentional monkey-patching)
- Update find_opts to use -prune for .jj directories instead of -path filter
- Add opts = opts or {} in vcs_files to prevent nil indexing
- Add user-visible message in jj_root when .jj walk-up fails
- Add jj_files and vcs_files to README.md and doc/fzf-lua.txt
- Update example configs with current find_opts/rg_opts/fd_opts defaults
* fix: use discovered workspace root for jj -R flag, add docs TOC and prereqs
- Use walk-up discovered root_dir instead of opts.cwd for jj -R flag
- Add *fzf-lua-jj* TOC entry and section tag in vimdoc
- Add jj to optional dependencies in README
- Derive jj defaults from git.files via tbl_deep_extend
- Add nil-opts regression test for vcs_files()
* fix: detect GNU getopt on Apple Silicon Macs
Add /opt/homebrew/opt/gnu-getopt/bin/getopt path check for Homebrew on
Apple Silicon, before the existing /usr/local/bin/getopt Intel path.
* fix: remove explicit -print from find_opts, normalize jj_root cwd, add jj optional dep
- Remove -print from default find_opts so the hidden toggle filter and
nullglob -print0 are correctly positioned in the predicate chain
- Append -print0 after predicates (instead of prepending) in render_crlf
- Insert hidden filter before -print0 in find commands so it is evaluated
- Normalize opts.cwd in jj_root with tilde expansion and relative path
resolution, matching how git_cwd handles paths
- List jj as an optional dependency in the help docs
* docs: sync help file defaults with code and clarify vcs_files fallback
- Update find_opts, rg_opts, fd_opts in customization example to match
the actual runtime defaults (remove -print and --hidden flags)
- Clarify that only jj_files is a no-op without jj; vcs_files falls
back to git_files or the generic files picker
* fix: alignment issues
* fix: revert find_opts to `! -path` pattern and drop unrelated headless_fd.sh change
Address ibhagwan's review feedback:
- Revert find_opts from -prune to `! -path` pattern to avoid .git entries
leaking into output and macOS -print0 incompatibilities
- Revert -print0 placement in config.lua (prepend, not append)
- Revert hidden toggle refactor in providers/files.lua (unnecessary with
! -path pattern)
- Revert unrelated getopt path change in scripts/headless_fd.sh
* feat: add VCS-specific header to vcs_files popup and test coverage
vcs_files now sets cwd_header_txt to indicate which VCS backend (jj/git)
is being used. Both git.files and jj.files already have "cwd" in their
_headers config, ensuring a header displays in the popup.
Tests added for: vcs_files header text per VCS type, git_files quiet
failure when not in a git repo, and _headers configuration for both
git.files and jj.files.
* fix: capitalize JJ in default-title profile ("JJ Files" not "Jj Files")
* Restore `--hidden`
* feat: simplify jj_root to use jj root command directly
* fix: handle missing jj command gracefully in utils.io_systemlist
* fix: handle missing commands gracefully in utils.io_systemlist and io_system
* docs: incorrect default --hidden
ci: fix lint
---------
Co-authored-by: bhagwan <bhagwan@disroot.org>vcs_search function (#2610)1 parent 8a79ee5 commit e3b0bb6
10 files changed
Lines changed: 393 additions & 15 deletions
File tree
- doc
- lua/fzf-lua
- profiles
- providers
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
| 215 | + | |
214 | 216 | | |
215 | 217 | | |
216 | 218 | | |
| |||
273 | 275 | | |
274 | 276 | | |
275 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
276 | 288 | | |
277 | 289 | | |
278 | 290 | | |
| |||
823 | 835 | | |
824 | 836 | | |
825 | 837 | | |
826 | | - | |
827 | | - | |
828 | | - | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
829 | 841 | | |
830 | 842 | | |
831 | 843 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
132 | 138 | | |
133 | 139 | | |
134 | 140 | | |
| |||
259 | 265 | | |
260 | 266 | | |
261 | 267 | | |
| 268 | + | |
262 | 269 | | |
263 | 270 | | |
264 | 271 | | |
| |||
317 | 324 | | |
318 | 325 | | |
319 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
320 | 335 | | |
321 | 336 | | |
322 | 337 | | |
| |||
798 | 813 | | |
799 | 814 | | |
800 | 815 | | |
801 | | - | |
802 | | - | |
803 | | - | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
804 | 819 | | |
805 | 820 | | |
806 | 821 | | |
| |||
1678 | 1693 | | |
1679 | 1694 | | |
1680 | 1695 | | |
1681 | | - | |
| 1696 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
525 | | - | |
526 | | - | |
527 | | - | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
| |||
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
897 | 905 | | |
898 | 906 | | |
899 | 907 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| 266 | + | |
| 267 | + | |
266 | 268 | | |
267 | 269 | | |
268 | 270 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
620 | 642 | | |
621 | 643 | | |
622 | 644 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
175 | 192 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1279 | 1279 | | |
1280 | 1280 | | |
1281 | 1281 | | |
1282 | | - | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
1283 | 1289 | | |
1284 | 1290 | | |
1285 | 1291 | | |
| |||
1293 | 1299 | | |
1294 | 1300 | | |
1295 | 1301 | | |
1296 | | - | |
1297 | | - | |
1298 | | - | |
1299 | | - | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
1300 | 1311 | | |
1301 | 1312 | | |
1302 | 1313 | | |
| |||
0 commit comments