Skip to content

[Bug]: .gitignore regression in 0.10.x #723

Description

@vadimi

Which fff frontend?

Neovim plugin (fff.nvim)

has logs

No response

Description

Hello, I have the following .gitignore file:

# Ignore all
*

# Unignore all with extensions
!*.*

# Unignore all dirs
!/**/

I'm using fff version 0.10.x in nvim and it can only find files in the top level directory, version 0.9.x worked just fine

Activity

  1. gustav-fff commented on Jul 29, 2026

    @gustav-fff
    Collaborator

    [triage-bot] REPRODUCED: origin/main, branch triage-bot/issue-723.

    Zlob walker (release/--features zlob, i.e. what users install) prunes subdirs when .gitignore uses * + !*.* + !/**/. Ripgrep walker (default --features ripgrep) handles it correctly, so this is a regression introduced by 1cd8d31 (#645) swapping the walker backend. Bug is upstream in zlob 1.6.1: the negation !/**/ fails to re-include directories that were pruned by *.

    Minimal repro (inline test in crates/fff-core/src/walk/mod.rs):

    #[test]
    fn negation_reincludes_nested_files_issue_723() {
        let dir = tempfile::tempdir().unwrap();
        let root = dir.path();
        fs::create_dir(root.join(".git")).unwrap();
        fs::write(
            root.join(".gitignore"),
            "*\n!*.*\n!/**/\n",
        ).unwrap();
        fs::create_dir_all(root.join("sub1/sub2")).unwrap();
        fs::write(root.join("top.rs"), "").unwrap();
        fs::write(root.join("sub1/mid.rs"), "").unwrap();
        fs::write(root.join("sub1/sub2/deep.rs"), "").unwrap();
    
        let counter = Arc::new(AtomicUsize::new(0));
        let out = walk_collect_files(root, true, false, 1, &counter).unwrap();
        let names: Vec<String> = out.pairs.into_iter().map(|(_, r)| r).collect();
        assert!(names.iter().any(|n| n.ends_with("mid.rs")), "got: {names:?}");
    }

    Ripgrep backend:

    $ cargo test --manifest-path crates/fff-core/Cargo.toml --no-default-features --features ripgrep --lib negation_reincludes_nested_files_issue_723
    test walk::tests::negation_reincludes_nested_files_issue_723 ... ok
    

    Zlob backend (this is what ships):

    $ cargo test --manifest-path crates/fff-core/Cargo.toml --no-default-features --features zlob --lib negation_reincludes_nested_files_issue_723
    test walk::tests::negation_reincludes_nested_files_issue_723 ... FAILED
    sub1/mid.rs missing: [".gitignore", "top.rs"]
    

    @dmtrKovalenko this is not fixable inside fff-core without either (a) patching zlob's ignore matcher (upstream in zlob 1.6.1, src/walk.rs), or (b) detecting negation patterns and falling back to the ripgrep walker for those repos. Option (b) undoes the perf win of #645 for anyone with a ! in their .gitignore — probably not what you want. Punting to you for scoping.

    Not opening a PR.

    Honk-Honk 🪿

  2. added a commit that references this issue on Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriaged

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions