committing-code.txt 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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`.
  25. To request commit access, please contact an existing committer privately.
  26. Public requests for commit access are potential flame-war starters, and
  27. will be ignored.
  28. Committing guidelines
  29. ---------------------
  30. Please follow these guidelines when committing code to Django's Subversion
  31. repository:
  32. * For any medium-to-big changes, where "medium-to-big" is according to
  33. your judgment, please bring things up on the `django-developers`_
  34. mailing list before making the change.
  35. If you bring something up on `django-developers`_ and nobody responds,
  36. please don't take that to mean your idea is great and should be
  37. implemented immediately because nobody contested it. Django's lead
  38. developers don't have a lot of time to read mailing-list discussions
  39. immediately, so you may have to wait a couple of days before getting a
  40. response.
  41. * Write detailed commit messages in the past tense, not present tense.
  42. * Good: "Fixed Unicode bug in RSS API."
  43. * Bad: "Fixes Unicode bug in RSS API."
  44. * Bad: "Fixing Unicode bug in RSS API."
  45. * For commits to a branch, prefix the commit message with the branch name.
  46. For example: "magic-removal: Added support for mind reading."
  47. * Limit commits to the most granular change that makes sense. This means,
  48. use frequent small commits rather than infrequent large commits. For
  49. example, if implementing feature X requires a small change to library Y,
  50. first commit the change to library Y, then commit feature X in a
  51. separate commit. This goes a *long way* in helping all core Django
  52. developers follow your changes.
  53. * Separate bug fixes from feature changes.
  54. Bug fixes need to be added to the current bugfix branch (e.g. the
  55. ``1.0.X`` branch) as well as the current trunk.
  56. * If your commit closes a ticket in the Django `ticket tracker`_, begin
  57. your commit message with the text "Fixed #abc", where "abc" is the
  58. number of the ticket your commit fixes. Example: "Fixed #123 -- Adde
  59. support for foo". We've rigged Subversion and Trac so that any commit
  60. message in that format will automatically close the referenced ticket
  61. and post a comment to it with the full commit message.
  62. If your commit closes a ticket and is in a branch, use the branch name
  63. first, then the "Fixed #abc." For example:
  64. "magic-removal: Fixed #123 -- Added whizbang feature."
  65. For the curious: We're using a `Trac post-commit hook`_ for this.
  66. .. _Trac post-commit hook: http://trac.edgewall.org/browser/trunk/contrib/trac-post-commit-hook
  67. * If your commit references a ticket in the Django `ticket tracker`_ but
  68. does *not* close the ticket, include the phrase "Refs #abc", where "abc"
  69. is the number of the ticket your commit references. We've rigged
  70. Subversion and Trac so that any commit message in that format will
  71. automatically post a comment to the appropriate ticket.
  72. Reverting commits
  73. -----------------
  74. Nobody's perfect; mistakes will be committed. When a mistaken commit is
  75. discovered, please follow these guidelines:
  76. * Try very hard to ensure that mistakes don't happen. Just because we
  77. have a reversion policy doesn't relax your responsibility to aim for
  78. the highest quality possible. Really: double-check your work before
  79. you commit it in the first place!
  80. * If possible, have the original author revert his/her own commit.
  81. * Don't revert another author's changes without permission from the
  82. original author.
  83. * If the original author can't be reached (within a reasonable amount
  84. of time -- a day or so) and the problem is severe -- crashing bug,
  85. major test failures, etc -- then ask for objections on django-dev
  86. then revert if there are none.
  87. * If the problem is small (a feature commit after feature freeze,
  88. say), wait it out.
  89. * If there's a disagreement between the committer and the
  90. reverter-to-be then try to work it out on the `django-developers`_
  91. mailing list. If an agreement can't be reached then it should
  92. be put to a vote.
  93. * If the commit introduced a confirmed, disclosed security
  94. vulnerability then the commit may be reverted immediately without
  95. permission from anyone.
  96. * The release branch maintainer may back out commits to the release
  97. branch without permission if the commit breaks the release branch.
  98. .. _django-developers: http://groups.google.com/group/django-developers
  99. .. _ticket tracker: http://code.djangoproject.com/newticket