Annotation of htdocs/developers/commit-guidelines.html, revision 1.28
1.1 jschauma 1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2: <html xmlns:html="http://www.w3.org/1999/xhtml">
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.26 darcy 9: <link rel="next" href="../developers/cvs-repos/notes.html" title="Misc developer CVS notes">
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.1 jschauma 13: <link rel="stylesheet" href="/NetBSD.css" type="text/css">
14: <title>NetBSD Commit Guidelines</title>
15: </head>
1.27 heinz 16: <body class="website"><div class="webpage">
17: <a name="developers-commit-guidelines"></a><h1>NetBSD Commit Guidelines</h1>
1.1 jschauma 18: <div class="sect1" lang="en">
1.12 wiz 19: <div class="titlepage"><div><div><h2 class="title" style="clear: both">
1.1 jschauma 20: <a name="guidelines"></a>
21: The following Commit Guidelines define the Project's standards for making
22: commits to the source tree:
1.12 wiz 23: </h2></div></div></div>
1.1 jschauma 24:
25:
26:
27: <div class="orderedlist"><ol type="1">
28: <li>
29: <div class="sect2" lang="en">
1.12 wiz 30: <div class="titlepage"><div><div><h3 class="title">
31: <a name="know-thy-code"></a>Commit only code you are familiar with.</h3></div></div></div>
1.1 jschauma 32:
33: <p>
34: If you are not sure if the code you plan to commit is acceptable
35: (e. g. when taking code that was submitted with a problem report),
36: ask a developer who is familiar with that part of the system for
37: review. If you're new to the Project, check with your sponsor.
38: </p>
39: </div>
40: </li>
41: <li>
42: <div class="sect2" lang="en">
1.12 wiz 43: <div class="titlepage"><div><div><h3 class="title">
44: <a name="tainted"></a>Do not commit tainted code to the repository.</h3></div></div></div>
1.1 jschauma 45:
46: <p>
47: If you commit code that was not written by yourself, double check
48: that the license on that code permits import into the NetBSD source
49: repository, and permits free distribution. Check with the author(s)
50: of the code, make sure that they were the sole author of the code
51: and verify with them that they did not copy any other code.
52: </p>
53: </div>
54: </li>
55: <li>
56: <div class="sect2" lang="en">
1.12 wiz 57: <div class="titlepage"><div><div><h3 class="title">
1.1 jschauma 58: <a name="intrusive"></a>
59: The more intrusive your changes are the higher is the level of
60: required prior approval.
1.12 wiz 61: </h3></div></div></div>
1.1 jschauma 62:
63: <div class="itemizedlist"><ul type="disc">
64: <li>
65: <p>
66: "Obvious" fixes can be committed without any prior discussion
67: or review. (The definition of "obvious" in the GCC Project is:
68: "could not possibly cause anyone to object." We adopt this
69: definition here)
70: </p>
71: </li>
72: <li>
73: <p>
74: All other (i. e. "non-obvious") fixes <span class="emphasis"><em>should</em></span>
75: have a review.
76: </p>
77: </li>
78: <li>
79: <p>
80: Implementing (significant) new features requires a prior
81: discussion on an appropriate technical mailing list.
82: </p>
83: </li>
84: <li>
85: <p>
86: Changing existing interfaces in libraries or in the kernel
87: requires prior approval by Core.
88: </p>
89: </li>
90: </ul></div>
91: </div>
92: </li>
93: <li>
94: <div class="sect2" lang="en">
1.12 wiz 95: <div class="titlepage"><div><div><h3 class="title">
96: <a name="tested"></a>Commit only code that you have tested.</h3></div></div></div>
1.1 jschauma 97:
98: <p>
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: </p>
104: <p>
105: For normal commits (to the trunk), test that your code works
106: on -current. Prior to reqesting a pull-up to a branch, test
107: the very changes you will request from releng on the respective
108: release branch.
109: </p>
110: </div>
111: </li>
112: <li>
113: <div class="sect2" lang="en">
1.12 wiz 114: <div class="titlepage"><div><div><h3 class="title">
115: <a name="group"></a>Group commits together that are part of the same fix.</h3></div></div></div>
1.1 jschauma 116:
117: <p>
118: Rototilling a make variable that affects 50 Makefiles should get
119: one commit for all of them together.
120: </p>
121: </div>
122: </li>
123: <li>
124: <div class="sect2" lang="en">
1.12 wiz 125: <div class="titlepage"><div><div><h3 class="title">
126: <a name="separate"></a>Each commit should be a separate patch/fix/addition/etc.</h3></div></div></div>
1.1 jschauma 127:
128: <p>
129: Don't fix 3 bugs with the same commit and roll that into
130: "Fixed some bugs". Fix one, test, commit, rinse, repeat. This
131: makes life infinitely easier for releng to pull up fixes since
132: often not everything applies to a given branch.
133: </p>
134: </div>
135: </li>
136: <li>
137: <div class="sect2" lang="en">
1.12 wiz 138: <div class="titlepage"><div><div><h3 class="title">
1.1 jschauma 139: <a name="dont-mix"></a>
140: Do not mix functionality or bug-fix patches with
141: whitespace/layout updates.
1.12 wiz 142: </h3></div></div></div>
1.1 jschauma 143:
144: <p>
145: Do those separately (apart from the general requirement that
146: changes be made in such a way that it is easy to discern what
147: each fix did, as described in item 6, there will be pullup
148: issues with largely changed files from trunk->branch when
149: mixing whitespace with functionality fixes).
150: </p>
151: </div>
152: </li>
153: <li>
154: <div class="sect2" lang="en">
1.12 wiz 155: <div class="titlepage"><div><div><h3 class="title">
156: <a name="document"></a>Clearly document your changes in the commit log.</h3></div></div></div>
1.1 jschauma 157:
158: <p>
159: Detail to some degree what was changed and why. Doesn't need
160: to be a code review/walkthrough but it should be informative
161: to someone reading the log and looking over the diff in 6
162: months. Again "fixed some stuff" or "cvs-1.10.0" isn't
163: acceptable whereas the following example is:
164: </p>
165: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
166: <h3 class="title"></h3>
167: "Print useful line number on error while executing .for directive."
168: </div>
169: <p>
170: If your change fixes a PR, document this:
171: </p>
172: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
173: <h3 class="title"></h3>
174: "Closes PR bin/6666"
175: </div>
176: <p>
177: If your code has been reviewed by someone else, document this:
178: </p>
179: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
180: <h3 class="title"></h3>
181: "Reviewed by <mrg>"
182: </div>
183: <p>
184: (Please note that a good commit log doesn't relieve the need
185: for good documentation in the program itself.)
186: </p>
187: </div>
188: </li>
189: <li>
190: <div class="sect2" lang="en">
1.12 wiz 191: <div class="titlepage"><div><div><h3 class="title">
192: <a name="credit"></a>Give proper credit.</h3></div></div></div>
1.1 jschauma 193:
194: <p>
195: If you commit code that had been submitted in a PR, give
196: proper credit, like:
197: </p>
198: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
199: <h3 class="title"></h3>
200: "Code submitted in PR lib/393939 by Joe Doe"
201: </div>
202: <p>
203: Since the commit messages will eventually appear on the
204: source-changes mailing list which is also available via web,
205: specifying the e-mail addresses of the PR submitter should
206: generally be avoided.
207: </p>
208: <p>
209: If you took code from an other Open Source Project, give
210: credit, like:
211: </p>
212: <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
213: <h3 class="title"></h3>
214: "From FreeBSD"
215: </div>
216: </div>
217: </li>
218: <li>
219: <div class="sect2" lang="en">
1.12 wiz 220: <div class="titlepage"><div><div><h3 class="title">
221: <a name="revert"></a>Do not revert other developer's commits.</h3></div></div></div>
1.1 jschauma 222:
223: <p>
224: If you do not agree with another developer's commit, do not
225: revert it on your own. Contact the other developer and explain
226: to him or her the issues you have with his commit. Ask him
227: or her to backout his changes himself.
228: </p>
229: <p>
230: If no agreement can be reached, contact the Technical
231: Executive Committee <technical-exec@NetBSD.org>, which
232: will serve as mediation authority.
233: </p>
234: </div>
235: </li>
236: </ol></div>
237:
238: </div>
239: <div class="navfoot">
240: <hr>
241: <table border="0" summary="Footer navigation"><tr>
1.27 heinz 242: <td class="foothome"><span class="foothome"><a href="../."><img src="/images/NetBSD-flag.png" alt="[NetBSD flag]" border="0" width="90" height="90"></a></span></td>
1.1 jschauma 243: <td class="foothome">
1.21 jschauma 244: <span class="foothome"><a href="../.">Home page</a></span><br>
1.1 jschauma 245: </td>
246: </tr></table>
247: <hr>
248: </div>
249: <p></p>
250: <span class="footfeed"><a href="http://www.NetBSD.org/cgi-bin/feedback.cgi">(contact us)</a></span>
251:
252:
1.28 ! mishka 253: <span class="foottag">Generated from <em>%NetBSD: commit-guidelines.xml,v 1.3 2005/07/16 17:13:56 heinz Exp %</em></span><br><span class="footcopy"><a href="/Misc/disclaimer.html"><span class="copyright">Copyright © 1994-2005 The NetBSD Foundation, Inc. </span>ALL RIGHTS RESERVED.<br>NetBSD<sup>®</sup> is a registered trademark of The NetBSD
! 254: Foundation, Inc.</a></span>
1.1 jschauma 255: </div></body>
256: </html>
CVSweb <webmaster@jp.NetBSD.org>