Question

I am trying to create patch a file using diff tool.But facing an issues. I have created one directory named a and put original file in to it:

  • a/original_file.c

I have created other directory named b and put same file with modified content in to it.

  • b/original_file.c

I have copied the content of the b/original_file.c file from the internet and put it into some text editor.

After giving command diff -Naur a b > patch_file.patch, I can see patch_file.patch is generated and it has some unwanted changes (it's related to indentation).

For example:

 return msg (MSG_NOTIFY, &msg, senr,
-                 sizeof (struct msgotify));
+                  sizeof (struct msgotify)); 

You can see there are changed related to indentation where sizeof (struct msgotify)) is replaced by same sizeof (struct msgotify)) but one basis of indentation which is what we don't want.

Could anybody let me know how to get rid of this problem??

Was it helpful?

Solution

If you don't care about changes in spacing, add -b to the diff command that generates the patch.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top