Skip to content

fix: separate ignore instances for .gitignore and .ignore#12876

Open
brandtcormorant wants to merge 3 commits intoanomalyco:devfrom
brandtcormorant:two-ignore-instances
Open

fix: separate ignore instances for .gitignore and .ignore#12876
brandtcormorant wants to merge 3 commits intoanomalyco:devfrom
brandtcormorant:two-ignore-instances

Conversation

@brandtcormorant
Copy link

@brandtcormorant brandtcormorant commented Feb 9, 2026

What does this PR do?

Fixes #4739

This fixes File.list() to process .gitignore and .ignore separately instead of merging them into a single ignore instance. This allows .ignore negation patterns (e.g. !/foo/) to override .gitignore rules, matching the intended behavior where .ignore controls what tools like the filepicker show independently of what git tracks.

My use case is to ignore git repos inside another git repo but still be able to traverse them in the filepicker.

An example of what this pull request enables:

.gitignore:

/repositories/*

.ignore:

!/repositories/
!/repositories/**
/repositories/**/.git/
/repositories/**/node_modules/

This is useful in a workspace that isn't a monorepo but that manages a set of repositories. There are probably other use cases for the changes in this pull request, things like having gitignored sandbox or tmp directories where we still want to easily reference the contents.

How did you verify your code works?

Ran tests to make sure nothing broke and launched using bun dev path/to/project/ where i had .gitignore and .ignore files set up like above.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

Hey! Your PR title use separate ignore instances for .gitignore and .ignore doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2026

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@brandtcormorant brandtcormorant changed the title use separate ignore instances for .gitignore and .ignore fix: separate ignore instances for .gitignore and .ignore Feb 10, 2026
@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

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.

Unignoring the .gitignore with .ignore should allow reading the file

1 participant