HOWTO get a patch checked in

From ODE Wiki

Jump to: navigation, search

ODE is a slow-moving project. Patches sometimes don't get checked in as quickly as their authors would like. Consequently, here is the strategy going forward to get patches into SVN faster:

  • If your patch is a bug fix, please create a test case (e.g. derive a demo from one of the existing demos) so the devs can see the bug actually exists.
  • If your patch optimizes some code, create a test case that can measure the improvement; preferably through a profiler, avoid including system-specific system calls to measure time. Speed and code size aren't always correlated, so measure before claiming to have optimized something.
  • Try to not make too many changes in a single patch. For example, don't mix a bug fix with a new feature when they could be submitted as 2 separate patches. If your patch accomplishes "A" and "B", and somebody else already addressed "A", "B" might be forgotten.
  • If you want to check in your patch, but think that the project developers are being too slow, ask to get 'developer' status on sourceforge (make sure to include your sourceforge user id in your request). As a developer, you can check in your change yourself! Yes, this is more work for you, but it's less work for the project admins (you might think it takes just ten seconds to check in a patch, but that's true only if you are checking in 100 at a time).
  • When you check in your patch, remember to post a message to the ODE mailing list saying what you've done and why.


How to Create a patch

  • Make sure you have Subversion on your computer. If not just go and get it since this is a free program.
  • Check out the latest version of the code
 svn co https://opende.svn.sourceforge.net/svnroot/opende/trunk openode

This will create the directory openode in your current working directory.

  • Make change to the file you want.
  • Test and retest your changes
    • The first test to do is to check the compilation of the possible version of ODE. It is possible to create the different Visual Studio with premake. If you don't have it on your computer just go and get it since this is a free program.
    • Create one version of ODE and compile it. The following line creates the solution and project needed by Visual Studio 2003 for 4 different version.

For gimpact:

 premake --with-doubles --with-gimpact --with-tests --with-demos --target vs2003
 premake                --with-gimpact --with-tests --with-demos --target vs2003

For Opcode:

 premake --with-doubles --with-tests --with-demos --target vs2003
 premake                --with-tests --with-demos --target vs2003 

Try to follow the coding style of ODE

N.B. Style is only important if your patch is "big"; patches that only touch a few lines can be formatted by the developer applying it.

astyle can help you with this problem. If you don't have it on your computer just go and get it since this is a free program. The generally accepted style is ANSI, through the --style=ansi option. N.B. Since ODE was created long time ago and by many programmers, the style can vary from file to file. A process is going on to establish a standard style.

The best way to have your changes follow the ODE coding style without polluting our patch with style change in other part of the code is:

  • Apply astyle on the file
 astyle --style=ansi joint.cpp

astyle will have created a backup file. (with the suffix .orig or .pre)

  • Rename joint.cpp to joint.cpp.with_astyle
  • Restore the backup:
  mv joint.cpp.orig joint.cpp
  • Merge the change you did with the good style in the file joint.cpp.with_astyle to joint.cpp. Programs like Winmerge, meld and KDiff3 help on this task.

Create your patch

  • Go to the openode directory and type.
 svn diff > my_patch_to_be_submitted.patch
Personal tools
Navigation