Skip to content
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

fix: recursive directory ignore rules #118

Merged
merged 3 commits into from
Nov 28, 2023
Merged

fix: recursive directory ignore rules #118

merged 3 commits into from
Nov 28, 2023

Conversation

wraithgar
Copy link
Member

@wraithgar wraithgar commented Nov 28, 2023

This is a rebase and cleanup of #16


Citing from the gitignore docs:

If there is a separator at the beginning or middle (or both) of the pattern, then the pattern is relative to the directory level of the particular .gitignore file itself. Otherwise the pattern may also match at any level below the .gitignore level.

Previously, parent walkers were only passed the resolved path to a file
entry via filterEntry()`. This patch also passes the entry's basename
which is matched against the rule if it is relative.

Regression tests are included as well.

Closes #9.

LinqLover and others added 3 commits November 28, 2023 10:36
Citing from the gitignore docs [1]:

> If there is a separator at the beginning or middle (or both) of the
> pattern, then the pattern is relative to the directory level of the
> particular .gitignore file itself. Otherwise the pattern may also
> match at any level below the .gitignore level.

Previously, parent walkers were only passed the resolved path to a file
entry via filterEntry(). This patch also passes the entry's basename
which is matched against the rule if it is relative.

Regression tests are included as well.

Closes #9.

[1] http://git-scm.com/docs/gitignore#_pattern_format#:~:text=If%20there%20is%20a%20separator%20at%20the%20beginning%20or%20middle%20(or%20both)%20of%20the%20pattern%2C%20then%20the%20pattern%20is%20relative%20to%20the%20directory%20level%20of%20the%20particular%20.gitignore%20file%20itself.%20Otherwise%20the%20pattern%20may%20also%20match%20at%20any%20level%20below%20the%20.gitignore%20level.
@wraithgar wraithgar requested a review from a team as a code owner November 28, 2023 20:36
@wraithgar wraithgar self-assigned this Nov 28, 2023
@wraithgar wraithgar mentioned this pull request Nov 28, 2023
@wraithgar wraithgar merged commit 8e9b2fd into main Nov 28, 2023
27 checks passed
@wraithgar wraithgar deleted the gar/pr-16 branch November 28, 2023 22:23
wraithgar added a commit that referenced this pull request Nov 29, 2023
Gets us closer to parity w/ the gitignore rules.

Citing from the [gitignore
docs](http://git-scm.com/docs/gitignore#_pattern_format#:~:text=If%20there%20is%20a%20separator%20at%20the%20beginning%20or%20middle%20(or%20both)%20of%20the%20pattern%2C%20then%20the%20pattern%20is%20relative%20to%20the%20directory%20level%20of%20the%20particular%20.gitignore%20file%20itself.%20Otherwise%20the%20pattern%20may%20also%20match%20at%20any%20level%20below%20the%20.gitignore%20level.):

> If there is a separator at the beginning or middle (or both) of the
pattern, then the pattern is relative to the directory level of the
particular `.gitignore` file itself. Otherwise the pattern may also
match at any level below the `.gitignore` level.

Previously, parent walkers were only passed the resolved path to a file
entry via  filterEntry()`. This patch also passes the entry's basename
which is matched against the rule if it is relative.

Regression tests are included as well.

Closes #9.

---------

Co-authored-by: Christoph Thiede <[email protected]>
wraithgar added a commit that referenced this pull request Nov 29, 2023
Gets us closer to parity w/ the gitignore rules.

Closes #9.

---------

Co-authored-by: Christoph Thiede <[email protected]>
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.

Name ending with slash does not ignore recursively
3 participants