I'm trying to use the normal format to create a patch and then apply it. Despite -n on both diff and patch, and an explicit file output -o on patch, I get the error:
patch: **** Only garbage was found in the patch input. How can I solve this? I can't use unified or context patches in this case, so that's not a solution.
Is it a bug or something? Editor format seems to work, for some reason:
$ echo a > a.txt $ echo b > b.txt $ diff -n a.txt b.txt > ab.diff $ patch -n -o a.txt a.txt ab.diff patch: **** Only garbage was found in the patch input. $ diff -e a.txt b.txt > ab.diff $ patch -e -o a.txt a.txt ab.diff $ diff a.txt b.txt $ This is on Linux Mint 16, with:
$ diff --version diff (GNU diffutils) 3.2 $ patch --version GNU patch 2.7.1