LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   why use diff (https://www.linuxquestions.org/questions/linux-newbie-8/why-use-diff-810882/)

ltoso 05-29-2010 03:10 AM

why use diff
 
Hi,
i want to know why do we need to patch files based upon diff when we can directly overwrite the old file with the new file.


Please recommend
regards
ltoso

business_kid 05-29-2010 03:17 AM

size.
Put yourself in the position of a kernel programmer. He fixes three of the thousands of files in one modules 17 directories down and adds a new subdir to that directory with a few files in it. If he didn't have diff, how would he distribute this work?

grail 05-29-2010 03:41 AM

Plus patching is quite often the precursor to the next release but until it comes out and fixes the relevant issues the patch is supplied.

cantab 05-29-2010 05:38 AM

Size, and also maybe to not clash with other changes.

jamescondron 05-29-2010 06:28 AM

Its also a brilliant way of looking at what this new code contains; a few times I've seen patches which are no better than the code they replace, and have been in a position to say so. If I was being sent a tarball of the whole thing then we'd probably have to keep running the new bad code until it broke and we fixed it again.


All times are GMT -5. The time now is 01:56 PM.