Howto:Submit patches: Difference between revisions

Jump to navigation Jump to search
m
Robot: Cosmetic changes
m (Robot: Cosmetic changes)
Line 8: Line 8:


* Try to make your patch optionally minimally invasive:
* Try to make your patch optionally minimally invasive:
** provide compile time switches to generally enable or disable your modifications (i.e. using #ifdefs, [http://sources.redhat.com/autobook/ autoconf and automake] macros) That way, you will ensure that your patch can be easily disabled (excluded from compilation while remaining in the source tree) if it should cause trouble while any issues are addressed. This applies in particular if your patch introduces any extra dependencies (i.e. libraries) or is any way platform specific.
** provide compile time switches to generally enable or disable your modifications (i.e. using #ifdefs, [http://sources.redhat.com/autobook/ autoconf and automake] macros) That way, you will ensure that your patch can be easily disabled (excluded from compilation while remaining in the source tree) if it should cause trouble while any issues are addressed. This applies in particular if your patch introduces any extra dependencies (i.e. libraries) or is any way platform specific.
** provide capabilities to enable or disable your code modifications at startup time or even at runtime, using command line options (check out $FG_SRC/Main/options.cxx) or preferably the PropertyTree/SGPropertyListeners and some simple GUI dialog (check out $FG_ROOT/gui) to enable developers and users to decide whether they want to activate your code. That way, it can be ensured that your code doesn't interfere with any other FlightGear components. This will make potential bug tracking much easier and the chances of your code remaining in the source tree are much better as well.
** provide capabilities to enable or disable your code modifications at startup time or even at runtime, using command line options (check out $FG_SRC/Main/options.cxx) or preferably the PropertyTree/SGPropertyListeners and some simple GUI dialog (check out $FG_ROOT/gui) to enable developers and users to decide whether they want to activate your code. That way, it can be ensured that your code doesn't interfere with any other FlightGear components. This will make potential bug tracking much easier and the chances of your code remaining in the source tree are much better as well.
** if you intend to add new features that may benefit from proper documentation, make sure to also provide patches to the documentation files provided under $FG_SRC/mini-docs and $FG_ROOT/Docs
** if you intend to add new features that may benefit from proper documentation, make sure to also provide patches to the documentation files provided under $FG_SRC/mini-docs and $FG_ROOT/Docs
** new command line switches should also be documented via options.xml
** new command line switches should also be documented via options.xml
Line 24: Line 24:


=== Patch Format ===
=== Patch Format ===
TODO:   unified diff vs. tarball (compressed archives)
TODO: unified diff vs. tarball (compressed archives)


=== Howto Create Patches ===
=== Howto Create Patches ===
Line 30: Line 30:
'''fg-submit script'''
'''fg-submit script'''


As of March 2007, a bash script "fg-submit" is available that simplifies the preparation of patches that are to be submitted for commit. It can be found in '/source/scripts/tools'. It compares your changes to cvs, creates a diff file and an archive containing your changed files and the diff file. Run this script from within the CVS directory containing your changes. It's output will go to that same directory.
As of March 2007, a bash script "fg-submit" is available that simplifies the preparation of patches that are to be submitted for commit. It can be found in '/source/scripts/tools'. It compares your changes to cvs, creates a diff file and an archive containing your changed files and the diff file. Run this script from within the CVS directory containing your changes. It's output will go to that same directory.


fg-submit should work with any flavor of Unix/Linux. Windows users may use this script from within a Cygwin bash shell, assuming the necessary Devel tools have been installed.
fg-submit should work with any flavor of Unix/Linux. Windows users may use this script from within a Cygwin bash shell, assuming the necessary Devel tools have been installed.

Navigation menu