Where to download WinMerge
http://winmerge.sourceforge.net
A beginners guide for generating a patch.
Working with the files
Save a copy of the original file that you are working with for editing.(it will be your working copy)
Keep the original file to use for comparison by WinMerge and for use in generating the patch file.
Work on your copy of the original file, make the changes you need and use it for testing as needed.
When you are finished with your changes and are ready to generate a patch, save the edited file.
This part I am not sure is right, but works for me.. Create an empty file with a text editor named as your patch and save it.
Two ways to generate the patch
Both of these are very much the same. It just depends on whether you want to compare the file side by side before generating the patch.
Compare the files visually before generating the patch
Open WinMerge, click on the folder Icon to open the 'Files and Folders' interface.
Click the top browse button and locate the original file. I make a habit of having it in the left. You can choose where you want it(left or right), but it's good to do it the same each time.
Click the second browse button and locate the file you have been editing.
When you click 'ok', the two files will load side by side in the WinMerge window. When your are satisfied with the changes as compared with the original.
Click Tools > Generate Patch which will open the patch generator interface.
Click the browse button next to the 'Result' field to select the file where the patch will be written.
This will be the empty file you created to hold your patch.
In the format section, select 'unified'.
Unified will create the @@ -3,43 +3,95 @@ line numbers.
The context selection will set how many lines are shown above your changed line when the patch is generated.
If this is a readme file, 0 works well. If it is a code patch, 3 works better as it will let people find the section of code easier.
Now the patch generator is ready, Click 'Ok'
The operating system warning dialog box will popup asking if you want to replace the empty file you created. Choose 'yes'
That will allow the file to be listed in the result: line of the interface.
Click 'ok' again in the Patch Generator interface.
Now Winmerge will popup a warning asking if you want to overwrite the file. Choose 'Yes'
WinMerge will popup a dialog box 'Patch file successfully written'
Login to Drupal.org and submit the file to the project Issue Que for review.
Generate the patch without loading the files for visual inspection
Open WinMerge, Click Tools > Generate Patch which will open the patch generator interface.
Click the browse button to choose File1: (this will be the original file)
Click the browse button to choose File2: (this will be the edited file you made the changes to.
Click the browse button next to the 'Result' field to select the file where the patch will be written.
This will be the empty file you created to hold your patch.
In the format section, select 'unified'.
Unified will create the @@ -3,43 +3,95 @@ line numbers.
The context selection will set how many lines are shown above your changed line when the patch is generated.
If this is a readme file, 0 works well. If it is a code patch, 3 works better as it will let people find the section of code easier.
Now the patch generator is ready, Click 'Ok'
The operating system warning dialog box will popup asking if you want to replace the empty file you created. Choose 'yes'
That will allow the file to be listed in the result: line of the interface.
Click 'ok' again in the Patch Generator interface.
Now Winmerge will popup a warning asking if you want to overwrite the file. Choose 'Yes'
WinMerge will popup a dialog box 'Patch file successfully written'
Login to Drupal.org and submit the file to the project Issue Que for review.
The resulting patch file will be formatted just like the pro's do it.
--- node_gallery/node_gallery.admin.inc Fri Oct 09 15:36:52 2009
+++ node_gallery/node_gallery.admin.inc Sat Oct 10 20:01:14 2009
@@ -55,7 +55,7 @@
'#type' => 'radios',
'#title' => t('Gallery Type'),
'#options' => $node_types,
- '#description' => t('Select which content type should be used as gallery type.'),
+ '#description' => t('Select which content type should be used as the gallery type.'),
'#default_value' => $gallery_config['gallery_type'],
'#required' => TRUE,
);