Skip to content
Robin Dunn edited this page Dec 27, 2013 · 17 revisions

Below is a quick-start guide intended for both contributors as well as core developers for using this mirror for wxWidgets development instead of using the wxWidgets SVN repository directly.

Contributing to wxWidgets

Start out with a simple clone of the wxWidgets repository (either directly from this repository or from your own fork):

git clone https://github.com/wxWidgets/wxWidgets.git

Create your branches in whatever way you prefer to work in:

git checkout -b my_custom_work master

Make your local changes and commit them just like you would on any other git clone:

git commit -m "I like how this works better."

When you want to contribute those changes back to wxWidgets, please note that since this is a mirror, we will not accept any GitHub pull requests to this repository. You will need to create a patch and submit it to the wxWidgets Issue Tracker.

Since git diff creates patches slightly different from the typical SVN workflow, you should use --no-prefix with git diff every time you create a patch. To configure your clone to do this by default so you don't need to remember to use this every time:

git config diff.noprefix true

Now you can create a patch. Remember to specify the original official branch you branched from so only your new work is included in the patch:

git diff master... > my_custom_work.patch

Using the ... revision range shorthand will automatically only include your local changes from the common ancestor commit in case the official branch contains newer commits that your local branch doesn't. Now you have a patch ready to be submitted to the issue tracker, it's that simple.

wxWidgets Core Developers

This GitHub mirror also has the ability to be used for committing directly to the wxWidgets SVN repository on trunk or any branches too. Yes, even core developers can put away their SVN client (except for creating tags), and use this mirror for all development too.

First follow the instructions above for cloning the wxWidgets GitHub mirror. Once the clone has finished, you will need to tell git that there is a SVN repository this was cloned from and where it is:

git config svn-remote.svn.url https://svn.wxwidgets.org/svn/wx
git config svn-remote.svn.fetch wxWidgets/trunk:refs/remotes/origin/master
git config svn-remote.svn.branches wxWidgets/branches/*:refs/remotes/origin/*

NOTE: If the name of the remote that you use for the master wxWidgets repository is is not "origin" (for example, I use "upstream" for the name of this remote repository in my local repo) then substitute that name in the configuration commands above.

Optionally, so that your commits (with git svn dcommit) do not diverge from the upstream mirror, you might want to configure the SVN authors file for your local clone so commit authors (specifically you) are translated exactly the same way the mirror does into name/email pairs. A copy of the authors file used for the mirror can be downloaded from here: https://github.com/downloads/wxWidgets/wxWidgets/authors.txt

Stick the authors file somewhere out of the way (either in the .git folder, or somewhere else outside of the repository), and tell your clone where to find it like so:

git config svn.authorsfile ~/.wxwidgets/authors.txt

If you do not configure the authors file, you will need to remember to reset the branches you have made commits on to the head of the corresponding branches in the mirror when it updates with your commits.

For every branch you checkout, including the master branch you checked out when you cloned, git will need to update the SVN metadata it stores for working with SVN. This takes very little time to do, and can be triggered simply by running:

git svn info

This should also happen automatically when you run git svn dcommit as well, but it's nice to get it out of the way first to make sure you have everything configured correctly.