This tutorial will teach you how to test a Joomla patch (i.e. code fix) on a Windows PC using TortoiseGit. It assumes you've already installed TortoiseGit and created a local repository of the Joomla using TortoiseGit.
As a recap from our first lesson, recall that the main Bug Tracker is the Joomla! CMS Issue Tracker. Click the link to the left to go the Bug Tracker to find pending issues, which contain patches for testing. Recall that you can use the filters to narrow the list.
For the purposes of this tutorial, I will be using the Joomla! CMS Issue Tracker to test a Joomla 3 patch.
Make sure you're up-to-date
Right click on your repository, then go to TortoiseGit, then Pull.
Click on OK.
When it's done updating, Close out of the window.
Download the .patch or .diff file
Go to a tracker item marked as "Pending", which means that there is code to test. Ready through it, as well as the testing instructions, and get a good context for the issue.
Once ready, at the very bottom within the Files tab, look for a .patch or a .diff file. If there is more than one file, then read through the tracker item and determine which one you should use.
If there isn't a patch file uploaded, look for a github pull request; for example:
https://github.com/joomla/joomla-cms/pull/768
If you add .diff behind it, that will provide a link to the patch (technically, in a diff format); for example:
https://github.com/joomla/joomla-cms/pull/768.diff
Then just visit the link, copy and paste all the text into a text editor, and save the file as pick_a_filename.diff; for example:
768.diff
Apply the patch
To apply the patch, right click on the patch file that you downloaded, then go to TortoiseGit, then Review/apply single patch...
Note, if the patch does not apply, try editing the file and adding a new line at the end of the file. Sometimes that is needed for some patch/diff files.
Select the joomla-cms folder within the repository folder to which you "pulled", then click OK.
Patch all items.
Test the patch
Now that the patch is applied, test the patch according to the instructions in the tracker item. After testing thoroughly, comment in the tracker item with your results, first adding "@test" above your testing results. For example:
"@test
Works well in 2.5.8, 2.5.9, 3.0.2, and 3.0.3. In 2.5.8, it allows me to update
to 2.5.9. In 2.5.9, it says it's the latest. In 3.0.2, it allows me to update
to 3.0.3. In 3.0.3, it says it's the latest."
The above is a sample comment; note the "@test" above the actual testing results.
After testing is finished, revert the patch
Once done testing, we have to revert the patch. To do this, right-click on your joomla-cms folder, go to TortoiseGit, then Revert.
Select all, then click OK.
Celebrate!
Finally, celebrate! When ready, you can repeat this tutorial to test a new patch.