-
Notifications
You must be signed in to change notification settings - Fork 97
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 filtering in ShouldExclude
#516
Conversation
Thank you for submitting this PR!
Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment.
We currently aim to provide initial feedback/triaging within two business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@crackcomm just to understand: you're saying the current implementation is not fully compatible with https://git-scm.com/docs/gitignore, correct? If so, do you mind fixing the tests (adding the .IsDir
method to the mock), as well as adding a regression test to ensure that this is working as expected?
Yes, this PR fixes:
Nevertheless even after this change it's not fully compatible. To be fully compatible, the paths have to be matched against a relative path, right now it's just a file name. |
@hacdias I can add the function to the mock, no problem but could you please guide me where to add the test? I would also want to add another change (not sure if separate PR or should I change this one): do NOT add the hidden files when they match ignore rules even if |
@crackcomm as for adding a test, I think
I think so. To me, that sounds like something that should've already been happening. If it is explicitly ignored as per the file, For me you can include it with this PR, but please keep the commits separate just in case. |
Ensure ignore rule `bar/` matches directories by appending `/`. Addresses issue where `bar/` didn't catch directories. After this change, both `bar` and `bar/` rules filter out the `bar` directory and its contents.
fe0a823
to
8f6e3bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Triage notes:
- Rebased, but CI fails
TestFileFilter
seems to fail on CI, needs to be updated (and cI needs to be green)- We need a PR against Kubo that confirms these sharness tests that use filtering via
--ignore*
param inipfs add
pass
@crackcomm are you able to address the above?
I've converted this into a bug report: #648 |
Ensure ignore rule
bar/
matches directories by appending/
. Addresses issue wherebar/
didn't catch directories. After this change, bothbar
andbar/
rules filter out thebar
directory and its contents.Note: This is required because git would skip empty directories and use full paths relative to repo.
I'm not sure how much I could break the API but it's still just using file names as opposed to full relative paths for filtering which is not ideal.