Skip to content

Ignore binary extensions, except in folder names #17595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 12, 2025
Merged

Conversation

RobinMalfait
Copy link
Member

@RobinMalfait RobinMalfait commented Apr 7, 2025

We generate a glob to ignore binary extensions that looks something like this:

*.{mp4,pages,exe,…}

However, if you have a folder that happens to end in .pages for example, then this folder will be ignored in its entirety.

To solve this, we added a new flag to the Gitignore struct so we can register a bunch of ignore rules that only apply to paths and not folders.

Fixes: #17569

Test plan

  • Added a unit test

We generate a glob to ignore binary extensions that looks like this:
```
*.{mp4,pages,exe,…}
```

However, if you have a folder that happens to end in `.pages` for
example, then this folder will be ignored in its entirety.

To solve this, we will instead generate the following globs:
```
*.{mp4,pages,exe,…}
!*.{mp4,pages,exe,…}/
```

This way, the `/` indicates that we are dealing with a folder and that
these should _not_ be ignored.
The implementation we chose right now means that there is a situation
where an explicit ignore in your `.gitignore` file could now be included
due to the fix we implemented.

We can always add an additional `@source not` on top of everything, but
ideally this is not needed at all.
@philipp-spiess philipp-spiess marked this pull request as ready for review April 11, 2025 16:30
@philipp-spiess philipp-spiess requested a review from a team as a code owner April 11, 2025 16:30
@RobinMalfait RobinMalfait merged commit bbd916a into main Apr 12, 2025
7 checks passed
@RobinMalfait RobinMalfait deleted the fix/issue-17569 branch April 12, 2025 11:30
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.

tailwind .pages folder error
3 participants