Paste a source file on the left and a unified diff on the right — the kind diff -u and git diff emit — and get the patched text back. Each hunk is applied against its recorded line number first, then tried at nearby offsets (fuzz) if the source has drifted. Rejected hunks show up in a .rej-style block so you can hand-merge them.
…
Every @@ -old_start,old_count +new_start,new_count @@ header is applied in order.
Lines starting with a space are context (must match source), - lines are removed,
and + lines are added. When Fuzz-match is on, if the source has drifted the applier
scans up to ±100 lines from the recorded start looking for a run that matches the hunk’s pre-image.
A successful shift is reported as an offset; a failed one shows the hunk as a reject. This
mirrors what patch(1) does when it writes .rej files.
Note: this tool operates on a single file — if your diff contains multiple --- a/… /
+++ b/… file blocks, only the first file’s hunks are applied. Strip the extras first, or
apply file-by-file.