WordPress / WordPress/grunt-patch-wordpress
Consider to skip missing target files
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 51
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the behavior with grunt patch:43986 and compare it with svn patch 43986v5.2.diff, using the missing src/wp-admin/css/list-tables-rtl.css target and the other listed files as the example. Trace the grunt patch task from that entry point and check how missing targets are handled. Done means missing targets are skipped without prompting while applicable files are still patched.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100