Annotation of htdocs/developers/commit-guidelines.xml, revision 1.7

1.1       jschauma    1: <?xml version="1.0"?>
                      2: <!DOCTYPE webpage
1.2       hrs         3:   PUBLIC "-//NetBSD//DTD Website-based NetBSD Extension//EN"
                      4:         "http://www.NetBSD.org/XML/htdocs/lang/share/xml/website-netbsd.dtd">
1.1       jschauma    5: 
1.3       heinz       6: <webpage id="developers-commit-guidelines">
1.1       jschauma    7: <config param="desc" value="NetBSD Commit Guidelines"/>
1.7     ! pooka       8: <config param="cvstag" value="$NetBSD: commit-guidelines.xml,v 1.6 2006/11/05 19:18:13 heinz Exp $"/>
        !             9: <config param="rcsdate" value="$Date: 2006/11/05 19:18:13 $"/>
1.1       jschauma   10: <head>
                     11: <title>NetBSD Commit Guidelines</title>
                     12: </head>
                     13: 
                     14: <sect1 id="guidelines">
                     15: 
                     16: <title>
                     17:   The following Commit Guidelines define the Project's standards for making
                     18:   commits to the source tree:
                     19: </title>
                     20: 
                     21: <orderedlist>
                     22:   <listitem>
                     23:     <sect2 id="know-thy-code">
                     24:       <title>Commit only code you are familiar with.</title>
                     25:       <para>
                     26:         If you are not sure if the code you plan to commit is acceptable
                     27:         (e. g. when taking code that was submitted with a problem report),
                     28:        ask a developer who is familiar with that part of the system for
                     29:        review. If you're new to the Project, check with your sponsor.
                     30:       </para>
                     31:     </sect2>
                     32:    </listitem>
                     33: 
                     34:    <listitem>
                     35:     <sect2 id="tainted">
                     36:       <title>Do not commit tainted code to the repository.</title>
                     37:       <para>
                     38:        If you commit code that was not written by yourself, double check
                     39:        that the license on that code permits import into the NetBSD source
                     40:        repository, and permits free distribution. Check with the author(s)
                     41:        of the code, make sure that they were the sole author of the code
                     42:        and verify with them that they did not copy any other code.
                     43:       </para>
                     44:     </sect2>
                     45:    </listitem>
                     46: 
                     47:    <listitem>
1.4       jschauma   48:     <sect2 id="repository">
                     49:       <title>Do not commit code from foreign trees.</title>
                     50:       <para>
                     51:        Do not commit code from a tree checked out from anywhere but from
                     52:        cvs.NetBSD.org.  Note that all developers have access to the private
                     53:        <ulink url="restricted.html#rsync">rsync-over-ssh service on
                     54:        cvs.NetBSD.org</ulink>.
                     55:       </para>
                     56:     </sect2>
                     57:    </listitem>
                     58: 
                     59:    <listitem>
1.1       jschauma   60:     <sect2 id="intrusive">
                     61:       <title>
                     62:        The more intrusive your changes are the higher is the level of
                     63:        required prior approval.
                     64:       </title>
                     65:       <itemizedlist>
                     66:         <listitem>
                     67:           <para>
                     68:            "Obvious" fixes can be committed without any prior discussion
                     69:            or review. (The definition of "obvious" in the GCC Project is:
                     70:            "could not possibly cause anyone to object." We adopt this
                     71:            definition here)
                     72:          </para>
                     73:        </listitem>
                     74:        <listitem>
                     75:          <para>
                     76:            All other (i. e. "non-obvious") fixes <emphasis>should</emphasis>
                     77:            have a review.
                     78:          </para>
                     79:        </listitem>
                     80:        <listitem>
                     81:          <para>
                     82:            Implementing (significant) new features requires a prior
                     83:            discussion on an appropriate technical mailing list.
                     84:          </para>
                     85:        </listitem>
                     86:        <listitem>
                     87:          <para>
                     88:            Changing existing interfaces in libraries or in the kernel
                     89:            requires prior approval by Core.
                     90:          </para>
                     91:        </listitem>
                     92:       </itemizedlist>
                     93:     </sect2>
                     94:    </listitem>
                     95:    <listitem>
                     96:     <sect2 id="tested">
                     97:       <title>Commit only code that you have tested.</title>
                     98:        <para>
                     99:          Make sure that your code actually works as expected, by
                    100:          compiling and running the code that is affected by your change
                    101:          with your system's tools. If you changed a man page, make sure
                    102:          that groff/nroff creates the formatted man page you expect.
                    103:        </para>
                    104:        <para>
                    105:          For normal commits (to the trunk), test that your code works
1.5       kano      106:          on -current. Prior to requesting a pull-up to a branch, test
1.1       jschauma  107:          the very changes you will request from releng on the respective
                    108:          release branch.
                    109:        </para>
1.7     ! pooka     110:        <para>
        !           111:          Run all relevant tests from
        !           112:          <filename class="directory">/usr/tests</filename> or
        !           113:          ideally the whole test suite.  The logs of the automated
        !           114:          test runs are currently available
        !           115:          <ulink url="http://www.gson.org/netbsd/bugs/build/">here</ulink>.
        !           116:          Long-term regressions (build breakage or failing tests)
        !           117:          are not acceptable and changes causing such will be backed
        !           118:          out if the regressions are not addressed.
        !           119:        </para>
1.1       jschauma  120:      </sect2>
                    121:     </listitem>
                    122:     <listitem>
                    123:       <sect2 id="group">
                    124:        <title>Group commits together that are part of the same fix.</title>
                    125:        <para>
                    126:          Rototilling a make variable that affects 50 Makefiles should get
                    127:           one commit for all of them together.
                    128:        </para>
                    129:       </sect2>
                    130:     </listitem>
                    131:     <listitem>
                    132:       <sect2 id="separate">
                    133:        <title>Each commit should be a separate patch/fix/addition/etc.</title>
                    134:        <para>
                    135:          Don't fix 3 bugs with the same commit and roll that into
                    136:          "Fixed some bugs". Fix one, test, commit, rinse, repeat. This
                    137:          makes life infinitely easier for releng to pull up fixes since
                    138:          often not everything applies to a given branch.
                    139:        </para>
                    140:       </sect2>
                    141:     </listitem>
                    142:     <listitem>
                    143:       <sect2 id="dont-mix">
                    144:        <title>
                    145:          Do not mix functionality or bug-fix patches with
                    146:          whitespace/layout updates.
                    147:        </title>
                    148:         <para>
                    149:          Do those separately (apart from the general requirement that
                    150:          changes be made in such a way that it is easy to discern what
                    151:          each fix did, as described in item 6, there will be pullup
                    152:          issues with largely changed files from trunk->branch when
                    153:          mixing whitespace with functionality fixes).
                    154:        </para>
                    155:       </sect2>
                    156:     </listitem>
                    157:     <listitem>
                    158:       <sect2 id="document">
                    159:        <title>Clearly document your changes in the commit log.</title>
                    160:        <para>
                    161:          Detail to some degree what was changed and why. Doesn't need
                    162:          to be a code review/walkthrough but it should be informative
                    163:          to someone reading the log and looking over the diff in 6
                    164:          months. Again "fixed some stuff" or "cvs-1.10.0" isn't
                    165:          acceptable whereas the following example is:
                    166:        </para>
                    167:        <note><title/>
                    168:           "Print useful line number on error while executing .for directive."
                    169:         </note>
                    170:        <para>
1.6       heinz     171:          If your change fixes a PR, document it with an appropriate
                    172:          message. Using the template <quote>PR category/bug-id</quote> in
                    173:          your commit message will also append it to the respective problem
                    174:          report in our bug database:
1.1       jschauma  175:        </para>
                    176:        <note><title/>
                    177:           "Closes PR bin/6666"
                    178:         </note>
                    179:        <para>
                    180:          If your code has been reviewed by someone else, document this:
                    181:        </para>
                    182:        <note><title/>
                    183:           "Reviewed by &lt;mrg&gt;"
                    184:        </note>
                    185:        <para>
                    186:          (Please note that a good commit log doesn't relieve the need
                    187:          for good documentation in the program itself.)
                    188:        </para>
                    189:       </sect2>
                    190:     </listitem>
                    191:     <listitem>
                    192:       <sect2 id="credit">
                    193:        <title>Give proper credit.</title>
                    194:        <para>
                    195:          If you commit code that had been submitted in a PR, give
                    196:          proper credit, like:
                    197:        </para>
                    198:        <note><title/>
                    199:            "Code submitted in PR lib/393939 by Joe Doe"
                    200:        </note>
                    201:        <para>
                    202:          Since the commit messages will eventually appear on the
                    203:          source-changes mailing list which is also available via web,
                    204:          specifying the e-mail addresses of the PR submitter should
                    205:          generally be avoided.
                    206:        </para>
                    207:        <para>
                    208:          If you took code from an other Open Source Project, give
                    209:          credit, like:
                    210:        </para>
                    211:        <note><title/>
                    212:           "From FreeBSD"
                    213:        </note>
                    214:       </sect2>
                    215:     </listitem>
                    216:     <listitem>
                    217:       <sect2 id="revert">
                    218:        <title>Do not revert other developer's commits.</title>
                    219:        <para>
                    220:          If you do not agree with another developer's commit, do not
                    221:          revert it on your own. Contact the other developer and explain
                    222:          to him or her the issues you have with his commit. Ask him
                    223:          or her to backout his changes himself.
                    224:        </para>
                    225:        <para>
                    226:          If no agreement can be reached, contact the Technical
                    227:          Executive Committee &lt;technical-exec@NetBSD.org&gt;, which
                    228:          will serve as mediation authority.
                    229:        </para>
                    230:       </sect2>
                    231:   </listitem>
                    232: </orderedlist>
                    233: 
                    234: </sect1>
                    235: 
                    236: </webpage>

CVSweb <webmaster@jp.NetBSD.org>