blob: f4c5db592163e82f60f3efbdbdfb7a4989c9c254 [file] [log] [blame]
Junio C Hamano944ce252018-05-30 22:25:261<?xml version="1.0" encoding="UTF-8"?>
Junio C Hamanof2b74942012-11-20 21:06:262<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
5<head>
Junio C Hamano9d971152012-12-19 00:43:116<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
Junio C Hamanoeaa95f72020-04-14 17:39:357<meta name="generator" content="AsciiDoc 9.0.0rc1" />
Junio C Hamanof2b74942012-11-20 21:06:268<title>How to maintain Git</title>
9<style type="text/css">
Junio C Hamano9d971152012-12-19 00:43:1110/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
11
12/* Default font. */
13body {
14 font-family: Georgia,serif;
15}
16
17/* Title font. */
18h1, h2, h3, h4, h5, h6,
19div.title, caption.title,
20thead, p.table.header,
21#toctitle,
22#author, #revnumber, #revdate, #revremark,
23#footer {
24 font-family: Arial,Helvetica,sans-serif;
Junio C Hamanof2b74942012-11-20 21:06:2625}
26
27body {
28 margin: 1em 5% 1em 5%;
29}
30
31a {
32 color: blue;
33 text-decoration: underline;
34}
35a:visited {
36 color: fuchsia;
37}
38
39em {
40 font-style: italic;
41 color: navy;
42}
43
44strong {
45 font-weight: bold;
46 color: #083194;
47}
48
Junio C Hamanof2b74942012-11-20 21:06:2649h1, h2, h3, h4, h5, h6 {
50 color: #527bbd;
Junio C Hamanof2b74942012-11-20 21:06:2651 margin-top: 1.2em;
52 margin-bottom: 0.5em;
53 line-height: 1.3;
54}
55
56h1, h2, h3 {
57 border-bottom: 2px solid silver;
58}
59h2 {
60 padding-top: 0.5em;
61}
62h3 {
63 float: left;
64}
65h3 + * {
66 clear: left;
67}
Junio C Hamano9d971152012-12-19 00:43:1168h5 {
69 font-size: 1.0em;
70}
Junio C Hamanof2b74942012-11-20 21:06:2671
72div.sectionbody {
Junio C Hamanof2b74942012-11-20 21:06:2673 margin-left: 0;
74}
75
76hr {
77 border: 1px solid silver;
78}
79
80p {
81 margin-top: 0.5em;
82 margin-bottom: 0.5em;
83}
84
85ul, ol, li > p {
86 margin-top: 0;
87}
Junio C Hamano9d971152012-12-19 00:43:1188ul > li { color: #aaa; }
89ul > li > * { color: black; }
Junio C Hamanof2b74942012-11-20 21:06:2690
Junio C Hamanoc14e6ad2014-10-31 20:25:5391.monospaced, code, pre {
92 font-family: "Courier New", Courier, monospace;
93 font-size: inherit;
94 color: navy;
Junio C Hamanof2b74942012-11-20 21:06:2695 padding: 0;
96 margin: 0;
97}
Junio C Hamanoc14e6ad2014-10-31 20:25:5398pre {
99 white-space: pre-wrap;
100}
Junio C Hamanof2b74942012-11-20 21:06:26101
Junio C Hamano9d971152012-12-19 00:43:11102#author {
Junio C Hamanof2b74942012-11-20 21:06:26103 color: #527bbd;
Junio C Hamanof2b74942012-11-20 21:06:26104 font-weight: bold;
105 font-size: 1.1em;
106}
Junio C Hamano9d971152012-12-19 00:43:11107#email {
Junio C Hamanof2b74942012-11-20 21:06:26108}
Junio C Hamano9d971152012-12-19 00:43:11109#revnumber, #revdate, #revremark {
Junio C Hamanof2b74942012-11-20 21:06:26110}
111
Junio C Hamano9d971152012-12-19 00:43:11112#footer {
Junio C Hamanof2b74942012-11-20 21:06:26113 font-size: small;
114 border-top: 2px solid silver;
115 padding-top: 0.5em;
116 margin-top: 4.0em;
117}
Junio C Hamano9d971152012-12-19 00:43:11118#footer-text {
Junio C Hamanof2b74942012-11-20 21:06:26119 float: left;
120 padding-bottom: 0.5em;
121}
Junio C Hamano9d971152012-12-19 00:43:11122#footer-badges {
Junio C Hamanof2b74942012-11-20 21:06:26123 float: right;
124 padding-bottom: 0.5em;
125}
126
Junio C Hamano9d971152012-12-19 00:43:11127#preamble {
Junio C Hamanof2b74942012-11-20 21:06:26128 margin-top: 1.5em;
129 margin-bottom: 1.5em;
130}
Junio C Hamano9d971152012-12-19 00:43:11131div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamanof2b74942012-11-20 21:06:26132div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
133div.admonitionblock {
134 margin-top: 1.0em;
135 margin-bottom: 1.5em;
136}
137div.admonitionblock {
138 margin-top: 2.0em;
139 margin-bottom: 2.0em;
140 margin-right: 10%;
141 color: #606060;
142}
143
144div.content { /* Block element content. */
145 padding: 0;
146}
147
148/* Block element titles. */
149div.title, caption.title {
150 color: #527bbd;
Junio C Hamanof2b74942012-11-20 21:06:26151 font-weight: bold;
152 text-align: left;
153 margin-top: 1.0em;
154 margin-bottom: 0.5em;
155}
156div.title + * {
157 margin-top: 0;
158}
159
160td div.title:first-child {
161 margin-top: 0.0em;
162}
163div.content div.title:first-child {
164 margin-top: 0.0em;
165}
166div.content + div.title {
167 margin-top: 0.0em;
168}
169
170div.sidebarblock > div.content {
171 background: #ffffee;
Junio C Hamano9d971152012-12-19 00:43:11172 border: 1px solid #dddddd;
173 border-left: 4px solid #f0f0f0;
Junio C Hamanof2b74942012-11-20 21:06:26174 padding: 0.5em;
175}
176
177div.listingblock > div.content {
Junio C Hamano9d971152012-12-19 00:43:11178 border: 1px solid #dddddd;
179 border-left: 5px solid #f0f0f0;
180 background: #f8f8f8;
Junio C Hamanof2b74942012-11-20 21:06:26181 padding: 0.5em;
182}
183
184div.quoteblock, div.verseblock {
185 padding-left: 1.0em;
186 margin-left: 1.0em;
187 margin-right: 10%;
Junio C Hamano9d971152012-12-19 00:43:11188 border-left: 5px solid #f0f0f0;
189 color: #888;
Junio C Hamanof2b74942012-11-20 21:06:26190}
191
192div.quoteblock > div.attribution {
193 padding-top: 0.5em;
194 text-align: right;
195}
196
Junio C Hamano9d971152012-12-19 00:43:11197div.verseblock > pre.content {
198 font-family: inherit;
199 font-size: inherit;
Junio C Hamanof2b74942012-11-20 21:06:26200}
201div.verseblock > div.attribution {
202 padding-top: 0.75em;
203 text-align: left;
204}
205/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
206div.verseblock + div.attribution {
207 text-align: left;
208}
209
210div.admonitionblock .icon {
211 vertical-align: top;
212 font-size: 1.1em;
213 font-weight: bold;
214 text-decoration: underline;
215 color: #527bbd;
216 padding-right: 0.5em;
217}
218div.admonitionblock td.content {
219 padding-left: 0.5em;
220 border-left: 3px solid #dddddd;
221}
222
223div.exampleblock > div.content {
224 border-left: 3px solid #dddddd;
225 padding-left: 0.5em;
226}
227
228div.imageblock div.content { padding-left: 0; }
Junio C Hamanoc14e6ad2014-10-31 20:25:53229span.image img { border-style: none; vertical-align: text-bottom; }
Junio C Hamanof2b74942012-11-20 21:06:26230a.image:visited { color: white; }
231
232dl {
233 margin-top: 0.8em;
234 margin-bottom: 0.8em;
235}
236dt {
237 margin-top: 0.5em;
238 margin-bottom: 0;
239 font-style: normal;
240 color: navy;
241}
242dd > *:first-child {
243 margin-top: 0.1em;
244}
245
246ul, ol {
247 list-style-position: outside;
248}
249ol.arabic {
250 list-style-type: decimal;
251}
252ol.loweralpha {
253 list-style-type: lower-alpha;
254}
255ol.upperalpha {
256 list-style-type: upper-alpha;
257}
258ol.lowerroman {
259 list-style-type: lower-roman;
260}
261ol.upperroman {
262 list-style-type: upper-roman;
263}
264
265div.compact ul, div.compact ol,
266div.compact p, div.compact p,
267div.compact div, div.compact div {
268 margin-top: 0.1em;
269 margin-bottom: 0.1em;
270}
271
Junio C Hamanof2b74942012-11-20 21:06:26272tfoot {
273 font-weight: bold;
274}
275td > div.verse {
276 white-space: pre;
277}
Junio C Hamanof2b74942012-11-20 21:06:26278
279div.hdlist {
280 margin-top: 0.8em;
281 margin-bottom: 0.8em;
282}
283div.hdlist tr {
284 padding-bottom: 15px;
285}
286dt.hdlist1.strong, td.hdlist1.strong {
287 font-weight: bold;
288}
289td.hdlist1 {
290 vertical-align: top;
291 font-style: normal;
292 padding-right: 0.8em;
293 color: navy;
294}
295td.hdlist2 {
296 vertical-align: top;
297}
298div.hdlist.compact tr {
299 margin: 0;
300 padding-bottom: 0;
301}
302
303.comment {
304 background: yellow;
305}
306
307.footnote, .footnoteref {
308 font-size: 0.8em;
309}
310
311span.footnote, span.footnoteref {
312 vertical-align: super;
313}
314
315#footnotes {
316 margin: 20px 0 20px 0;
317 padding: 7px 0 0 0;
318}
319
320#footnotes div.footnote {
321 margin: 0 0 5px 0;
322}
323
324#footnotes hr {
325 border: none;
326 border-top: 1px solid silver;
327 height: 1px;
328 text-align: left;
329 margin-left: 0;
330 width: 20%;
331 min-width: 100px;
332}
333
Junio C Hamano9d971152012-12-19 00:43:11334div.colist td {
335 padding-right: 0.5em;
336 padding-bottom: 0.3em;
337 vertical-align: top;
338}
339div.colist td img {
340 margin-top: 0.3em;
Junio C Hamanof2b74942012-11-20 21:06:26341}
342
Junio C Hamano9d971152012-12-19 00:43:11343@media print {
344 #footer-badges { display: none; }
345}
346
347#toc {
Junio C Hamanof2b74942012-11-20 21:06:26348 margin-bottom: 2.5em;
349}
350
Junio C Hamano9d971152012-12-19 00:43:11351#toctitle {
Junio C Hamanof2b74942012-11-20 21:06:26352 color: #527bbd;
Junio C Hamanof2b74942012-11-20 21:06:26353 font-size: 1.1em;
354 font-weight: bold;
355 margin-top: 1.0em;
356 margin-bottom: 0.1em;
357}
358
Junio C Hamanoc14e6ad2014-10-31 20:25:53359div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanof2b74942012-11-20 21:06:26360 margin-top: 0;
361 margin-bottom: 0;
362}
363div.toclevel2 {
364 margin-left: 2em;
365 font-size: 0.9em;
366}
367div.toclevel3 {
368 margin-left: 4em;
369 font-size: 0.9em;
370}
371div.toclevel4 {
372 margin-left: 6em;
373 font-size: 0.9em;
374}
Junio C Hamanof2b74942012-11-20 21:06:26375
Junio C Hamano9d971152012-12-19 00:43:11376span.aqua { color: aqua; }
377span.black { color: black; }
378span.blue { color: blue; }
379span.fuchsia { color: fuchsia; }
380span.gray { color: gray; }
381span.green { color: green; }
382span.lime { color: lime; }
383span.maroon { color: maroon; }
384span.navy { color: navy; }
385span.olive { color: olive; }
386span.purple { color: purple; }
387span.red { color: red; }
388span.silver { color: silver; }
389span.teal { color: teal; }
390span.white { color: white; }
391span.yellow { color: yellow; }
392
393span.aqua-background { background: aqua; }
394span.black-background { background: black; }
395span.blue-background { background: blue; }
396span.fuchsia-background { background: fuchsia; }
397span.gray-background { background: gray; }
398span.green-background { background: green; }
399span.lime-background { background: lime; }
400span.maroon-background { background: maroon; }
401span.navy-background { background: navy; }
402span.olive-background { background: olive; }
403span.purple-background { background: purple; }
404span.red-background { background: red; }
405span.silver-background { background: silver; }
406span.teal-background { background: teal; }
407span.white-background { background: white; }
408span.yellow-background { background: yellow; }
409
410span.big { font-size: 2em; }
411span.small { font-size: 0.6em; }
412
413span.underline { text-decoration: underline; }
414span.overline { text-decoration: overline; }
415span.line-through { text-decoration: line-through; }
416
Junio C Hamanoc14e6ad2014-10-31 20:25:53417div.unbreakable { page-break-inside: avoid; }
418
Junio C Hamano9d971152012-12-19 00:43:11419
420/*
421 * xhtml11 specific
422 *
423 * */
424
425div.tableblock {
426 margin-top: 1.0em;
427 margin-bottom: 1.5em;
Junio C Hamanof2b74942012-11-20 21:06:26428}
Junio C Hamano9d971152012-12-19 00:43:11429div.tableblock > table {
430 border: 3px solid #527bbd;
431}
432thead, p.table.header {
Junio C Hamanof2b74942012-11-20 21:06:26433 font-weight: bold;
Junio C Hamano9d971152012-12-19 00:43:11434 color: #527bbd;
435}
436p.table {
437 margin-top: 0;
438}
Junio C Hamano725b0da2020-01-22 22:02:40439/* Because the table frame attribute is overridden by CSS in most browsers. */
Junio C Hamano9d971152012-12-19 00:43:11440div.tableblock > table[frame="void"] {
441 border-style: none;
442}
443div.tableblock > table[frame="hsides"] {
444 border-left-style: none;
445 border-right-style: none;
446}
447div.tableblock > table[frame="vsides"] {
448 border-top-style: none;
449 border-bottom-style: none;
Junio C Hamanof2b74942012-11-20 21:06:26450}
451
Junio C Hamano9d971152012-12-19 00:43:11452
453/*
454 * html5 specific
455 *
456 * */
457
458table.tableblock {
459 margin-top: 1.0em;
460 margin-bottom: 1.5em;
461}
462thead, p.tableblock.header {
463 font-weight: bold;
464 color: #527bbd;
465}
466p.tableblock {
467 margin-top: 0;
468}
469table.tableblock {
470 border-width: 3px;
471 border-spacing: 0px;
472 border-style: solid;
473 border-color: #527bbd;
474 border-collapse: collapse;
475}
476th.tableblock, td.tableblock {
477 border-width: 1px;
478 padding: 4px;
479 border-style: solid;
480 border-color: #527bbd;
Junio C Hamanof2b74942012-11-20 21:06:26481}
482
Junio C Hamano9d971152012-12-19 00:43:11483table.tableblock.frame-topbot {
484 border-left-style: hidden;
485 border-right-style: hidden;
486}
487table.tableblock.frame-sides {
488 border-top-style: hidden;
489 border-bottom-style: hidden;
490}
491table.tableblock.frame-none {
492 border-style: hidden;
493}
494
495th.tableblock.halign-left, td.tableblock.halign-left {
496 text-align: left;
497}
498th.tableblock.halign-center, td.tableblock.halign-center {
499 text-align: center;
500}
501th.tableblock.halign-right, td.tableblock.halign-right {
Junio C Hamanof2b74942012-11-20 21:06:26502 text-align: right;
503}
504
Junio C Hamano9d971152012-12-19 00:43:11505th.tableblock.valign-top, td.tableblock.valign-top {
506 vertical-align: top;
Junio C Hamanof2b74942012-11-20 21:06:26507}
Junio C Hamano9d971152012-12-19 00:43:11508th.tableblock.valign-middle, td.tableblock.valign-middle {
509 vertical-align: middle;
510}
511th.tableblock.valign-bottom, td.tableblock.valign-bottom {
512 vertical-align: bottom;
Junio C Hamanof2b74942012-11-20 21:06:26513}
514
Junio C Hamano9d971152012-12-19 00:43:11515
516/*
517 * manpage specific
518 *
519 * */
520
521body.manpage h1 {
522 padding-top: 0.5em;
523 padding-bottom: 0.5em;
524 border-top: 2px solid silver;
525 border-bottom: 2px solid silver;
526}
527body.manpage h2 {
528 border-style: none;
529}
530body.manpage div.sectionbody {
531 margin-left: 3em;
Junio C Hamanof2b74942012-11-20 21:06:26532}
533
Junio C Hamano9d971152012-12-19 00:43:11534@media print {
535 body.manpage div#toc { display: none; }
536}
Junio C Hamanoc14e6ad2014-10-31 20:25:53537
538
Junio C Hamanof2b74942012-11-20 21:06:26539</style>
540<script type="text/javascript">
541/*<![CDATA[*/
Junio C Hamanof2b74942012-11-20 21:06:26542var asciidoc = { // Namespace.
543
544/////////////////////////////////////////////////////////////////////
545// Table Of Contents generator
546/////////////////////////////////////////////////////////////////////
547
548/* Author: Mihai Bazon, September 2002
549 * http://students.infoiasi.ro/~mishoo
550 *
551 * Table Of Content generator
552 * Version: 0.4
553 *
554 * Feel free to use this script under the terms of the GNU General Public
555 * License, as long as you do not remove or alter this notice.
556 */
557
558 /* modified by Troy D. Hanson, September 2006. License: GPL */
559 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
560
561// toclevels = 1..4.
562toc: function (toclevels) {
563
564 function getText(el) {
565 var text = "";
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
568 text += i.data;
569 else if (i.firstChild != null)
570 text += getText(i);
571 }
572 return text;
573 }
574
575 function TocEntry(el, text, toclevel) {
576 this.element = el;
577 this.text = text;
578 this.toclevel = toclevel;
579 }
580
581 function tocEntries(el, toclevels) {
582 var result = new Array;
Junio C Hamanoc14e6ad2014-10-31 20:25:53583 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamanof2b74942012-11-20 21:06:26584 // Function that scans the DOM tree for header elements (the DOM2
585 // nodeIterator API would be a better technique but not supported by all
586 // browsers).
587 var iterate = function (el) {
588 for (var i = el.firstChild; i != null; i = i.nextSibling) {
589 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
590 var mo = re.exec(i.tagName);
591 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
592 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
593 }
594 iterate(i);
595 }
596 }
597 }
598 iterate(el);
599 return result;
600 }
601
602 var toc = document.getElementById("toc");
Junio C Hamano9d971152012-12-19 00:43:11603 if (!toc) {
604 return;
605 }
606
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
609 var i;
610 for (i = 0; i < toc.childNodes.length; i++) {
611 var entry = toc.childNodes[i];
Junio C Hamanoc14e6ad2014-10-31 20:25:53612 if (entry.nodeName.toLowerCase() == 'div'
Junio C Hamano9d971152012-12-19 00:43:11613 && entry.getAttribute("class")
614 && entry.getAttribute("class").match(/^toclevel/))
615 tocEntriesToRemove.push(entry);
616 }
617 for (i = 0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
619 }
620
621 // Rebuild TOC entries.
Junio C Hamanof2b74942012-11-20 21:06:26622 var entries = tocEntries(document.getElementById("content"), toclevels);
623 for (var i = 0; i < entries.length; ++i) {
624 var entry = entries[i];
625 if (entry.element.id == "")
626 entry.element.id = "_toc_" + i;
627 var a = document.createElement("a");
628 a.href = "#" + entry.element.id;
629 a.appendChild(document.createTextNode(entry.text));
630 var div = document.createElement("div");
631 div.appendChild(a);
632 div.className = "toclevel" + entry.toclevel;
633 toc.appendChild(div);
634 }
635 if (entries.length == 0)
636 toc.parentNode.removeChild(toc);
637},
638
639
640/////////////////////////////////////////////////////////////////////
641// Footnotes generator
642/////////////////////////////////////////////////////////////////////
643
644/* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
646 */
647
648footnotes: function () {
Junio C Hamano9d971152012-12-19 00:43:11649 // Delete existing footnote entries in case we're reloading the footnodes.
650 var i;
Junio C Hamanof2b74942012-11-20 21:06:26651 var noteholder = document.getElementById("footnotes");
Junio C Hamano9d971152012-12-19 00:43:11652 if (!noteholder) {
653 return;
654 }
655 var entriesToRemove = [];
656 for (i = 0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
Junio C Hamanoc14e6ad2014-10-31 20:25:53658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
Junio C Hamano9d971152012-12-19 00:43:11659 entriesToRemove.push(entry);
660 }
661 for (i = 0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
663 }
664
665 // Rebuild footnote entries.
666 var cont = document.getElementById("content");
Junio C Hamanof2b74942012-11-20 21:06:26667 var spans = cont.getElementsByTagName("span");
668 var refs = {};
669 var n = 0;
670 for (i=0; i<spans.length; i++) {
671 if (spans[i].className == "footnote") {
672 n++;
Junio C Hamano9d971152012-12-19 00:43:11673 var note = spans[i].getAttribute("data-note");
674 if (!note) {
675 // Use [\s\S] in place of . so multi-line matches work.
676 // Because JavaScript has no s (dotall) regex flag.
677 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
678 spans[i].innerHTML =
679 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
680 "' title='View footnote' class='footnote'>" + n + "</a>]";
681 spans[i].setAttribute("data-note", note);
682 }
Junio C Hamanof2b74942012-11-20 21:06:26683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n + "'>" +
685 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
686 n + "</a>. " + note + "</div>";
Junio C Hamanof2b74942012-11-20 21:06:26687 var id =spans[i].getAttribute("id");
688 if (id != null) refs["#"+id] = n;
689 }
690 }
691 if (n == 0)
692 noteholder.parentNode.removeChild(noteholder);
693 else {
694 // Process footnoterefs.
695 for (i=0; i<spans.length; i++) {
696 if (spans[i].className == "footnoteref") {
697 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
698 href = href.match(/#.*/)[0]; // Because IE return full URL.
699 n = refs[href];
700 spans[i].innerHTML =
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n + "</a>]";
703 }
704 }
705 }
Junio C Hamano9d971152012-12-19 00:43:11706},
707
708install: function(toclevels) {
709 var timerId;
710
711 function reinstall() {
712 asciidoc.footnotes();
713 if (toclevels) {
714 asciidoc.toc(toclevels);
715 }
716 }
717
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
720 reinstall();
721 }
722
723 timerId = setInterval(reinstall, 500);
724 if (document.addEventListener)
725 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
726 else
727 window.onload = reinstallAndRemoveTimer;
Junio C Hamanof2b74942012-11-20 21:06:26728}
729
730}
Junio C Hamano9d971152012-12-19 00:43:11731asciidoc.install();
Junio C Hamanof2b74942012-11-20 21:06:26732/*]]>*/
733</script>
734</head>
Junio C Hamano9d971152012-12-19 00:43:11735<body class="article">
Junio C Hamanof2b74942012-11-20 21:06:26736<div id="header">
737<h1>How to maintain Git</h1>
738</div>
739<div id="content">
Junio C Hamano36d52292013-01-25 21:32:36740<div class="sect1">
741<h2 id="_activities">Activities</h2>
Junio C Hamanof2b74942012-11-20 21:06:26742<div class="sectionbody">
Junio C Hamano076ffcc2013-02-06 05:13:21743<div class="paragraph"><p>The maintainer&#8217;s Git time is spent on three activities.</p></div>
Junio C Hamanof2b74942012-11-20 21:06:26744<div class="ulist"><ul>
745<li>
746<p>
Junio C Hamano36d52292013-01-25 21:32:36747Communication (45%)
Junio C Hamanof2b74942012-11-20 21:06:26748</p>
749<div class="literalblock">
750<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53751<pre><code>Mailing list discussions on general design, fielding user
Junio C Hamanof2b74942012-11-20 21:06:26752questions, diagnosing bug reports; reviewing, commenting on,
Junio C Hamanoc14e6ad2014-10-31 20:25:53753suggesting alternatives to, and rejecting patches.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26754</div></div>
755</li>
756<li>
757<p>
Junio C Hamano36d52292013-01-25 21:32:36758Integration (50%)
Junio C Hamanof2b74942012-11-20 21:06:26759</p>
760<div class="literalblock">
761<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53762<pre><code>Applying new patches from the contributors while spotting and
Junio C Hamanof2b74942012-11-20 21:06:26763correcting minor mistakes, shuffling the integration and
764testing branches, pushing the results out, cutting the
Junio C Hamanoc14e6ad2014-10-31 20:25:53765releases, and making announcements.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26766</div></div>
767</li>
768<li>
769<p>
Junio C Hamano36d52292013-01-25 21:32:36770Own development (5%)
Junio C Hamanof2b74942012-11-20 21:06:26771</p>
772<div class="literalblock">
773<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53774<pre><code>Scratching my own itch and sending proposed patch series out.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26775</div></div>
776</li>
777</ul></div>
Junio C Hamano36d52292013-01-25 21:32:36778</div>
779</div>
780<div class="sect1">
781<h2 id="_the_policy">The Policy</h2>
782<div class="sectionbody">
Junio C Hamanof2b74942012-11-20 21:06:26783<div class="paragraph"><p>The policy on Integration is informally mentioned in "A Note
784from the maintainer" message, which is periodically posted to
785this mailing list after each feature release is made.</p></div>
Junio C Hamanof2b74942012-11-20 21:06:26786<div class="ulist"><ul>
787<li>
788<p>
Junio C Hamanoa9c36342014-02-06 23:33:42789Feature releases are numbered as vX.Y.0 and are meant to
Junio C Hamanof2b74942012-11-20 21:06:26790 contain bugfixes and enhancements in any area, including
791 functionality, performance and usability, without regression.
792</p>
793</li>
794<li>
795<p>
Junio C Hamano36d52292013-01-25 21:32:36796One release cycle for a feature release is expected to last for
797 eight to ten weeks.
798</p>
799</li>
800<li>
801<p>
Junio C Hamanoa9c36342014-02-06 23:33:42802Maintenance releases are numbered as vX.Y.Z and are meant
803 to contain only bugfixes for the corresponding vX.Y.0 feature
804 release and earlier maintenance releases vX.Y.W (W &lt; Z).
Junio C Hamanof2b74942012-11-20 21:06:26805</p>
806</li>
807<li>
808<p>
809<em>master</em> branch is used to prepare for the next feature
810 release. In other words, at some point, the tip of <em>master</em>
Junio C Hamanoa9c36342014-02-06 23:33:42811 branch is tagged with vX.Y.0.
Junio C Hamanof2b74942012-11-20 21:06:26812</p>
813</li>
814<li>
815<p>
816<em>maint</em> branch is used to prepare for the next maintenance
Junio C Hamanoa9c36342014-02-06 23:33:42817 release. After the feature release vX.Y.0 is made, the tip
Junio C Hamanof2b74942012-11-20 21:06:26818 of <em>maint</em> branch is set to that release, and bugfixes will
819 accumulate on the branch, and at some point, the tip of the
Junio C Hamanoa9c36342014-02-06 23:33:42820 branch is tagged with vX.Y.1, vX.Y.2, and so on.
Junio C Hamanof2b74942012-11-20 21:06:26821</p>
822</li>
823<li>
824<p>
825<em>next</em> branch is used to publish changes (both enhancements
826 and fixes) that (1) have worthwhile goal, (2) are in a fairly
827 good shape suitable for everyday use, (3) but have not yet
828 demonstrated to be regression free. New changes are tested
829 in <em>next</em> before merged to <em>master</em>.
830</p>
831</li>
832<li>
833<p>
Junio C Hamanoa8911782020-07-07 05:35:57834<em>seen</em> branch is used to publish other proposed changes that do
Junio C Hamanof2b74942012-11-20 21:06:26835 not yet pass the criteria set for <em>next</em>.
836</p>
837</li>
838<li>
839<p>
Junio C Hamano36d52292013-01-25 21:32:36840The tips of <em>master</em> and <em>maint</em> branches will not be rewound to
841 allow people to build their own customization on top of them.
842 Early in a new development cycle, <em>next</em> is rewound to the tip of
843 <em>master</em> once, but otherwise it will not be rewound until the end
844 of the cycle.
Junio C Hamanof2b74942012-11-20 21:06:26845</p>
846</li>
847<li>
848<p>
Junio C Hamano36d52292013-01-25 21:32:36849Usually <em>master</em> contains all of <em>maint</em> and <em>next</em> contains all
Junio C Hamanoa8911782020-07-07 05:35:57850 of <em>master</em>. <em>seen</em> contains all the topics merged to <em>next</em>, but
Junio C Hamano36d52292013-01-25 21:32:36851 is rebuilt directly on <em>master</em>.
Junio C Hamanof2b74942012-11-20 21:06:26852</p>
853</li>
854<li>
855<p>
856The tip of <em>master</em> is meant to be more stable than any
857 tagged releases, and the users are encouraged to follow it.
858</p>
859</li>
860<li>
861<p>
862The <em>next</em> branch is where new action takes place, and the
863 users are encouraged to test it so that regressions and bugs
864 are found before new topics are merged to <em>master</em>.
865</p>
866</li>
867</ul></div>
Junio C Hamanoa9c36342014-02-06 23:33:42868<div class="paragraph"><p>Note that before v1.9.0 release, the version numbers used to be
869structured slightly differently. vX.Y.Z were feature releases while
870vX.Y.Z.W were maintenance releases for vX.Y.Z.</p></div>
Junio C Hamano36d52292013-01-25 21:32:36871</div>
872</div>
873<div class="sect1">
874<h2 id="_a_typical_git_day">A Typical Git Day</h2>
875<div class="sectionbody">
Junio C Hamano076ffcc2013-02-06 05:13:21876<div class="paragraph"><p>A typical Git day for the maintainer implements the above policy
Junio C Hamanof2b74942012-11-20 21:06:26877by doing the following:</p></div>
878<div class="ulist"><ul>
879<li>
880<p>
Junio C Hamano36d52292013-01-25 21:32:36881Scan mailing list. Respond with review comments, suggestions
882 etc. Kibitz. Collect potentially usable patches from the
883 mailing list. Patches about a single topic go to one mailbox (I
884 read my mail in Gnus, and type \C-o to save/append messages in
885 files in mbox format).
886</p>
887</li>
888<li>
889<p>
890Write his own patches to address issues raised on the list but
891 nobody has stepped up solving. Send it out just like other
892 contributors do, and pick them up just like patches from other
893 contributors (see above).
Junio C Hamanof2b74942012-11-20 21:06:26894</p>
895</li>
896<li>
897<p>
898Review the patches in the saved mailboxes. Edit proposed log
899 message for typofixes and clarifications, and add Acks
900 collected from the list. Edit patch to incorporate "Oops,
901 that should have been like this" fixes from the discussion.
902</p>
903</li>
904<li>
905<p>
906Classify the collected patches and handle <em>master</em> and
907 <em>maint</em> updates:
908</p>
909</li>
910<li>
911<p>
912Obviously correct fixes that pertain to the tip of <em>maint</em>
913 are directly applied to <em>maint</em>.
914</p>
915</li>
916<li>
917<p>
918Obviously correct fixes that pertain to the tip of <em>master</em>
919 are directly applied to <em>master</em>.
920</p>
Junio C Hamano36d52292013-01-25 21:32:36921</li>
922<li>
923<p>
924Other topics are not handled in this step.
925</p>
Junio C Hamanof2b74942012-11-20 21:06:26926<div class="literalblock">
927<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53928<pre><code>This step is done with "git am".</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26929</div></div>
930<div class="literalblock">
931<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53932<pre><code>$ git checkout master ;# or "git checkout maint"
Junio C Hamano36d52292013-01-25 21:32:36933$ git am -sc3 mailbox
Junio C Hamanoc14e6ad2014-10-31 20:25:53934$ make test</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26935</div></div>
Junio C Hamanof2b74942012-11-20 21:06:26936<div class="literalblock">
937<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53938<pre><code>In practice, almost no patch directly goes to 'master' or
939'maint'.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26940</div></div>
941</li>
942<li>
943<p>
944Review the last issue of "What&#8217;s cooking" message, review the
Junio C Hamano36d52292013-01-25 21:32:36945 topics ready for merging (topic&#8594;master and topic&#8594;maint). Use
946 "Meta/cook -w" script (where Meta/ contains a checkout of the
947 <em>todo</em> branch) to aid this step.
Junio C Hamanof2b74942012-11-20 21:06:26948</p>
949<div class="literalblock">
950<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53951<pre><code>And perform the merge. Use "Meta/Reintegrate -e" script (see
952later) to aid this step.</code></pre>
Junio C Hamano36d52292013-01-25 21:32:36953</div></div>
954<div class="literalblock">
955<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53956<pre><code>$ Meta/cook -w last-issue-of-whats-cooking.mbox</code></pre>
Junio C Hamano36d52292013-01-25 21:32:36957</div></div>
958<div class="literalblock">
959<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53960<pre><code>$ git checkout master ;# or "git checkout maint"
Junio C Hamano36d52292013-01-25 21:32:36961$ echo ai/topic | Meta/Reintegrate -e ;# "git merge ai/topic"
Junio C Hamanof2b74942012-11-20 21:06:26962$ git log -p ORIG_HEAD.. ;# final review
963$ git diff ORIG_HEAD.. ;# final review
Junio C Hamanoc14e6ad2014-10-31 20:25:53964$ make test ;# final review</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26965</div></div>
966</li>
967<li>
968<p>
969Handle the remaining patches:
970</p>
971</li>
972<li>
973<p>
974Anything unobvious that is applicable to <em>master</em> (in other
975 words, does not depend on anything that is still in <em>next</em>
976 and not in <em>master</em>) is applied to a new topic branch that
Junio C Hamano357906b2020-03-25 21:32:01977 is forked from the tip of <em>master</em> (or the last feature release,
978 which is a bit older than <em>master</em>). This includes both
Junio C Hamanof2b74942012-11-20 21:06:26979 enhancements and unobvious fixes to <em>master</em>. A topic
Junio C Hamano36d52292013-01-25 21:32:36980 branch is named as ai/topic where "ai" is two-letter string
981 named after author&#8217;s initial and "topic" is a descriptive name
982 of the topic (in other words, "what&#8217;s the series is about").
Junio C Hamanof2b74942012-11-20 21:06:26983</p>
984</li>
985<li>
986<p>
987An unobvious fix meant for <em>maint</em> is applied to a new
Junio C Hamano357906b2020-03-25 21:32:01988 topic branch that is forked from the tip of <em>maint</em> (or the
989 oldest and still relevant maintenance branch). The
990 topic may be named as ai/maint-topic.
Junio C Hamanof2b74942012-11-20 21:06:26991</p>
992</li>
993<li>
994<p>
995Changes that pertain to an existing topic are applied to
996 the branch, but:
997</p>
998</li>
999<li>
1000<p>
1001obviously correct ones are applied first;
1002</p>
1003</li>
1004<li>
1005<p>
1006questionable ones are discarded or applied to near the tip;
1007</p>
1008</li>
1009<li>
1010<p>
1011Replacement patches to an existing topic are accepted only
1012 for commits not in <em>next</em>.
1013</p>
1014<div class="literalblock">
1015<div class="content">
Junio C Hamano357906b2020-03-25 21:32:011016<pre><code>The initial round is done with:</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261017</div></div>
1018<div class="literalblock">
1019<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531020<pre><code>$ git checkout ai/topic ;# or "git checkout -b ai/topic master"
1021$ git am -sc3 mailbox</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261022</div></div>
1023<div class="literalblock">
1024<div class="content">
Junio C Hamano357906b2020-03-25 21:32:011025<pre><code>and replacing an existing topic with subsequent round is done with:</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261026</div></div>
1027<div class="literalblock">
1028<div class="content">
Junio C Hamano357906b2020-03-25 21:32:011029<pre><code>$ git checkout master...ai/topic ;# try to reapply to the same base
1030$ git am -sc3 mailbox</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261031</div></div>
1032<div class="literalblock">
1033<div class="content">
Junio C Hamano357906b2020-03-25 21:32:011034<pre><code>to prepare the new round on a detached HEAD, and then</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261035</div></div>
1036<div class="literalblock">
1037<div class="content">
Junio C Hamano357906b2020-03-25 21:32:011038<pre><code>$ git range-diff @{-1}...
1039$ git diff @{-1}</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261040</div></div>
1041<div class="literalblock">
1042<div class="content">
Junio C Hamano357906b2020-03-25 21:32:011043<pre><code>to double check what changed since the last round, and finally</code></pre>
1044</div></div>
1045<div class="literalblock">
1046<div class="content">
1047<pre><code>$ git checkout -B @{-1}</code></pre>
1048</div></div>
1049<div class="literalblock">
1050<div class="content">
1051<pre><code>to conclude (the last step is why a topic already in 'next' is
1052not replaced but updated incrementally).</code></pre>
1053</div></div>
1054<div class="literalblock">
1055<div class="content">
1056<pre><code>Whether it is the initial round or a subsequent round, the topic
1057may not build even in isolation, or may break the build when
1058merged to integration branches due to bugs. There may already
1059be obvious and trivial improvements suggested on the list. The
1060maintainer often adds an extra commit, with "SQUASH???" in its
1061title, to fix things up, before publishing the integration
1062branches to make it usable by other developers for testing.
1063These changes are what the maintainer is not 100% committed to
1064(trivial typofixes etc. are often squashed directly into the
1065patches that need fixing, without being applied as a separate
1066"SQUASH???" commit), so that they can be removed easily as needed.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261067</div></div>
1068</li>
1069<li>
1070<p>
Junio C Hamano36d52292013-01-25 21:32:361071Merge maint to master as needed:
Junio C Hamanof2b74942012-11-20 21:06:261072</p>
1073<div class="literalblock">
1074<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531075<pre><code>$ git checkout master
Junio C Hamano36d52292013-01-25 21:32:361076$ git merge maint
Junio C Hamanoc14e6ad2014-10-31 20:25:531077$ make test</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261078</div></div>
1079</li>
1080<li>
1081<p>
Junio C Hamano36d52292013-01-25 21:32:361082Merge master to next as needed:
Junio C Hamanof2b74942012-11-20 21:06:261083</p>
1084<div class="literalblock">
1085<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531086<pre><code>$ git checkout next
Junio C Hamano36d52292013-01-25 21:32:361087$ git merge master
Junio C Hamanoc14e6ad2014-10-31 20:25:531088$ make test</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261089</div></div>
1090</li>
1091<li>
1092<p>
Junio C Hamano36d52292013-01-25 21:32:361093Review the last issue of "What&#8217;s cooking" again and see if topics
1094 that are ready to be merged to <em>next</em> are still in good shape
1095 (e.g. has there any new issue identified on the list with the
1096 series?)
1097</p>
1098</li>
1099<li>
1100<p>
1101Prepare <em>jch</em> branch, which is used to represent somewhere
Junio C Hamanoa8911782020-07-07 05:35:571102 between <em>master</em> and <em>seen</em> and often is slightly ahead of <em>next</em>.
Junio C Hamano36d52292013-01-25 21:32:361103</p>
1104<div class="literalblock">
1105<div class="content">
Junio C Hamanoa8911782020-07-07 05:35:571106<pre><code>$ Meta/Reintegrate master..seen &gt;Meta/redo-jch.sh</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361107</div></div>
1108<div class="literalblock">
1109<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531110<pre><code>The result is a script that lists topics to be merged in order to
Junio C Hamanoa8911782020-07-07 05:35:571111rebuild 'seen' as the input to Meta/Reintegrate script. Remove
Junio C Hamano36d52292013-01-25 21:32:361112later topics that should not be in 'jch' yet. Add a line that
1113consists of '### match next' before the name of the first topic
Junio C Hamanoc14e6ad2014-10-31 20:25:531114in the output that should be in 'jch' but not in 'next' yet.</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361115</div></div>
1116</li>
1117<li>
1118<p>
1119Now we are ready to start merging topics to <em>next</em>. For each
1120 branch whose tip is not merged to <em>next</em>, one of three things can
1121 happen:
1122</p>
1123</li>
1124<li>
1125<p>
1126The commits are all next-worthy; merge the topic to next;
1127</p>
1128</li>
1129<li>
1130<p>
Junio C Hamanof2b74942012-11-20 21:06:261131The new parts are of mixed quality, but earlier ones are
Junio C Hamano36d52292013-01-25 21:32:361132 next-worthy; merge the early parts to next;
Junio C Hamanof2b74942012-11-20 21:06:261133</p>
Junio C Hamanof2b74942012-11-20 21:06:261134</li>
1135<li>
1136<p>
1137Nothing is next-worthy; do not do anything.
1138</p>
Junio C Hamano36d52292013-01-25 21:32:361139<div class="literalblock">
1140<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531141<pre><code>This step is aided with Meta/redo-jch.sh script created earlier.
Junio C Hamano36d52292013-01-25 21:32:361142If a topic that was already in 'next' gained a patch, the script
1143would list it as "ai/topic~1". To include the new patch to the
1144updated 'next', drop the "~1" part; to keep it excluded, do not
1145touch the line. If a topic that was not in 'next' should be
Junio C Hamanoc14e6ad2014-10-31 20:25:531146merged to 'next', add it at the end of the list. Then:</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361147</div></div>
1148<div class="literalblock">
1149<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531150<pre><code>$ git checkout -B jch master
1151$ Meta/redo-jch.sh -c1</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361152</div></div>
1153<div class="literalblock">
1154<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531155<pre><code>to rebuild the 'jch' branch from scratch. "-c1" tells the script
Junio C Hamano36d52292013-01-25 21:32:361156to stop merging at the first line that begins with '###'
Junio C Hamanoc14e6ad2014-10-31 20:25:531157(i.e. the "### match next" line you added earlier).</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361158</div></div>
1159<div class="literalblock">
1160<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531161<pre><code>At this point, build-test the result. It may reveal semantic
Junio C Hamano36d52292013-01-25 21:32:361162conflicts (e.g. a topic renamed a variable, another added a new
1163reference to the variable under its old name), in which case
1164prepare an appropriate merge-fix first (see appendix), and
1165rebuild the 'jch' branch from scratch, starting at the tip of
Junio C Hamanoc14e6ad2014-10-31 20:25:531166'master'.</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361167</div></div>
1168<div class="literalblock">
1169<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531170<pre><code>Then do the same to 'next'</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361171</div></div>
1172<div class="literalblock">
1173<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531174<pre><code>$ git checkout next
1175$ sh Meta/redo-jch.sh -c1 -e</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361176</div></div>
1177<div class="literalblock">
1178<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531179<pre><code>The "-e" option allows the merge message that comes from the
Junio C Hamano36d52292013-01-25 21:32:361180history of the topic and the comments in the "What's cooking" to
1181be edited. The resulting tree should match 'jch' as the same set
1182of topics are merged on 'master'; otherwise there is a mismerge.
1183Investigate why and do not proceed until the mismerge is found
Junio C Hamanoc14e6ad2014-10-31 20:25:531184and rectified.</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361185</div></div>
1186<div class="literalblock">
1187<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531188<pre><code>$ git diff jch next</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361189</div></div>
1190<div class="literalblock">
1191<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531192<pre><code>When all is well, clean up the redo-jch.sh script with</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361193</div></div>
1194<div class="literalblock">
1195<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531196<pre><code>$ sh Meta/redo-jch.sh -u</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361197</div></div>
1198<div class="literalblock">
1199<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531200<pre><code>This removes topics listed in the script that have already been
Junio C Hamano36d52292013-01-25 21:32:361201merged to 'master'. This may lose '### match next' marker;
Junio C Hamanoc14e6ad2014-10-31 20:25:531202add it again to the appropriate place when it happens.</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361203</div></div>
Junio C Hamanof2b74942012-11-20 21:06:261204</li>
1205<li>
1206<p>
Junio C Hamanoa8911782020-07-07 05:35:571207Rebuild <em>seen</em>.
Junio C Hamanof2b74942012-11-20 21:06:261208</p>
1209<div class="literalblock">
1210<div class="content">
Junio C Hamanoa8911782020-07-07 05:35:571211<pre><code>$ Meta/Reintegrate master..seen &gt;Meta/redo-seen.sh</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261212</div></div>
1213<div class="literalblock">
1214<div class="content">
Junio C Hamanoa8911782020-07-07 05:35:571215<pre><code>Edit the result by adding new topics that are not still in 'seen'
Junio C Hamanoc14e6ad2014-10-31 20:25:531216in the script. Then</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361217</div></div>
1218<div class="literalblock">
1219<div class="content">
Junio C Hamanoa8911782020-07-07 05:35:571220<pre><code>$ git checkout -B seen jch
1221$ sh Meta/redo-seen.sh</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361222</div></div>
1223<div class="literalblock">
1224<div class="content">
Junio C Hamanoa8911782020-07-07 05:35:571225<pre><code>When all is well, clean up the redo-seen.sh script with</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361226</div></div>
1227<div class="literalblock">
1228<div class="content">
Junio C Hamanoa8911782020-07-07 05:35:571229<pre><code>$ sh Meta/redo-seen.sh -u</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361230</div></div>
1231<div class="literalblock">
1232<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531233<pre><code>Double check by running</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361234</div></div>
1235<div class="literalblock">
1236<div class="content">
Junio C Hamanoa8911782020-07-07 05:35:571237<pre><code>$ git branch --no-merged seen</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361238</div></div>
1239<div class="literalblock">
1240<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531241<pre><code>to see there is no unexpected leftover topics.</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361242</div></div>
1243<div class="literalblock">
1244<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531245<pre><code>At this point, build-test the result for semantic conflicts, and
Junio C Hamano36d52292013-01-25 21:32:361246if there are, prepare an appropriate merge-fix first (see
Junio C Hamanoa8911782020-07-07 05:35:571247appendix), and rebuild the 'seen' branch from scratch, starting at
Junio C Hamanoc14e6ad2014-10-31 20:25:531248the tip of 'jch'.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261249</div></div>
1250</li>
1251<li>
1252<p>
Junio C Hamano36d52292013-01-25 21:32:361253Update "What&#8217;s cooking" message to review the updates to
1254 existing topics, newly added topics and graduated topics.
Junio C Hamanof2b74942012-11-20 21:06:261255</p>
1256<div class="literalblock">
1257<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531258<pre><code>This step is helped with Meta/cook script.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261259</div></div>
1260<div class="literalblock">
1261<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531262<pre><code>$ Meta/cook</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361263</div></div>
1264<div class="literalblock">
1265<div class="content">
Junio C Hamanoa8911782020-07-07 05:35:571266<pre><code>This script inspects the history between master..seen, finds tips
Junio C Hamano36d52292013-01-25 21:32:361267of topic branches, compares what it found with the current
1268contents in Meta/whats-cooking.txt, and updates that file.
Junio C Hamanoa8911782020-07-07 05:35:571269Topics not listed in the file but are found in master..seen are
Junio C Hamano36d52292013-01-25 21:32:361270added to the "New topics" section, topics listed in the file that
Junio C Hamanoa8911782020-07-07 05:35:571271are no longer found in master..seen are moved to the "Graduated to
Junio C Hamano36d52292013-01-25 21:32:361272master" section, and topics whose commits changed their states
Junio C Hamanoa8911782020-07-07 05:35:571273(e.g. used to be only in 'seen', now merged to 'next') are updated
Junio C Hamanoc14e6ad2014-10-31 20:25:531274with change markers "&lt;&lt;" and "&gt;&gt;".</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361275</div></div>
1276<div class="literalblock">
1277<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531278<pre><code>Look for lines enclosed in "&lt;&lt;" and "&gt;&gt;"; they hold contents from
Junio C Hamano36d52292013-01-25 21:32:361279old file that are replaced by this integration round. After
1280verifying them, remove the old part. Review the description for
1281each topic and update its doneness and plan as needed. To review
Junio C Hamanoc14e6ad2014-10-31 20:25:531282the updated plan, run</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361283</div></div>
1284<div class="literalblock">
1285<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531286<pre><code>$ Meta/cook -w</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361287</div></div>
1288<div class="literalblock">
1289<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531290<pre><code>which will pick up comments given to the topics, such as "Will
Junio C Hamano36d52292013-01-25 21:32:361291merge to 'next'", etc. (see Meta/cook script to learn what kind
Junio C Hamanoc14e6ad2014-10-31 20:25:531292of phrases are supported).</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261293</div></div>
1294</li>
1295<li>
1296<p>
Junio C Hamano36d52292013-01-25 21:32:361297Compile, test and install all four (five) integration branches;
1298 Meta/Dothem script may aid this step.
Junio C Hamanof2b74942012-11-20 21:06:261299</p>
1300</li>
1301<li>
1302<p>
Junio C Hamano36d52292013-01-25 21:32:361303Format documentation if the <em>master</em> branch was updated;
1304 Meta/dodoc.sh script may aid this step.
Junio C Hamanof2b74942012-11-20 21:06:261305</p>
Junio C Hamanof2b74942012-11-20 21:06:261306</li>
1307<li>
1308<p>
Junio C Hamano36d52292013-01-25 21:32:361309Push the integration branches out to public places; Meta/pushall
1310 script may aid this step.
Junio C Hamanof2b74942012-11-20 21:06:261311</p>
1312</li>
1313</ul></div>
Junio C Hamano36d52292013-01-25 21:32:361314</div>
1315</div>
1316<div class="sect1">
1317<h2 id="_observations">Observations</h2>
1318<div class="sectionbody">
Junio C Hamanof2b74942012-11-20 21:06:261319<div class="paragraph"><p>Some observations to be made.</p></div>
1320<div class="ulist"><ul>
1321<li>
1322<p>
Junio C Hamano36d52292013-01-25 21:32:361323Each topic is tested individually, and also together with other
Junio C Hamanoa8911782020-07-07 05:35:571324 topics cooking first in <em>seen</em>, then in <em>jch</em> and then in <em>next</em>.
Junio C Hamano36d52292013-01-25 21:32:361325 Until it matures, no part of it is merged to <em>master</em>.
Junio C Hamanof2b74942012-11-20 21:06:261326</p>
1327</li>
1328<li>
1329<p>
1330A topic already in <em>next</em> can get fixes while still in
1331 <em>next</em>. Such a topic will have many merges to <em>next</em> (in
1332 other words, "git log --first-parent next" will show many
Junio C Hamano36d52292013-01-25 21:32:361333 "Merge branch <em>ai/topic</em> to next" for the same topic.
Junio C Hamanof2b74942012-11-20 21:06:261334</p>
1335</li>
1336<li>
1337<p>
1338An unobvious fix for <em>maint</em> is cooked in <em>next</em> and then
1339 merged to <em>master</em> to make extra sure it is Ok and then
1340 merged to <em>maint</em>.
1341</p>
1342</li>
1343<li>
1344<p>
1345Even when <em>next</em> becomes empty (in other words, all topics
1346 prove stable and are merged to <em>master</em> and "git diff master
1347 next" shows empty), it has tons of merge commits that will
1348 never be in <em>master</em>.
1349</p>
1350</li>
1351<li>
1352<p>
1353In principle, "git log --first-parent master..next" should
1354 show nothing but merges (in practice, there are fixup commits
1355 and reverts that are not merges).
1356</p>
1357</li>
1358<li>
1359<p>
1360Commits near the tip of a topic branch that are not in <em>next</em>
1361 are fair game to be discarded, replaced or rewritten.
1362 Commits already merged to <em>next</em> will not be.
1363</p>
1364</li>
1365<li>
1366<p>
1367Being in the <em>next</em> branch is not a guarantee for a topic to
1368 be included in the next feature release. Being in the
1369 <em>master</em> branch typically is.
1370</p>
1371</li>
Junio C Hamano357906b2020-03-25 21:32:011372<li>
1373<p>
1374Due to the nature of "SQUASH???" fix-ups, if the original author
1375 agrees with the suggested changes, it is OK to squash them to
1376 appropriate patches in the next round (when the suggested change
1377 is small enough, the author should not even bother with
1378 "Helped-by"). It is also OK to drop them from the next round
1379 when the original author does not agree with the suggestion, but
1380 the author is expected to say why somewhere in the discussion.
1381</p>
1382</li>
Junio C Hamanof2b74942012-11-20 21:06:261383</ul></div>
1384</div>
1385</div>
Junio C Hamano36d52292013-01-25 21:32:361386<div class="sect1">
1387<h2 id="_appendix">Appendix</h2>
1388<div class="sectionbody">
1389<div class="sect2">
1390<h3 id="_preparing_a_merge_fix">Preparing a "merge-fix"</h3>
1391<div class="paragraph"><p>A merge of two topics may not textually conflict but still have
1392conflict at the semantic level. A classic example is for one topic
1393to rename an variable and all its uses, while another topic adds a
1394new use of the variable under its old name. When these two topics
1395are merged together, the reference to the variable newly added by
1396the latter topic will still use the old name in the result.</p></div>
Junio C Hamanoa8911782020-07-07 05:35:571397<div class="paragraph"><p>The Meta/Reintegrate script that is used by redo-jch and redo-seen
Junio C Hamano36d52292013-01-25 21:32:361398scripts implements a crude but usable way to work this issue around.
1399When the script merges branch $X, it checks if "refs/merge-fix/$X"
1400exists, and if so, the effect of it is squashed into the result of
1401the mechanical merge. In other words,</p></div>
1402<div class="literalblock">
1403<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531404<pre><code>$ echo $X | Meta/Reintegrate</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361405</div></div>
1406<div class="paragraph"><p>is roughly equivalent to this sequence:</p></div>
1407<div class="literalblock">
1408<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531409<pre><code>$ git merge --rerere-autoupdate $X
Junio C Hamano36d52292013-01-25 21:32:361410$ git commit
1411$ git cherry-pick -n refs/merge-fix/$X
Junio C Hamanoc14e6ad2014-10-31 20:25:531412$ git commit --amend</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361413</div></div>
1414<div class="paragraph"><p>The goal of this "prepare a merge-fix" step is to come up with a
1415commit that can be squashed into a result of mechanical merge to
1416correct semantic conflicts.</p></div>
1417<div class="paragraph"><p>After finding that the result of merging branch "ai/topic" to an
Junio C Hamanoa8911782020-07-07 05:35:571418integration branch had such a semantic conflict, say seen~4, check the
Junio C Hamano36d52292013-01-25 21:32:361419problematic merge out on a detached HEAD, edit the working tree to
1420fix the semantic conflict, and make a separate commit to record the
1421fix-up:</p></div>
1422<div class="literalblock">
1423<div class="content">
Junio C Hamanoa8911782020-07-07 05:35:571424<pre><code>$ git checkout seen~4
Junio C Hamano36d52292013-01-25 21:32:361425$ git show -s --pretty=%s ;# double check
Junio C Hamanoa8911782020-07-07 05:35:571426Merge branch 'ai/topic' to seen
Junio C Hamano36d52292013-01-25 21:32:361427$ edit
Junio C Hamanoc14e6ad2014-10-31 20:25:531428$ git commit -m 'merge-fix/ai/topic' -a</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361429</div></div>
1430<div class="paragraph"><p>Then make a reference "refs/merge-fix/ai/topic" to point at this
1431result:</p></div>
1432<div class="literalblock">
1433<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531434<pre><code>$ git update-ref refs/merge-fix/ai/topic HEAD</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361435</div></div>
1436<div class="paragraph"><p>Then double check the result by asking Meta/Reintegrate to redo the
1437merge:</p></div>
1438<div class="literalblock">
1439<div class="content">
Junio C Hamanoa8911782020-07-07 05:35:571440<pre><code>$ git checkout seen~5 ;# the parent of the problem merge
Junio C Hamano36d52292013-01-25 21:32:361441$ echo ai/topic | Meta/Reintegrate
Junio C Hamanoa8911782020-07-07 05:35:571442$ git diff seen~4</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361443</div></div>
1444<div class="paragraph"><p>This time, because you prepared refs/merge-fix/ai/topic, the
1445resulting merge should have been tweaked to include the fix for the
1446semantic conflict.</p></div>
1447<div class="paragraph"><p>Note that this assumes that the order in which conflicting branches
1448are merged does not change. If the reason why merging ai/topic
1449branch needs this merge-fix is because another branch merged earlier
1450to the integration branch changed the underlying assumption ai/topic
1451branch made (e.g. ai/topic branch added a site to refer to a
1452variable, while the other branch renamed that variable and adjusted
Junio C Hamanoa8911782020-07-07 05:35:571453existing use sites), and if you changed redo-jch (or redo-seen) script
Junio C Hamano36d52292013-01-25 21:32:361454to merge ai/topic branch before the other branch, then the above
1455merge-fix should not be applied while merging ai/topic, but should
1456instead be applied while merging the other branch. You would need
1457to move the fix to apply to the other branch, perhaps like this:</p></div>
1458<div class="literalblock">
1459<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531460<pre><code>$ mf=refs/merge-fix
Junio C Hamano36d52292013-01-25 21:32:361461$ git update-ref $mf/$the_other_branch $mf/ai/topic
Junio C Hamanoc14e6ad2014-10-31 20:25:531462$ git update-ref -d $mf/ai/topic</code></pre>
Junio C Hamano36d52292013-01-25 21:32:361463</div></div>
1464</div>
1465</div>
1466</div>
Junio C Hamanof2b74942012-11-20 21:06:261467</div>
1468<div id="footnotes"><hr /></div>
1469<div id="footer">
1470<div id="footer-text">
Junio C Hamano2ef0ba32018-01-26 23:13:531471Last updated
Junio C Hamanoa8911782020-07-07 05:35:571472 2020-07-06 22:34:12 PDT
Junio C Hamanof2b74942012-11-20 21:06:261473</div>
1474</div>
1475</body>
1476</html>