Imprudence:Contributing Code

= Submitting a Patch =

There are three ways to submit a patch to Imprudence:


 * 1) (preferred) Clone Imprudence on GitHub.com and push a branch carrying your patch, then let us know about it either on the ImpDev mailing list or on the forums. This allows other developers to cherry pick your change and include it faster (see git tutorial).
 * 2) Attach your patch in our forums. If you're solving a bug or implementing a feature, attach it to the appropriate post. Letting us know on ImpDev it exists will help get it applied faster.
 * 3) Submit your patch directly to the ImpDev mailing list.

Please, read the guidelines! We love applying patches to Imprudence. The guidelines ensure good patches get applied quickly.

= Patch Guidelines =


 * Do NOT use hardcoded strings in cpp files. Instead, place strings in the appropriate xml file and access them with getString("string_name");. This allows them to be translated, and easily changed if need be.

An example from llpanelavatar.cpp and panel_avatar.xml:

childSetText("notes edit", getString("Loading"));

 Loading...


 * Add new settings to settings.xml alphabetically.


 * Multiple changes should be split into multiple patches.


 * Comment what you changed/implemented where appropriate.


 * Use the Imprudence header when creating new source files.


 * Add your name and what changes you made to the Change Log (ChangeLog.txt in the root directory). This allows us to keep a record of what files have been changed and give you full credit for your patch in the release notes.

And finally:


 * Keep the UI clean. Imprudence prides itself on having a cleaner looking UI than other viewers out there.

= Patch Formatting =

Patches should be in the unified diff format.

Git
The easiest way to generate a unified diff patch is to use git, e.g.:



See git-diff for more information.

Diff
You can also use diff to generate patches.

Create two copies of your source tree, leaving one unmodified, and including your changes in the other. You can use diff -u to compare the two and generate patches.

For single files:



For multiple files, you need to compare directory tries. Files can be excluded by using the --exclude flag (see the manual):



Multiple files can also be added to the patch manually by using the >> operator:



Sample Output
Here's what a typical patch looks like:

diff --git a/ChangeLog.txt b/ChangeLog.txt index 97168eb..6185340 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,10 @@ +2009-09-14 McCabe Maxsted  + +    * Small improvement to Hide Selection Outlines feature in LLSelectMgr. +	 +		modified:  linden/indra/newview/llselectmgr.cpp +		+

diff --git a/linden/indra/newview/llselectmgr.cpp b/linden/indra/newview/llselectmgr.cpp index 998cc50..f46f104 100644 --- a/linden/indra/newview/llselectmgr.cpp +++ b/linden/indra/newview/llselectmgr.cpp @@ -4552,6 +4552,11 @@ extern LLGLdouble	gGLModelView[16]; void LLSelectMgr::updateSilhouettes { +	if (!mRenderSilhouettes || !LLSelectMgr::sRenderSelectionHighlights) +	{ +		return; +	} + 	S32 num_sils_genned = 0; LLVector3d	cameraPos = gAgent.getCameraPositionGlobal;