Typo3 - Patch einspielen: Unterschied zwischen den Versionen

Aus Wikizone
Wechseln zu: Navigation, Suche
 
Zeile 1: Zeile 1:
Creating a "diff"
+
== Creating a "diff" ==
  
 
A "diff" is a file that contains just the differences between two files. Diffs are widely used for development because they allow easy reviewing of changes to the program code. There are various styles of diff output. It is important to know that for TYPO3 development we almost only use the "unified diff" (a diff variant that contains three lines of context before and after that part that was changed).
 
A "diff" is a file that contains just the differences between two files. Diffs are widely used for development because they allow easy reviewing of changes to the program code. There are various styles of diff output. It is important to know that for TYPO3 development we almost only use the "unified diff" (a diff variant that contains three lines of context before and after that part that was changed).
  
The opposit part of "diff" is "patch", a program that can apply changes from a diff file to the original code.
+
The '''opposite part of "diff" is "patch"''', a program that can apply changes from a diff file to the original code.
  
 
Here are the two most important commands:
 
Here are the two most important commands:
Zeile 9: Zeile 9:
 
Create a unified diff of two directories:
 
Create a unified diff of two directories:
  
diff -ru typo3_src.orig/ typo3_src.new/ > bug_1234.diff
+
diff -ru typo3_src.orig/ typo3_src.new/ > bug_1234.diff
 
   
 
   
How to apply a patch
+
'''How to apply a patch'''
  
 
Patch your source code using a diff file:
 
Patch your source code using a diff file:
  
cd typo3_src.new/
+
cd typo3_src.new/  
patch --dry-run -p1 < ../bug_1234.diff
+
patch --dry-run -p1 < ../bug_1234.diff
  
 
(Use the --dry-run parameter to first check if the patch applies successfully. Run the same command again without this parameter to make the changes affect.)
 
(Use the --dry-run parameter to first check if the patch applies successfully. Run the same command again without this parameter to make the changes affect.)

Version vom 1. Mai 2010, 20:09 Uhr

Creating a "diff"

A "diff" is a file that contains just the differences between two files. Diffs are widely used for development because they allow easy reviewing of changes to the program code. There are various styles of diff output. It is important to know that for TYPO3 development we almost only use the "unified diff" (a diff variant that contains three lines of context before and after that part that was changed).

The opposite part of "diff" is "patch", a program that can apply changes from a diff file to the original code.

Here are the two most important commands:

Create a unified diff of two directories:

diff -ru typo3_src.orig/ typo3_src.new/ > bug_1234.diff

How to apply a patch

Patch your source code using a diff file:

cd typo3_src.new/ 
patch --dry-run -p1 < ../bug_1234.diff

(Use the --dry-run parameter to first check if the patch applies successfully. Run the same command again without this parameter to make the changes affect.)