I have some files in my server that I wanted to make a patch for, so I took one of the files to test:
cp /path/file ~/file
So now I have just the same file in my root directory so I make any changes I need on the file at ~/file and now I run the diff command on the 2 files:
diff -Nuar /path/file ~/file > my_file.patch
I have also tried:
diff -u /path/file ~/file > my_file.patch diff -c /path/file ~/file > my_file.patch diff /path/file ~/file > my_file.patch
Now as you can see there is no differences on the files besides what I have just changed on it but instead of creating a my_file.patch with only the code to patch the changes I made into /path/file it always create a full file with all the content of /path/file marked to be removed and the content of ~/file marked to be added.
Then I try to apply the patch:
patch -p0 < ~/my_file.patch
And it fails badly ... it always print out a reject file with all the content just like the file is.
I am running out of ideas to why it is doing this all the time, with a few files I can produce a patch without problems but with most of the files on the system that I need to make one it won't work at all.
Any ideas on what could be the problem ? encoding, format ? solutions ?