Skip to content

Honor nested .gitignore negations (deepest match wins) - #5535

Open
Kayvan-Zahiri wants to merge 6 commits into
psf:mainfrom
Kayvan-Zahiri:fix/nested-gitignore-negation
Open

Kayvan-Zahiri wants to merge 6 commits into
psf:mainfrom
Kayvan-Zahiri:fix/nested-gitignore-negation

Conversation

@Kayvan-Zahiri

Copy link
Copy Markdown
Contributor

Summary

  • Change _path_is_ignored so the deepest .gitignore with a matching pattern decides (via GitIgnoreSpec.check_file), matching git.
  • Add a regression fixture for root ignore + nested negation (#5376).

Test plan

  • pytest tests/test_black.py -k gitignore
  • CI

Made with Cursor

Kayvan-Zahiri and others added 3 commits October 13, 2026 16:20
Match git's rule so a nested .gitignore can re-include paths an ancestor
excluded. Fixes psf#5376.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

diff-shades results comparing this PR (c56396c) to main (11cff13):

--preview style: no changes

--stable style: no changes


What is this? | Workflow run | diff-shades documentation

This branch has not been deployed

No deployments
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