Howto:Submit patches: Difference between revisions

m
augmentations
m (cat)
m (augmentations)
Line 6: Line 6:


* 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).
** 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 or preferably the PropertyTree and some simple GUI dialog 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.
** provide capabilities to enable or disable your code modifications at startup time or even at  runtime, using command line options or preferably the PropertyTree/SGPropertyListeners and some simple GUI dialog 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.


* Try to carefully document those passages in your source code that:
* Try to carefully document those passages in your source code that:
** are non-obvious
** are non-obvious or unfinished
** are hackish or workarounds
** are hackish or workarounds
** use code where you yourself aren't entirely sure if you're doing the right thing
** use code where you yourself aren't entirely sure if you're doing the right thing
** are known to negatively interfere with other FlightGear code
** are known to negatively interfere with other FlightGear code
** seem to affect overall runtime performance of FlightGear


* Try to make sure that your code isn't platform-specific. Hence, it is generally a good idea to make any contributions as cross-platform capable as possible
* Try to make sure that your code isn't platform-specific. Hence, it is generally a good idea to make any contributions as cross-platform capable as possible


* If you need to print output to the terminal, make sure to use the SG_LOG logging mechanism, using the appropriate log level. Use this command sparingly, as excessive logging information has negative impact on framerate, especially on some platforms. When committing a patch, make sure you have either removed or commented out any cout or cerr statements that you have used during private debugging sessions.
* If you need to print output to the terminal, make sure to use the SG_LOG logging mechanism, using the appropriate log level. Use this command sparingly, as excessive logging information has negative impact on framerate, especially on some platforms (you can however easily use switches to generally enable/disable output of debugging information). When committing a patch, make sure you have either removed or commented out any cout or cerr statements that you have used during private debugging sessions.


=== Patch Format ===
=== Patch Format ===
2,561

edits