committing-code.txt 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. ===============
  2. Committing code
  3. ===============
  4. This section is addressed to the :doc:`/internals/committers` and to anyone
  5. interested in knowing how code gets committed into Django core.
  6. Commit access
  7. -------------
  8. Django has two types of committers:
  9. Core committers
  10. These are people who have a long history of contributions to Django's
  11. codebase, a solid track record of being polite and helpful on the
  12. mailing lists, and a proven desire to dedicate serious time to Django's
  13. development. The bar is high for full commit access.
  14. Partial committers
  15. These are people who are "domain experts." They have direct check-in
  16. access to the subsystems that fall under their jurisdiction, and they're
  17. given a formal vote in questions that involve their subsystems. This type
  18. of access is likely to be given to someone who contributes a large
  19. subframework to Django and wants to continue to maintain it.
  20. Partial commit access is granted by the same process as full
  21. committers. However, the bar is set lower; proven expertise in the area
  22. in question is likely to be sufficient.
  23. Decisions on new committers will follow the process explained in
  24. :ref:`how-we-make-decisions`. To request commit access, please contact an
  25. existing committer privately. Public requests for commit access are potential
  26. flame-war starters, and will be ignored.
  27. Committing guidelines
  28. ---------------------
  29. Please follow these guidelines when committing code to Django's Subversion
  30. repository:
  31. * For any medium-to-big changes, where "medium-to-big" is according to
  32. your judgment, please bring things up on the `django-developers`_
  33. mailing list before making the change.
  34. If you bring something up on `django-developers`_ and nobody responds,
  35. please don't take that to mean your idea is great and should be
  36. implemented immediately because nobody contested it. Django's lead
  37. developers don't have a lot of time to read mailing-list discussions
  38. immediately, so you may have to wait a couple of days before getting a
  39. response.
  40. * Write detailed commit messages in the past tense, not present tense.
  41. * Good: "Fixed Unicode bug in RSS API."
  42. * Bad: "Fixes Unicode bug in RSS API."
  43. * Bad: "Fixing Unicode bug in RSS API."
  44. * For commits to a branch, prefix the commit message with the branch name.
  45. For example: "magic-removal: Added support for mind reading."
  46. * Limit commits to the most granular change that makes sense. This means,
  47. use frequent small commits rather than infrequent large commits. For
  48. example, if implementing feature X requires a small change to library Y,
  49. first commit the change to library Y, then commit feature X in a
  50. separate commit. This goes a *long way* in helping all core Django
  51. developers follow your changes.
  52. * Separate bug fixes from feature changes.
  53. Bug fixes need to be added to the current bugfix branch as well as the
  54. current trunk.
  55. * If your commit closes a ticket in the Django `ticket tracker`_, begin
  56. your commit message with the text "Fixed #abc", where "abc" is the
  57. number of the ticket your commit fixes. Example: "Fixed #123 -- Added
  58. support for foo". We've rigged Subversion and Trac so that any commit
  59. message in that format will automatically close the referenced ticket
  60. and post a comment to it with the full commit message.
  61. If your commit closes a ticket and is in a branch, use the branch name
  62. first, then the "Fixed #abc." For example:
  63. "magic-removal: Fixed #123 -- Added whizbang feature."
  64. For the curious: we're using a `Trac post-commit hook`_ for this.
  65. .. _Trac post-commit hook: http://trac.edgewall.org/browser/trunk/contrib/trac-post-commit-hook
  66. * If your commit references a ticket in the Django `ticket tracker`_ but
  67. does *not* close the ticket, include the phrase "Refs #abc", where "abc"
  68. is the number of the ticket your commit references. We've rigged
  69. Subversion and Trac so that any commit message in that format will
  70. automatically post a comment to the appropriate ticket.
  71. * Write commit messages for backports using this pattern::
  72. [<Django version>] Fixed <ticket> -- <description>
  73. Backport of <revision> from <branch>.
  74. For example::
  75. [1.3.X] Fixed #17028 - Changed diveintopython.org -> diveintopython.net.
  76. Backport of r17115 from trunk.
  77. Reverting commits
  78. -----------------
  79. Nobody's perfect; mistakes will be committed. When a mistaken commit is
  80. discovered, please follow these guidelines:
  81. * Try very hard to ensure that mistakes don't happen. Just because we
  82. have a reversion policy doesn't relax your responsibility to aim for
  83. the highest quality possible. Really: double-check your work before
  84. you commit it in the first place!
  85. * If possible, have the original author revert his/her own commit.
  86. * Don't revert another author's changes without permission from the
  87. original author.
  88. * If the original author can't be reached (within a reasonable amount
  89. of time -- a day or so) and the problem is severe -- crashing bug,
  90. major test failures, etc -- then ask for objections on the
  91. `django-developers`_ mailing list then revert if there are none.
  92. * If the problem is small (a feature commit after feature freeze,
  93. say), wait it out.
  94. * If there's a disagreement between the committer and the
  95. reverter-to-be then try to work it out on the `django-developers`_
  96. mailing list. If an agreement can't be reached then it should
  97. be put to a vote.
  98. * If the commit introduced a confirmed, disclosed security
  99. vulnerability then the commit may be reverted immediately without
  100. permission from anyone.
  101. * The release branch maintainer may back out commits to the release
  102. branch without permission if the commit breaks the release branch.
  103. .. _django-developers: http://groups.google.com/group/django-developers
  104. .. _ticket tracker: http://code.djangoproject.com/newticket