Skip to content

Consider to skip missing target files #67

@afercia

Description

@afercia

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions