1 From: Junio C Hamano <gitster@pobox.com>
2 Date: Wed, 21 Nov 2007 16:32:55 -0800
3 Subject: Addendum to "MaintNotes"
4 Abstract: Imagine that git development is racing along as usual, when our friendly
5 neighborhood maintainer is struck down by a wayward bus. Out of the
6 hordes of suckers (loyal developers), you have been tricked (chosen) to
7 step up as the new maintainer. This howto will show you "how to" do it.
8 Content-type: text/asciidoc
13 The maintainer's git time is spent on three activities.
17 Mailing list discussions on general design, fielding user
18 questions, diagnosing bug reports; reviewing, commenting on,
19 suggesting alternatives to, and rejecting patches.
23 Applying new patches from the contributors while spotting and
24 correcting minor mistakes, shuffling the integration and
25 testing branches, pushing the results out, cutting the
26 releases, and making announcements.
28 - Own development (10%)
30 Scratching my own itch and sending proposed patch series out.
32 The policy on Integration is informally mentioned in "A Note
33 from the maintainer" message, which is periodically posted to
34 this mailing list after each feature release is made.
38 - Feature releases are numbered as vX.Y.Z and are meant to
39 contain bugfixes and enhancements in any area, including
40 functionality, performance and usability, without regression.
42 - Maintenance releases are numbered as vX.Y.Z.W and are meant
43 to contain only bugfixes for the corresponding vX.Y.Z feature
44 release and earlier maintenance releases vX.Y.Z.V (V < W).
46 - 'master' branch is used to prepare for the next feature
47 release. In other words, at some point, the tip of 'master'
48 branch is tagged with vX.Y.Z.
50 - 'maint' branch is used to prepare for the next maintenance
51 release. After the feature release vX.Y.Z is made, the tip
52 of 'maint' branch is set to that release, and bugfixes will
53 accumulate on the branch, and at some point, the tip of the
54 branch is tagged with vX.Y.Z.1, vX.Y.Z.2, and so on.
56 - 'next' branch is used to publish changes (both enhancements
57 and fixes) that (1) have worthwhile goal, (2) are in a fairly
58 good shape suitable for everyday use, (3) but have not yet
59 demonstrated to be regression free. New changes are tested
60 in 'next' before merged to 'master'.
62 - 'pu' branch is used to publish other proposed changes that do
63 not yet pass the criteria set for 'next'.
65 - The tips of 'master', 'maint' and 'next' branches will always
66 fast-forward, to allow people to build their own
67 customization on top of them.
69 - Usually 'master' contains all of 'maint', 'next' contains all
70 of 'master' and 'pu' contains all of 'next'.
72 - The tip of 'master' is meant to be more stable than any
73 tagged releases, and the users are encouraged to follow it.
75 - The 'next' branch is where new action takes place, and the
76 users are encouraged to test it so that regressions and bugs
77 are found before new topics are merged to 'master'.
80 A typical git day for the maintainer implements the above policy
81 by doing the following:
83 - Scan mailing list and #git channel log. Respond with review
84 comments, suggestions etc. Kibitz. Collect potentially
85 usable patches from the mailing list. Patches about a single
86 topic go to one mailbox (I read my mail in Gnus, and type
87 \C-o to save/append messages in files in mbox format).
89 - Review the patches in the saved mailboxes. Edit proposed log
90 message for typofixes and clarifications, and add Acks
91 collected from the list. Edit patch to incorporate "Oops,
92 that should have been like this" fixes from the discussion.
94 - Classify the collected patches and handle 'master' and
97 - Obviously correct fixes that pertain to the tip of 'maint'
98 are directly applied to 'maint'.
100 - Obviously correct fixes that pertain to the tip of 'master'
101 are directly applied to 'master'.
103 This step is done with "git am".
105 $ git checkout master ;# or "git checkout maint"
106 $ git am -3 -s mailbox
109 - Merge downwards (maint->master):
111 $ git checkout master
115 - Review the last issue of "What's cooking" message, review the
116 topics scheduled for merging upwards (topic->master and
117 topic->maint), and merge.
119 $ git checkout master ;# or "git checkout maint"
120 $ git merge ai/topic ;# or "git merge ai/maint-topic"
121 $ git log -p ORIG_HEAD.. ;# final review
122 $ git diff ORIG_HEAD.. ;# final review
123 $ make test ;# final review
124 $ git branch -d ai/topic ;# or "git branch -d ai/maint-topic"
126 - Merge downwards (maint->master) if needed:
128 $ git checkout master
132 - Merge downwards (master->next) if needed:
138 - Handle the remaining patches:
140 - Anything unobvious that is applicable to 'master' (in other
141 words, does not depend on anything that is still in 'next'
142 and not in 'master') is applied to a new topic branch that
143 is forked from the tip of 'master'. This includes both
144 enhancements and unobvious fixes to 'master'. A topic
145 branch is named as ai/topic where "ai" is typically
146 author's initial and "topic" is a descriptive name of the
147 topic (in other words, "what's the series is about").
149 - An unobvious fix meant for 'maint' is applied to a new
150 topic branch that is forked from the tip of 'maint'. The
151 topic is named as ai/maint-topic.
153 - Changes that pertain to an existing topic are applied to
156 - obviously correct ones are applied first;
158 - questionable ones are discarded or applied to near the tip;
160 - Replacement patches to an existing topic are accepted only
161 for commits not in 'next'.
163 The above except the "replacement" are all done with:
165 $ git am -3 -s mailbox
167 while patch replacement is often done by:
169 $ git format-patch ai/topic~$n..ai/topic ;# export existing
171 then replace some parts with the new patch, and reapplying:
173 $ git reset --hard ai/topic~$n
174 $ git am -3 -s 000*.txt
176 The full test suite is always run for 'maint' and 'master'
177 after patch application; for topic branches the tests are run
180 - Update "What's cooking" message to review the updates to
181 existing topics, newly added topics and graduated topics.
183 This step is helped with Meta/cook script (where Meta/ contains
184 a checkout of the 'todo' branch).
186 - Merge topics to 'next'. For each branch whose tip is not
187 merged to 'next', one of three things can happen:
189 - The commits are all next-worthy; merge the topic to next:
192 $ git merge ai/topic ;# or "git merge ai/maint-topic"
195 - The new parts are of mixed quality, but earlier ones are
196 next-worthy; merge the early parts to next:
199 $ git merge ai/topic~2 ;# the tip two are dubious
202 - Nothing is next-worthy; do not do anything.
204 - [** OBSOLETE **] Optionally rebase topics that do not have any commit
205 in next yet, when they can take advantage of low-level framework
206 change that is merged to 'master' already.
208 $ git rebase master ai/topic
210 This step is helped with Meta/git-topic.perl script to
211 identify which topic is rebaseable. There also is a
212 pre-rebase hook to make sure that topics that are already in
213 'next' are not rebased beyond the merged commit.
215 - [** OBSOLETE **] Rebuild "pu" to merge the tips of topics not in 'next'.
218 $ git reset --hard next
219 $ git merge ai/topic ;# repeat for all remaining topics
222 This step is helped with Meta/PU script
224 - Push four integration branches to a private repository at
225 k.org and run "make test" on all of them.
227 - Push four integration branches to /pub/scm/git/git.git at
228 k.org. This triggers its post-update hook which:
230 (1) runs "git pull" in $HOME/git-doc/ repository to pull
231 'master' just pushed out;
233 (2) runs "make doc" in $HOME/git-doc/, install the generated
234 documentation in staging areas, which are separate
235 repositories that have html and man branches checked
238 (3) runs "git commit" in the staging areas, and run "git
239 push" back to /pub/scm/git/git.git/ to update the html
242 (4) installs generated documentation to /pub/software/scm/git/docs/
243 to be viewed from http://www.kernel.org/
245 - Fetch html and man branches back from k.org, and push four
246 integration branches and the two documentation branches to
247 repo.or.cz and other mirrors.
250 Some observations to be made.
252 * Each topic is tested individually, and also together with
253 other topics cooking in 'next'. Until it matures, none part
254 of it is merged to 'master'.
256 * A topic already in 'next' can get fixes while still in
257 'next'. Such a topic will have many merges to 'next' (in
258 other words, "git log --first-parent next" will show many
259 "Merge ai/topic to next" for the same topic.
261 * An unobvious fix for 'maint' is cooked in 'next' and then
262 merged to 'master' to make extra sure it is Ok and then
265 * Even when 'next' becomes empty (in other words, all topics
266 prove stable and are merged to 'master' and "git diff master
267 next" shows empty), it has tons of merge commits that will
268 never be in 'master'.
270 * In principle, "git log --first-parent master..next" should
271 show nothing but merges (in practice, there are fixup commits
272 and reverts that are not merges).
274 * Commits near the tip of a topic branch that are not in 'next'
275 are fair game to be discarded, replaced or rewritten.
276 Commits already merged to 'next' will not be.
278 * Being in the 'next' branch is not a guarantee for a topic to
279 be included in the next feature release. Being in the
280 'master' branch typically is.