Jump to content
  • 0

How to use this .patch file in my server?


zeikheim

Question


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  38
  • Reputation:   0
  • Joined:  09/14/15
  • Last Seen:  

i want to use this .patch file but i dont know how . noob questiono sorry

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  235
  • Reputation:   55
  • Joined:  12/02/11
  • Last Seen:  

1 hour ago, zeikheim said:

i want to use this .patch file but i dont know how . noob questiono sorry

 

.patch and .diff are just the same.
Usually i add the .diff/patch manually since every code you add you can check it easily.

Diff files

A diff file is a file to make:

  • implementation of a modification easier
  • check what and where you modified things
  • share your modifications with the rest of the world
  • it is also an easy way for people that give support on forums to check themselves what is wrong to the modifications you made

Creating .diff files using the tortoise menu

  1. right click on the folder
  2. goto TortoiseSVN menu
  3. click create patch
  4. save as .diff file

Manually Creating .diff files (knowing the mechanics and repairing .diffs if needed)

  1. create a new txt file
  2. rename the .txt extention to .diff
  3. start with pointing out the index (path where the diff files will patch)

    • example:
    Index: src
  4.  
  5. add a ========================================= line to indicate the next file

    • example:
    =========================================
  6.  
  7. add the patch of the file where content will be removed (---) and add the revision

    • example:
    --- src/common/mmo.c (revision 12300 Stable)
  8.  
  9. add the path of the file where content will be added (+++) and add (working copy)

    • example:
    +++ src/common/mmo.c (working copy)
  10.  
  11. add the location of the lines that need to be modified in this way:

    1. @@
    2. -100: start reading original lines at line 100
    3. ,5: read 5 original lines
    4. +100: start reading new lines at line 100
    5. ,7: read 7 new lines
    6. @@

    • example:
    @@ -100,5 +100,7 @@
  12.  
  13. add a and write a line that is from the original text (this line will be unmodified) and all others starting with a space

    • A SPACE IS NEEDED, IF YOU COPY A DIFF FROM A FORUM APPLY THE SPACES YOURSELF
    • example:
     this line will be unmodified
  14.  
  15. add a "-" and write the line that must be modified

    • example:
    -this line will be removed from the original code
  16.  
  17. add a "+" and write the line that need to be placed to replace or added to the original code

    • example:
    +this line will be added in the new code
    • full example on a @@ -x,7 +x,8 @@:
    line1: this line will be unmodified											
    	line2: this line will be unmodified line3:-this line will be deleted line4:+this line will replace line 3 line5:+this line will add a line of code line6: this line will be unmodified, but will move down one line line7: line8: this line will be unmodified, move down one line (same as the line above since an counts as a line)
  18.  

NOTICE = THE ON LINE 7 MUST START WITH A as well

Using .diff/.patch files to patch your server

Windows:

  1. go place the folder in the index folder
  2. richt click the *.diff file and go to TortoiseSVN menu
  3. click patch

Linux:

cd /path/to/your/server/folder patch -p0 < /path/to/patch/file/filename.extension

Edited by Kaze
Link to comment
Share on other sites

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3123
  • Reputation:   1617
  • Joined:  03/26/12
  • Last Seen:  

What .patch file? What's it for? What git platform are you using?

No details = no help.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3123
  • Reputation:   1617
  • Joined:  03/26/12
  • Last Seen:  

I'm not sure where you copy/pasted that info from, but you shouldn't be using TortoiseSVN for a Git project. Manually creating/editing a diff file defeats the purpose of the file.

Link to comment
Share on other sites

  • -2

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  928
  • Reputation:   170
  • Joined:  04/05/13
  • Last Seen:  

Just manual patch by + - the line in src folder and files. ( You can view .patch file clearly by Notepad++ and follow files name & line of code to edit. )

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...