Welcome, Guest. Please
The Codex is
› Understanding a diff script
‹ No Topic |
Understanding a diff script (Read 1487 times)
Understanding a diff script
, 2010 at 8:10pm
To read these diff files:
A line prefaced with --- indicates the old file; a line with +++ indicates the new file. Generally, these will both have the same (or similar) filename. Note that there may be more than one ---/+++ line per file, because multiple files may be modified. For your purposes, you want to just pay attention to the +++ line, which indicates the file you want to edit.
Then, the @@ lines indicate the line number at which to start looking (the - number is the line in the old file, the + is for the new file). Go to that line number, then:
Any line WITHOUT a - or + in front of it is a "context" line, i.e. it tells you what surrounds (before and after) the area you need to change; these lines are unchanged between the files. Lines prefaced with a - or + differ between the files, where the - indicates the line in the old file, and the + indicates the line in the new file.
To put it more simply:
The +++ lines indicate the file to edit.
Go to the line number indicated by the @@ lines, and look for the code that looks like what's in the patch.
Remove any lines prefaced by -
Add lines prefaced by +
(Be aware that in more complicated files, "context" lines may come between the - and + lines... the trick is just to remove - lines and add + lines, in the same order they appear in relation to the context lines.)
‹ No Topic |
Forum Jump »
» 10 most recent Posts
» 10 most recent Topics
Frequently Asked Questions FAQ's
YaBB 3 Development
Upgrading to YaBB 2.X
Setting up YaBB Forum
Understanding the Admin Center
Managing Your Forum
Languages Addition and Translating
Guardian, Spam & Censor Settings
Backing up and Restoring
User Requested Template Modifications
Past YaBB Forum Software
YaBB 1.x (No longer Supported)
Installation, Setup, Errors and Structure
« Board Index
» Powered by
YaBB Forum Software
© 2000-2014. All Rights Reserved.