Language Selection

English French German Italian Portuguese Spanish

How to Create Patch Files Using Patch & Diff

Filed under

Patch file is a readable file that created by diff with -c (context output format). It doesn’t matter and if you wanna know more, man diff. To patch the entire folder of source codes (as usually people do) I do as below:

Assume Original source code at folder Tb01, and latest source code at folder Tb02. And there have multiple sub directories at Tb01 and Tb02 too.

diff -crB Tb01 Tb02 > Tb02.patch

-c context, -r recursive (multiple levels dir), -B is to ignore Blank Lines.
I put -B because blank lines is really useless for patching, sometimes I need to manually read the patch file to track the changes, without -B is really headache.

Full Story.

compare files and edit simultaneously with vimdiff

Refers to How to create patch file using patch and diff, you can actually read the diff file to compare the difference between the files. But what if you wanna compare and edit simultaneously?

Given 2 different files at your hand, you can do that with vimdiff. Let say I wanna compare this two files Tb01/TbApi.cpp and Tb02/TbApi.cpp, I can do this

vimdiff Tb01/TbApi.cpp Tb02/TbApi.cpp

More Here.

You talk the talk, but do you waddle the waddle?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

More in Tux Machines

Azul Zing goes live on Red Hat Enterprise Linux on Amazon Web Services

Azul Systems, the provider of Java runtime solutions, has announced that Zing, it's Java Virtual Machine, is now available as Amazon Machine Images (AMIs) running on Red Hat Enterprise Linux on Amazon Web Services. Read more

How to move the needle in open source

The intersection of those two concepts is the sweet spot to success (in my mind) in open source. Everyone wants to be a +1 in their interactions in open source, but sometimes you have to settle for being a 0 for a while until you build up enough expertise in a project. You don't want to be a -1, where you are actively hampering work from being done. However, you should be bold and inquisitive when figuring out what you want to work on in open source. People will generally help you in open source communities if they see you're passionate and willing to learn. Read more

Larry Wall Unveils Perl 6.0.0

The first thing he did was thank Craigslist "for sponsoring me these last few years". On October 5th, 2015 Larry Wall addressed a crowd of geeks at San Francisco's Exploratorium, saying he couldn't properly express his gratitude to Craigslist. Then he acknowledged how long the development arc had been for Perl 6. "As the old joke goes, Perl 6 is coming out this Christmas." Only this time, he meant it. Read more

Leftovers: KDE