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

Add --ignore-whitespace option when patching

Open rodrigoaguilera opened this issue 6 years ago • 3 comments

I found a case where the plugin fails to patch a file generated with git diff

The git project is https://www.drupal.org/project/nexus And I attach the patch

test-whitespace.txt

After some digging I discovered that is a whitespace problem and that adding --ignore-whitespace to the patch command makes the patch to be applied.

My temporary solution was to generate the patch with diff instead of git

Can we add that option by default?

Or at least configurable like the patchlevel

Thank you for such a great project :)

rodrigoaguilera avatar Jan 05 '19 09:01 rodrigoaguilera

+1 for this

kinglozzer avatar Feb 19 '19 12:02 kinglozzer

would be a decent default value 👍

attisan avatar Mar 08 '20 17:03 attisan

I've created #370 which implements this as a config option you can add to your composer.json.

seanbeaton avatar Jun 16 '21 20:06 seanbeaton

See #370 -- IMO, just fix the patch if it's causing issues.

cweagans avatar Feb 07 '23 20:02 cweagans