<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Committing code — Django 1.4.5 documentation</title> <link rel="stylesheet" href="../../_static/default.css" type="text/css" /> <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '../../', VERSION: '1.4.5', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="../../_static/jquery.js"></script> <script type="text/javascript" src="../../_static/underscore.js"></script> <script type="text/javascript" src="../../_static/doctools.js"></script> <link rel="top" title="Django 1.4.5 documentation" href="../../index.html" /> <link rel="up" title="Contributing to Django" href="index.html" /> <link rel="next" title="Django committers" href="../committers.html" /> <link rel="prev" title="Localizing Django" href="localizing.html" /> <script type="text/javascript" src="../../templatebuiltins.js"></script> <script type="text/javascript"> (function($) { if (!django_template_builtins) { // templatebuiltins.js missing, do nothing. return; } $(document).ready(function() { // Hyperlink Django template tags and filters var base = "../../ref/templates/builtins.html"; if (base == "#") { // Special case for builtins.html itself base = ""; } // Tags are keywords, class '.k' $("div.highlight\\-html\\+django span.k").each(function(i, elem) { var tagname = $(elem).text(); if ($.inArray(tagname, django_template_builtins.ttags) != -1) { var fragment = tagname.replace(/_/, '-'); $(elem).html("<a href='" + base + "#" + fragment + "'>" + tagname + "</a>"); } }); // Filters are functions, class '.nf' $("div.highlight\\-html\\+django span.nf").each(function(i, elem) { var filtername = $(elem).text(); if ($.inArray(filtername, django_template_builtins.tfilters) != -1) { var fragment = filtername.replace(/_/, '-'); $(elem).html("<a href='" + base + "#" + fragment + "'>" + filtername + "</a>"); } }); }); })(jQuery); </script> </head> <body> <div class="document"> <div id="custom-doc" class="yui-t6"> <div id="hd"> <h1><a href="../../index.html">Django 1.4.5 documentation</a></h1> <div id="global-nav"> <a title="Home page" href="../../index.html">Home</a> | <a title="Table of contents" href="../../contents.html">Table of contents</a> | <a title="Global index" href="../../genindex.html">Index</a> | <a title="Module index" href="../../py-modindex.html">Modules</a> </div> <div class="nav"> « <a href="localizing.html" title="Localizing Django">previous</a> | <a href="../index.html" title="Django internals" accesskey="U">up</a> | <a href="../committers.html" title="Django committers">next</a> »</div> </div> <div id="bd"> <div id="yui-main"> <div class="yui-b"> <div class="yui-g" id="internals-contributing-committing-code"> <div class="section" id="s-committing-code"> <span id="committing-code"></span><h1>Committing code<a class="headerlink" href="#committing-code" title="Permalink to this headline">¶</a></h1> <p>This section is addressed to the <a class="reference internal" href="../committers.html"><em>Django committers</em></a> and to anyone interested in knowing how code gets committed into Django core.</p> <div class="section" id="s-commit-access"> <span id="commit-access"></span><h2>Commit access<a class="headerlink" href="#commit-access" title="Permalink to this headline">¶</a></h2> <p>Django has two types of committers:</p> <dl class="docutils"> <dt>Core committers</dt> <dd>These are people who have a long history of contributions to Django’s codebase, a solid track record of being polite and helpful on the mailing lists, and a proven desire to dedicate serious time to Django’s development. The bar is high for full commit access.</dd> <dt>Partial committers</dt> <dd><p class="first">These are people who are “domain experts.” They have direct check-in access to the subsystems that fall under their jurisdiction, and they’re given a formal vote in questions that involve their subsystems. This type of access is likely to be given to someone who contributes a large subframework to Django and wants to continue to maintain it.</p> <p class="last">Partial commit access is granted by the same process as full committers. However, the bar is set lower; proven expertise in the area in question is likely to be sufficient.</p> </dd> </dl> <p>Decisions on new committers will follow the process explained in <a class="reference internal" href="bugs-and-features.html#how-we-make-decisions"><em>How we make decisions</em></a>. To request commit access, please contact an existing committer privately. Public requests for commit access are potential flame-war starters, and will be ignored.</p> </div> <div class="section" id="s-committing-guidelines"> <span id="committing-guidelines"></span><h2>Committing guidelines<a class="headerlink" href="#committing-guidelines" title="Permalink to this headline">¶</a></h2> <p>Please follow these guidelines when committing code to Django’s Subversion repository:</p> <ul> <li><p class="first">For any medium-to-big changes, where “medium-to-big” is according to your judgment, please bring things up on the <a class="reference external" href="http://groups.google.com/group/django-developers">django-developers</a> mailing list before making the change.</p> <p>If you bring something up on <a class="reference external" href="http://groups.google.com/group/django-developers">django-developers</a> and nobody responds, please don’t take that to mean your idea is great and should be implemented immediately because nobody contested it. Django’s lead developers don’t have a lot of time to read mailing-list discussions immediately, so you may have to wait a couple of days before getting a response.</p> </li> <li><p class="first">Write detailed commit messages in the past tense, not present tense.</p> <ul class="simple"> <li>Good: “Fixed Unicode bug in RSS API.”</li> <li>Bad: “Fixes Unicode bug in RSS API.”</li> <li>Bad: “Fixing Unicode bug in RSS API.”</li> </ul> </li> <li><p class="first">For commits to a branch, prefix the commit message with the branch name. For example: “magic-removal: Added support for mind reading.”</p> </li> <li><p class="first">Limit commits to the most granular change that makes sense. This means, use frequent small commits rather than infrequent large commits. For example, if implementing feature X requires a small change to library Y, first commit the change to library Y, then commit feature X in a separate commit. This goes a <em>long way</em> in helping all core Django developers follow your changes.</p> </li> <li><p class="first">Separate bug fixes from feature changes.</p> <p>Bug fixes need to be added to the current bugfix branch as well as the current trunk.</p> </li> <li><p class="first">If your commit closes a ticket in the Django <a class="reference external" href="https://code.djangoproject.com/newticket">ticket tracker</a>, begin your commit message with the text “Fixed #abc”, where “abc” is the number of the ticket your commit fixes. Example: “Fixed #123 – Added support for foo”. We’ve rigged Subversion and Trac so that any commit message in that format will automatically close the referenced ticket and post a comment to it with the full commit message.</p> <p>If your commit closes a ticket and is in a branch, use the branch name first, then the “Fixed #abc.” For example: “magic-removal: Fixed #123 – Added whizbang feature.”</p> <p>For the curious: we’re using a <a class="reference external" href="http://trac.edgewall.org/browser/trunk/contrib/trac-svn-post-commit-hook.cmd">Trac post-commit hook</a> for this.</p> </li> <li><p class="first">If your commit references a ticket in the Django <a class="reference external" href="https://code.djangoproject.com/newticket">ticket tracker</a> but does <em>not</em> close the ticket, include the phrase “Refs #abc”, where “abc” is the number of the ticket your commit references. We’ve rigged Subversion and Trac so that any commit message in that format will automatically post a comment to the appropriate ticket.</p> </li> <li><p class="first">Write commit messages for backports using this pattern:</p> <div class="highlight-python"><pre>[<Django version>] Fixed <ticket> -- <description> Backport of <revision> from <branch>.</pre> </div> <p>For example:</p> <div class="highlight-python"><pre>[1.3.X] Fixed #17028 - Changed diveintopython.org -> diveintopython.net. Backport of r17115 from trunk.</pre> </div> </li> </ul> </div> <div class="section" id="s-reverting-commits"> <span id="reverting-commits"></span><h2>Reverting commits<a class="headerlink" href="#reverting-commits" title="Permalink to this headline">¶</a></h2> <p>Nobody’s perfect; mistakes will be committed. When a mistaken commit is discovered, please follow these guidelines:</p> <ul class="simple"> <li>Try very hard to ensure that mistakes don’t happen. Just because we have a reversion policy doesn’t relax your responsibility to aim for the highest quality possible. Really: double-check your work before you commit it in the first place!</li> <li>If possible, have the original author revert his/her own commit.</li> <li>Don’t revert another author’s changes without permission from the original author.</li> <li>If the original author can’t be reached (within a reasonable amount of time – a day or so) and the problem is severe – crashing bug, major test failures, etc – then ask for objections on the <a class="reference external" href="http://groups.google.com/group/django-developers">django-developers</a> mailing list then revert if there are none.</li> <li>If the problem is small (a feature commit after feature freeze, say), wait it out.</li> <li>If there’s a disagreement between the committer and the reverter-to-be then try to work it out on the <a class="reference external" href="http://groups.google.com/group/django-developers">django-developers</a> mailing list. If an agreement can’t be reached then it should be put to a vote.</li> <li>If the commit introduced a confirmed, disclosed security vulnerability then the commit may be reverted immediately without permission from anyone.</li> <li>The release branch maintainer may back out commits to the release branch without permission if the commit breaks the release branch.</li> </ul> </div> </div> </div> </div> </div> <div class="yui-b" id="sidebar"> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <h3><a href="../../contents.html">Table Of Contents</a></h3> <ul> <li><a class="reference internal" href="#">Committing code</a><ul> <li><a class="reference internal" href="#commit-access">Commit access</a></li> <li><a class="reference internal" href="#committing-guidelines">Committing guidelines</a></li> <li><a class="reference internal" href="#reverting-commits">Reverting commits</a></li> </ul> </li> </ul> <h3>Browse</h3> <ul> <li>Prev: <a href="localizing.html">Localizing Django</a></li> <li>Next: <a href="../committers.html">Django committers</a></li> </ul> <h3>You are here:</h3> <ul> <li> <a href="../../index.html">Django 1.4.5 documentation</a> <ul><li><a href="../index.html">Django internals</a> <ul><li><a href="index.html">Contributing to Django</a> <ul><li>Committing code</li></ul> </li></ul></li></ul> </li> </ul> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../../_sources/internals/contributing/committing-code.txt" rel="nofollow">Show Source</a></li> </ul> <div id="searchbox" style="display: none"> <h3>Quick search</h3> <form class="search" action="../../search.html" method="get"> <input type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> <p class="searchtip" style="font-size: 90%"> Enter search terms or a module, class or function name. </p> </div> <script type="text/javascript">$('#searchbox').show(0);</script> </div> </div> <h3>Last update:</h3> <p class="topless">Feb 21, 2013</p> </div> </div> <div id="ft"> <div class="nav"> « <a href="localizing.html" title="Localizing Django">previous</a> | <a href="../index.html" title="Django internals" accesskey="U">up</a> | <a href="../committers.html" title="Django committers">next</a> »</div> </div> </div> <div class="clearer"></div> </div> </body> </html>