Skip to content
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

Consider to skip missing target files #67

Open
afercia opened this issue Jun 1, 2018 · 1 comment
Open

Consider to skip missing target files #67

afercia opened this issue Jun 1, 2018 · 1 comment

Comments

@afercia
Copy link

afercia commented Jun 1, 2018

Definitely not my area of expertise, but I've just noticed something and thought to report it. Seems that when a patch targets a missing file (maybe because it was moved or for any other reason), grunt-patch just stops and asks for the path to the missing file. Instead, svn patch just patches straight away and skips the missing target.

Wouldn't be better to match the native svn patch behavior?

Here's the output of the two commands while I've run with a patch targeting a missing file:

$ grunt patch:43986
Running "patch:43986" (patch) task
? Please select a patch to apply 43986v5.2.diff​ (9.7 KB) - added by afragen 11 hours ago.
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git src/wp-admin/css/list-tables-rtl.css src/wp-admin/css/list-tables-rtl.css
|index 468dcbf8a1..dd7f90d607 100644
|--- src/wp-admin/css/list-tables-rtl.css
|+++ src/wp-admin/css/list-tables-rtl.css
--------------------------
File to patch: 
$ svn patch 43986v5.2.diff
Skipped missing target: 'src/wp-admin/css/list-tables-rtl.css'
U         src/wp-admin/css/list-tables.css
U         src/wp-admin/includes/class-wp-plugin-install-list-table.php
U         src/wp-admin/includes/plugin-install.php
Summary of conflicts:
  Skipped paths: 1
@ohader
Copy link

ohader commented Jul 26, 2022

patch -t would skip missing files during batch processes... for this plugin it would be and additional

patchArgs.push( '-t' );

before https://github.com/WordPress/grunt-patch-wordpress/blob/trunk/tasks/patch_wordpress.js#L58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants