-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Finder] Ignore paths from .gitignore #26714 #30448
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
54c6b04
to
2bfe1de
Compare
@amaabdou could you please take a look at this https://labs.consol.de/development/git/2017/02/22/gitignore.html and add more test with advanced use cases? |
I added as many cases I could,If I missed anything or more cases need or something is unclear |
|
is there anything I can do to move this forward ? |
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.
Great job 🔥
is there anything else I can do to move this forward ? |
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.
Can you add a note in the component CHANGELOG file?
@fabpot just did , is this one okay ? |
f7a664e
to
9491393
Compare
Great work @amaabdou, thank you |
This PR was squashed before being merged into the 4.3-dev branch (closes #30448). Discussion ---------- [Finder] Ignore paths from .gitignore #26714 | Q | A | ------------- | --- | Branch? | master for features | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #26714 | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> <!-- Write a short README entry for your feature/bugfix here (replace this comment block.) This will help people understand your PR and can be used as a start of the Doc PR. Additionally: - Bug fixes must be submitted against the lowest branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too). - Features and deprecations must be submitted against the master branch. --> Implementation of feature request #26714 Finder::ignoreVCS() is great at ignoring file patterns for the files created by popular VCS systems. However, it would be great to be able to instruct Finder to actually exclude the paths excluded by .gitignore. So if we have .gitignore: vendor/ cache/ Finder::create() ->files() ->ignoreVCS(true) // <--- Ignores `.git` ->ignoreVCSIgnored(true); // <--- Ignores vendor/ and cache/ Commits ------- 9491393 [Finder] Ignore paths from .gitignore #26714
Thank you for this great new feature @amaabdou, would you please create a documentation PR in the symfony-docs repository? |
thanks @amaabdou :) |
@OskarStark Yep yep, of course, working on this |
Thank you @amaabdou! ❤️ |
This PR was merged into the master branch. Discussion ---------- Adding ignoreVCSIgnored documentation <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Adding documentation for symfony/symfony#30448 Commits ------- 6d7ec3f adding ignoreVCSIgnored documentation
I think we should either add support for other VCS or rename method. And this method is also broken, as it looks for a |
Implementation of feature request #26714
Finder::ignoreVCS() is great at ignoring file patterns for the files created by popular VCS systems.
However, it would be great to be able to instruct Finder to actually exclude the paths excluded by .gitignore.
So if we have .gitignore:
vendor/
cache/
Finder::create()
->files()
->ignoreVCS(true) // <--- Ignores
.git
->ignoreVCSIgnored(true); // <--- Ignores vendor/ and cache/