Language Selection

English French German Italian Portuguese Spanish

How to Create Patch Files Using Patch & Diff

Filed under
HowTos

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

Citrix and Google partner to bring native enterprise features to Chromebooks

Chromebooks are making inroads into the education sector, and a push is coming for the enterprise with new native Chrome capabilities from Citrix. Google and Citrix have announced Citrix Receiver for Chrome, a native app for the Chromebook which has direct access to the system resources, including printing, audio, and video. To provide the security needed for the enterprise, the new Citrix app assigns a unique Receiver ID to each device for monitoring, seamless Clipboard integration across remote and local applications, end user experience monitoring with HDX Insight, and direct SSL connections. Read more

Is Open Source an Open Invitation to Hack Webmail Encryption?

While the open source approach to software development has proven its value over and over again, the idea of opening up the code for security features to anyone with eyeballs still creates anxiety in some circles. Such worries are ill-founded, though. One concern about opening up security code to anyone is that anyone will include the NSA, which has a habit of discovering vulnerabilities and sitting on them so it can exploit them at a later time. Such discoveries shouldn't be a cause of concern, argued Phil Zimmermann, creator of PGP, the encryption scheme Yahoo and Google will be using for their webmail. Read more

Changing times, busy times and why Google will save Usenet.

Linux however has succeeded by way of form factors diversifying. Be it Android phones or tablets there is a big shift with the mainstream consumer in terms of what devices they want and here Linux has excelled. In 2008 my decision remove my Microsoft dependency was for reasons of the control they had on the desktop, the practices alleged against them and the dubious tactics some of their advocates used to promote the products. I also wholeheartedly agree with the ethos of FOSS which was another contributory factor. Today, my feelings about FOSS have not changed, there are caveats to my opinions of FOSS (especially in gaming) but I’ve covered that before in other articles. Today I avoid Microsoft not because I feel the need to make a stand against its behaviour, its because I don’t need them. I support Microsoft being a “choice” in the market as I support user freedom, but as for what Microsoft can offer me (regardless of its past) there is nothing. Read more

Eltechs Debuts x86 Crossover Platform for ARM Tablets, Mini-PCs

The product, called ExaGear Desktop, runs x86 operating systems on top of hardware devices using ARMv7 CPUs. That's significant because x86 software, which is the kind that runs natively on most computing platforms today, does not generally work on ARM hardware unless software developers undertake the considerable effort of porting it. Since few are likely to do that, having a way to run x86 applications on ARM devices is likely to become increasingly important as more ARM-based tablets and portable computers come to market. That said, the ExaGear Desktop, which Eltechs plans to make available next month, currently has some steep limitations. First, it only supports Ubuntu Linux. And while Eltechs said support for additional Linux distributions is forthcoming, there's no indication the product will be able to run x86 builds of Windows on ARM hardware, a feat that is likely to be in much greater demand than Linux compatibility. Read more