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

Linux 4.6.5

I'm announcing the release of the 4.6.5 kernel. All users of the 4.6 kernel series must upgrade. The updated 4.6.y git tree can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git linux-4.6.y and can be browsed at the normal kernel.org git web browser: http://git.kernel.org/?p=linux/kernel/git/stable/linux-st... thanks, greg k-h Read more Also: Linux 4.4.16 Linux 3.14.74

today's leftovers

Leftovers: Software

  • The Linux Deepin File Manager Is a Thing of Beauty
    China-based Linux distro Deepin has shown off its all-new desktop file manager. And to say it's pretty is an understatement.
  • GRadio Lets You Find, Listen to Radio Stations from the Ubuntu Desktop
    Love to listen to the radio? My ol’ pal Lolly did. But let’s say you want to listen to the radio on Ubuntu. How do you do it? Well, the Ubuntu Software centre should always be the first dial you try, but you’ll need to sift through a load of static to find a decent app.
  • Reprotest 0.2 released, with virtualization support
    reprotest 0.2 is available in PyPi and should hit Debian soon. I have tested null (no container, build on the host system), schroot, and qemu, but it's likely that chroot, Linux containers (lxc/lxd), and quite possibly ssh are also working. I haven't tested the autopkgtest code on a non-Debian system, but again, it probably works. At this point, reprotest is not quite a replacement for the prebuilder script because I haven't implemented all the variations yet, but it offers better virtualization because it supports qemu, and it can build non-Debian software because it doesn't rely on pbuilder.
  • Calibre 2.63.0 eBook Converter and Viewer Adds Unicode 9.0 Support, Bugfixes
    Kovid Goyal has released yet another maintenance update for his popular, open-source, free, and cross-platform Calibre ebook library management software, version 2.63.0. Calibre 2.63.0 arrives two weeks after the release of the previous maintenance update, Calibre 2.62.0, which introduced support for the new Kindle Oasis ebook reader from Amazon, as well as reading and writing of EPUB 3 metadata. Unfortunately, there aren't many interesting features added in the Calibre 2.63.0 release, except for the implementation of Unicode 9.0 support in the regex engine of the Edit Book feature that lets users edit books that contain characters encoded with the recently released Unicode 9.0 standard.
  • Mozilla Delivers Improved User Experience in Firefox for iOS
    When we rolled out Firefox for iOS late last year, we got a tremendous response and millions of downloads. Lots of Firefox users were ecstatic they could use the browser they love on the iPhone or iPad they had chosen. Today, we’re thrilled to release some big improvements to Firefox for iOS. These improvements will give users more speed, flexibility and choice, three things we care deeply about.
  • LibreOffice 5.2 Is Being Released Next Wednesday
    One week from today will mark the release of LibreOffice 5.2 as the open-source office suite's latest major update. LibreOffice 5.2 features a new (optional) single toolbar mode, bookmark improvements. new Calc spreadsheet functions (including forecasting functions), support for signature descriptions, support for OOXML signature import/export, and a wealth of other updates. There are also GTK3 user-interface improvements, OpenGL rendering improvements, multi-threaded 3D rendering, faster rendering, and more.
  • Blackmagic Design Finally Introduces Fusion 8 For Linux
  • Why Microsoft’s revival of Skype for Linux is a big deal [Ed: This article is nonsense right from the headline. Web client is not Linux support. And it's spyware (centralised too).]

today's howtos