Annotation of htdocs/developers/commit-guidelines.html, revision 1.41

1.1       jschauma    1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
1.31      kano        2: <html>
1.1       jschauma    3: <head>
                      4: <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
1.27      heinz       5: <meta name="generator" content="Website XSL Stylesheet V2.6.0">
1.21      jschauma    6: <link rel="home" href="../." title="Welcome to The NetBSD Project: Of course it runs NetBSD.">
                      7: <link rel="up" href="../developers/." title="NetBSD Developer Documentation">
1.27      heinz       8: <link rel="previous" href="../developers/announce.html" title="NetBSD Developer Documentation: News story guidelines">
1.30      wiz         9: <link rel="next" href="../developers/cvs-repos/." title="CVS Repository Issues">
1.27      heinz      10: <link rel="first" href="../developers/announce.html" title="NetBSD Developer Documentation: News story guidelines">
                     11: <link rel="last" href="../developers/www.html" title="NetBSD Developer Documentation: Information about the www
                     12:       mailing list">
1.41    ! dsieger    13: <link rel="stylesheet" href="../global.css" type="text/css">
1.1       jschauma   14: <title>NetBSD Commit Guidelines</title>
                     15: </head>
1.27      heinz      16: <body class="website"><div class="webpage">
1.34      dsieger    17: <a name="developers-commit-guidelines"></a><div id="top"><a href="#mainContent" class="doNotDisplay doNotPrint">Skip to main content.</a></div>
                     18: <div id="header">
                     19: <div class="topNavigation">
1.37      dsieger    20: <span>» </span><a href="../docs/guide/en/">
                     21:          The Guide</a> |
1.34      dsieger    22:        <a href="http://man.NetBSD.org/">Manual pages</a> |
1.39      kano       23:        <a href="../mailinglists/">
1.37      dsieger    24:          Mailing lists</a> and
1.34      dsieger    25:        <a href="http://mail-index.NetBSD.org/">Archives</a> |
                     26:        <a href="http://cvsweb.NetBSD.org/">CVS repository</a> |
1.37      dsieger    27:        <a href="http://www.NetBSD.org/cgi-bin/sendpr.cgi?gndb=netbsd">Report</a>
                     28:        or 
1.40      kano       29:        <a href="../support/query-pr.html">
                     30:          query</a> a bug |
1.37      dsieger    31:        <a href="../docs/software/packages.html">
                     32:          Software Packages
                     33:        </a>
1.34      dsieger    34: </div>
                     35: <div class="centralHeader">
1.37      dsieger    36: <a href="../"><img alt="[NetBSD Logo]" width="506" height="90" src="../images/NetBSD-headerlogo.png"></a><div class="headerTools"><div id="headerSearch"><form method="get" action="http://www.google.com/custom">
1.35      dsieger    37: <input class="whiteOnBlack" type="text" name="q" onfocus="if(this.value==this.defaultValue ) this.value='';" size="12" maxlength="255" value="Search"><input type="hidden" name="cof" value="L:http://www.NetBSD.org/images/NetBSD-smaller.png;LH:200;LW:200;AH:center;AWFID:4f6b0499f0f58d2c;"><input type="hidden" name="domains" value="NetBSD.org"><input type="hidden" name="sitesearch" value="www.NetBSD.org"><input type="submit" value="Search">
1.34      dsieger    38: </form></div></div>
                     39: </div>
                     40: <div class="navBar">
1.37      dsieger    41: <span class="doNotDisplay">
                     42:          Navigation:
                     43:        </span><a href="../">
                     44:          Home</a> | 
                     45:        <a href="../about/">
                     46:          About</a> | 
                     47:        <a href="../releases/">
                     48:          Download</a> | 
                     49:        <a href="../docs/">
                     50:          Documentation</a> | 
                     51:        <a href="../support/">
                     52:          Support</a> | 
                     53:        <a href="../community/">
                     54:          Community</a> | 
                     55:        <a href="../ports/">
                     56:          Ports</a>
1.34      dsieger    57: </div>
                     58: </div>
                     59: <div id="content"><div class="fullWidth"><div class="rowOfBoxes">
                     60: <h1>NetBSD Commit Guidelines</h1>
1.1       jschauma   61: <div class="sect1" lang="en">
1.12      wiz        62: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.1       jschauma   63: <a name="guidelines"></a>
                     64:   The following Commit Guidelines define the Project's standards for making
                     65:   commits to the source tree:
1.12      wiz        66: </h2></div></div></div>
1.1       jschauma   67: 
                     68: 
                     69: 
                     70: <div class="orderedlist"><ol type="1">
                     71: <li>
                     72:     <div class="sect2" lang="en">
1.12      wiz        73: <div class="titlepage"><div><div><h3 class="title">
                     74: <a name="know-thy-code"></a>Commit only code you are familiar with.</h3></div></div></div>
1.1       jschauma   75:       
                     76:       <p>
                     77:         If you are not sure if the code you plan to commit is acceptable
                     78:         (e. g. when taking code that was submitted with a problem report),
                     79:        ask a developer who is familiar with that part of the system for
                     80:        review. If you're new to the Project, check with your sponsor.
                     81:       </p>
                     82:     </div>
                     83:    </li>
                     84: <li>
                     85:     <div class="sect2" lang="en">
1.12      wiz        86: <div class="titlepage"><div><div><h3 class="title">
                     87: <a name="tainted"></a>Do not commit tainted code to the repository.</h3></div></div></div>
1.1       jschauma   88:       
                     89:       <p>
                     90:        If you commit code that was not written by yourself, double check
                     91:        that the license on that code permits import into the NetBSD source
                     92:        repository, and permits free distribution. Check with the author(s)
                     93:        of the code, make sure that they were the sole author of the code
                     94:        and verify with them that they did not copy any other code.
                     95:       </p>
                     96:     </div>
                     97:    </li>
                     98: <li>
                     99:     <div class="sect2" lang="en">
1.12      wiz       100: <div class="titlepage"><div><div><h3 class="title">
1.29      jschauma  101: <a name="repository"></a>Do not commit code from foreign trees.</h3></div></div></div>
                    102:       
                    103:       <p>
                    104:        Do not commit code from a tree checked out from anywhere but from
                    105:        cvs.NetBSD.org.  Note that all developers have access to the private
1.41    ! dsieger   106:        <a class="ulink" href="restricted.html#rsync" target="_top">rsync-over-ssh service on
1.29      jschauma  107:        cvs.NetBSD.org</a>.
                    108:       </p>
                    109:     </div>
                    110:    </li>
                    111: <li>
                    112:     <div class="sect2" lang="en">
                    113: <div class="titlepage"><div><div><h3 class="title">
1.1       jschauma  114: <a name="intrusive"></a>
                    115:        The more intrusive your changes are the higher is the level of
                    116:        required prior approval.
1.12      wiz       117:       </h3></div></div></div>
1.1       jschauma  118:       
                    119:       <div class="itemizedlist"><ul type="disc">
                    120: <li>
                    121:           <p>
                    122:            "Obvious" fixes can be committed without any prior discussion
                    123:            or review. (The definition of "obvious" in the GCC Project is:
                    124:            "could not possibly cause anyone to object." We adopt this
                    125:            definition here)
                    126:          </p>
                    127:        </li>
                    128: <li>
                    129:          <p>
                    130:            All other (i. e. "non-obvious") fixes <span class="emphasis"><em>should</em></span>
                    131:            have a review.
                    132:          </p>
                    133:        </li>
                    134: <li>
                    135:          <p>
                    136:            Implementing (significant) new features requires a prior
                    137:            discussion on an appropriate technical mailing list.
                    138:          </p>
                    139:        </li>
                    140: <li>
                    141:          <p>
                    142:            Changing existing interfaces in libraries or in the kernel
                    143:            requires prior approval by Core.
                    144:          </p>
                    145:        </li>
                    146: </ul></div>
                    147:     </div>
                    148:    </li>
                    149: <li>
                    150:     <div class="sect2" lang="en">
1.12      wiz       151: <div class="titlepage"><div><div><h3 class="title">
                    152: <a name="tested"></a>Commit only code that you have tested.</h3></div></div></div>
1.1       jschauma  153:       
                    154:        <p>
                    155:          Make sure that your code actually works as expected, by
                    156:          compiling and running the code that is affected by your change
                    157:          with your system's tools. If you changed a man page, make sure
                    158:          that groff/nroff creates the formatted man page you expect.
                    159:        </p>
                    160:        <p>
                    161:          For normal commits (to the trunk), test that your code works
1.31      kano      162:          on -current. Prior to requesting a pull-up to a branch, test
1.1       jschauma  163:          the very changes you will request from releng on the respective
                    164:          release branch.
                    165:        </p>
                    166:      </div>
                    167:     </li>
                    168: <li>
                    169:       <div class="sect2" lang="en">
1.12      wiz       170: <div class="titlepage"><div><div><h3 class="title">
                    171: <a name="group"></a>Group commits together that are part of the same fix.</h3></div></div></div>
1.1       jschauma  172:        
                    173:        <p>
                    174:          Rototilling a make variable that affects 50 Makefiles should get
                    175:           one commit for all of them together.
                    176:        </p>
                    177:       </div>
                    178:     </li>
                    179: <li>
                    180:       <div class="sect2" lang="en">
1.12      wiz       181: <div class="titlepage"><div><div><h3 class="title">
                    182: <a name="separate"></a>Each commit should be a separate patch/fix/addition/etc.</h3></div></div></div>
1.1       jschauma  183:        
                    184:        <p>
                    185:          Don't fix 3 bugs with the same commit and roll that into
                    186:          "Fixed some bugs". Fix one, test, commit, rinse, repeat. This
                    187:          makes life infinitely easier for releng to pull up fixes since
                    188:          often not everything applies to a given branch.
                    189:        </p>
                    190:       </div>
                    191:     </li>
                    192: <li>
                    193:       <div class="sect2" lang="en">
1.12      wiz       194: <div class="titlepage"><div><div><h3 class="title">
1.1       jschauma  195: <a name="dont-mix"></a>
                    196:          Do not mix functionality or bug-fix patches with
                    197:          whitespace/layout updates.
1.12      wiz       198:        </h3></div></div></div>
1.1       jschauma  199:        
                    200:         <p>
                    201:          Do those separately (apart from the general requirement that
                    202:          changes be made in such a way that it is easy to discern what
                    203:          each fix did, as described in item 6, there will be pullup
                    204:          issues with largely changed files from trunk-&gt;branch when
                    205:          mixing whitespace with functionality fixes).
                    206:        </p>
                    207:       </div>
                    208:     </li>
                    209: <li>
                    210:       <div class="sect2" lang="en">
1.12      wiz       211: <div class="titlepage"><div><div><h3 class="title">
                    212: <a name="document"></a>Clearly document your changes in the commit log.</h3></div></div></div>
1.1       jschauma  213:        
                    214:        <p>
                    215:          Detail to some degree what was changed and why. Doesn't need
                    216:          to be a code review/walkthrough but it should be informative
                    217:          to someone reading the log and looking over the diff in 6
                    218:          months. Again "fixed some stuff" or "cvs-1.10.0" isn't
                    219:          acceptable whereas the following example is:
                    220:        </p>
                    221:        <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
                    222: <h3 class="title"></h3>
                    223:           "Print useful line number on error while executing .for directive."
                    224:         </div>
                    225:        <p>
1.32      heinz     226:          If your change fixes a PR, document it with an appropriate
                    227:          message. Using the template &#8220;<span class="quote">PR category/bug-id</span>&#8221; in
                    228:          your commit message will also append it to the respective problem
                    229:          report in our bug database:
1.1       jschauma  230:        </p>
                    231:        <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
                    232: <h3 class="title"></h3>
                    233:           "Closes PR bin/6666"
                    234:         </div>
                    235:        <p>
                    236:          If your code has been reviewed by someone else, document this:
                    237:        </p>
                    238:        <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
                    239: <h3 class="title"></h3>
                    240:           "Reviewed by &lt;mrg&gt;"
                    241:        </div>
                    242:        <p>
                    243:          (Please note that a good commit log doesn't relieve the need
                    244:          for good documentation in the program itself.)
                    245:        </p>
                    246:       </div>
                    247:     </li>
                    248: <li>
                    249:       <div class="sect2" lang="en">
1.12      wiz       250: <div class="titlepage"><div><div><h3 class="title">
                    251: <a name="credit"></a>Give proper credit.</h3></div></div></div>
1.1       jschauma  252:        
                    253:        <p>
                    254:          If you commit code that had been submitted in a PR, give
                    255:          proper credit, like:
                    256:        </p>
                    257:        <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
                    258: <h3 class="title"></h3>
                    259:            "Code submitted in PR lib/393939 by Joe Doe"
                    260:        </div>
                    261:        <p>
                    262:          Since the commit messages will eventually appear on the
                    263:          source-changes mailing list which is also available via web,
                    264:          specifying the e-mail addresses of the PR submitter should
                    265:          generally be avoided.
                    266:        </p>
                    267:        <p>
                    268:          If you took code from an other Open Source Project, give
                    269:          credit, like:
                    270:        </p>
                    271:        <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
                    272: <h3 class="title"></h3>
                    273:           "From FreeBSD"
                    274:        </div>
                    275:       </div>
                    276:     </li>
                    277: <li>
                    278:       <div class="sect2" lang="en">
1.12      wiz       279: <div class="titlepage"><div><div><h3 class="title">
                    280: <a name="revert"></a>Do not revert other developer's commits.</h3></div></div></div>
1.1       jschauma  281:        
                    282:        <p>
                    283:          If you do not agree with another developer's commit, do not
                    284:          revert it on your own. Contact the other developer and explain
                    285:          to him or her the issues you have with his commit. Ask him
                    286:          or her to backout his changes himself.
                    287:        </p>
                    288:        <p>
                    289:          If no agreement can be reached, contact the Technical
                    290:          Executive Committee &lt;technical-exec@NetBSD.org&gt;, which
                    291:          will serve as mediation authority.
                    292:        </p>
                    293:       </div>
                    294:   </li>
                    295: </ol></div>
                    296: 
                    297: </div>
1.34      dsieger   298: </div></div></div>
                    299: <div class="navfoot"></div>
                    300: <div id="footer"><center>
                    301: <span class="footfeed"><a href="http://www.NetBSD.org/cgi-bin/feedback.cgi">
                    302:          Contact</a> |
1.40      kano      303:       </span><span class="footcopy"><a href="../about/disclaimer.html">
1.34      dsieger   304:       Disclaimer</a> |
1.1       jschauma  305: 
1.41    ! dsieger   306:       <span class="copyright">Copyright © 1994-2008 The NetBSD Foundation, Inc. </span>ALL RIGHTS RESERVED.<br>NetBSD<sup>®</sup> is a registered trademark of The NetBSD
1.34      dsieger   307:        Foundation, Inc.</span>
                    308: </center></div>
1.1       jschauma  309: </div></body>
                    310: </html>

CVSweb <webmaster@jp.NetBSD.org>