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
Finder ->ignoreVCSIgnored(true) doesn't do what it claims #37781
Comments
Hey, thanks for your report! |
Yes, this bug is still present. I actually don't use/need this feature, but I would vote for its deprecation and removal, given it doesn't work, and there's no obvious way to correct it. |
I belive fix can be easy - instead of generating the exclude regex from one Here is the code:
but it fails on https://github.com/PrestaShop/PrestaShop repo with:
error message. This needs to be addressed first. I made a PR #40763 for it. |
I can confirm this issue, with ignoring child .gitignore files. I've tried to implement it on my own:
This does not work properly, because the first step finds .gitignore files which should be excluded. And this is what this issue is basically about. So recursion should fix the issue here, I just don't know how ;) |
Recursion cannot fix it, because git also looks at parent directories recursively too... |
This is basically a no-fix, and I'd recommend deprecating and removing this function, since it cannot be implemented in a sane way. |
traversing with dirname up too the repo root is easy and quick |
Not if the user is not allowed to do that. |
why? This is how native git works, root repo is located even if cwd in not root repo |
Why did you close the issue? There is a merge request, I wanted to test, which looks promising. |
For those subscribed to this issue, you may find #49703 interesting 🙂. |
Symfony version(s) affected: 5.1.3
Description
The
ignoreVCSIgnored
method says it can make the finder skip over all ignored files, however this is not the case. It assumes there is only exactly one.gitignore
file in the root of the directory the finder is "in".It is reasonable (and probably desirable) that the finder does not recursively search upwards for .gitignore files, however, unreasonable that it does not respect ignore files in subdirectories and mandates the "in" directory must have an ignore file.
The text was updated successfully, but these errors were encountered: