I want to apply a unified diff from mypatch.diff to stdin and output the result to stdout.
So far, I have tried:
patch -i mypatch.diff -o - -u originalfile
Which successfully applies mypatch.diff and prints the result to stdout. However, I still have to provide the original file as originalfile, not via stdin.
And if I try something like:
patch -i mypatch.diff -o - -u -
Then the patch gets rejected:
patching file -
Hunk #1 FAILED at 1.
1 out of 1 hunk FAILED -- saving rejects to file -.rej