Commit message guidelines: Difference between revisions

→‎Examples: Update punctuation to GNU style
No edit summary
(→‎Examples: Update punctuation to GNU style)
 
(4 intermediate revisions by 2 users not shown)
Line 10: Line 10:


<pre>
<pre>
look for methods before constructors
Look for methods before constructors.


* symtab.cc (symbol_table::fcn_info::fcn_info_rep::find):
* symtab.cc (symbol_table::fcn_info::fcn_info_rep::find):
Line 22: Line 22:


<pre>
<pre>
allow abbreviations for optimset and optimget (bug #38999)
Allow abbreviations for optimset and optimget (bug #38999).


* optimset.m, optimget.m: Handle abbreviated keys and warn for
* optimset.m, optimget.m: Handle abbreviated keys and warn for
Line 29: Line 29:


<pre>
<pre>
add format option to ticklabel (bug #34906)
Add format option to ticklabel (bug #34906).


* graphics.cc: add new functions to support different input arguments to
* graphics.cc: Add new functions to support different input arguments to
   xyzticklabel. Add tests.
   xyzticklabel. Add tests.
* graphics.in.h: define set_xyzticklabel as external function
* graphics.in.h: Define set_xyzticklabel as external function.
</pre>
</pre>


<pre>
<pre>
tag symbols in indexed assignments as variables (bug #39240)
Tag symbols in indexed assignments as variables (bug #39240).


* pt-arg-list.cc (tree_argument_list::variable_names): Also return the
* pt-arg-list.cc (tree_argument_list::variable_names): Also return the
Line 45: Line 45:


<pre>
<pre>
tar, untar, unpack: Add support for BSD tar (bug #53695)
tar, untar, unpack: Add support for BSD tar (bug #53695).


* tar_is_bsd.m: New function.
* tar_is_bsd.m: New function.
Line 56: Line 56:
This examples are the rare cases where only one file is modified and the change is simple enough:
This examples are the rare cases where only one file is modified and the change is simple enough:


  maint: merge stable to default.
  maint: Merge stable to default.
   
   
  maint: merge away accidental head.
  maint: Merge away accidental head.
   
   
  maint: Strip trailing whitespace from source files.
  maint: Strip trailing whitespace from source files.
Line 64: Line 64:
  maint: Update gnulib to latest changes.
  maint: Update gnulib to latest changes.
   
   
  doc: grammarcheck documentation for 4.2 release.
  doc: Grammarcheck documentation for 4.2 release.
   
   
  pkg.m4: update to lastest version as released with pkg-config 0.29 (bug #48775)
  pkg.m4: Update to latest version as released with pkg-config 0.29 (bug #48775).
   
   
  uigetfile.m: allow path names as input arg (bug #48828)
  uigetfile.m: Allow path names as input arg (bug #48828).


== Guidelines ==
== Guidelines ==
Line 79: Line 79:
* Add the bug number, e.g. <code>(bug #12345)</code>, where applicable.
* Add the bug number, e.g. <code>(bug #12345)</code>, where applicable.
* Use prefixes where applicable:
* Use prefixes where applicable:
** <code>maint:</code> for reorganisation of the sources that do not change the source. Regular merge commits are a prominent example.
** <code>build:</code> for changes to the build system, for example autoconf or automake files.
** <code>doc:</code> for changes to the documentation.
** <code>doc:</code> for changes to the documentation.
** <code>build:</code> for changes to the build system, for example autoconf or automake files.
** <code>gui:</code> for changes to the graphical user interface.
** <code>maint:</code> for reorganization of the sources that do not change the source. Regular merge commits are a prominent example.
** <code>test:</code> for changes to [[Tests]] only, e.g. new/removed BISTs, changed tolerances, etc.
 
 
=== Wording ===
 
{| class="wikitable"
! bad
! good
|-
| style="color:darkred;" | "Added function"
| style="color:green;" | "New function"
|-
| style="color:darkred;" | "Changed to return retval"
| style="color:green;" | "Return retval"
|-
| style="color:darkred;" | "Fixed bug"
| style="color:green;" | Write '''what''' has changed.
|}
 
The commit message should describe '''what''' was changed, not '''why''' it was changed. Any explanations should appear as comments in the code, particularly if there is something that might not be obvious to someone reading it later.


=== Body of the commit message ===
=== Body of the commit message ===
Line 112: Line 133:


For m-file and Fortran sources, the function name can be omitted if the file contains only one function. For changes outside of functions or classes, of course the parenthetical (function) or (class::function) specifiers can also be omitted.
For m-file and Fortran sources, the function name can be omitted if the file contains only one function. For changes outside of functions or classes, of course the parenthetical (function) or (class::function) specifiers can also be omitted.
=== Wording ===
{| class="wikitable"
! bad
! good
|-
| style="color:darkred;" | "Added function"
| style="color:green;" | "New function"
|-
| style="color:darkred;" | "Changed to return retval"
| style="color:green;" | "Return retval"
|-
| style="color:darkred;" | "Fixed bug"
| style="color:green;" | Write '''what''' has changed.
|}
The commit message should describe '''what''' was changed, not '''why''' it was changed. Any explanations should appear as comments in the code, particularly if there is something that might not be obvious to someone reading it later.


[[Category:Development]]
[[Category:Development]]
219

edits