Verification
Is your feature request related to a problem?
This is the default command that composer-patches v1 used to apply a patch:
patch '-p2' --no-backup-if-mismatch -d '/var/www/html/web/core' < '/mnt/ddev-global-cache/composer/patches/foobar.patch'
This is the default command that composer-patches v2 is using:
'git' -C '/var/www/html/web/core' apply --check --verbose -p2 '/mnt/ddev-global-cache/composer/patches/foobar.patch'
Problem with applying patches with git is: It doesn't have the built-in fuzzyness that patch has. For git the target file needs to look exactly as it's written in the .patch.
Now a lot of patches simply don't apply anymore with this message:
No available patcher was able to apply patch foobar.patch to drupal/core
Describe your proposed solution(s)
Similar to the existing GitPatcher plugin, add a PatchPatcher plugin.
This of course would contradict having it removed in v2 in the first place.
Which might make introducing another config option necessary to have the PatchPatcher disabled by default. To enable the PatchPatcher then people would need to enable it explicitly.
For example:
"extra": {
"composer-patches": {
"include-patch-patcher": true
}
}
Describe alternatives
To make all patches getting applied with patch I can use the Freeform Patcher, but that would require changing all patches to the extended format, making the maintenance burden much higher.
Also not sure how that would work with nested patches coming from dependency's composer.json I can not control.
Additional context
Sample composer.json that works with v1 but does not work with v2:
composer.json
Verification
composer self-update)composer update cweagans/composer-patches)Is your feature request related to a problem?
This is the default command that composer-patches v1 used to apply a patch:
This is the default command that composer-patches v2 is using:
Problem with applying patches with
gitis: It doesn't have the built-in fuzzyness thatpatchhas. Forgitthe target file needs to look exactly as it's written in the .patch.Now a lot of patches simply don't apply anymore with this message:
Describe your proposed solution(s)
Similar to the existing GitPatcher plugin, add a PatchPatcher plugin.
This of course would contradict having it removed in v2 in the first place.
Which might make introducing another config option necessary to have the PatchPatcher disabled by default. To enable the PatchPatcher then people would need to enable it explicitly.
For example:
Describe alternatives
To make all patches getting applied with
patchI can use the Freeform Patcher, but that would require changing all patches to the extended format, making the maintenance burden much higher.Also not sure how that would work with nested patches coming from dependency's composer.json I can not control.
Additional context
Sample composer.json that works with v1 but does not work with v2:
composer.json