-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Finder] Add recursive .gitignore files support #43150
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
Conversation
68931ab
to
d53d862
Compare
d53d862
to
a2b5e91
Compare
src/Symfony/Component/Finder/Iterator/VcsIgnoredFilterIterator.php
Outdated
Show resolved
Hide resolved
Hey! I think @simPod has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
c936e40
to
3270237
Compare
src/Symfony/Component/Finder/Iterator/VcsIgnoredFilterIterator.php
Outdated
Show resolved
Hide resolved
de4266f
to
5152336
Compare
Thank you @julienfalque. |
Thanks @fabpot @nicolas-grekas @keradus! |
This seems to look for |
The look up is supposed to stop at the initial search directory, though no tests prove that. I'll try to add some. |
@julienfalque is this |
Looks like this was not working fine on Windows (tests seem to cause an infinite loop on AppVeyor). See #43239. |
…ulienfalque) This PR was merged into the 6.1 branch. Discussion ---------- [Finder] Look for gitignore patterns up to git root | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | yes-ish | Deprecations? | no | Tickets | #43150 (comment) | License | MIT | Doc PR | - Commits ------- 744392d [Finder] Look for gitignore patterns up to git root
{ | ||
$file = $this->current(); | ||
|
||
$fileRealPath = $file->getRealPath(); |
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.
@julienfalque realpath can be slow and I do not think this is actually correct by git spec at all
Imagine a symlink excluded by a .gitignore. The symlink will not be ignored a it is resolved here.
see https://stackoverflow.com/questions/40460216/how-do-i-make-git-ignore-symlink#40461160
also there should be no is_dir/is_dir, simply traverse the path up
This PR extends
Finder
's.gitignore
support to nested files.Note: as a side effect, a
.gitignore
file is not required at the top level anymore. Actually, if no.gitignore
file is found at all, no errors will be triggered.