composer-patches icon indicating copy to clipboard operation
composer-patches copied to clipboard

#244 add ignore-whitespace config for patches

Open seanbeaton opened this issue 3 years ago • 1 comments

This patch adds a config option that adds --whitespace-ignore to its patch application commands.

Without that flag, a few of my patches would fail to apply, specifically to some minified js from a drupal contrib module.

I also updated the readme with instructions on how to use the setting.

I'd love to add this to the 2.x version as well, though I don't believe there's currently the option to set config on a per-package basis there as there is on the 1.x branch (like the patch-level/patchLevel option).

It's implemented by choosing between two versions of the command based on the config setting instead of just another argument like the patchLevel one as if it's disabled, it would pass in '' as an the argument, which gets misinterpreted as the patch filename. If there's a better way to do this, feel free to let me know.

seanbeaton avatar Jun 16 '21 20:06 seanbeaton

@cweagans thoughts?

bogdankharchenko avatar Jan 19 '22 15:01 bogdankharchenko

I don't think we need a config option for this. Fix your patch if it's causing issues.

cweagans avatar Feb 04 '23 07:02 cweagans

@cweagans I don't think that's always possible. In my case I am maintaining the patches within the project repository (git) and deploying them via github actions. Therefore git seems to automatically change the line endings of the patch. After that, the patch does not apply anymore on the target system, and the only way around that else than fix the vendor file line endings or the patch line endings after deployment, which is really annoying to maintain for every specific customer repository if they may or may not use some of these packages or not.

Nico-Schaefer-2111 avatar Jan 05 '24 08:01 Nico-Schaefer-2111