Results 1 to 6 of 6

Thread: How to write a patch

  1. #1
    Jedi knight Luke Skywalker's Avatar
    Join Date
    Jul 2009
    Age
    23
    Liked
    0 times
    Posts
    2,175

    Default How to write a patch

    Recently a member have asked me how to write a patch.As in my previous thread I explain how to apply a patch, Now what are you gonna do if you want to some one yourself? Write a patch. It is a quick was to get to be known by all.
    Example You have a file name L.txt containing a line :

    Luke Vader is a Jedi knight
    Well you wrote your another same as above but updated with line :

    Luke Skywalker is a Jedi Knight.
    After writing the patch type this:

    diff -c originalfile updatedfile > patchfilename.patch
    But many a time you will find bugs reported in many files of directory. Then type this:

    diff --crB /orginal/directory /updated/directory > patchfilename.patch.

    Hurray patch is complete. But before submitting test it on your self.
    patch --dry-run -p0 patchfilename.patch

    if its working then submit it.
    Not always will you be lucky to find the solution posted but you will have to find them yourself.
    Last edited by Luke Skywalker; 02-11-10 at 07:48 PM.
    History is on the move,my friends.Those who cannot keep up will be left behind, to watch from distance.And those who stand in its way will not watch at all.http://windows7sins.org/
    People are going to tell stories about me none of which change who I really am.

  2. #2
    mrhannette
    Guest

    Default

    Hi,

    I'm looking for these details from so many days. Thank you

  3. #3
    Banned
    Join Date
    May 2010
    Liked
    0 times
    Posts
    129

    Smile

    Quote Originally Posted by mrhannette View Post
    Hi,

    I'm looking for these details from so many days. Thank you
    Your most welcome, 'We are always there to contribute you'
    So any queries further are most welcome

  4. #4
    Junior Member
    Join Date
    Apr 2010
    Liked
    0 times
    Posts
    45

    Default

    Great post!

    For all curious Linux users, the great than sign ('>') means output will be stored to the file. You can use it for almost any CLI (command-line interface) program. If you want to take a good look at the diff before making it a patch file, I'd suggest you use:
    Code:
    diff -c originalfile updatedfile | less
    You can use the slash key ('/') to search for things within the diff.

    Luke, I have a question. I understand that on most VCS's the diff command output is not the same as that of the diff you've just explained here. And if I'm not using a DVCS, it isn't very simple to branch (will have to spend bandwidth downloading). Is there any simple way to generate a patch when I'm already using a VCS like hg, bzr or svn? Thanks!

  5. #5
    m2h_katie
    Guest

    Thumbs up

    Hello,

    Thank you for sharing these details with us. I have tried and it works.

    Thank you so much.

  6. #6
    Junior Member
    Join Date
    Dec 2010
    Liked
    0 times
    Posts
    3

    Default Thank

    Dear sir,
    i am very thank full to you for this kind information. I am trying it.and taking its a advantages.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to apply a patch
    By Luke Skywalker in forum Linux
    Replies: 1
    Last Post: 03-23-10, 11:49 AM
  2. Outlook 2010 Patch
    By meetdilip in forum Software News, Previews and Reviews
    Replies: 0
    Last Post: 02-13-10, 03:50 PM
  3. EVGA rolls out new SLI Patch Comes with AvP Profile
    By coolramiz in forum Computer technology
    Replies: 0
    Last Post: 02-06-10, 06:52 PM
  4. Microsoft set to patch 17 year old vulnerability
    By meetdilip in forum Software News, Previews and Reviews
    Replies: 1
    Last Post: 02-05-10, 07:42 PM