Autogenerated HTML docs for v2.47.0-305-g4083a
[git-htmldocs.git] / SubmittingPatches.html
blobcfaa31401c83533ae4b4d6effef499b77ab94ec3
1 <!DOCTYPE html>
2 <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
3 <head>
4 <meta charset="UTF-8"/>
5 <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
6 <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
7 <meta name="generator" content="Asciidoctor 2.0.20"/>
8 <title>Submitting Patches</title>
9 <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"/>
10 <style>
11 /*! Asciidoctor default stylesheet | MIT License | https://asciidoctor.org */
12 /* Uncomment the following line when using as a custom stylesheet */
13 /* @import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"; */
14 html{font-family:sans-serif;-webkit-text-size-adjust:100%}
15 a{background:none}
16 a:focus{outline:thin dotted}
17 a:active,a:hover{outline:0}
18 h1{font-size:2em;margin:.67em 0}
19 b,strong{font-weight:bold}
20 abbr{font-size:.9em}
21 abbr[title]{cursor:help;border-bottom:1px dotted #dddddf;text-decoration:none}
22 dfn{font-style:italic}
23 hr{height:0}
24 mark{background:#ff0;color:#000}
25 code,kbd,pre,samp{font-family:monospace;font-size:1em}
26 pre{white-space:pre-wrap}
27 q{quotes:"\201C" "\201D" "\2018" "\2019"}
28 small{font-size:80%}
29 sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}
30 sup{top:-.5em}
31 sub{bottom:-.25em}
32 img{border:0}
33 svg:not(:root){overflow:hidden}
34 figure{margin:0}
35 audio,video{display:inline-block}
36 audio:not([controls]){display:none;height:0}
37 fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}
38 legend{border:0;padding:0}
39 button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}
40 button,input{line-height:normal}
41 button,select{text-transform:none}
42 button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}
43 button[disabled],html input[disabled]{cursor:default}
44 input[type=checkbox],input[type=radio]{padding:0}
45 button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}
46 textarea{overflow:auto;vertical-align:top}
47 table{border-collapse:collapse;border-spacing:0}
48 *,::before,::after{box-sizing:border-box}
49 html,body{font-size:100%}
50 body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;line-height:1;position:relative;cursor:auto;-moz-tab-size:4;-o-tab-size:4;tab-size:4;word-wrap:anywhere;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}
51 a:hover{cursor:pointer}
52 img,object,embed{max-width:100%;height:auto}
53 object,embed{height:100%}
54 img{-ms-interpolation-mode:bicubic}
55 .left{float:left!important}
56 .right{float:right!important}
57 .text-left{text-align:left!important}
58 .text-right{text-align:right!important}
59 .text-center{text-align:center!important}
60 .text-justify{text-align:justify!important}
61 .hide{display:none}
62 img,object,svg{display:inline-block;vertical-align:middle}
63 textarea{height:auto;min-height:50px}
64 select{width:100%}
65 .subheader,.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{line-height:1.45;color:#7a2518;font-weight:400;margin-top:0;margin-bottom:.25em}
66 div,dl,dt,dd,ul,ol,li,h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6,pre,form,p,blockquote,th,td{margin:0;padding:0}
67 a{color:#2156a5;text-decoration:underline;line-height:inherit}
68 a:hover,a:focus{color:#1d4b8f}
69 a img{border:0}
70 p{line-height:1.6;margin-bottom:1.25em;text-rendering:optimizeLegibility}
71 p aside{font-size:.875em;line-height:1.35;font-style:italic}
72 h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{font-family:"Open Sans","DejaVu Sans",sans-serif;font-weight:300;font-style:normal;color:#ba3925;text-rendering:optimizeLegibility;margin-top:1em;margin-bottom:.5em;line-height:1.0125em}
73 h1 small,h2 small,h3 small,#toctitle small,.sidebarblock>.content>.title small,h4 small,h5 small,h6 small{font-size:60%;color:#e99b8f;line-height:0}
74 h1{font-size:2.125em}
75 h2{font-size:1.6875em}
76 h3,#toctitle,.sidebarblock>.content>.title{font-size:1.375em}
77 h4,h5{font-size:1.125em}
78 h6{font-size:1em}
79 hr{border:solid #dddddf;border-width:1px 0 0;clear:both;margin:1.25em 0 1.1875em}
80 em,i{font-style:italic;line-height:inherit}
81 strong,b{font-weight:bold;line-height:inherit}
82 small{font-size:60%;line-height:inherit}
83 code{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;color:rgba(0,0,0,.9)}
84 ul,ol,dl{line-height:1.6;margin-bottom:1.25em;list-style-position:outside;font-family:inherit}
85 ul,ol{margin-left:1.5em}
86 ul li ul,ul li ol{margin-left:1.25em;margin-bottom:0}
87 ul.circle{list-style-type:circle}
88 ul.disc{list-style-type:disc}
89 ul.square{list-style-type:square}
90 ul.circle ul:not([class]),ul.disc ul:not([class]),ul.square ul:not([class]){list-style:inherit}
91 ol li ul,ol li ol{margin-left:1.25em;margin-bottom:0}
92 dl dt{margin-bottom:.3125em;font-weight:bold}
93 dl dd{margin-bottom:1.25em}
94 blockquote{margin:0 0 1.25em;padding:.5625em 1.25em 0 1.1875em;border-left:1px solid #ddd}
95 blockquote,blockquote p{line-height:1.6;color:rgba(0,0,0,.85)}
96 @media screen and (min-width:768px){h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2}
97 h1{font-size:2.75em}
98 h2{font-size:2.3125em}
99 h3,#toctitle,.sidebarblock>.content>.title{font-size:1.6875em}
100 h4{font-size:1.4375em}}
101 table{background:#fff;margin-bottom:1.25em;border:1px solid #dedede;word-wrap:normal}
102 table thead,table tfoot{background:#f7f8f7}
103 table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;color:rgba(0,0,0,.8);text-align:left}
104 table tr th,table tr td{padding:.5625em .625em;font-size:inherit;color:rgba(0,0,0,.8)}
105 table tr.even,table tr.alt{background:#f8f8f7}
106 table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{line-height:1.6}
107 h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2;word-spacing:-.05em}
108 h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock>.content>.title strong,h4 strong,h5 strong,h6 strong{font-weight:400}
109 .center{margin-left:auto;margin-right:auto}
110 .stretch{width:100%}
111 .clearfix::before,.clearfix::after,.float-group::before,.float-group::after{content:" ";display:table}
112 .clearfix::after,.float-group::after{clear:both}
113 :not(pre).nobreak{word-wrap:normal}
114 :not(pre).nowrap{white-space:nowrap}
115 :not(pre).pre-wrap{white-space:pre-wrap}
116 :not(pre):not([class^=L])>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background:#f7f7f8;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed}
117 pre{color:rgba(0,0,0,.9);font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;line-height:1.45;text-rendering:optimizeSpeed}
118 pre code,pre pre{color:inherit;font-size:inherit;line-height:inherit}
119 pre>code{display:block}
120 pre.nowrap,pre.nowrap pre{white-space:pre;word-wrap:normal}
121 em em{font-style:normal}
122 strong strong{font-weight:400}
123 .keyseq{color:rgba(51,51,51,.8)}
124 kbd{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;display:inline-block;color:rgba(0,0,0,.8);font-size:.65em;line-height:1.45;background:#f7f7f7;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 0 rgba(0,0,0,.2),inset 0 0 0 .1em #fff;margin:0 .15em;padding:.2em .5em;vertical-align:middle;position:relative;top:-.1em;white-space:nowrap}
125 .keyseq kbd:first-child{margin-left:0}
126 .keyseq kbd:last-child{margin-right:0}
127 .menuseq,.menuref{color:#000}
128 .menuseq b:not(.caret),.menuref{font-weight:inherit}
129 .menuseq{word-spacing:-.02em}
130 .menuseq b.caret{font-size:1.25em;line-height:.8}
131 .menuseq i.caret{font-weight:bold;text-align:center;width:.45em}
132 b.button::before,b.button::after{position:relative;top:-1px;font-weight:400}
133 b.button::before{content:"[";padding:0 3px 0 2px}
134 b.button::after{content:"]";padding:0 2px 0 3px}
135 p a>code:hover{color:rgba(0,0,0,.9)}
136 #header,#content,#footnotes,#footer{width:100%;margin:0 auto;max-width:62.5em;*zoom:1;position:relative;padding-left:.9375em;padding-right:.9375em}
137 #header::before,#header::after,#content::before,#content::after,#footnotes::before,#footnotes::after,#footer::before,#footer::after{content:" ";display:table}
138 #header::after,#content::after,#footnotes::after,#footer::after{clear:both}
139 #content{margin-top:1.25em}
140 #content::before{content:none}
141 #header>h1:first-child{color:rgba(0,0,0,.85);margin-top:2.25rem;margin-bottom:0}
142 #header>h1:first-child+#toc{margin-top:8px;border-top:1px solid #dddddf}
143 #header>h1:only-child,body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #dddddf;padding-bottom:8px}
144 #header .details{border-bottom:1px solid #dddddf;line-height:1.45;padding-top:.25em;padding-bottom:.25em;padding-left:.25em;color:rgba(0,0,0,.6);display:flex;flex-flow:row wrap}
145 #header .details span:first-child{margin-left:-.125em}
146 #header .details span.email a{color:rgba(0,0,0,.85)}
147 #header .details br{display:none}
148 #header .details br+span::before{content:"\00a0\2013\00a0"}
149 #header .details br+span.author::before{content:"\00a0\22c5\00a0";color:rgba(0,0,0,.85)}
150 #header .details br+span#revremark::before{content:"\00a0|\00a0"}
151 #header #revnumber{text-transform:capitalize}
152 #header #revnumber::after{content:"\00a0"}
153 #content>h1:first-child:not([class]){color:rgba(0,0,0,.85);border-bottom:1px solid #dddddf;padding-bottom:8px;margin-top:0;padding-top:1rem;margin-bottom:1.25rem}
154 #toc{border-bottom:1px solid #e7e7e9;padding-bottom:.5em}
155 #toc>ul{margin-left:.125em}
156 #toc ul.sectlevel0>li>a{font-style:italic}
157 #toc ul.sectlevel0 ul.sectlevel1{margin:.5em 0}
158 #toc ul{font-family:"Open Sans","DejaVu Sans",sans-serif;list-style-type:none}
159 #toc li{line-height:1.3334;margin-top:.3334em}
160 #toc a{text-decoration:none}
161 #toc a:active{text-decoration:underline}
162 #toctitle{color:#7a2518;font-size:1.2em}
163 @media screen and (min-width:768px){#toctitle{font-size:1.375em}
164 body.toc2{padding-left:15em;padding-right:0}
165 #toc.toc2{margin-top:0!important;background:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #e7e7e9;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;padding:1.25em 1em;height:100%;overflow:auto}
166 #toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em}
167 #toc.toc2>ul{font-size:.9em;margin-bottom:0}
168 #toc.toc2 ul ul{margin-left:0;padding-left:1em}
169 #toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:0;margin-top:.5em;margin-bottom:.5em}
170 body.toc2.toc-right{padding-left:0;padding-right:15em}
171 body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #e7e7e9;left:auto;right:0}}
172 @media screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0}
173 #toc.toc2{width:20em}
174 #toc.toc2 #toctitle{font-size:1.375em}
175 #toc.toc2>ul{font-size:.95em}
176 #toc.toc2 ul ul{padding-left:1.25em}
177 body.toc2.toc-right{padding-left:0;padding-right:20em}}
178 #content #toc{border:1px solid #e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;border-radius:4px}
179 #content #toc>:first-child{margin-top:0}
180 #content #toc>:last-child{margin-bottom:0}
181 #footer{max-width:none;background:rgba(0,0,0,.8);padding:1.25em}
182 #footer-text{color:hsla(0,0%,100%,.8);line-height:1.44}
183 #content{margin-bottom:.625em}
184 .sect1{padding-bottom:.625em}
185 @media screen and (min-width:768px){#content{margin-bottom:1.25em}
186 .sect1{padding-bottom:1.25em}}
187 .sect1:last-child{padding-bottom:0}
188 .sect1+.sect1{border-top:1px solid #e7e7e9}
189 #content h1>a.anchor,h2>a.anchor,h3>a.anchor,#toctitle>a.anchor,.sidebarblock>.content>.title>a.anchor,h4>a.anchor,h5>a.anchor,h6>a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400}
190 #content h1>a.anchor::before,h2>a.anchor::before,h3>a.anchor::before,#toctitle>a.anchor::before,.sidebarblock>.content>.title>a.anchor::before,h4>a.anchor::before,h5>a.anchor::before,h6>a.anchor::before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em}
191 #content h1:hover>a.anchor,#content h1>a.anchor:hover,h2:hover>a.anchor,h2>a.anchor:hover,h3:hover>a.anchor,#toctitle:hover>a.anchor,.sidebarblock>.content>.title:hover>a.anchor,h3>a.anchor:hover,#toctitle>a.anchor:hover,.sidebarblock>.content>.title>a.anchor:hover,h4:hover>a.anchor,h4>a.anchor:hover,h5:hover>a.anchor,h5>a.anchor:hover,h6:hover>a.anchor,h6>a.anchor:hover{visibility:visible}
192 #content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link{color:#ba3925;text-decoration:none}
193 #content h1>a.link:hover,h2>a.link:hover,h3>a.link:hover,#toctitle>a.link:hover,.sidebarblock>.content>.title>a.link:hover,h4>a.link:hover,h5>a.link:hover,h6>a.link:hover{color:#a53221}
194 details,.audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:1.25em}
195 details{margin-left:1.25rem}
196 details>summary{cursor:pointer;display:block;position:relative;line-height:1.6;margin-bottom:.625rem;outline:none;-webkit-tap-highlight-color:transparent}
197 details>summary::-webkit-details-marker{display:none}
198 details>summary::before{content:"";border:solid transparent;border-left:solid;border-width:.3em 0 .3em .5em;position:absolute;top:.5em;left:-1.25rem;transform:translateX(15%)}
199 details[open]>summary::before{border:solid transparent;border-top:solid;border-width:.5em .3em 0;transform:translateY(15%)}
200 details>summary::after{content:"";width:1.25rem;height:1em;position:absolute;top:.3em;left:-1.25rem}
201 .admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{text-rendering:optimizeLegibility;text-align:left;font-family:"Noto Serif","DejaVu Serif",serif;font-size:1rem;font-style:italic}
202 table.tableblock.fit-content>caption.title{white-space:nowrap;width:0}
203 .paragraph.lead>p,#preamble>.sectionbody>[class=paragraph]:first-of-type p{font-size:1.21875em;line-height:1.6;color:rgba(0,0,0,.85)}
204 .admonitionblock>table{border-collapse:separate;border:0;background:none;width:100%}
205 .admonitionblock>table td.icon{text-align:center;width:80px}
206 .admonitionblock>table td.icon img{max-width:none}
207 .admonitionblock>table td.icon .title{font-weight:bold;font-family:"Open Sans","DejaVu Sans",sans-serif;text-transform:uppercase}
208 .admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #dddddf;color:rgba(0,0,0,.6);word-wrap:anywhere}
209 .admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0}
210 .exampleblock>.content{border:1px solid #e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;border-radius:4px}
211 .sidebarblock{border:1px solid #dbdbd6;margin-bottom:1.25em;padding:1.25em;background:#f3f3f2;border-radius:4px}
212 .sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center}
213 .exampleblock>.content>:first-child,.sidebarblock>.content>:first-child{margin-top:0}
214 .exampleblock>.content>:last-child,.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}
215 .literalblock pre,.listingblock>.content>pre{border-radius:4px;overflow-x:auto;padding:1em;font-size:.8125em}
216 @media screen and (min-width:768px){.literalblock pre,.listingblock>.content>pre{font-size:.90625em}}
217 @media screen and (min-width:1280px){.literalblock pre,.listingblock>.content>pre{font-size:1em}}
218 .literalblock pre,.listingblock>.content>pre:not(.highlight),.listingblock>.content>pre[class=highlight],.listingblock>.content>pre[class^="highlight "]{background:#f7f7f8}
219 .literalblock.output pre{color:#f7f7f8;background:rgba(0,0,0,.9)}
220 .listingblock>.content{position:relative}
221 .listingblock code[data-lang]::before{display:none;content:attr(data-lang);position:absolute;font-size:.75em;top:.425rem;right:.5rem;line-height:1;text-transform:uppercase;color:inherit;opacity:.5}
222 .listingblock:hover code[data-lang]::before{display:block}
223 .listingblock.terminal pre .command::before{content:attr(data-prompt);padding-right:.5em;color:inherit;opacity:.5}
224 .listingblock.terminal pre .command:not([data-prompt])::before{content:"$"}
225 .listingblock pre.highlightjs{padding:0}
226 .listingblock pre.highlightjs>code{padding:1em;border-radius:4px}
227 .listingblock pre.prettyprint{border-width:0}
228 .prettyprint{background:#f7f7f8}
229 pre.prettyprint .linenums{line-height:1.45;margin-left:2em}
230 pre.prettyprint li{background:none;list-style-type:inherit;padding-left:0}
231 pre.prettyprint li code[data-lang]::before{opacity:1}
232 pre.prettyprint li:not(:first-child) code[data-lang]::before{display:none}
233 table.linenotable{border-collapse:separate;border:0;margin-bottom:0;background:none}
234 table.linenotable td[class]{color:inherit;vertical-align:top;padding:0;line-height:inherit;white-space:normal}
235 table.linenotable td.code{padding-left:.75em}
236 table.linenotable td.linenos,pre.pygments .linenos{border-right:1px solid;opacity:.35;padding-right:.5em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
237 pre.pygments span.linenos{display:inline-block;margin-right:.75em}
238 .quoteblock{margin:0 1em 1.25em 1.5em;display:table}
239 .quoteblock:not(.excerpt)>.title{margin-left:-1.5em;margin-bottom:.75em}
240 .quoteblock blockquote,.quoteblock p{color:rgba(0,0,0,.85);font-size:1.15rem;line-height:1.75;word-spacing:.1em;letter-spacing:0;font-style:italic;text-align:justify}
241 .quoteblock blockquote{margin:0;padding:0;border:0}
242 .quoteblock blockquote::before{content:"\201c";float:left;font-size:2.75em;font-weight:bold;line-height:.6em;margin-left:-.6em;color:#7a2518;text-shadow:0 1px 2px rgba(0,0,0,.1)}
243 .quoteblock blockquote>.paragraph:last-child p{margin-bottom:0}
244 .quoteblock .attribution{margin-top:.75em;margin-right:.5ex;text-align:right}
245 .verseblock{margin:0 1em 1.25em}
246 .verseblock pre{font-family:"Open Sans","DejaVu Sans",sans-serif;font-size:1.15rem;color:rgba(0,0,0,.85);font-weight:300;text-rendering:optimizeLegibility}
247 .verseblock pre strong{font-weight:400}
248 .verseblock .attribution{margin-top:1.25rem;margin-left:.5ex}
249 .quoteblock .attribution,.verseblock .attribution{font-size:.9375em;line-height:1.45;font-style:italic}
250 .quoteblock .attribution br,.verseblock .attribution br{display:none}
251 .quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.025em;color:rgba(0,0,0,.6)}
252 .quoteblock.abstract blockquote::before,.quoteblock.excerpt blockquote::before,.quoteblock .quoteblock blockquote::before{display:none}
253 .quoteblock.abstract blockquote,.quoteblock.abstract p,.quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{line-height:1.6;word-spacing:0}
254 .quoteblock.abstract{margin:0 1em 1.25em;display:block}
255 .quoteblock.abstract>.title{margin:0 0 .375em;font-size:1.15em;text-align:center}
256 .quoteblock.excerpt>blockquote,.quoteblock .quoteblock{padding:0 0 .25em 1em;border-left:.25em solid #dddddf}
257 .quoteblock.excerpt,.quoteblock .quoteblock{margin-left:0}
258 .quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{color:inherit;font-size:1.0625rem}
259 .quoteblock.excerpt .attribution,.quoteblock .quoteblock .attribution{color:inherit;font-size:.85rem;text-align:left;margin-right:0}
260 p.tableblock:last-child{margin-bottom:0}
261 td.tableblock>.content{margin-bottom:1.25em;word-wrap:anywhere}
262 td.tableblock>.content>:last-child{margin-bottom:-1.25em}
263 table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede}
264 table.grid-all>*>tr>*{border-width:1px}
265 table.grid-cols>*>tr>*{border-width:0 1px}
266 table.grid-rows>*>tr>*{border-width:1px 0}
267 table.frame-all{border-width:1px}
268 table.frame-ends{border-width:1px 0}
269 table.frame-sides{border-width:0 1px}
270 table.frame-none>colgroup+*>:first-child>*,table.frame-sides>colgroup+*>:first-child>*{border-top-width:0}
271 table.frame-none>:last-child>:last-child>*,table.frame-sides>:last-child>:last-child>*{border-bottom-width:0}
272 table.frame-none>*>tr>:first-child,table.frame-ends>*>tr>:first-child{border-left-width:0}
273 table.frame-none>*>tr>:last-child,table.frame-ends>*>tr>:last-child{border-right-width:0}
274 table.stripes-all>*>tr,table.stripes-odd>*>tr:nth-of-type(odd),table.stripes-even>*>tr:nth-of-type(even),table.stripes-hover>*>tr:hover{background:#f8f8f7}
275 th.halign-left,td.halign-left{text-align:left}
276 th.halign-right,td.halign-right{text-align:right}
277 th.halign-center,td.halign-center{text-align:center}
278 th.valign-top,td.valign-top{vertical-align:top}
279 th.valign-bottom,td.valign-bottom{vertical-align:bottom}
280 th.valign-middle,td.valign-middle{vertical-align:middle}
281 table thead th,table tfoot th{font-weight:bold}
282 tbody tr th{background:#f7f8f7}
283 tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(0,0,0,.8);font-weight:bold}
284 p.tableblock>code:only-child{background:none;padding:0}
285 p.tableblock{font-size:1em}
286 ol{margin-left:1.75em}
287 ul li ol{margin-left:1.5em}
288 dl dd{margin-left:1.125em}
289 dl dd:last-child,dl dd:last-child>:last-child{margin-bottom:0}
290 li p,ul dd,ol dd,.olist .olist,.ulist .ulist,.ulist .olist,.olist .ulist{margin-bottom:.625em}
291 ul.checklist,ul.none,ol.none,ul.no-bullet,ol.no-bullet,ol.unnumbered,ul.unstyled,ol.unstyled{list-style-type:none}
292 ul.no-bullet,ol.no-bullet,ol.unnumbered{margin-left:.625em}
293 ul.unstyled,ol.unstyled{margin-left:0}
294 li>p:empty:only-child::before{content:"";display:inline-block}
295 ul.checklist>li>p:first-child{margin-left:-1em}
296 ul.checklist>li>p:first-child>.fa-square-o:first-child,ul.checklist>li>p:first-child>.fa-check-square-o:first-child{width:1.25em;font-size:.8em;position:relative;bottom:.125em}
297 ul.checklist>li>p:first-child>input[type=checkbox]:first-child{margin-right:.25em}
298 ul.inline{display:flex;flex-flow:row wrap;list-style:none;margin:0 0 .625em -1.25em}
299 ul.inline>li{margin-left:1.25em}
300 .unstyled dl dt{font-weight:400;font-style:normal}
301 ol.arabic{list-style-type:decimal}
302 ol.decimal{list-style-type:decimal-leading-zero}
303 ol.loweralpha{list-style-type:lower-alpha}
304 ol.upperalpha{list-style-type:upper-alpha}
305 ol.lowerroman{list-style-type:lower-roman}
306 ol.upperroman{list-style-type:upper-roman}
307 ol.lowergreek{list-style-type:lower-greek}
308 .hdlist>table,.colist>table{border:0;background:none}
309 .hdlist>table>tbody>tr,.colist>table>tbody>tr{background:none}
310 td.hdlist1,td.hdlist2{vertical-align:top;padding:0 .625em}
311 td.hdlist1{font-weight:bold;padding-bottom:1.25em}
312 td.hdlist2{word-wrap:anywhere}
313 .literalblock+.colist,.listingblock+.colist{margin-top:-.5em}
314 .colist td:not([class]):first-child{padding:.4em .75em 0;line-height:1;vertical-align:top}
315 .colist td:not([class]):first-child img{max-width:none}
316 .colist td:not([class]):last-child{padding:.25em 0}
317 .thumb,.th{line-height:0;display:inline-block;border:4px solid #fff;box-shadow:0 0 0 1px #ddd}
318 .imageblock.left{margin:.25em .625em 1.25em 0}
319 .imageblock.right{margin:.25em 0 1.25em .625em}
320 .imageblock>.title{margin-bottom:0}
321 .imageblock.thumb,.imageblock.th{border-width:6px}
322 .imageblock.thumb>.title,.imageblock.th>.title{padding:0 .125em}
323 .image.left,.image.right{margin-top:.25em;margin-bottom:.25em;display:inline-block;line-height:0}
324 .image.left{margin-right:.625em}
325 .image.right{margin-left:.625em}
326 a.image{text-decoration:none;display:inline-block}
327 a.image object{pointer-events:none}
328 sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super}
329 sup.footnote a,sup.footnoteref a{text-decoration:none}
330 sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline}
331 #footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em}
332 #footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em;border-width:1px 0 0}
333 #footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;margin-bottom:.2em}
334 #footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none;margin-left:-1.05em}
335 #footnotes .footnote:last-of-type{margin-bottom:0}
336 #content #footnotes{margin-top:-.625em;margin-bottom:0;padding:.75em 0}
337 div.unbreakable{page-break-inside:avoid}
338 .big{font-size:larger}
339 .small{font-size:smaller}
340 .underline{text-decoration:underline}
341 .overline{text-decoration:overline}
342 .line-through{text-decoration:line-through}
343 .aqua{color:#00bfbf}
344 .aqua-background{background:#00fafa}
345 .black{color:#000}
346 .black-background{background:#000}
347 .blue{color:#0000bf}
348 .blue-background{background:#0000fa}
349 .fuchsia{color:#bf00bf}
350 .fuchsia-background{background:#fa00fa}
351 .gray{color:#606060}
352 .gray-background{background:#7d7d7d}
353 .green{color:#006000}
354 .green-background{background:#007d00}
355 .lime{color:#00bf00}
356 .lime-background{background:#00fa00}
357 .maroon{color:#600000}
358 .maroon-background{background:#7d0000}
359 .navy{color:#000060}
360 .navy-background{background:#00007d}
361 .olive{color:#606000}
362 .olive-background{background:#7d7d00}
363 .purple{color:#600060}
364 .purple-background{background:#7d007d}
365 .red{color:#bf0000}
366 .red-background{background:#fa0000}
367 .silver{color:#909090}
368 .silver-background{background:#bcbcbc}
369 .teal{color:#006060}
370 .teal-background{background:#007d7d}
371 .white{color:#bfbfbf}
372 .white-background{background:#fafafa}
373 .yellow{color:#bfbf00}
374 .yellow-background{background:#fafa00}
375 span.icon>.fa{cursor:default}
376 a span.icon>.fa{cursor:inherit}
377 .admonitionblock td.icon [class^="fa icon-"]{font-size:2.5em;text-shadow:1px 1px 2px rgba(0,0,0,.5);cursor:default}
378 .admonitionblock td.icon .icon-note::before{content:"\f05a";color:#19407c}
379 .admonitionblock td.icon .icon-tip::before{content:"\f0eb";text-shadow:1px 1px 2px rgba(155,155,0,.8);color:#111}
380 .admonitionblock td.icon .icon-warning::before{content:"\f071";color:#bf6900}
381 .admonitionblock td.icon .icon-caution::before{content:"\f06d";color:#bf3400}
382 .admonitionblock td.icon .icon-important::before{content:"\f06a";color:#bf0000}
383 .conum[data-value]{display:inline-block;color:#fff!important;background:rgba(0,0,0,.8);border-radius:50%;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold}
384 .conum[data-value] *{color:#fff!important}
385 .conum[data-value]+b{display:none}
386 .conum[data-value]::after{content:attr(data-value)}
387 pre .conum[data-value]{position:relative;top:-.125em}
388 b.conum *{color:inherit!important}
389 .conum:not([data-value]):empty{display:none}
390 dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
391 h1,h2,p,td.content,span.alt,summary{letter-spacing:-.01em}
392 p strong,td.content strong,div.footnote strong{letter-spacing:-.005em}
393 p,blockquote,dt,td.content,td.hdlist1,span.alt,summary{font-size:1.0625rem}
394 p{margin-bottom:1.25rem}
395 .sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}
396 .exampleblock>.content{background:#fffef7;border-color:#e0e0dc;box-shadow:0 1px 4px #e0e0dc}
397 .print-only{display:none!important}
398 @page{margin:1.25cm .75cm}
399 @media print{*{box-shadow:none!important;text-shadow:none!important}
400 html{font-size:80%}
401 a{color:inherit!important;text-decoration:underline!important}
402 a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important}
403 a[href^="http:"]:not(.bare)::after,a[href^="https:"]:not(.bare)::after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em}
404 abbr[title]{border-bottom:1px dotted}
405 abbr[title]::after{content:" (" attr(title) ")"}
406 pre,blockquote,tr,img,object,svg{page-break-inside:avoid}
407 thead{display:table-header-group}
408 svg{max-width:100%}
409 p,blockquote,dt,td.content{font-size:1em;orphans:3;widows:3}
410 h2,h3,#toctitle,.sidebarblock>.content>.title{page-break-after:avoid}
411 #header,#content,#footnotes,#footer{max-width:none}
412 #toc,.sidebarblock,.exampleblock>.content{background:none!important}
413 #toc{border-bottom:1px solid #dddddf!important;padding-bottom:0!important}
414 body.book #header{text-align:center}
415 body.book #header>h1:first-child{border:0!important;margin:2.5em 0 1em}
416 body.book #header .details{border:0!important;display:block;padding:0!important}
417 body.book #header .details span:first-child{margin-left:0!important}
418 body.book #header .details br{display:block}
419 body.book #header .details br+span::before{content:none!important}
420 body.book #toc{border:0!important;text-align:left!important;padding:0!important;margin:0!important}
421 body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-break-before:always}
422 .listingblock code[data-lang]::before{display:block}
423 #footer{padding:0 .9375em}
424 .hide-on-print{display:none!important}
425 .print-only{display:block!important}
426 .hide-for-print{display:none!important}
427 .show-for-print{display:inherit!important}}
428 @media amzn-kf8,print{#header>h1:first-child{margin-top:1.25rem}
429 .sect1{padding:0!important}
430 .sect1+.sect1{border:0}
431 #footer{background:none}
432 #footer-text{color:rgba(0,0,0,.6);font-size:.9em}}
433 @media amzn-kf8{#header,#content,#footnotes,#footer{padding:0}}
434 </style>
435 <style>
436 pre>code {
437 display: inline;
439 </style>
440 </head>
441 <body class="article">
442 <div id="header">
443 <h1>Submitting Patches</h1>
444 <div class="details">
445 <span id="revdate">2024-11-20</span>
446 </div>
447 </div>
448 <div id="content">
449 <div class="sect1">
450 <h2 id="_guidelines">Guidelines</h2>
451 <div class="sectionbody">
452 <div class="paragraph">
453 <p>Here are some guidelines for contributing back to this
454 project. There is also a <a href="MyFirstContribution.html">step-by-step tutorial</a>
455 available which covers many of these same guidelines.</p>
456 </div>
457 <div class="sect2">
458 <h3 id="patch-flow">A typical life cycle of a patch series</h3>
459 <div class="paragraph">
460 <p>To help us understand the reason behind various guidelines given later
461 in the document, first let&#8217;s understand how the life cycle of a
462 typical patch series for this project goes.</p>
463 </div>
464 <div class="olist arabic">
465 <ol class="arabic">
466 <li>
467 <p>You come up with an itch. You code it up. You do not need any
468 pre-authorization from the project to do so.</p>
469 <div class="paragraph">
470 <p>Your patches will be reviewed by other contributors on the mailing
471 list, and the reviews will be done to assess the merit of various
472 things, like the general idea behind your patch (including "is it
473 solving a problem worth solving in the first place?"), the reason
474 behind the design of the solution, and the actual implementation.
475 The guidelines given here are there to help your patches by making
476 them easier to understand by the reviewers.</p>
477 </div>
478 </li>
479 <li>
480 <p>You send the patches to the list and cc people who may need to know
481 about the change. Your goal is <strong>not</strong> necessarily to convince others
482 that what you are building is good. Your goal is to get help in
483 coming up with a solution for the "itch" that is better than what
484 you can build alone.</p>
485 <div class="paragraph">
486 <p>The people who may need to know are the ones who worked on the code
487 you are touching. These people happen to be the ones who are
488 most likely to be knowledgeable enough to help you, but
489 they have no obligation to help you (i.e. you ask them for help,
490 you don&#8217;t demand). <code>git</code> <code>log</code> <code>-p</code> &#x2d;&#x2d; <code><em>$area_you_are_modifying</em></code> would
491 help you find out who they are.</p>
492 </div>
493 </li>
494 <li>
495 <p>You get comments and suggestions for improvements. You may even get
496 them in an "on top of your change" patch form. You are expected to
497 respond to them with "Reply-All" on the mailing list, while taking
498 them into account while preparing an updated set of patches.</p>
499 </li>
500 <li>
501 <p>Polish, refine, and re-send your patches to the list and to the people
502 who spent their time to improve your patch. Go back to step (2).</p>
503 </li>
504 <li>
505 <p>While the above iterations improve your patches, the maintainer may
506 pick the patches up from the list and queue them to the <code>seen</code>
507 branch, in order to make it easier for people to play with it
508 without having to pick up and apply the patches to their trees
509 themselves. Being in <code>seen</code> has no other meaning. Specifically, it
510 does not mean the patch was "accepted" in any way.</p>
511 </li>
512 <li>
513 <p>When the discussion reaches a consensus that the latest iteration of
514 the patches are in good enough shape, the maintainer includes the
515 topic in the "What&#8217;s cooking" report that are sent out a few times a
516 week to the mailing list, marked as "Will merge to <em>next</em>." This
517 decision is primarily made by the maintainer with help from those
518 who participated in the review discussion.</p>
519 </li>
520 <li>
521 <p>After the patches are merged to the <em>next</em> branch, the discussion
522 can still continue to further improve them by adding more patches on
523 top, but by the time a topic gets merged to <em>next</em>, it is expected
524 that everybody agrees that the scope and the basic direction of the
525 topic are appropriate, so such an incremental updates are limited to
526 small corrections and polishing. After a topic cooks for some time
527 (like 7 calendar days) in <em>next</em> without needing further tweaks on
528 top, it gets merged to the <em>master</em> branch and wait to become part
529 of the next major release.</p>
530 </li>
531 </ol>
532 </div>
533 <div class="paragraph">
534 <p>In the following sections, many techniques and conventions are listed
535 to help your patches get reviewed effectively in such a life cycle.</p>
536 </div>
537 </div>
538 <div class="sect2">
539 <h3 id="choose-starting-point">Choose a starting point.</h3>
540 <div class="paragraph">
541 <p>As a preliminary step, you must first choose a starting point for your
542 work. Typically this means choosing a branch, although technically
543 speaking it is actually a particular commit (typically the HEAD, or tip,
544 of the branch).</p>
545 </div>
546 <div class="paragraph">
547 <p>There are several important branches to be aware of. Namely, there are
548 four integration branches as discussed in <a href="gitworkflows.html">gitworkflows(7)</a>:</p>
549 </div>
550 <div class="ulist">
551 <ul>
552 <li>
553 <p>maint</p>
554 </li>
555 <li>
556 <p>master</p>
557 </li>
558 <li>
559 <p>next</p>
560 </li>
561 <li>
562 <p>seen</p>
563 </li>
564 </ul>
565 </div>
566 <div class="paragraph">
567 <p>The branches lower on the list are typically descendants of the ones
568 that come before it. For example, <code>maint</code> is an "older" branch than
569 <code>master</code> because <code>master</code> usually has patches (commits) on top of
570 <code>maint</code>.</p>
571 </div>
572 <div class="paragraph">
573 <p>There are also "topic" branches, which contain work from other
574 contributors. Topic branches are created by the Git maintainer (in
575 their fork) to organize the current set of incoming contributions on
576 the mailing list, and are itemized in the regular "What&#8217;s cooking in
577 git.git" announcements. To find the tip of a topic branch, run <code>git</code> <code>log</code>
578 <code>--first-parent</code> <code>master</code><code>..</code><code>seen</code> and look for the merge commit. The second
579 parent of this commit is the tip of the topic branch.</p>
580 </div>
581 <div class="paragraph">
582 <p>There is one guiding principle for choosing the right starting point: in
583 general, always base your work on the oldest integration branch that
584 your change is relevant to (see "Merge upwards" in
585 <a href="gitworkflows.html">gitworkflows(7)</a>). What this principle means is that for the
586 vast majority of cases, the starting point for new work should be the
587 latest HEAD commit of <code>maint</code> or <code>master</code> based on the following cases:</p>
588 </div>
589 <div class="ulist">
590 <ul>
591 <li>
592 <p>If you are fixing bugs in the released version, use <code>maint</code> as the
593 starting point (which may mean you have to fix things without using
594 new API features on the cutting edge that recently appeared in
595 <code>master</code> but were not available in the released version).</p>
596 </li>
597 <li>
598 <p>Otherwise (such as if you are adding new features) use <code>master</code>.</p>
599 </li>
600 </ul>
601 </div>
602 <div class="admonitionblock note">
603 <table>
604 <tr>
605 <td class="icon">
606 <div class="title">Note</div>
607 </td>
608 <td class="content">
609 In exceptional cases, a bug that was introduced in an old
610 version may have to be fixed for users of releases that are much older
611 than the recent releases. <code>git</code> <code>describe</code> <code>--contains</code> <code>X</code> may describe
612 <code>X</code> as <code>v2.30.0-rc2-gXXXXXX</code> for the commit <code>X</code> that introduced the
613 bug, and the bug may be so high-impact that we may need to issue a new
614 maintenance release for Git 2.30.x series, when "Git 2.41.0" is the
615 current release. In such a case, you may want to use the tip of the
616 maintenance branch for the 2.30.x series, which may be available in the
617 <code>maint-2.30</code> branch in <a href="https://github.com/gitster/git">the maintainer&#8217;s
618 "broken out" repo</a>.
619 </td>
620 </tr>
621 </table>
622 </div>
623 <div class="paragraph">
624 <p>This also means that <code>next</code> or <code>seen</code> are inappropriate starting points
625 for your work, if you want your work to have a realistic chance of
626 graduating to <code>master</code>. They are simply not designed to be used as a
627 base for new work; they are only there to make sure that topics in
628 flight work well together. This is why both <code>next</code> and <code>seen</code> are
629 frequently re-integrated with incoming patches on the mailing list and
630 force-pushed to replace previous versions of themselves. A topic that is
631 literally built on top of <code>next</code> cannot be merged to <code>master</code> without
632 dragging in all the other topics in <code>next</code>, some of which may not be
633 ready.</p>
634 </div>
635 <div class="paragraph">
636 <p>For example, if you are making tree-wide changes, while somebody else is
637 also making their own tree-wide changes, your work may have severe
638 overlap with the other person&#8217;s work. This situation may tempt you to
639 use <code>next</code> as your starting point (because it would have the other
640 person&#8217;s work included in it), but doing so would mean you&#8217;ll not only
641 depend on the other person&#8217;s work, but all the other random things from
642 other contributors that are already integrated into <code>next</code>. And as soon
643 as <code>next</code> is updated with a new version, all of your work will need to
644 be rebased anyway in order for them to be cleanly applied by the
645 maintainer.</p>
646 </div>
647 <div class="paragraph">
648 <p>Under truly exceptional circumstances where you absolutely must depend
649 on a select few topic branches that are already in <code>next</code> but not in
650 <code>master</code>, you may want to create your own custom base-branch by forking
651 <code>master</code> and merging the required topic branches into it. You could then
652 work on top of this base-branch. But keep in mind that this base-branch
653 would only be known privately to you. So when you are ready to send
654 your patches to the list, be sure to communicate how you created it in
655 your cover letter. This critical piece of information would allow
656 others to recreate your base-branch on their end in order for them to
657 try out your work.</p>
658 </div>
659 <div class="paragraph">
660 <p>Finally, note that some parts of the system have dedicated maintainers
661 with their own separate source code repositories (see the section
662 "Subsystems" below).</p>
663 </div>
664 </div>
665 <div class="sect2">
666 <h3 id="separate-commits">Make separate commits for logically separate changes.</h3>
667 <div class="paragraph">
668 <p>Unless your patch is really trivial, you should not be sending
669 out a patch that was generated between your working tree and
670 your commit head. Instead, always make a commit with complete
671 commit message and generate a series of patches from your
672 repository. It is a good discipline.</p>
673 </div>
674 <div class="paragraph">
675 <p>Give an explanation for the change(s) that is detailed enough so
676 that people can judge if it is good thing to do, without reading
677 the actual patch text to determine how well the code does what
678 the explanation promises to do.</p>
679 </div>
680 <div class="paragraph">
681 <p>If your description starts to get too long, that&#8217;s a sign that you
682 probably need to split up your commit to finer grained pieces.
683 That being said, patches which plainly describe the things that
684 help reviewers check the patch, and future maintainers understand
685 the code, are the most beautiful patches. Descriptions that summarize
686 the point in the subject well, and describe the motivation for the
687 change, the approach taken by the change, and if relevant how this
688 differs substantially from the prior version, are all good things
689 to have.</p>
690 </div>
691 <div class="paragraph">
692 <p>Make sure that you have tests for the bug you are fixing. See
693 <code>t/README</code> for guidance.</p>
694 </div>
695 <div id="tests" class="paragraph">
696 <p>When adding a new feature, make sure that you have new tests to show
697 the feature triggers the new behavior when it should, and to show the
698 feature does not trigger when it shouldn&#8217;t. After any code change,
699 make sure that the entire test suite passes. When fixing a bug, make
700 sure you have new tests that break if somebody else breaks what you
701 fixed by accident to avoid regression. Also, try merging your work to
702 <em>next</em> and <em>seen</em> and make sure the tests still pass; topics by others
703 that are still in flight may have unexpected interactions with what
704 you are trying to do in your topic.</p>
705 </div>
706 <div class="paragraph">
707 <p>Pushing to a fork of <a href="https://github.com/git/git" class="bare">https://github.com/git/git</a> will use their CI
708 integration to test your changes on Linux, Mac and Windows. See the
709 <a href="#GHCI">GitHub CI</a> section for details.</p>
710 </div>
711 <div class="paragraph">
712 <p>Do not forget to update the documentation to describe the updated
713 behavior and make sure that the resulting documentation set formats
714 well (try the Documentation/doc-diff script).</p>
715 </div>
716 <div class="paragraph">
717 <p>We currently have a liberal mixture of US and UK English norms for
718 spelling and grammar, which is somewhat unfortunate. A huge patch that
719 touches the files all over the place only to correct the inconsistency
720 is not welcome, though. Potential clashes with other changes that can
721 result from such a patch are not worth it. We prefer to gradually
722 reconcile the inconsistencies in favor of US English, with small and
723 easily digestible patches, as a side effect of doing some other real
724 work in the vicinity (e.g. rewriting a paragraph for clarity, while
725 turning en_UK spelling to en_US). Obvious typographical fixes are much
726 more welcomed ("teh &#8594; "the"), preferably submitted as independent
727 patches separate from other documentation changes.</p>
728 </div>
729 <div id="whitespace-check" class="paragraph">
730 <p>Oh, another thing. We are picky about whitespaces. Make sure your
731 changes do not trigger errors with the sample pre-commit hook shipped
732 in <code>templates/hooks--pre-commit</code>. To help ensure this does not happen,
733 run <code>git</code> <code>diff</code> <code>--check</code> on your changes before you commit.</p>
734 </div>
735 </div>
736 <div class="sect2">
737 <h3 id="describe-changes">Describe your changes well.</h3>
738 <div class="paragraph">
739 <p>The log message that explains your changes is just as important as the
740 changes themselves. Your code may be clearly written with in-code
741 comment to sufficiently explain how it works with the surrounding
742 code, but those who need to fix or enhance your code in the future
743 will need to know <em>why</em> your code does what it does, for a few
744 reasons:</p>
745 </div>
746 <div class="olist arabic">
747 <ol class="arabic">
748 <li>
749 <p>Your code may be doing something differently from what you wanted it
750 to do. Writing down what you actually wanted to achieve will help
751 them fix your code and make it do what it should have been doing
752 (also, you often discover your own bugs yourself, while writing the
753 log message to summarize the thought behind it).</p>
754 </li>
755 <li>
756 <p>Your code may be doing things that were only necessary for your
757 immediate needs (e.g. "do X to directories" without implementing or
758 even designing what is to be done on files). Writing down why you
759 excluded what the code does not do will help guide future developers.
760 Writing down "we do X to directories, because directories have
761 characteristic Y" would help them infer "oh, files also have the same
762 characteristic Y, so perhaps doing X to them would also make sense?".
763 Saying "we don&#8217;t do the same X to files, because &#8230;&#8203;" will help them
764 decide if the reasoning is sound (in which case they do not waste
765 time extending your code to cover files), or reason differently (in
766 which case, they can explain why they extend your code to cover
767 files, too).</p>
768 </li>
769 </ol>
770 </div>
771 <div class="paragraph">
772 <p>The goal of your log message is to convey the <em>why</em> behind your change
773 to help future developers. The reviewers will also make sure that
774 your proposed log message will serve this purpose well.</p>
775 </div>
776 <div class="paragraph">
777 <p>The first line of the commit message should be a short description (50
778 characters is the soft limit, see DISCUSSION in <a href="git-commit.html">git-commit(1)</a>),
779 and should skip the full stop. It is also conventional in most cases to
780 prefix the first line with "area: " where the area is a filename or
781 identifier for the general area of the code being modified, e.g.</p>
782 </div>
783 <div class="ulist">
784 <ul>
785 <li>
786 <p>doc: clarify distinction between sign-off and pgp-signing</p>
787 </li>
788 <li>
789 <p>githooks.txt: improve the intro section</p>
790 </li>
791 </ul>
792 </div>
793 <div class="paragraph">
794 <p>If in doubt which identifier to use, run <code>git</code> <code>log</code> <code>--no-merges</code> on the
795 files you are modifying to see the current conventions.</p>
796 </div>
797 <div id="summary-section" class="paragraph">
798 <p>The title sentence after the "area:" prefix omits the full stop at the
799 end, and its first word is not capitalized (the omission
800 of capitalization applies only to the word after the "area:"
801 prefix of the title) unless there is a reason to
802 capitalize it other than because it is the first word in the sentence.
803 E.g. "doc: clarify&#8230;&#8203;", not "doc: Clarify&#8230;&#8203;", or "githooks.txt:
804 improve&#8230;&#8203;", not "githooks.txt: Improve&#8230;&#8203;". But "refs: HEAD is also
805 treated as a ref" is correct, as we spell <code>HEAD</code> in all caps even when
806 it appears in the middle of a sentence.</p>
807 </div>
808 <div id="meaningful-message" class="paragraph">
809 <p>The body should provide a meaningful commit message, which:</p>
810 </div>
811 <div class="olist arabic">
812 <ol class="arabic">
813 <li>
814 <p>explains the problem the change tries to solve, i.e. what is wrong
815 with the current code without the change.</p>
816 </li>
817 <li>
818 <p>justifies the way the change solves the problem, i.e. why the
819 result with the change is better.</p>
820 </li>
821 <li>
822 <p>alternate solutions considered but discarded, if any.</p>
823 </li>
824 </ol>
825 </div>
826 <div id="present-tense" class="paragraph">
827 <p>The problem statement that describes the status quo is written in the
828 present tense. Write "The code does X when it is given input Y",
829 instead of "The code used to do Y when given input X". You do not
830 have to say "Currently"---the status quo in the problem statement is
831 about the code <em>without</em> your change, by project convention.</p>
832 </div>
833 <div id="imperative-mood" class="paragraph">
834 <p>Describe your changes in imperative mood, e.g. "make xyzzy do frotz"
835 instead of "[This patch] makes xyzzy do frotz" or "[I] changed xyzzy
836 to do frotz", as if you are giving orders to the codebase to change
837 its behavior. Try to make sure your explanation can be understood
838 without external resources. Instead of giving a URL to a mailing list
839 archive, summarize the relevant points of the discussion.</p>
840 </div>
841 <div id="commit-reference" class="paragraph">
842 <p>There are a few reasons why you may want to refer to another commit in
843 the "more stable" part of the history (i.e. on branches like <code>maint</code>,
844 <code>master</code>, and <code>next</code>):</p>
845 </div>
846 <div class="olist arabic">
847 <ol class="arabic">
848 <li>
849 <p>A commit that introduced the root cause of a bug you are fixing.</p>
850 </li>
851 <li>
852 <p>A commit that introduced a feature that you are enhancing.</p>
853 </li>
854 <li>
855 <p>A commit that conflicts with your work when you made a trial merge
856 of your work into <code>next</code> and <code>seen</code> for testing.</p>
857 </li>
858 </ol>
859 </div>
860 <div class="paragraph">
861 <p>When you reference a commit on a more stable branch (like <code>master</code>,
862 <code>maint</code> and <code>next</code>), use the format "abbreviated hash (subject,
863 date)", like this:</p>
864 </div>
865 <div class="literalblock">
866 <div class="content">
867 <pre> Commit f86a374 (pack-bitmap.c: fix a memleak, 2015-03-30)
868 noticed that ...</pre>
869 </div>
870 </div>
871 <div class="paragraph">
872 <p>The "Copy commit reference" command of gitk can be used to obtain this
873 format (with the subject enclosed in a pair of double-quotes), or this
874 invocation of <code>git</code> <code>show</code>:</p>
875 </div>
876 <div class="literalblock">
877 <div class="content">
878 <pre> git show -s --pretty=reference &lt;commit&gt;</pre>
879 </div>
880 </div>
881 <div class="paragraph">
882 <p>or, on an older version of Git without support for --pretty=reference:</p>
883 </div>
884 <div class="literalblock">
885 <div class="content">
886 <pre> git show -s --date=short --pretty='format:%h (%s, %ad)' &lt;commit&gt;</pre>
887 </div>
888 </div>
889 </div>
890 <div class="sect2">
891 <h3 id="sign-off">Certify your work by adding your <code>Signed-off-by</code> trailer</h3>
892 <div class="paragraph">
893 <p>To improve tracking of who did what, we ask you to certify that you
894 wrote the patch or have the right to pass it on under the same license
895 as ours, by "signing off" your patch. Without sign-off, we cannot
896 accept your patches.</p>
897 </div>
898 <div class="paragraph">
899 <p>If (and only if) you certify the below D-C-O:</p>
900 </div>
901 <div id="dco" class="quoteblock">
902 <div class="title">Developer&#8217;s Certificate of Origin 1.1</div>
903 <blockquote>
904 <div class="paragraph">
905 <p>By making a contribution to this project, I certify that:</p>
906 </div>
907 <div class="olist loweralpha">
908 <ol class="loweralpha">
909 <li>
910 <p>The contribution was created in whole or in part by me and I
911 have the right to submit it under the open source license
912 indicated in the file; or</p>
913 </li>
914 <li>
915 <p>The contribution is based upon previous work that, to the best
916 of my knowledge, is covered under an appropriate open source
917 license and I have the right under that license to submit that
918 work with modifications, whether created in whole or in part
919 by me, under the same open source license (unless I am
920 permitted to submit under a different license), as indicated
921 in the file; or</p>
922 </li>
923 <li>
924 <p>The contribution was provided directly to me by some other
925 person who certified (a), (b) or (c) and I have not modified
926 it.</p>
927 </li>
928 <li>
929 <p>I understand and agree that this project and the contribution
930 are public and that a record of the contribution (including all
931 personal information I submit with it, including my sign-off) is
932 maintained indefinitely and may be redistributed consistent with
933 this project or the open source license(s) involved.</p>
934 </li>
935 </ol>
936 </div>
937 </blockquote>
938 </div>
939 <div class="paragraph">
940 <p>you add a "Signed-off-by" trailer to your commit, that looks like
941 this:</p>
942 </div>
943 <div class="literalblock">
944 <div class="content">
945 <pre> Signed-off-by: Random J Developer &lt;random@developer.example.org&gt;</pre>
946 </div>
947 </div>
948 <div class="paragraph">
949 <p>This line can be added by Git if you run the git-commit command with
950 the -s option.</p>
951 </div>
952 <div class="paragraph">
953 <p>Notice that you can place your own <code>Signed-off-by</code> trailer when
954 forwarding somebody else&#8217;s patch with the above rules for
955 D-C-O. Indeed you are encouraged to do so. Do not forget to
956 place an in-body "From: " line at the beginning to properly attribute
957 the change to its true author (see (2) above).</p>
958 </div>
959 <div class="paragraph">
960 <p>This procedure originally came from the Linux kernel project, so our
961 rule is quite similar to theirs, but what exactly it means to sign-off
962 your patch differs from project to project, so it may be different
963 from that of the project you are accustomed to.</p>
964 </div>
965 <div id="real-name" class="paragraph">
966 <p>Also notice that a real name is used in the <code>Signed-off-by</code> trailer. Please
967 don&#8217;t hide your real name.</p>
968 </div>
969 <div id="commit-trailers" class="paragraph">
970 <p>If you like, you can put extra trailers at the end:</p>
971 </div>
972 <div class="olist arabic">
973 <ol class="arabic">
974 <li>
975 <p><code>Reported-by:</code> is used to credit someone who found the bug that
976 the patch attempts to fix.</p>
977 </li>
978 <li>
979 <p><code>Acked-by:</code> says that the person who is more familiar with the area
980 the patch attempts to modify liked the patch.</p>
981 </li>
982 <li>
983 <p><code>Reviewed-by:</code>, unlike the other trailers, can only be offered by the
984 reviewers themselves when they are completely satisfied with the
985 patch after a detailed analysis.</p>
986 </li>
987 <li>
988 <p><code>Tested-by:</code> is used to indicate that the person applied the patch
989 and found it to have the desired effect.</p>
990 </li>
991 <li>
992 <p><code>Co-authored-by:</code> is used to indicate that people exchanged drafts
993 of a patch before submitting it.</p>
994 </li>
995 <li>
996 <p><code>Helped-by:</code> is used to credit someone who suggested ideas for
997 changes without providing the precise changes in patch form.</p>
998 </li>
999 <li>
1000 <p><code>Mentored-by:</code> is used to credit someone with helping develop a
1001 patch as part of a mentorship program (e.g., GSoC or Outreachy).</p>
1002 </li>
1003 <li>
1004 <p><code>Suggested-by:</code> is used to credit someone with suggesting the idea
1005 for a patch.</p>
1006 </li>
1007 </ol>
1008 </div>
1009 <div class="paragraph">
1010 <p>While you can also create your own trailer if the situation warrants it, we
1011 encourage you to instead use one of the common trailers in this project
1012 highlighted above.</p>
1013 </div>
1014 <div class="paragraph">
1015 <p>Only capitalize the very first letter of the trailer, i.e. favor
1016 "Signed-off-by" over "Signed-Off-By" and "Acked-by:" over "Acked-By".</p>
1017 </div>
1018 </div>
1019 <div class="sect2">
1020 <h3 id="git-tools">Generate your patch using Git tools out of your commits.</h3>
1021 <div class="paragraph">
1022 <p>Git based diff tools generate unidiff which is the preferred format.</p>
1023 </div>
1024 <div class="paragraph">
1025 <p>You do not have to be afraid to use <code>-M</code> option to <code>git</code> <code>diff</code> or
1026 <code>git</code> <code>format-patch</code>, if your patch involves file renames. The
1027 receiving end can handle them just fine.</p>
1028 </div>
1029 <div id="review-patch" class="paragraph">
1030 <p>Please make sure your patch does not add commented out debugging code,
1031 or include any extra files which do not relate to what your patch
1032 is trying to achieve. Make sure to review
1033 your patch after generating it, to ensure accuracy. Before
1034 sending out, please make sure it cleanly applies to the starting point you
1035 have chosen in the "Choose a starting point" section.</p>
1036 </div>
1037 <div class="admonitionblock note">
1038 <table>
1039 <tr>
1040 <td class="icon">
1041 <div class="title">Note</div>
1042 </td>
1043 <td class="content">
1044 From the perspective of those reviewing your patch, the <code>master</code>
1045 branch is the default expected starting point. So if you have chosen a
1046 different starting point, please communicate this choice in your cover
1047 letter.
1048 </td>
1049 </tr>
1050 </table>
1051 </div>
1052 </div>
1053 <div class="sect2">
1054 <h3 id="send-patches">Sending your patches.</h3>
1055 <div class="sect3">
1056 <h4 id="_choosing_your_reviewers">Choosing your reviewers</h4>
1057 <div class="admonitionblock note">
1058 <table>
1059 <tr>
1060 <td class="icon">
1061 <div class="title">Note</div>
1062 </td>
1063 <td class="content">
1064 Patches that may be
1065 security relevant should be submitted privately to the Git Security
1066 mailing list<sup class="footnote" id="_footnote_security-ml">[<a id="_footnoteref_1" class="footnote" href="#_footnotedef_1" title="View footnote.">1</a>]</sup>, instead of the public mailing list.
1067 </td>
1068 </tr>
1069 </table>
1070 </div>
1071 <div class="paragraph">
1072 <p>Send your patch with "To:" set to the mailing list, with "cc:" listing
1073 people who are involved in the area you are touching (the <code>git-contacts</code>
1074 script in <code>contrib/contacts/</code><sup class="footnote" id="_footnote_contrib-scripts">[<a id="_footnoteref_2" class="footnote" href="#_footnotedef_2" title="View footnote.">2</a>]</sup> can help to
1075 identify them), to solicit comments and reviews. Also, when you made
1076 trial merges of your topic to <code>next</code> and <code>seen</code>, you may have noticed
1077 work by others conflicting with your changes. There is a good possibility
1078 that these people may know the area you are touching well.</p>
1079 </div>
1080 <div class="paragraph">
1081 <p>If you are using <code>send-email</code>, you can feed it the output of <code>git-contacts</code> like
1082 this:</p>
1083 </div>
1084 <div class="literalblock">
1085 <div class="content">
1086 <pre> git send-email --cc-cmd='perl contrib/contacts/git-contacts' feature/*.patch</pre>
1087 </div>
1088 </div>
1089 <div class="paragraph">
1090 <p>After the list reached a consensus that it is a good idea to apply the
1091 patch, re-send it with "To:" set to the maintainer<sup class="footnote">[<a id="_footnoteref_3" class="footnote" href="#_footnotedef_3" title="View footnote.">3</a>]</sup>
1092 and "cc:" the list<sup class="footnote">[<a id="_footnoteref_4" class="footnote" href="#_footnotedef_4" title="View footnote.">4</a>]</sup> for inclusion. This is especially relevant
1093 when the maintainer did not heavily participate in the discussion and
1094 instead left the review to trusted others.</p>
1095 </div>
1096 <div class="paragraph">
1097 <p>Do not forget to add trailers such as <code>Acked-by:</code>, <code>Reviewed-by:</code> and
1098 <code>Tested-by:</code> lines as necessary to credit people who helped your
1099 patch, and "cc:" them when sending such a final version for inclusion.</p>
1100 </div>
1101 </div>
1102 <div class="sect3">
1103 <h4 id="_format_patch_and_send_email"><code>format-patch</code> and <code>send-email</code></h4>
1104 <div class="paragraph">
1105 <p>Learn to use <code>format-patch</code> and <code>send-email</code> if possible. These commands
1106 are optimized for the workflow of sending patches, avoiding many ways
1107 your existing e-mail client (often optimized for "multipart/*" MIME
1108 type e-mails) might render your patches unusable.</p>
1109 </div>
1110 <div class="admonitionblock note">
1111 <table>
1112 <tr>
1113 <td class="icon">
1114 <div class="title">Note</div>
1115 </td>
1116 <td class="content">
1117 Here we outline the procedure using <code>format-patch</code> and
1118 <code>send-email</code>, but you can instead use GitGitGadget to send in your
1119 patches (see <a href="MyFirstContribution.html">MyFirstContribution</a>).
1120 </td>
1121 </tr>
1122 </table>
1123 </div>
1124 <div class="paragraph">
1125 <p>People on the Git mailing list need to be able to read and
1126 comment on the changes you are submitting. It is important for
1127 a developer to be able to "quote" your changes, using standard
1128 e-mail tools, so that they may comment on specific portions of
1129 your code. For this reason, each patch should be submitted
1130 "inline" in a separate message.</p>
1131 </div>
1132 <div class="paragraph">
1133 <p>All subsequent versions of a patch series and other related patches should be
1134 grouped into their own e-mail thread to help readers find all parts of the
1135 series. To that end, send them as replies to either an additional "cover
1136 letter" message (see below), the first patch, or the respective preceding patch.
1137 Here is a <a href="MyFirstContribution.html#v2-git-send-email">step-by-step guide</a> on
1138 how to submit updated versions of a patch series.</p>
1139 </div>
1140 <div class="paragraph">
1141 <p>If your log message (including your name on the
1142 <code>Signed-off-by</code> trailer) is not writable in ASCII, make sure that
1143 you send off a message in the correct encoding.</p>
1144 </div>
1145 <div class="admonitionblock warning">
1146 <table>
1147 <tr>
1148 <td class="icon">
1149 <div class="title">Warning</div>
1150 </td>
1151 <td class="content">
1152 Be wary of your MUAs word-wrap
1153 corrupting your patch. Do not cut-n-paste your patch; you can
1154 lose tabs that way if you are not careful.
1155 </td>
1156 </tr>
1157 </table>
1158 </div>
1159 <div class="paragraph">
1160 <p>It is a common convention to prefix your subject line with
1161 [PATCH]. This lets people easily distinguish patches from other
1162 e-mail discussions. Use of markers in addition to PATCH within
1163 the brackets to describe the nature of the patch is also
1164 encouraged. E.g. [RFC PATCH] (where RFC stands for "request for
1165 comments") is often used to indicate a patch needs further
1166 discussion before being accepted, [PATCH v2], [PATCH v3] etc.
1167 are often seen when you are sending an update to what you have
1168 previously sent.</p>
1169 </div>
1170 <div class="paragraph">
1171 <p>The <code>git</code> <code>format-patch</code> command follows the best current practice to
1172 format the body of an e-mail message. At the beginning of the
1173 patch should come your commit message, ending with the
1174 <code>Signed-off-by</code> trailers, and a line that consists of three dashes,
1175 followed by the diffstat information and the patch itself. If
1176 you are forwarding a patch from somebody else, optionally, at
1177 the beginning of the e-mail message just before the commit
1178 message starts, you can put a "From: " line to name that person.
1179 To change the default "[PATCH]" in the subject to "[&lt;text&gt;]", use
1180 <code>git</code> <code>format-patch</code> <code>--subject-prefix=</code><em>&lt;text&gt;</em>. As a shortcut, you
1181 can use <code>--rfc</code> instead of <code>--subject-prefix=</code>"RFC <code>PATCH</code>", or
1182 <code>-v</code> <em>&lt;n&gt;</em> instead of <code>--subject-prefix=</code>"PATCH <code>v</code><em>&lt;n&gt;</em>".</p>
1183 </div>
1184 <div class="paragraph">
1185 <p>You often want to add additional explanation about the patch,
1186 other than the commit message itself. Place such "cover letter"
1187 material between the three-dash line and the diffstat. For
1188 patches requiring multiple iterations of review and discussion,
1189 an explanation of changes between each iteration can be kept in
1190 Git-notes and inserted automatically following the three-dash
1191 line via <code>git</code> <code>format-patch</code> <code>--notes</code>.</p>
1192 </div>
1193 <div id="the-topic-summary" class="paragraph">
1194 <p><strong>This is EXPERIMENTAL</strong>.</p>
1195 </div>
1196 <div class="paragraph">
1197 <p>When sending a topic, you can propose a one-paragraph summary that
1198 should appear in the "What&#8217;s cooking" report when it is picked up to
1199 explain the topic. If you choose to do so, please write a 2-5 line
1200 paragraph that will fit well in our release notes (see many bulleted
1201 entries in the Documentation/RelNotes/* files for examples), and make
1202 it the first paragraph of the cover letter. For a single-patch
1203 series, use the space between the three-dash line and the diffstat, as
1204 described earlier.</p>
1205 </div>
1206 <div id="attachment" class="paragraph">
1207 <p>Do not attach the patch as a MIME attachment, compressed or not.
1208 Do not let your e-mail client send quoted-printable. Do not let
1209 your e-mail client send format=flowed which would destroy
1210 whitespaces in your patches. Many
1211 popular e-mail applications will not always transmit a MIME
1212 attachment as plain text, making it impossible to comment on
1213 your code. A MIME attachment also takes a bit more time to
1214 process. This does not decrease the likelihood of your
1215 MIME-attached change being accepted, but it makes it more likely
1216 that it will be postponed.</p>
1217 </div>
1218 <div class="paragraph">
1219 <p>Exception: If your mailer is mangling patches then someone may ask
1220 you to re-send them using MIME, that is OK.</p>
1221 </div>
1222 <div id="pgp-signature" class="paragraph">
1223 <p>Do not PGP sign your patch. Most likely, your maintainer or other people on the
1224 list would not have your PGP key and would not bother obtaining it anyway.
1225 Your patch is not judged by who you are; a good patch from an unknown origin
1226 has a far better chance of being accepted than a patch from a known, respected
1227 origin that is done poorly or does incorrect things.</p>
1228 </div>
1229 <div class="paragraph">
1230 <p>If you really really really really want to do a PGP signed
1231 patch, format it as "multipart/signed", not a text/plain message
1232 that starts with <code>-----BEGIN</code> <code>PGP</code> <code>SIGNED</code> <code>MESSAGE-----</code>. That is
1233 not a text/plain, it&#8217;s something else.</p>
1234 </div>
1235 </div>
1236 </div>
1237 <div class="sect2">
1238 <h3 id="_handling_conflicts_and_iterating_patches">Handling Conflicts and Iterating Patches</h3>
1239 <div class="paragraph">
1240 <p>When revising changes made to your patches, it&#8217;s important to
1241 acknowledge the possibility of conflicts with other ongoing topics. To
1242 navigate these potential conflicts effectively, follow the recommended
1243 steps outlined below:</p>
1244 </div>
1245 <div class="olist arabic">
1246 <ol class="arabic">
1247 <li>
1248 <p>Build on a suitable base branch, see the <a href="#choose-starting-point">section above</a>,
1249 and format-patch the series. If you are doing "rebase -i" in-place to
1250 update from the previous round, this will reuse the previous base so
1251 (2) and (3) may become trivial.</p>
1252 </li>
1253 <li>
1254 <p>Find the base of where the last round was queued</p>
1255 <div class="literalblock">
1256 <div class="content">
1257 <pre>$ mine='kn/ref-transaction-symref'
1258 $ git checkout "origin/seen^{/^Merge branch '$mine'}...master"</pre>
1259 </div>
1260 </div>
1261 </li>
1262 <li>
1263 <p>Apply your format-patch result. There are two cases</p>
1264 <div class="olist loweralpha">
1265 <ol class="loweralpha" type="a">
1266 <li>
1267 <p>Things apply cleanly and tests fine. Go to (4).</p>
1268 </li>
1269 <li>
1270 <p>Things apply cleanly but does not build or test fails, or things do
1271 not apply cleanly.</p>
1272 <div class="paragraph">
1273 <p>In the latter case, you have textual or semantic conflicts coming from
1274 the difference between the old base and the base you used to build in
1275 (1). Identify what caused the breakages (e.g., a topic or two may have
1276 merged since the base used by (2) until the base used by (1)).</p>
1277 </div>
1278 <div class="paragraph">
1279 <p>Check out the latest <em>origin/master</em> (which may be newer than the base
1280 used by (2)), "merge --no-ff" the topics you newly depend on in there,
1281 and use the result of the merge(s) as the base, rebuild the series and
1282 test again. Run format-patch from the last such merges to the tip of
1283 your topic. If you did</p>
1284 </div>
1285 <div class="literalblock">
1286 <div class="content">
1287 <pre>$ git checkout origin/master
1288 $ git merge --no-ff --into-name kn/ref-transaction-symref fo/obar
1289 $ git merge --no-ff --into-name kn/ref-transaction-symref ba/zqux
1290 ... rebuild the topic ...</pre>
1291 </div>
1292 </div>
1293 <div class="paragraph">
1294 <p>Then you&#8217;d just format your topic above these "preparing the ground"
1295 merges, e.g.</p>
1296 </div>
1297 <div class="literalblock">
1298 <div class="content">
1299 <pre>$ git format-patch "HEAD^{/^Merge branch 'ba/zqux'}"..HEAD</pre>
1300 </div>
1301 </div>
1302 <div class="paragraph">
1303 <p>Do not forget to write in the cover letter you did this, including the
1304 topics you have in your base on top of <em>master</em>. Then go to (4).</p>
1305 </div>
1306 </li>
1307 </ol>
1308 </div>
1309 </li>
1310 <li>
1311 <p>Make a trial merge of your topic into <em>next</em> and <em>seen</em>, e.g.</p>
1312 <div class="literalblock">
1313 <div class="content">
1314 <pre>$ git checkout --detach 'origin/seen'
1315 $ git revert -m 1 &lt;the merge of the previous iteration into seen&gt;
1316 $ git merge kn/ref-transaction-symref</pre>
1317 </div>
1318 </div>
1319 <div class="paragraph">
1320 <p>The "revert" is needed if the previous iteration of your topic is
1321 already in <em>seen</em> (like in this case). You could choose to rebuild
1322 master..origin/seen from scratch while excluding your previous
1323 iteration, which may emulate what happens on the maintainers end more
1324 closely.</p>
1325 </div>
1326 <div class="paragraph">
1327 <p>This trial merge may conflict. It is primarily to see what conflicts
1328 <em>other</em> topics may have with your topic. In other words, you do not
1329 have to depend on it to make your topic work on <em>master</em>. It may
1330 become the job of the other topic owners to resolve conflicts if your
1331 topic goes to <em>next</em> before theirs.</p>
1332 </div>
1333 <div class="paragraph">
1334 <p>Make a note on what conflict you saw in the cover letter. You do not
1335 necessarily have to resolve them, but it would be a good opportunity to
1336 learn what others are doing in related areas.</p>
1337 </div>
1338 <div class="literalblock">
1339 <div class="content">
1340 <pre>$ git checkout --detach 'origin/next'
1341 $ git merge kn/ref-transaction-symref</pre>
1342 </div>
1343 </div>
1344 <div class="paragraph">
1345 <p>This is to see what conflicts your topic has with other topics that are
1346 already cooking. This should not conflict if (3)-2 prepared a base on
1347 top of updated master plus dependent topics taken from <em>next</em>. Unless
1348 the context is severe (one way to tell is try the same trial merge with
1349 your old iteration, which may conflict in a similar way), expect that it
1350 will be handled on maintainers end (if it gets unmanageable, I&#8217;ll ask to
1351 rebase when I receive your patches).</p>
1352 </div>
1353 </li>
1354 </ol>
1355 </div>
1356 </div>
1357 </div>
1358 </div>
1359 <div class="sect1">
1360 <h2 id="_subsystems_with_dedicated_maintainers">Subsystems with dedicated maintainers</h2>
1361 <div class="sectionbody">
1362 <div class="paragraph">
1363 <p>Some parts of the system have dedicated maintainers with their own
1364 repositories.</p>
1365 </div>
1366 <div class="ulist">
1367 <ul>
1368 <li>
1369 <p><code>git-gui/</code> comes from git-gui project, maintained by Johannes Sixt:</p>
1370 <div class="literalblock">
1371 <div class="content">
1372 <pre>https://github.com/j6t/git-gui</pre>
1373 </div>
1374 </div>
1375 </li>
1376 <li>
1377 <p><code>gitk-git/</code> comes from Paul Mackerras&#8217;s gitk project:</p>
1378 <div class="literalblock">
1379 <div class="content">
1380 <pre>git://git.ozlabs.org/~paulus/gitk</pre>
1381 </div>
1382 </div>
1383 <div class="literalblock">
1384 <div class="content">
1385 <pre>Those who are interested in improving gitk can volunteer to help Paul
1386 maintain it, cf. &lt;YntxL/fTplFm8lr6@cleo&gt;.</pre>
1387 </div>
1388 </div>
1389 </li>
1390 <li>
1391 <p><code>po/</code> comes from the localization coordinator, Jiang Xin:</p>
1392 <div class="literalblock">
1393 <div class="content">
1394 <pre>https://github.com/git-l10n/git-po/</pre>
1395 </div>
1396 </div>
1397 </li>
1398 </ul>
1399 </div>
1400 <div class="paragraph">
1401 <p>Patches to these parts should be based on their trees.</p>
1402 </div>
1403 <div class="ulist">
1404 <ul>
1405 <li>
1406 <p>The "Git documentation translations" project, led by Jean-Noël
1407 Avila, translates our documentation pages. Their work products are
1408 maintained separately from this project, not as part of our tree:</p>
1409 <div class="literalblock">
1410 <div class="content">
1411 <pre>https://github.com/jnavila/git-manpages-l10n/</pre>
1412 </div>
1413 </div>
1414 </li>
1415 </ul>
1416 </div>
1417 </div>
1418 </div>
1419 <div class="sect1">
1420 <h2 id="_github_ci">GitHub CI<a id="GHCI"></a></h2>
1421 <div class="sectionbody">
1422 <div class="paragraph">
1423 <p>With an account at GitHub, you can use GitHub CI to test your changes
1424 on Linux, Mac and Windows. See
1425 <a href="https://github.com/git/git/actions/workflows/main.yml" class="bare">https://github.com/git/git/actions/workflows/main.yml</a> for examples of
1426 recent CI runs.</p>
1427 </div>
1428 <div class="paragraph">
1429 <p>Follow these steps for the initial setup:</p>
1430 </div>
1431 <div class="olist arabic">
1432 <ol class="arabic">
1433 <li>
1434 <p>Fork <a href="https://github.com/git/git" class="bare">https://github.com/git/git</a> to your GitHub account.
1435 You can find detailed instructions how to fork here:
1436 <a href="https://help.github.com/articles/fork-a-repo/" class="bare">https://help.github.com/articles/fork-a-repo/</a></p>
1437 </li>
1438 </ol>
1439 </div>
1440 <div class="paragraph">
1441 <p>After the initial setup, CI will run whenever you push new changes
1442 to your fork of Git on GitHub. You can monitor the test state of all your
1443 branches here: <code>https://github.com/</code>&lt;Your <code>GitHub</code> <code>handle</code>&gt;<code>/git/actions/workflows/main.yml</code></p>
1444 </div>
1445 <div class="paragraph">
1446 <p>If a branch does not pass all test cases then it will be marked with a
1447 red <code>x</code>, instead of a green check. In that case, you can click on the
1448 failing job and navigate to "ci/run-build-and-tests.sh" and/or
1449 "ci/print-test-failures.sh". You can also download "Artifacts" which
1450 are zip archives containing tarred (or zipped) archives with test data
1451 relevant for debugging.</p>
1452 </div>
1453 <div class="paragraph">
1454 <p>Then fix the problem and push your fix to your GitHub fork. This will
1455 trigger a new CI build to ensure all tests pass.</p>
1456 </div>
1457 </div>
1458 </div>
1459 <div class="sect1">
1460 <h2 id="mua">MUA specific hints</h2>
1461 <div class="sectionbody">
1462 <div class="paragraph">
1463 <p>Some of the patches I receive or pick up from the list share common
1464 patterns of breakage. Please make sure your MUA is set up
1465 properly not to corrupt whitespaces.</p>
1466 </div>
1467 <div class="paragraph">
1468 <p>See the DISCUSSION section of <a href="git-format-patch.html">git-format-patch(1)</a> for hints on
1469 checking your patch by mailing it to yourself and applying with
1470 <a href="git-am.html">git-am(1)</a>.</p>
1471 </div>
1472 <div class="paragraph">
1473 <p>While you are at it, check the resulting commit log message from
1474 a trial run of applying the patch. If what is in the resulting
1475 commit is not exactly what you would want to see, it is very
1476 likely that your maintainer would end up hand editing the log
1477 message when he applies your patch. Things like "Hi, this is my
1478 first patch.\n", if you really want to put in the patch e-mail,
1479 should come after the three-dash line that signals the end of the
1480 commit message.</p>
1481 </div>
1482 <div class="sect2">
1483 <h3 id="_pine">Pine</h3>
1484 <div class="paragraph">
1485 <p>(Johannes Schindelin)</p>
1486 </div>
1487 <div class="literalblock">
1488 <div class="content">
1489 <pre>I don't know how many people still use pine, but for those poor
1490 souls it may be good to mention that the quell-flowed-text is
1491 needed for recent versions.
1493 ... the "no-strip-whitespace-before-send" option, too. AFAIK it
1494 was introduced in 4.60.</pre>
1495 </div>
1496 </div>
1497 <div class="paragraph">
1498 <p>(Linus Torvalds)</p>
1499 </div>
1500 <div class="literalblock">
1501 <div class="content">
1502 <pre>And 4.58 needs at least this.
1504 diff-tree 8326dd8350be64ac7fc805f6563a1d61ad10d32c (from e886a61f76edf5410573e92e38ce22974f9c40f1)
1505 Author: Linus Torvalds &lt;torvalds@g5.osdl.org&gt;
1506 Date: Mon Aug 15 17:23:51 2005 -0700
1508 Fix pine whitespace-corruption bug
1510 There's no excuse for unconditionally removing whitespace from
1511 the pico buffers on close.
1513 diff --git a/pico/pico.c b/pico/pico.c
1514 --- a/pico/pico.c
1515 +++ b/pico/pico.c
1516 @@ -219,7 +219,9 @@ PICO *pm;
1517 switch(pico_all_done){ /* prepare for/handle final events */
1518 case COMP_EXIT : /* already confirmed */
1519 packheader();
1520 +#if 0
1521 stripwhitespace();
1522 +#endif
1523 c |= COMP_EXIT;
1524 break;</pre>
1525 </div>
1526 </div>
1527 <div class="paragraph">
1528 <p>(Daniel Barkalow)</p>
1529 </div>
1530 <div class="literalblock">
1531 <div class="content">
1532 <pre>&gt; A patch to SubmittingPatches, MUA specific help section for
1533 &gt; users of Pine 4.63 would be very much appreciated.
1535 Ah, it looks like a recent version changed the default behavior to do the
1536 right thing, and inverted the sense of the configuration option. (Either
1537 that or Gentoo did it.) So you need to set the
1538 "no-strip-whitespace-before-send" option, unless the option you have is
1539 "strip-whitespace-before-send", in which case you should avoid checking
1540 it.</pre>
1541 </div>
1542 </div>
1543 </div>
1544 <div class="sect2">
1545 <h3 id="_thunderbird_kmail_gmail">Thunderbird, KMail, GMail</h3>
1546 <div class="paragraph">
1547 <p>See the MUA-SPECIFIC HINTS section of <a href="git-format-patch.html">git-format-patch(1)</a>.</p>
1548 </div>
1549 </div>
1550 <div class="sect2">
1551 <h3 id="_gnus">Gnus</h3>
1552 <div class="paragraph">
1553 <p>"|" in the *Summary* buffer can be used to pipe the current
1554 message to an external program, and this is a handy way to drive
1555 <code>git</code> <code>am</code>. However, if the message is MIME encoded, what is
1556 piped into the program is the representation you see in your
1557 *Article* buffer after unwrapping MIME. This is often not what
1558 you would want for two reasons. It tends to screw up non-ASCII
1559 characters (most notably in people&#8217;s names), and also
1560 whitespaces (fatal in patches). Running "C-u g" to display the
1561 message in raw form before using "|" to run the pipe can work
1562 this problem around.</p>
1563 </div>
1564 </div>
1565 </div>
1566 </div>
1567 </div>
1568 <div id="footnotes">
1569 <hr/>
1570 <div class="footnote" id="_footnotedef_1">
1571 <a href="#_footnoteref_1">1</a>. The Git Security mailing list: <a href="mailto:git-security@googlegroups.com">git-security@googlegroups.com</a>
1572 </div>
1573 <div class="footnote" id="_footnotedef_2">
1574 <a href="#_footnoteref_2">2</a>. Scripts under `contrib/` are not part of the core `git` binary and must be called directly. Clone the Git codebase and run `perl contrib/contacts/git-contacts`.
1575 </div>
1576 <div class="footnote" id="_footnotedef_3">
1577 <a href="#_footnoteref_3">3</a>. The current maintainer: <a href="mailto:gitster@pobox.com">gitster@pobox.com</a>
1578 </div>
1579 <div class="footnote" id="_footnotedef_4">
1580 <a href="#_footnoteref_4">4</a>. The mailing list: <a href="mailto:git@vger.kernel.org">git@vger.kernel.org</a>
1581 </div>
1582 </div>
1583 <div id="footer">
1584 <div id="footer-text">
1585 Last updated 2024-11-02 14:46:57 +0900
1586 </div>
1587 </div>
1588 </body>
1589 </html>