You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Install mageplaza/magento-2-seo-extension to vendor
Check that files from this module have CRLF line terminators: file -k vendor/mageplaza/magento-2-seo-extension/Plugin/SeoRender.php
Make some patch from this file:
git add -f vendor/mageplaza/magento-2-seo-extension/Plugin/SeoRender.php
-- add some changes into file
git diff vendor/mageplaza/magento-2-seo-extension/Plugin/SeoRender.php >> m2-hotfixes/diff.patch
Applying patches for mageplaza/magento-2-seo-extension (1)
~ magento/project-community-edition: m2-hotfixes/fix.patch [NEW]
asd
Failed to apply the patch. Halting execution!
Probable causes for the failure:
Notes
Looks like it happens because when I added vendor/mageplaza/magento-2-seo-extension/Plugin/SeoRender.php into git indexation, file becomes from CRLF to LF line terminator (becuase I have done it on Mac, but it was developed on Windows).
Git showed me following warning:
warning: CRLF will be replaced by LF in vendor/mageplaza/magento-2-seo-extension/Plugin/SeoRender.php
And patch contains LF line terminator. But when composer:install is executed, file again becomes to CRLF.
The text was updated successfully, but these errors were encountered:
Encountered the issue trying to patch Magento/Bundle/etc/events.xml
The vendor file has CRLF line endings in my magento/project-enterprise-edition@2.4.0 with magento/module-bundle@101.0.0
My patch file is built with LF line endings as it also contains changes for PHP files of the Magento/Bundle module and they have LF line endings.
Proposed fix: add --ignore-whitespace option to "PATCH" applier by default into "check" and "patch" operations.
Workaround: add this option to applier manually in your composer.json
Patches cannot be applied for files with CRLF line terminators
Pre-requisites
To Reproduce
Steps to reproduce the behavior:
git add -f vendor/mageplaza/magento-2-seo-extension/Plugin/SeoRender.php
-- add some changes into file
git diff vendor/mageplaza/magento-2-seo-extension/Plugin/SeoRender.php >> m2-hotfixes/diff.patch
Expected
Patch should be installed
Actual
Notes
Looks like it happens because when I added vendor/mageplaza/magento-2-seo-extension/Plugin/SeoRender.php into git indexation, file becomes from CRLF to LF line terminator (becuase I have done it on Mac, but it was developed on Windows).
Git showed me following warning:
And patch contains LF line terminator. But when composer:install is executed, file again becomes to CRLF.
The text was updated successfully, but these errors were encountered: