encourage using () for anon subtypes in attribute declarations
[gitmo/Moose.git] / lib / Moose / Manual / Contributing.pod
CommitLineData
600f7f85 1=pod
2
3=head1 NAME
4
5Moose::Manual::Contributing - How to get involved in Moose
6
7=head1 GETTING INVOLVED
8
04437dba 9Moose is an open project, and we are always willing to accept bug fixes,
10more tests, and documentation patches. Commit bits are given out freely, and
11the L</STANDARD WORKFLOW> is very simple. The general gist is: clone the Git
12repository, create a new topic branch, hack away, then find a committer to
13review your changes.
600f7f85 14
15=head1 NEW FEATURES
16
04437dba 17Moose already has a fairly large feature set, and we are currently
d85337ff 18B<not> looking to add any major new features to it. If you have an
19idea for a new feature in Moose, you are invited instead to create a
20MooseX module first.
21
22At this stage, no new features will even be considered for addition
23into the core without first being vetted as a MooseX module, unless
24it is absolutely 100% impossible to implement the feature outside the
25core.
600f7f85 26
04437dba 27If you think it is 100% impossible, please come discuss it with us on IRC or
28via e-mail. However, your feature may need a small hook in the core, or a
29refactoring of some core modules, and we are definitely open to that.
d85337ff 30
31Moose was built from the ground up with the idea of being highly
32extensible, and quite often the feature requests we see can be
33implemented through a couple of small and well placed extensions. Try
34it, it is much easier then you might think.
600f7f85 35
04437dba 36=head1 PEOPLE
37
38As Moose has matured, some structure has emerged in the process.
39
40=over
41
42=item Contributors - people creating a topic or branch
43
44You.
45
46If you have commit access, you can create a topic on the main Moose.git,
47otherwise either give us your SSH key or create your own clone of the
5af926eb 48L<git://git.moose.perl.org/Moose.git> repository or fork of the GitHub mirror.
04437dba 49
50=item Core Committers - people reviewing and merging a branch
51
52These people have worked with the Moose codebase for a while.
53
54They've been responsible for large features or branches and can help review
55your changes and apply them to the master branch.
56
57They are also fairly well versed in Git, in order to merge the branches with
58no mistakes (especially when the merge fails), and to provide advice to
59contributors.
60
61=item Cabal - people who can release moose
62
63These people are the ones who have co-maint on Moose itself and can create a
64release. They're listed under L<Moose/CABAL> in the Moose documentation. They
65merge from Master to Stable.
66
67=back
68
69=head1 BRANCH LAYOUT
70
5af926eb 71The repository is divided into several branches to make maintenance easier for
04437dba 72everyone involved. The branches below are ordered by level of stability.
73
74=over
75
76=item Stable (refs/heads/stable)
77
78The branch from which releases are cut. When making a new release, the
79release manager merges from master to stable. The stable branch is only
80updated by someone from the Cabal during a release.
81
82=item Master (refs/heads/master)
83
84The branch for new development. This branch is merged into and branched from.
85
86=item Branches (refs/heads/*)
87
88Large community branches for big development "projects".
89
6106b7a2 90=item Topics (refs/heads/topic/*)
04437dba 91
92Small personal branches that have been published for review, but can get
9840bb38 93freely rebased. Targeted features that may span a handful of commits.
04437dba 94
95Any change or bugfix should be created in a topic branch.
96
97=back
98
99=head1 STANDARD WORKFLOW
100
101 # update your copy of master
102 git checkout master
103 git pull --rebase
104
105 # create a new topic branch
106 git checkout -b topic/my-feature
107
108 # hack, commit, feel free to break fast forward
109 git commit --amend # allowed
110 git rebase --interactive # allowed
111 git push --force origin topic/my_feature # allowed
112
113Then go on IRC, ask for someone to review, and merge to master. If it merges
114cleanly and nobody has any objections, then it can be pushed to master.
115
116If it doesn't merge as a fast forward, the author of the branch needs to run
117
118 git remote update
119 git rebase origin/master # or merge
120
121and bring the branch up to date, so that it can be merged as a fast forward
122into master.
123
124No actual merging (as in a human resolving conflicts) should be done when
125merging into master, only from master into other branches.
126
127=head2 Preparing a topic branch
128
129Before a merge, a topic branch can be cleaned up by the author.
130
131This can be done using interactive rebase to combine commits, etc, or even
132C<git merge --squash> to make the whole topic into a single commit.
133
134Structuring changes like this makes it easier to apply git revert at a later
135date, and encourages a clean and descriptive history that documents what the
136author was trying to do, without the various hangups that happened while they
137were trying to do it (commits like "oops forgot that file" are not only
138unnecessary noise, they also make running things like git bisect or git revert
139harder).
140
141However, by far the biggest benefit is that the number of commits that go into
142master is eventually reduced, and they are simple and coherent, making it much
143easier for people maintaining branches to stay up to date.
144
145All large changes should be documented in L<Moose::Manual::Delta>.
146
147=head1 RELEASE WORKFLOW
148
149 git checkout master
150 # edit for final version bumping, changelogging, etc
151 # prepare release (test suite etc)
152 git commit
153 git checkout stable
154 git merge master # must be a fast forward
155 git push both
156 # ship & tag
157
158Development releases are made without merging into the stable branch.
159
160=head1 EMERGENCY BUG WORKFLOW (for immediate release)
161
162Anyone can create the necessary fix by branching off of the stable branch:
163
164 git remote update
fd9e0bac 165 git checkout -b topic/my-emergency-fix origin/stable
04437dba 166 # hack
167 git commit
168
169Then a cabal member merges into stable:
170
171 git checkout stable
172 git merge topic/my-emergency-fix
173 git push
174 # release
175 git checkout master
176 git merge stable
177
178=head1 PROJECT WORKFLOW
179
180For longer lasting branches, we use a subversion style branch layout, where
181master is routinely merged into the branch. Rebasing is allowed as long as all
5af926eb 182the branch contributors are using C<git pull --rebase> properly.
04437dba 183
184C<commit --amend>, C<rebase --interactive>, etc. are not allowed, and should
185only be done in topic branches. Committing to master is still done with the
186same review process as a topic branch, and the branch must merge as a fast
187forward.
188
9840bb38 189This is pretty much the way we're doing branches for large-ish things right
04437dba 190now.
191
192Obviously there is no technical limitation on the number of branches. You can
193freely create topic branches off of project branches, or sub projects inside
194larger projects freely. Such branches should incorporate the name of the branch
195they were made off so that people don't accidentally assume they should be
196merged into master:
197
198 git checkout -b my-project--topic/foo my-project
199
200(unfortunately Git will not allow C<my-project/foo> as a branch name if
201C<my-project> is a valid ref).
202
203=head1 THE "PU" BRANCH
204
205To make things easier for longer lived branches (whether topics or projects),
206the 'pu' branch is basically what happens if you merge all of the branches and
207topics together with master.
208
209We can update this as necessary (e.g. on a weekly basis if there is merit),
210notifying the authors of the respective branches if their branches did not merge
211(and why).
212
213To update 'pu':
214
215 git checkout pu
216 git remote update
217 git reset --hard origin/master
218 git merge @all_the_branches
219
220If the merge is clean, 'pu' is updated with C<push --force>.
221
222If the merge is not clean, the offending branch is removed from
223C<@all_the_branches>, with a small note of the conflict, and we try again.
224
225The authors of the failed branches should be told to try to merge their branch
226into 'pu', to see how their branch interacts with other branches.
227
228'pu' is probably broken most of the time, but lets us know how the different
229branches interact.
230
231=head1 BRANCH ARCHIVAL
232
233Merged branches should be deleted.
234
235Failed branches may be kept, but consider moving to refs/attic/ (e.g.
236http://danns.co.uk/node/295) to keep git branch -l current.
237
238Any branch that could still realistically be merged in the future, even if it
239hasn't had work recently, should not be archived.
240
600f7f85 241=head1 TESTS, TESTS, TESTS
242
d85337ff 243If you write I<any> code for Moose or Class::MOP, you B<must> add
244tests for that code. If you do not write tests then we cannot
04437dba 245guarantee your change will not be removed or altered at a later date,
246as there is nothing to confirm this is desired behavior.
d85337ff 247
248If your code change/addition is deep within the bowels of
249Moose/Class::MOP and your test exercises this feature in a non-obvious
250way, please add some comments either near the code in question or in
251the test so that others know.
600f7f85 252
d85337ff 253We also greatly appreciate documentation to go with your changes, and
254an entry in the Changes file. Make sure to give yourself credit!
600f7f85 255
d85337ff 256=head1 BACKWARDS COMPATIBILITY
600f7f85 257
04437dba 258Change is inevitable, and Moose is not immune to this. We do our best
86b96832 259to maintain backwards compatibility, but we do not want the code base
d85337ff 260to become overburdened by this. This is not to say that we will be
261frivolous with our changes, quite the opposite, just that we are not
262afraid of change and will do our best to keep it as painless as
263possible for the end user.
600f7f85 264
04437dba 265The rule is that if you do something that is not backwards compatible, you
266B<must> do I<at least> one deprecation cycle (more if it is larger change).
267For really larger or radical changes dev releases may be needed as well (the
268Cabal will decide on this on a case-per-case basis).
600f7f85 269
04437dba 270The preference with regard to deprecation is to warn loudly and often so that
271users will have time to fix their usages.
600f7f85 272
d85337ff 273All backwards incompatible changes B<must> be documented in
04437dba 274L<Moose::Manual::Delta>. Make sure to document any useful tips or workarounds
275for the change in that document.
600f7f85 276
277=head1 AUTHOR
278
279Stevan Little E<lt>stevan@iinteractive.comE<gt>
280
04437dba 281Chris (perigrin) Prather
282
283Yuval (nothingmuch) Kogman
284
600f7f85 285=head1 COPYRIGHT AND LICENSE
286
287Copyright 2009 by Infinity Interactive, Inc.
288
289L<http://www.iinteractive.com>
290
291This library is free software; you can redistribute it and/or modify
292it under the same terms as Perl itself.
293
d85337ff 294=cut