Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
68931ab tod53d862Compared53d862 toa2b5e91Comparesrc/Symfony/Component/Finder/Iterator/VcsIgnoredFilterIterator.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
carsonbot commentedSep 24, 2021
Hey! I think@simPod has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
c936e40 to3270237Comparesrc/Symfony/Component/Finder/Iterator/VcsIgnoredFilterIterator.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
de4266f to5152336Comparefabpot commentedSep 27, 2021
Thank you@julienfalque. |
julienfalque commentedSep 28, 2021
stof commentedSep 28, 2021
This seems to look for |
julienfalque commentedSep 28, 2021
The look up is supposed tostop at the initial search directory, though no tests prove that. I'll try to add some. |
stof commentedSep 28, 2021
@julienfalque is this |
julienfalque commentedSep 29, 2021
Looks like this was not working fine on Windows (tests seem to cause an infinite loop on AppVeyor). See#43239. |
Uh oh!
There was an error while loading.Please reload this page.
…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.
seehttps://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
Uh oh!
There was an error while loading.Please reload this page.
This PR extends
Finder's.gitignoresupport to nested files.Note: as a side effect, a
.gitignorefile is not required at the top level anymore. Actually, if no.gitignorefile is found at all, no errors will be triggered.