The Good Patch

(tidy, add category)
(Characteristics of a good patch: add git format-patch comment)
Line 1: Line 1:
== Characteristics of a good patch ==
== Characteristics of a good patch ==
A good patch should:
A good patch should:
-
* be in unified context format (diff -u)
+
* be in unified context format (<code>diff -u</code>)
 +
** alternatively, be generated with <pre>git format-patch</pre>
* only include related changes
* only include related changes
* not introduce any compile time warnings
* not introduce any compile time warnings
* have test code (if any) separate from the added/changed functionality
* have test code (if any) separate from the added/changed functionality
* not add any extra debug printing, unless absolutely necessary
* not add any extra debug printing, unless absolutely necessary
-
* match the coding style of the existing source file, for example with regard to indentation and whitespaces
+
* match the coding style of the existing source file, for example with regard to indentation and whitespace
-
When attaching a patch to a bug at https://bugs.maemo.org, add the "patch" keyword to the bug report.
+
When attaching a patch to a bug at https://bugs.maemo.org/, add the "patch" keyword to the bug report.
[[Category:Development]]
[[Category:Development]]

Revision as of 09:57, 1 February 2011

Characteristics of a good patch

A good patch should:

  • be in unified context format (diff -u)
    • alternatively, be generated with
      git format-patch
  • only include related changes
  • not introduce any compile time warnings
  • have test code (if any) separate from the added/changed functionality
  • not add any extra debug printing, unless absolutely necessary
  • match the coding style of the existing source file, for example with regard to indentation and whitespace

When attaching a patch to a bug at https://bugs.maemo.org/, add the "patch" keyword to the bug report.