Skip to content

Verifying the patch set

github-actions[bot] edited this page Dec 2, 2026 · 2 revisions

Written against v1.0.0.

Check that every patch still applies to the upstream release it is written against, in order, and that applying it a second time fails. Run this after changing a patch, and before moving an upstream pin.

  1. Clone the upstream release into an empty scratch directory.

    git clone --depth 1 --branch v5.3.7 https://github.com/pestphp/pest.git package
  2. Set PATCHES to this repository's patches folder. Replace the placeholder with the path to the checkout.

    PATCHES=/path/to/patches-pestphp-pest/patches
  3. Apply each patch in the order composer.json lists them.

    cd package
    git apply -p1 "$PATCHES/pestphp-pest-composer-autoload-path.patch"; echo "pestphp-pest-composer-autoload-path.patch: $?"

    Each prints 0.

  4. Apply each one a second time. Each must fail, which shows the first run changed the code rather than finding it already patched.

    git apply -p1 "$PATCHES/pestphp-pest-composer-autoload-path.patch"; echo "pestphp-pest-composer-autoload-path.patch again: $?"

    Each prints 1, after an error naming the file the patch no longer applies to.

Note: apply the patches in the order composer.json lists them. A later patch is cut against the output of the earlier ones, so applying them out of order can fail even when each patch is correct.

Reference

Clone this wiki locally