Autogenerated HTML docs for v2.46.0-540-g4c42d
[git-htmldocs.git] / git-format-patch.html
blob397ff15c6d1762a0def67824e2375e58601e4148
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>git-format-patch(1)</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="manpage">
442 <div id="header">
443 <h1>git-format-patch(1) Manual Page</h1>
444 <h2 id="_name">NAME</h2>
445 <div class="sectionbody">
446 <p>git-format-patch - Prepare patches for e-mail submission</p>
447 </div>
448 </div>
449 <div id="content">
450 <div class="sect1">
451 <h2 id="_synopsis">SYNOPSIS</h2>
452 <div class="sectionbody">
453 <div class="verseblock">
454 <pre class="content"><em>git format-patch</em> [-k] [(-o|--output-directory) &lt;dir&gt; | --stdout]
455 [--no-thread | --thread[=&lt;style&gt;]]
456 [(--attach|--inline)[=&lt;boundary&gt;] | --no-attach]
457 [-s | --signoff]
458 [--signature=&lt;signature&gt; | --no-signature]
459 [--signature-file=&lt;file&gt;]
460 [-n | --numbered | -N | --no-numbered]
461 [--start-number &lt;n&gt;] [--numbered-files]
462 [--in-reply-to=&lt;message-id&gt;] [--suffix=.&lt;sfx&gt;]
463 [--ignore-if-in-upstream] [--always]
464 [--cover-from-description=&lt;mode&gt;]
465 [--rfc[=&lt;rfc&gt;]] [--subject-prefix=&lt;subject-prefix&gt;]
466 [(--reroll-count|-v) &lt;n&gt;]
467 [--to=&lt;email&gt;] [--cc=&lt;email&gt;]
468 [--[no-]cover-letter] [--quiet]
469 [--[no-]encode-email-headers]
470 [--no-notes | --notes[=&lt;ref&gt;]]
471 [--interdiff=&lt;previous&gt;]
472 [--range-diff=&lt;previous&gt; [--creation-factor=&lt;percent&gt;]]
473 [--filename-max-length=&lt;n&gt;]
474 [--progress]
475 [&lt;common-diff-options&gt;]
476 [ &lt;since&gt; | &lt;revision-range&gt; ]</pre>
477 </div>
478 </div>
479 </div>
480 <div class="sect1">
481 <h2 id="_description">DESCRIPTION</h2>
482 <div class="sectionbody">
483 <div class="paragraph">
484 <p>Prepare each non-merge commit with its "patch" in
485 one "message" per commit, formatted to resemble a UNIX mailbox.
486 The output of this command is convenient for e-mail submission or
487 for use with <em>git am</em>.</p>
488 </div>
489 <div class="paragraph">
490 <p>A "message" generated by the command consists of three parts:</p>
491 </div>
492 <div class="ulist">
493 <ul>
494 <li>
495 <p>A brief metadata header that begins with <code>From &lt;commit&gt;</code>
496 with a fixed <code>Mon Sep 17 00:00:00 2001</code> datestamp to help programs
497 like "file(1)" to recognize that the file is an output from this
498 command, fields that record the author identity, the author date,
499 and the title of the change (taken from the first paragraph of the
500 commit log message).</p>
501 </li>
502 <li>
503 <p>The second and subsequent paragraphs of the commit log message.</p>
504 </li>
505 <li>
506 <p>The "patch", which is the "diff -p --stat" output (see
507 <a href="git-diff.html">git-diff(1)</a>) between the commit and its parent.</p>
508 </li>
509 </ul>
510 </div>
511 <div class="paragraph">
512 <p>The log message and the patch are separated by a line with a
513 three-dash line.</p>
514 </div>
515 <div class="paragraph">
516 <p>There are two ways to specify which commits to operate on.</p>
517 </div>
518 <div class="olist arabic">
519 <ol class="arabic">
520 <li>
521 <p>A single commit, &lt;since&gt;, specifies that the commits leading
522 to the tip of the current branch that are not in the history
523 that leads to the &lt;since&gt; to be output.</p>
524 </li>
525 <li>
526 <p>Generic &lt;revision-range&gt; expression (see "SPECIFYING
527 REVISIONS" section in <a href="gitrevisions.html">gitrevisions(7)</a>) means the
528 commits in the specified range.</p>
529 </li>
530 </ol>
531 </div>
532 <div class="paragraph">
533 <p>The first rule takes precedence in the case of a single &lt;commit&gt;. To
534 apply the second rule, i.e., format everything since the beginning of
535 history up until &lt;commit&gt;, use the <code>--root</code> option: <code>git format-patch
536 --root &lt;commit&gt;</code>. If you want to format only &lt;commit&gt; itself, you
537 can do this with <code>git format-patch -1 &lt;commit&gt;</code>.</p>
538 </div>
539 <div class="paragraph">
540 <p>By default, each output file is numbered sequentially from 1, and uses the
541 first line of the commit message (massaged for pathname safety) as
542 the filename. With the <code>--numbered-files</code> option, the output file names
543 will only be numbers, without the first line of the commit appended.
544 The names of the output files are printed to standard
545 output, unless the <code>--stdout</code> option is specified.</p>
546 </div>
547 <div class="paragraph">
548 <p>If <code>-o</code> is specified, output files are created in &lt;dir&gt;. Otherwise
549 they are created in the current working directory. The default path
550 can be set with the <code>format.outputDirectory</code> configuration option.
551 The <code>-o</code> option takes precedence over <code>format.outputDirectory</code>.
552 To store patches in the current working directory even when
553 <code>format.outputDirectory</code> points elsewhere, use <code>-o .</code>. All directory
554 components will be created.</p>
555 </div>
556 <div class="paragraph">
557 <p>By default, the subject of a single patch is "[PATCH] " followed by
558 the concatenation of lines from the commit message up to the first blank
559 line (see the DISCUSSION section of <a href="git-commit.html">git-commit(1)</a>).</p>
560 </div>
561 <div class="paragraph">
562 <p>When multiple patches are output, the subject prefix will instead be
563 "[PATCH n/m] ". To force 1/1 to be added for a single patch, use <code>-n</code>.
564 To omit patch numbers from the subject, use <code>-N</code>.</p>
565 </div>
566 <div class="paragraph">
567 <p>If given <code>--thread</code>, <code>git-format-patch</code> will generate <code>In-Reply-To</code> and
568 <code>References</code> headers to make the second and subsequent patch mails appear
569 as replies to the first mail; this also generates a <code>Message-ID</code> header to
570 reference.</p>
571 </div>
572 </div>
573 </div>
574 <div class="sect1">
575 <h2 id="_options">OPTIONS</h2>
576 <div class="sectionbody">
577 <div class="dlist">
578 <dl>
579 <dt class="hdlist1">-p</dt>
580 <dt class="hdlist1">--no-stat</dt>
581 <dd>
582 <p>Generate plain patches without any diffstats.</p>
583 </dd>
584 <dt class="hdlist1">-U&lt;n&gt;</dt>
585 <dt class="hdlist1">--unified=&lt;n&gt;</dt>
586 <dd>
587 <p>Generate diffs with &lt;n&gt; lines of context instead of
588 the usual three.</p>
589 </dd>
590 <dt class="hdlist1">--output=&lt;file&gt;</dt>
591 <dd>
592 <p>Output to a specific file instead of stdout.</p>
593 </dd>
594 <dt class="hdlist1">--output-indicator-new=&lt;char&gt;</dt>
595 <dt class="hdlist1">--output-indicator-old=&lt;char&gt;</dt>
596 <dt class="hdlist1">--output-indicator-context=&lt;char&gt;</dt>
597 <dd>
598 <p>Specify the character used to indicate new, old or context
599 lines in the generated patch. Normally they are <em>+</em>, <em>-</em> and
600 ' ' respectively.</p>
601 </dd>
602 <dt class="hdlist1">--indent-heuristic</dt>
603 <dd>
604 <p>Enable the heuristic that shifts diff hunk boundaries to make patches
605 easier to read. This is the default.</p>
606 </dd>
607 <dt class="hdlist1">--no-indent-heuristic</dt>
608 <dd>
609 <p>Disable the indent heuristic.</p>
610 </dd>
611 <dt class="hdlist1">--minimal</dt>
612 <dd>
613 <p>Spend extra time to make sure the smallest possible
614 diff is produced.</p>
615 </dd>
616 <dt class="hdlist1">--patience</dt>
617 <dd>
618 <p>Generate a diff using the "patience diff" algorithm.</p>
619 </dd>
620 <dt class="hdlist1">--histogram</dt>
621 <dd>
622 <p>Generate a diff using the "histogram diff" algorithm.</p>
623 </dd>
624 <dt class="hdlist1">--anchored=&lt;text&gt;</dt>
625 <dd>
626 <p>Generate a diff using the "anchored diff" algorithm.</p>
627 <div class="paragraph">
628 <p>This option may be specified more than once.</p>
629 </div>
630 <div class="paragraph">
631 <p>If a line exists in both the source and destination, exists only once,
632 and starts with this text, this algorithm attempts to prevent it from
633 appearing as a deletion or addition in the output. It uses the "patience
634 diff" algorithm internally.</p>
635 </div>
636 </dd>
637 <dt class="hdlist1">--diff-algorithm={patience|minimal|histogram|myers}</dt>
638 <dd>
639 <p>Choose a diff algorithm. The variants are as follows:</p>
640 <div class="openblock">
641 <div class="content">
642 <div class="dlist">
643 <dl>
644 <dt class="hdlist1"><code>default</code>, <code>myers</code></dt>
645 <dd>
646 <p>The basic greedy diff algorithm. Currently, this is the default.</p>
647 </dd>
648 <dt class="hdlist1"><code>minimal</code></dt>
649 <dd>
650 <p>Spend extra time to make sure the smallest possible diff is
651 produced.</p>
652 </dd>
653 <dt class="hdlist1"><code>patience</code></dt>
654 <dd>
655 <p>Use "patience diff" algorithm when generating patches.</p>
656 </dd>
657 <dt class="hdlist1"><code>histogram</code></dt>
658 <dd>
659 <p>This algorithm extends the patience algorithm to "support
660 low-occurrence common elements".</p>
661 </dd>
662 </dl>
663 </div>
664 </div>
665 </div>
666 <div class="paragraph">
667 <p>For instance, if you configured the <code>diff.algorithm</code> variable to a
668 non-default value and want to use the default one, then you
669 have to use <code>--diff-algorithm=default</code> option.</p>
670 </div>
671 </dd>
672 <dt class="hdlist1">--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]</dt>
673 <dd>
674 <p>Generate a diffstat. By default, as much space as necessary
675 will be used for the filename part, and the rest for the graph
676 part. Maximum width defaults to terminal width, or 80 columns
677 if not connected to a terminal, and can be overridden by
678 <code>&lt;width&gt;</code>. The width of the filename part can be limited by
679 giving another width <code>&lt;name-width&gt;</code> after a comma or by setting
680 <code>diff.statNameWidth=&lt;width&gt;</code>. The width of the graph part can be
681 limited by using <code>--stat-graph-width=&lt;width&gt;</code> or by setting
682 <code>diff.statGraphWidth=&lt;width&gt;</code>. Using <code>--stat</code> or
683 <code>--stat-graph-width</code> affects all commands generating a stat graph,
684 while setting <code>diff.statNameWidth</code> or <code>diff.statGraphWidth</code>
685 does not affect <code>git format-patch</code>.
686 By giving a third parameter <code>&lt;count&gt;</code>, you can limit the output to
687 the first <code>&lt;count&gt;</code> lines, followed by <code>...</code> if there are more.</p>
688 <div class="paragraph">
689 <p>These parameters can also be set individually with <code>--stat-width=&lt;width&gt;</code>,
690 <code>--stat-name-width=&lt;name-width&gt;</code> and <code>--stat-count=&lt;count&gt;</code>.</p>
691 </div>
692 </dd>
693 <dt class="hdlist1">--compact-summary</dt>
694 <dd>
695 <p>Output a condensed summary of extended header information such
696 as file creations or deletions ("new" or "gone", optionally "+l"
697 if it&#8217;s a symlink) and mode changes ("+x" or "-x" for adding
698 or removing executable bit respectively) in diffstat. The
699 information is put between the filename part and the graph
700 part. Implies <code>--stat</code>.</p>
701 </dd>
702 <dt class="hdlist1">--numstat</dt>
703 <dd>
704 <p>Similar to <code>--stat</code>, but shows number of added and
705 deleted lines in decimal notation and pathname without
706 abbreviation, to make it more machine friendly. For
707 binary files, outputs two <code>-</code> instead of saying
708 <code>0 0</code>.</p>
709 </dd>
710 <dt class="hdlist1">--shortstat</dt>
711 <dd>
712 <p>Output only the last line of the <code>--stat</code> format containing total
713 number of modified files, as well as number of added and deleted
714 lines.</p>
715 </dd>
716 <dt class="hdlist1">-X[&lt;param1,param2,&#8230;&#8203;&gt;]</dt>
717 <dt class="hdlist1">--dirstat[=&lt;param1,param2,&#8230;&#8203;&gt;]</dt>
718 <dd>
719 <p>Output the distribution of relative amount of changes for each
720 sub-directory. The behavior of <code>--dirstat</code> can be customized by
721 passing it a comma separated list of parameters.
722 The defaults are controlled by the <code>diff.dirstat</code> configuration
723 variable (see <a href="git-config.html">git-config(1)</a>).
724 The following parameters are available:</p>
725 <div class="openblock">
726 <div class="content">
727 <div class="dlist">
728 <dl>
729 <dt class="hdlist1"><code>changes</code></dt>
730 <dd>
731 <p>Compute the dirstat numbers by counting the lines that have been
732 removed from the source, or added to the destination. This ignores
733 the amount of pure code movements within a file. In other words,
734 rearranging lines in a file is not counted as much as other changes.
735 This is the default behavior when no parameter is given.</p>
736 </dd>
737 <dt class="hdlist1"><code>lines</code></dt>
738 <dd>
739 <p>Compute the dirstat numbers by doing the regular line-based diff
740 analysis, and summing the removed/added line counts. (For binary
741 files, count 64-byte chunks instead, since binary files have no
742 natural concept of lines). This is a more expensive <code>--dirstat</code>
743 behavior than the <code>changes</code> behavior, but it does count rearranged
744 lines within a file as much as other changes. The resulting output
745 is consistent with what you get from the other <code>--*stat</code> options.</p>
746 </dd>
747 <dt class="hdlist1"><code>files</code></dt>
748 <dd>
749 <p>Compute the dirstat numbers by counting the number of files changed.
750 Each changed file counts equally in the dirstat analysis. This is
751 the computationally cheapest <code>--dirstat</code> behavior, since it does
752 not have to look at the file contents at all.</p>
753 </dd>
754 <dt class="hdlist1"><code>cumulative</code></dt>
755 <dd>
756 <p>Count changes in a child directory for the parent directory as well.
757 Note that when using <code>cumulative</code>, the sum of the percentages
758 reported may exceed 100%. The default (non-cumulative) behavior can
759 be specified with the <code>noncumulative</code> parameter.</p>
760 </dd>
761 <dt class="hdlist1">&lt;limit&gt;</dt>
762 <dd>
763 <p>An integer parameter specifies a cut-off percent (3% by default).
764 Directories contributing less than this percentage of the changes
765 are not shown in the output.</p>
766 </dd>
767 </dl>
768 </div>
769 </div>
770 </div>
771 <div class="paragraph">
772 <p>Example: The following will count changed files, while ignoring
773 directories with less than 10% of the total amount of changed files,
774 and accumulating child directory counts in the parent directories:
775 <code>--dirstat=files,10,cumulative</code>.</p>
776 </div>
777 </dd>
778 <dt class="hdlist1">--cumulative</dt>
779 <dd>
780 <p>Synonym for --dirstat=cumulative</p>
781 </dd>
782 <dt class="hdlist1">--dirstat-by-file[=&lt;param1,param2&gt;&#8230;&#8203;]</dt>
783 <dd>
784 <p>Synonym for --dirstat=files,&lt;param1&gt;,&lt;param2&gt;&#8230;&#8203;</p>
785 </dd>
786 <dt class="hdlist1">--summary</dt>
787 <dd>
788 <p>Output a condensed summary of extended header information
789 such as creations, renames and mode changes.</p>
790 </dd>
791 <dt class="hdlist1">--no-renames</dt>
792 <dd>
793 <p>Turn off rename detection, even when the configuration
794 file gives the default to do so.</p>
795 </dd>
796 <dt class="hdlist1">--[no-]rename-empty</dt>
797 <dd>
798 <p>Whether to use empty blobs as rename source.</p>
799 </dd>
800 <dt class="hdlist1">--full-index</dt>
801 <dd>
802 <p>Instead of the first handful of characters, show the full
803 pre- and post-image blob object names on the "index"
804 line when generating patch format output.</p>
805 </dd>
806 <dt class="hdlist1">--binary</dt>
807 <dd>
808 <p>In addition to <code>--full-index</code>, output a binary diff that
809 can be applied with <code>git-apply</code>.</p>
810 </dd>
811 <dt class="hdlist1">--abbrev[=&lt;n&gt;]</dt>
812 <dd>
813 <p>Instead of showing the full 40-byte hexadecimal object
814 name in diff-raw format output and diff-tree header
815 lines, show the shortest prefix that is at least <em>&lt;n&gt;</em>
816 hexdigits long that uniquely refers the object.
817 In diff-patch output format, <code>--full-index</code> takes higher
818 precedence, i.e. if <code>--full-index</code> is specified, full blob
819 names will be shown regardless of <code>--abbrev</code>.
820 Non default number of digits can be specified with <code>--abbrev=&lt;n&gt;</code>.</p>
821 </dd>
822 <dt class="hdlist1">-B[&lt;n&gt;][/&lt;m&gt;]</dt>
823 <dt class="hdlist1">--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]</dt>
824 <dd>
825 <p>Break complete rewrite changes into pairs of delete and
826 create. This serves two purposes:</p>
827 <div class="paragraph">
828 <p>It affects the way a change that amounts to a total rewrite of a file
829 not as a series of deletion and insertion mixed together with a very
830 few lines that happen to match textually as the context, but as a
831 single deletion of everything old followed by a single insertion of
832 everything new, and the number <code>m</code> controls this aspect of the -B
833 option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the
834 original should remain in the result for Git to consider it a total
835 rewrite (i.e. otherwise the resulting patch will be a series of
836 deletion and insertion mixed together with context lines).</p>
837 </div>
838 <div class="paragraph">
839 <p>When used with -M, a totally-rewritten file is also considered as the
840 source of a rename (usually -M only considers a file that disappeared
841 as the source of a rename), and the number <code>n</code> controls this aspect of
842 the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with
843 addition and deletion compared to 20% or more of the file&#8217;s size are
844 eligible for being picked up as a possible source of a rename to
845 another file.</p>
846 </div>
847 </dd>
848 <dt class="hdlist1">-M[&lt;n&gt;]</dt>
849 <dt class="hdlist1">--find-renames[=&lt;n&gt;]</dt>
850 <dd>
851 <p>Detect renames.
852 If <code>n</code> is specified, it is a threshold on the similarity
853 index (i.e. amount of addition/deletions compared to the
854 file&#8217;s size). For example, <code>-M90%</code> means Git should consider a
855 delete/add pair to be a rename if more than 90% of the file
856 hasn&#8217;t changed. Without a <code>%</code> sign, the number is to be read as
857 a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
858 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is
859 the same as <code>-M5%</code>. To limit detection to exact renames, use
860 <code>-M100%</code>. The default similarity index is 50%.</p>
861 </dd>
862 <dt class="hdlist1">-C[&lt;n&gt;]</dt>
863 <dt class="hdlist1">--find-copies[=&lt;n&gt;]</dt>
864 <dd>
865 <p>Detect copies as well as renames. See also <code>--find-copies-harder</code>.
866 If <code>n</code> is specified, it has the same meaning as for <code>-M&lt;n&gt;</code>.</p>
867 </dd>
868 <dt class="hdlist1">--find-copies-harder</dt>
869 <dd>
870 <p>For performance reasons, by default, <code>-C</code> option finds copies only
871 if the original file of the copy was modified in the same
872 changeset. This flag makes the command
873 inspect unmodified files as candidates for the source of
874 copy. This is a very expensive operation for large
875 projects, so use it with caution. Giving more than one
876 <code>-C</code> option has the same effect.</p>
877 </dd>
878 <dt class="hdlist1">-D</dt>
879 <dt class="hdlist1">--irreversible-delete</dt>
880 <dd>
881 <p>Omit the preimage for deletes, i.e. print only the header but not
882 the diff between the preimage and <code>/dev/null</code>. The resulting patch
883 is not meant to be applied with <code>patch</code> or <code>git apply</code>; this is
884 solely for people who want to just concentrate on reviewing the
885 text after the change. In addition, the output obviously lacks
886 enough information to apply such a patch in reverse, even manually,
887 hence the name of the option.</p>
888 <div class="paragraph">
889 <p>When used together with <code>-B</code>, omit also the preimage in the deletion part
890 of a delete/create pair.</p>
891 </div>
892 </dd>
893 <dt class="hdlist1">-l&lt;num&gt;</dt>
894 <dd>
895 <p>The <code>-M</code> and <code>-C</code> options involve some preliminary steps that
896 can detect subsets of renames/copies cheaply, followed by an
897 exhaustive fallback portion that compares all remaining
898 unpaired destinations to all relevant sources. (For renames,
899 only remaining unpaired sources are relevant; for copies, all
900 original sources are relevant.) For N sources and
901 destinations, this exhaustive check is O(N^2). This option
902 prevents the exhaustive portion of rename/copy detection from
903 running if the number of source/destination files involved
904 exceeds the specified number. Defaults to diff.renameLimit.
905 Note that a value of 0 is treated as unlimited.</p>
906 </dd>
907 <dt class="hdlist1">-O&lt;orderfile&gt;</dt>
908 <dd>
909 <p>Control the order in which files appear in the output.
910 This overrides the <code>diff.orderFile</code> configuration variable
911 (see <a href="git-config.html">git-config(1)</a>). To cancel <code>diff.orderFile</code>,
912 use <code>-O/dev/null</code>.</p>
913 <div class="paragraph">
914 <p>The output order is determined by the order of glob patterns in
915 &lt;orderfile&gt;.
916 All files with pathnames that match the first pattern are output
917 first, all files with pathnames that match the second pattern (but not
918 the first) are output next, and so on.
919 All files with pathnames that do not match any pattern are output
920 last, as if there was an implicit match-all pattern at the end of the
921 file.
922 If multiple pathnames have the same rank (they match the same pattern
923 but no earlier patterns), their output order relative to each other is
924 the normal order.</p>
925 </div>
926 <div class="paragraph">
927 <p>&lt;orderfile&gt; is parsed as follows:</p>
928 </div>
929 <div class="openblock">
930 <div class="content">
931 <div class="ulist">
932 <ul>
933 <li>
934 <p>Blank lines are ignored, so they can be used as separators for
935 readability.</p>
936 </li>
937 <li>
938 <p>Lines starting with a hash ("<code>#</code>") are ignored, so they can be used
939 for comments. Add a backslash ("<code>\</code>") to the beginning of the
940 pattern if it starts with a hash.</p>
941 </li>
942 <li>
943 <p>Each other line contains a single pattern.</p>
944 </li>
945 </ul>
946 </div>
947 </div>
948 </div>
949 <div class="paragraph">
950 <p>Patterns have the same syntax and semantics as patterns used for
951 fnmatch(3) without the FNM_PATHNAME flag, except a pathname also
952 matches a pattern if removing any number of the final pathname
953 components matches the pattern. For example, the pattern "<code>foo*bar</code>"
954 matches "<code>fooasdfbar</code>" and "<code>foo/bar/baz/asdf</code>" but not "<code>foobarx</code>".</p>
955 </div>
956 </dd>
957 <dt class="hdlist1">--skip-to=&lt;file&gt;</dt>
958 <dt class="hdlist1">--rotate-to=&lt;file&gt;</dt>
959 <dd>
960 <p>Discard the files before the named &lt;file&gt; from the output
961 (i.e. <em>skip to</em>), or move them to the end of the output
962 (i.e. <em>rotate to</em>). These options were invented primarily for the use
963 of the <code>git difftool</code> command, and may not be very useful
964 otherwise.</p>
965 </dd>
966 <dt class="hdlist1">--relative[=&lt;path&gt;]</dt>
967 <dt class="hdlist1">--no-relative</dt>
968 <dd>
969 <p>When run from a subdirectory of the project, it can be
970 told to exclude changes outside the directory and show
971 pathnames relative to it with this option. When you are
972 not in a subdirectory (e.g. in a bare repository), you
973 can name which subdirectory to make the output relative
974 to by giving a &lt;path&gt; as an argument.
975 <code>--no-relative</code> can be used to countermand both <code>diff.relative</code> config
976 option and previous <code>--relative</code>.</p>
977 </dd>
978 <dt class="hdlist1">-a</dt>
979 <dt class="hdlist1">--text</dt>
980 <dd>
981 <p>Treat all files as text.</p>
982 </dd>
983 <dt class="hdlist1">--ignore-cr-at-eol</dt>
984 <dd>
985 <p>Ignore carriage-return at the end of line when doing a comparison.</p>
986 </dd>
987 <dt class="hdlist1">--ignore-space-at-eol</dt>
988 <dd>
989 <p>Ignore changes in whitespace at EOL.</p>
990 </dd>
991 <dt class="hdlist1">-b</dt>
992 <dt class="hdlist1">--ignore-space-change</dt>
993 <dd>
994 <p>Ignore changes in amount of whitespace. This ignores whitespace
995 at line end, and considers all other sequences of one or
996 more whitespace characters to be equivalent.</p>
997 </dd>
998 <dt class="hdlist1">-w</dt>
999 <dt class="hdlist1">--ignore-all-space</dt>
1000 <dd>
1001 <p>Ignore whitespace when comparing lines. This ignores
1002 differences even if one line has whitespace where the other
1003 line has none.</p>
1004 </dd>
1005 <dt class="hdlist1">--ignore-blank-lines</dt>
1006 <dd>
1007 <p>Ignore changes whose lines are all blank.</p>
1008 </dd>
1009 <dt class="hdlist1">-I&lt;regex&gt;</dt>
1010 <dt class="hdlist1">--ignore-matching-lines=&lt;regex&gt;</dt>
1011 <dd>
1012 <p>Ignore changes whose all lines match &lt;regex&gt;. This option may
1013 be specified more than once.</p>
1014 </dd>
1015 <dt class="hdlist1">--inter-hunk-context=&lt;lines&gt;</dt>
1016 <dd>
1017 <p>Show the context between diff hunks, up to the specified number
1018 of lines, thereby fusing hunks that are close to each other.
1019 Defaults to <code>diff.interHunkContext</code> or 0 if the config option
1020 is unset.</p>
1021 </dd>
1022 <dt class="hdlist1">-W</dt>
1023 <dt class="hdlist1">--function-context</dt>
1024 <dd>
1025 <p>Show whole function as context lines for each change.
1026 The function names are determined in the same way as
1027 <code>git diff</code> works out patch hunk headers (see <em>Defining a
1028 custom hunk-header</em> in <a href="gitattributes.html">gitattributes(5)</a>).</p>
1029 </dd>
1030 <dt class="hdlist1">--ext-diff</dt>
1031 <dd>
1032 <p>Allow an external diff helper to be executed. If you set an
1033 external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
1034 to use this option with <a href="git-log.html">git-log(1)</a> and friends.</p>
1035 </dd>
1036 <dt class="hdlist1">--no-ext-diff</dt>
1037 <dd>
1038 <p>Disallow external diff drivers.</p>
1039 </dd>
1040 <dt class="hdlist1">--textconv</dt>
1041 <dt class="hdlist1">--no-textconv</dt>
1042 <dd>
1043 <p>Allow (or disallow) external text conversion filters to be run
1044 when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
1045 details. Because textconv filters are typically a one-way
1046 conversion, the resulting diff is suitable for human
1047 consumption, but cannot be applied. For this reason, textconv
1048 filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
1049 <a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or
1050 diff plumbing commands.</p>
1051 </dd>
1052 <dt class="hdlist1">--ignore-submodules[=&lt;when&gt;]</dt>
1053 <dd>
1054 <p>Ignore changes to submodules in the diff generation. &lt;when&gt; can be
1055 either "none", "untracked", "dirty" or "all", which is the default.
1056 Using "none" will consider the submodule modified when it either contains
1057 untracked or modified files or its HEAD differs from the commit recorded
1058 in the superproject and can be used to override any settings of the
1059 <em>ignore</em> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When
1060 "untracked" is used submodules are not considered dirty when they only
1061 contain untracked content (but they are still scanned for modified
1062 content). Using "dirty" ignores all changes to the work tree of submodules,
1063 only changes to the commits stored in the superproject are shown (this was
1064 the behavior until 1.7.0). Using "all" hides all changes to submodules.</p>
1065 </dd>
1066 <dt class="hdlist1">--src-prefix=&lt;prefix&gt;</dt>
1067 <dd>
1068 <p>Show the given source prefix instead of "a/".</p>
1069 </dd>
1070 <dt class="hdlist1">--dst-prefix=&lt;prefix&gt;</dt>
1071 <dd>
1072 <p>Show the given destination prefix instead of "b/".</p>
1073 </dd>
1074 <dt class="hdlist1">--no-prefix</dt>
1075 <dd>
1076 <p>Do not show any source or destination prefix.</p>
1077 </dd>
1078 <dt class="hdlist1">--default-prefix</dt>
1079 <dd>
1080 <p>Use the default source and destination prefixes ("a/" and "b/").
1081 This overrides configuration variables such as <code>diff.noprefix</code>,
1082 <code>diff.srcPrefix</code>, <code>diff.dstPrefix</code>, and <code>diff.mnemonicPrefix</code>
1083 (see <code>git-config</code>(1)).</p>
1084 </dd>
1085 <dt class="hdlist1">--line-prefix=&lt;prefix&gt;</dt>
1086 <dd>
1087 <p>Prepend an additional prefix to every line of output.</p>
1088 </dd>
1089 <dt class="hdlist1">--ita-invisible-in-index</dt>
1090 <dd>
1091 <p>By default entries added by "git add -N" appear as an existing
1092 empty file in "git diff" and a new file in "git diff --cached".
1093 This option makes the entry appear as a new file in "git diff"
1094 and non-existent in "git diff --cached". This option could be
1095 reverted with <code>--ita-visible-in-index</code>. Both options are
1096 experimental and could be removed in future.</p>
1097 </dd>
1098 </dl>
1099 </div>
1100 <div class="paragraph">
1101 <p>For more detailed explanation on these common options, see also
1102 <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p>
1103 </div>
1104 <div class="dlist">
1105 <dl>
1106 <dt class="hdlist1">-&lt;n&gt;</dt>
1107 <dd>
1108 <p>Prepare patches from the topmost &lt;n&gt; commits.</p>
1109 </dd>
1110 <dt class="hdlist1">-o &lt;dir&gt;</dt>
1111 <dt class="hdlist1">--output-directory &lt;dir&gt;</dt>
1112 <dd>
1113 <p>Use &lt;dir&gt; to store the resulting files, instead of the
1114 current working directory.</p>
1115 </dd>
1116 <dt class="hdlist1">-n</dt>
1117 <dt class="hdlist1">--numbered</dt>
1118 <dd>
1119 <p>Name output in <em>[PATCH n/m]</em> format, even with a single patch.</p>
1120 </dd>
1121 <dt class="hdlist1">-N</dt>
1122 <dt class="hdlist1">--no-numbered</dt>
1123 <dd>
1124 <p>Name output in <em>[PATCH]</em> format.</p>
1125 </dd>
1126 <dt class="hdlist1">--start-number &lt;n&gt;</dt>
1127 <dd>
1128 <p>Start numbering the patches at &lt;n&gt; instead of 1.</p>
1129 </dd>
1130 <dt class="hdlist1">--numbered-files</dt>
1131 <dd>
1132 <p>Output file names will be a simple number sequence
1133 without the default first line of the commit appended.</p>
1134 </dd>
1135 <dt class="hdlist1">-k</dt>
1136 <dt class="hdlist1">--keep-subject</dt>
1137 <dd>
1138 <p>Do not strip/add <em>[PATCH]</em> from the first line of the
1139 commit log message.</p>
1140 </dd>
1141 <dt class="hdlist1">-s</dt>
1142 <dt class="hdlist1">--signoff</dt>
1143 <dd>
1144 <p>Add a <code>Signed-off-by</code> trailer to the commit message, using
1145 the committer identity of yourself.
1146 See the signoff option in <a href="git-commit.html">git-commit(1)</a> for more information.</p>
1147 </dd>
1148 <dt class="hdlist1">--stdout</dt>
1149 <dd>
1150 <p>Print all commits to the standard output in mbox format,
1151 instead of creating a file for each one.</p>
1152 </dd>
1153 <dt class="hdlist1">--attach[=&lt;boundary&gt;]</dt>
1154 <dd>
1155 <p>Create multipart/mixed attachment, the first part of
1156 which is the commit message and the patch itself in the
1157 second part, with <code>Content-Disposition: attachment</code>.</p>
1158 </dd>
1159 <dt class="hdlist1">--no-attach</dt>
1160 <dd>
1161 <p>Disable the creation of an attachment, overriding the
1162 configuration setting.</p>
1163 </dd>
1164 <dt class="hdlist1">--inline[=&lt;boundary&gt;]</dt>
1165 <dd>
1166 <p>Create multipart/mixed attachment, the first part of
1167 which is the commit message and the patch itself in the
1168 second part, with <code>Content-Disposition: inline</code>.</p>
1169 </dd>
1170 <dt class="hdlist1">--thread[=&lt;style&gt;]</dt>
1171 <dt class="hdlist1">--no-thread</dt>
1172 <dd>
1173 <p>Controls addition of <code>In-Reply-To</code> and <code>References</code> headers to
1174 make the second and subsequent mails appear as replies to the
1175 first. Also controls generation of the <code>Message-ID</code> header to
1176 reference.</p>
1177 <div class="paragraph">
1178 <p>The optional &lt;style&gt; argument can be either <code>shallow</code> or <code>deep</code>.
1179 <em>shallow</em> threading makes every mail a reply to the head of the
1180 series, where the head is chosen from the cover letter, the
1181 <code>--in-reply-to</code>, and the first patch mail, in this order. <em>deep</em>
1182 threading makes every mail a reply to the previous one.</p>
1183 </div>
1184 <div class="paragraph">
1185 <p>The default is <code>--no-thread</code>, unless the <code>format.thread</code> configuration
1186 is set. <code>--thread</code> without an argument is equivalent to <code>--thread=shallow</code>.</p>
1187 </div>
1188 <div class="paragraph">
1189 <p>Beware that the default for <em>git send-email</em> is to thread emails
1190 itself. If you want <code>git format-patch</code> to take care of threading, you
1191 will want to ensure that threading is disabled for <code>git send-email</code>.</p>
1192 </div>
1193 </dd>
1194 <dt class="hdlist1">--in-reply-to=&lt;message-id&gt;</dt>
1195 <dd>
1196 <p>Make the first mail (or all the mails with <code>--no-thread</code>) appear as a
1197 reply to the given &lt;message-id&gt;, which avoids breaking threads to
1198 provide a new patch series.</p>
1199 </dd>
1200 <dt class="hdlist1">--ignore-if-in-upstream</dt>
1201 <dd>
1202 <p>Do not include a patch that matches a commit in
1203 &lt;until&gt;..&lt;since&gt;. This will examine all patches reachable
1204 from &lt;since&gt; but not from &lt;until&gt; and compare them with the
1205 patches being generated, and any patch that matches is
1206 ignored.</p>
1207 </dd>
1208 <dt class="hdlist1">--always</dt>
1209 <dd>
1210 <p>Include patches for commits that do not introduce any change,
1211 which are omitted by default.</p>
1212 </dd>
1213 <dt class="hdlist1">--cover-from-description=&lt;mode&gt;</dt>
1214 <dd>
1215 <p>Controls which parts of the cover letter will be automatically
1216 populated using the branch&#8217;s description.</p>
1217 <div class="paragraph">
1218 <p>If <code>&lt;mode&gt;</code> is <code>message</code> or <code>default</code>, the cover letter subject will be
1219 populated with placeholder text. The body of the cover letter will be
1220 populated with the branch&#8217;s description. This is the default mode when
1221 no configuration nor command line option is specified.</p>
1222 </div>
1223 <div class="paragraph">
1224 <p>If <code>&lt;mode&gt;</code> is <code>subject</code>, the first paragraph of the branch description will
1225 populate the cover letter subject. The remainder of the description will
1226 populate the body of the cover letter.</p>
1227 </div>
1228 <div class="paragraph">
1229 <p>If <code>&lt;mode&gt;</code> is <code>auto</code>, if the first paragraph of the branch description
1230 is greater than 100 bytes, then the mode will be <code>message</code>, otherwise
1231 <code>subject</code> will be used.</p>
1232 </div>
1233 <div class="paragraph">
1234 <p>If <code>&lt;mode&gt;</code> is <code>none</code>, both the cover letter subject and body will be
1235 populated with placeholder text.</p>
1236 </div>
1237 </dd>
1238 <dt class="hdlist1">--description-file=&lt;file&gt;</dt>
1239 <dd>
1240 <p>Use the contents of &lt;file&gt; instead of the branch&#8217;s description
1241 for generating the cover letter.</p>
1242 </dd>
1243 <dt class="hdlist1">--subject-prefix=&lt;subject-prefix&gt;</dt>
1244 <dd>
1245 <p>Instead of the standard <em>[PATCH]</em> prefix in the subject
1246 line, instead use <em>[&lt;subject-prefix&gt;]</em>. This can be used
1247 to name a patch series, and can be combined with the
1248 <code>--numbered</code> option.</p>
1249 <div class="paragraph">
1250 <p>The configuration variable <code>format.subjectPrefix</code> may also be used
1251 to configure a subject prefix to apply to a given repository for
1252 all patches. This is often useful on mailing lists which receive
1253 patches for several repositories and can be used to disambiguate
1254 the patches (with a value of e.g. "PATCH my-project").</p>
1255 </div>
1256 </dd>
1257 <dt class="hdlist1">--filename-max-length=&lt;n&gt;</dt>
1258 <dd>
1259 <p>Instead of the standard 64 bytes, chomp the generated output
1260 filenames at around <em>&lt;n&gt;</em> bytes (too short a value will be
1261 silently raised to a reasonable length). Defaults to the
1262 value of the <code>format.filenameMaxLength</code> configuration
1263 variable, or 64 if unconfigured.</p>
1264 </dd>
1265 <dt class="hdlist1">--rfc[=&lt;rfc&gt;]</dt>
1266 <dd>
1267 <p>Prepends the string <em>&lt;rfc&gt;</em> (defaults to "RFC") to
1268 the subject prefix. As the subject prefix defaults to
1269 "PATCH", you&#8217;ll get "RFC PATCH" by default.</p>
1270 <div class="paragraph">
1271 <p>RFC means "Request For Comments"; use this when sending
1272 an experimental patch for discussion rather than application.
1273 "--rfc=WIP" may also be a useful way to indicate that a patch
1274 is not complete yet ("WIP" stands for "Work In Progress").</p>
1275 </div>
1276 <div class="paragraph">
1277 <p>If the convention of the receiving community for a particular extra
1278 string is to have it <em>after</em> the subject prefix, the string <em>&lt;rfc&gt;</em>
1279 can be prefixed with a dash ("<code>-</code>") to signal that the the rest of
1280 the <em>&lt;rfc&gt;</em> string should be appended to the subject prefix instead,
1281 e.g., <code>--rfc='-(WIP)'</code> results in "PATCH (WIP)".</p>
1282 </div>
1283 </dd>
1284 <dt class="hdlist1">-v &lt;n&gt;</dt>
1285 <dt class="hdlist1">--reroll-count=&lt;n&gt;</dt>
1286 <dd>
1287 <p>Mark the series as the &lt;n&gt;-th iteration of the topic. The
1288 output filenames have <code>v&lt;n&gt;</code> prepended to them, and the
1289 subject prefix ("PATCH" by default, but configurable via the
1290 <code>--subject-prefix</code> option) has ` v&lt;n&gt;` appended to it. E.g.
1291 <code>--reroll-count=4</code> may produce <code>v4-0001-add-makefile.patch</code>
1292 file that has "Subject: [PATCH v4 1/20] Add makefile" in it.
1293 <code>&lt;n&gt;</code> does not have to be an integer (e.g. "--reroll-count=4.4",
1294 or "--reroll-count=4rev2" are allowed), but the downside of
1295 using such a reroll-count is that the range-diff/interdiff
1296 with the previous version does not state exactly which
1297 version the new iteration is compared against.</p>
1298 </dd>
1299 <dt class="hdlist1">--to=&lt;email&gt;</dt>
1300 <dd>
1301 <p>Add a <code>To:</code> header to the email headers. This is in addition
1302 to any configured headers, and may be used multiple times.
1303 The negated form <code>--no-to</code> discards all <code>To:</code> headers added so
1304 far (from config or command line).</p>
1305 </dd>
1306 <dt class="hdlist1">--cc=&lt;email&gt;</dt>
1307 <dd>
1308 <p>Add a <code>Cc:</code> header to the email headers. This is in addition
1309 to any configured headers, and may be used multiple times.
1310 The negated form <code>--no-cc</code> discards all <code>Cc:</code> headers added so
1311 far (from config or command line).</p>
1312 </dd>
1313 <dt class="hdlist1">--from</dt>
1314 <dt class="hdlist1">--from=&lt;ident&gt;</dt>
1315 <dd>
1316 <p>Use <code>ident</code> in the <code>From:</code> header of each commit email. If the
1317 author ident of the commit is not textually identical to the
1318 provided <code>ident</code>, place a <code>From:</code> header in the body of the
1319 message with the original author. If no <code>ident</code> is given, use
1320 the committer ident.</p>
1321 <div class="paragraph">
1322 <p>Note that this option is only useful if you are actually sending the
1323 emails and want to identify yourself as the sender, but retain the
1324 original author (and <code>git am</code> will correctly pick up the in-body
1325 header). Note also that <code>git send-email</code> already handles this
1326 transformation for you, and this option should not be used if you are
1327 feeding the result to <code>git send-email</code>.</p>
1328 </div>
1329 </dd>
1330 <dt class="hdlist1">--[no-]force-in-body-from</dt>
1331 <dd>
1332 <p>With the e-mail sender specified via the <code>--from</code> option, by
1333 default, an in-body "From:" to identify the real author of
1334 the commit is added at the top of the commit log message if
1335 the sender is different from the author. With this option,
1336 the in-body "From:" is added even when the sender and the
1337 author have the same name and address, which may help if the
1338 mailing list software mangles the sender&#8217;s identity.
1339 Defaults to the value of the <code>format.forceInBodyFrom</code>
1340 configuration variable.</p>
1341 </dd>
1342 <dt class="hdlist1">--add-header=&lt;header&gt;</dt>
1343 <dd>
1344 <p>Add an arbitrary header to the email headers. This is in addition
1345 to any configured headers, and may be used multiple times.
1346 For example, <code>--add-header="Organization: git-foo"</code>.
1347 The negated form <code>--no-add-header</code> discards <strong>all</strong> (<code>To:</code>,
1348 <code>Cc:</code>, and custom) headers added so far from config or command
1349 line.</p>
1350 </dd>
1351 <dt class="hdlist1">--[no-]cover-letter</dt>
1352 <dd>
1353 <p>In addition to the patches, generate a cover letter file
1354 containing the branch description, shortlog and the overall diffstat. You can
1355 fill in a description in the file before sending it out.</p>
1356 </dd>
1357 <dt class="hdlist1">--encode-email-headers</dt>
1358 <dt class="hdlist1">--no-encode-email-headers</dt>
1359 <dd>
1360 <p>Encode email headers that have non-ASCII characters with
1361 "Q-encoding" (described in RFC 2047), instead of outputting the
1362 headers verbatim. Defaults to the value of the
1363 <code>format.encodeEmailHeaders</code> configuration variable.</p>
1364 </dd>
1365 <dt class="hdlist1">--interdiff=&lt;previous&gt;</dt>
1366 <dd>
1367 <p>As a reviewer aid, insert an interdiff into the cover letter,
1368 or as commentary of the lone patch of a 1-patch series, showing
1369 the differences between the previous version of the patch series and
1370 the series currently being formatted. <code>previous</code> is a single revision
1371 naming the tip of the previous series which shares a common base with
1372 the series being formatted (for example <code>git format-patch
1373 --cover-letter --interdiff=feature/v1 -3 feature/v2</code>).</p>
1374 </dd>
1375 <dt class="hdlist1">--range-diff=&lt;previous&gt;</dt>
1376 <dd>
1377 <p>As a reviewer aid, insert a range-diff (see <a href="git-range-diff.html">git-range-diff(1)</a>)
1378 into the cover letter, or as commentary of the lone patch of a
1379 1-patch series, showing the differences between the previous
1380 version of the patch series and the series currently being formatted.
1381 <code>previous</code> can be a single revision naming the tip of the previous
1382 series if it shares a common base with the series being formatted (for
1383 example <code>git format-patch --cover-letter --range-diff=feature/v1 -3
1384 feature/v2</code>), or a revision range if the two versions of the series are
1385 disjoint (for example <code>git format-patch --cover-letter
1386 --range-diff=feature/v1~3..feature/v1 -3 feature/v2</code>).</p>
1387 <div class="paragraph">
1388 <p>Note that diff options passed to the command affect how the primary
1389 product of <code>format-patch</code> is generated, and they are not passed to
1390 the underlying <code>range-diff</code> machinery used to generate the cover-letter
1391 material (this may change in the future).</p>
1392 </div>
1393 </dd>
1394 <dt class="hdlist1">--creation-factor=&lt;percent&gt;</dt>
1395 <dd>
1396 <p>Used with <code>--range-diff</code>, tweak the heuristic which matches up commits
1397 between the previous and current series of patches by adjusting the
1398 creation/deletion cost fudge factor. See <a href="git-range-diff.html">git-range-diff(1)</a>)
1399 for details.</p>
1400 <div class="paragraph">
1401 <p>Defaults to 999 (the <a href="git-range-diff.html">git-range-diff(1)</a> uses 60), as the use
1402 case is to show comparison with an older iteration of the same
1403 topic and the tool should find more correspondence between the two
1404 sets of patches.</p>
1405 </div>
1406 </dd>
1407 <dt class="hdlist1">--notes[=&lt;ref&gt;]</dt>
1408 <dt class="hdlist1">--no-notes</dt>
1409 <dd>
1410 <p>Append the notes (see <a href="git-notes.html">git-notes(1)</a>) for the commit
1411 after the three-dash line.</p>
1412 <div class="paragraph">
1413 <p>The expected use case of this is to write supporting explanation for
1414 the commit that does not belong to the commit log message proper,
1415 and include it with the patch submission. While one can simply write
1416 these explanations after <code>format-patch</code> has run but before sending,
1417 keeping them as Git notes allows them to be maintained between versions
1418 of the patch series (but see the discussion of the <code>notes.rewrite</code>
1419 configuration options in <a href="git-notes.html">git-notes(1)</a> to use this workflow).</p>
1420 </div>
1421 <div class="paragraph">
1422 <p>The default is <code>--no-notes</code>, unless the <code>format.notes</code> configuration is
1423 set.</p>
1424 </div>
1425 </dd>
1426 <dt class="hdlist1">--[no-]signature=&lt;signature&gt;</dt>
1427 <dd>
1428 <p>Add a signature to each message produced. Per RFC 3676 the signature
1429 is separated from the body by a line with '-- ' on it. If the
1430 signature option is omitted the signature defaults to the Git version
1431 number.</p>
1432 </dd>
1433 <dt class="hdlist1">--signature-file=&lt;file&gt;</dt>
1434 <dd>
1435 <p>Works just like --signature except the signature is read from a file.</p>
1436 </dd>
1437 <dt class="hdlist1">--suffix=.&lt;sfx&gt;</dt>
1438 <dd>
1439 <p>Instead of using <code>.patch</code> as the suffix for generated
1440 filenames, use specified suffix. A common alternative is
1441 <code>--suffix=.txt</code>. Leaving this empty will remove the <code>.patch</code>
1442 suffix.</p>
1443 <div class="paragraph">
1444 <p>Note that the leading character does not have to be a dot; for example,
1445 you can use <code>--suffix=-patch</code> to get <code>0001-description-of-my-change-patch</code>.</p>
1446 </div>
1447 </dd>
1448 <dt class="hdlist1">-q</dt>
1449 <dt class="hdlist1">--quiet</dt>
1450 <dd>
1451 <p>Do not print the names of the generated files to standard output.</p>
1452 </dd>
1453 <dt class="hdlist1">--no-binary</dt>
1454 <dd>
1455 <p>Do not output contents of changes in binary files, instead
1456 display a notice that those files changed. Patches generated
1457 using this option cannot be applied properly, but they are
1458 still useful for code review.</p>
1459 </dd>
1460 <dt class="hdlist1">--zero-commit</dt>
1461 <dd>
1462 <p>Output an all-zero hash in each patch&#8217;s From header instead
1463 of the hash of the commit.</p>
1464 </dd>
1465 <dt class="hdlist1">--[no-]base[=&lt;commit&gt;]</dt>
1466 <dd>
1467 <p>Record the base tree information to identify the state the
1468 patch series applies to. See the BASE TREE INFORMATION section
1469 below for details. If &lt;commit&gt; is "auto", a base commit is
1470 automatically chosen. The <code>--no-base</code> option overrides a
1471 <code>format.useAutoBase</code> configuration.</p>
1472 </dd>
1473 <dt class="hdlist1">--root</dt>
1474 <dd>
1475 <p>Treat the revision argument as a &lt;revision-range&gt;, even if it
1476 is just a single commit (that would normally be treated as a
1477 &lt;since&gt;). Note that root commits included in the specified
1478 range are always formatted as creation patches, independently
1479 of this flag.</p>
1480 </dd>
1481 <dt class="hdlist1">--progress</dt>
1482 <dd>
1483 <p>Show progress reports on stderr as patches are generated.</p>
1484 </dd>
1485 </dl>
1486 </div>
1487 </div>
1488 </div>
1489 <div class="sect1">
1490 <h2 id="_configuration">CONFIGURATION</h2>
1491 <div class="sectionbody">
1492 <div class="paragraph">
1493 <p>You can specify extra mail header lines to be added to each message,
1494 defaults for the subject prefix and file suffix, number patches when
1495 outputting more than one patch, add "To:" or "Cc:" headers, configure
1496 attachments, change the patch output directory, and sign off patches
1497 with configuration variables.</p>
1498 </div>
1499 <div class="listingblock">
1500 <div class="content">
1501 <pre>[format]
1502 headers = "Organization: git-foo\n"
1503 subjectPrefix = CHANGE
1504 suffix = .txt
1505 numbered = auto
1506 to = &lt;email&gt;
1507 cc = &lt;email&gt;
1508 attach [ = mime-boundary-string ]
1509 signOff = true
1510 outputDirectory = &lt;directory&gt;
1511 coverLetter = auto
1512 coverFromDescription = auto</pre>
1513 </div>
1514 </div>
1515 </div>
1516 </div>
1517 <div class="sect1">
1518 <h2 id="_discussion">DISCUSSION</h2>
1519 <div class="sectionbody">
1520 <div class="paragraph">
1521 <p>The patch produced by <em>git format-patch</em> is in UNIX mailbox format,
1522 with a fixed "magic" time stamp to indicate that the file is output
1523 from format-patch rather than a real mailbox, like so:</p>
1524 </div>
1525 <div class="listingblock">
1526 <div class="content">
1527 <pre>From 8f72bad1baf19a53459661343e21d6491c3908d3 Mon Sep 17 00:00:00 2001
1528 From: Tony Luck &lt;tony.luck@intel.com&gt;
1529 Date: Tue, 13 Jul 2010 11:42:54 -0700
1530 Subject: [PATCH] =?UTF-8?q?[IA64]=20Put=20ia64=20config=20files=20on=20the=20?=
1531 =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20diet?=
1532 MIME-Version: 1.0
1533 Content-Type: text/plain; charset=UTF-8
1534 Content-Transfer-Encoding: 8bit
1536 arch/arm config files were slimmed down using a python script
1537 (See commit c2330e286f68f1c408b4aa6515ba49d57f05beae comment)
1539 Do the same for ia64 so we can have sleek &amp; trim looking
1540 ...</pre>
1541 </div>
1542 </div>
1543 <div class="paragraph">
1544 <p>Typically it will be placed in a MUA&#8217;s drafts folder, edited to add
1545 timely commentary that should not go in the changelog after the three
1546 dashes, and then sent as a message whose body, in our example, starts
1547 with "arch/arm config files were&#8230;&#8203;". On the receiving end, readers
1548 can save interesting patches in a UNIX mailbox and apply them with
1549 <a href="git-am.html">git-am(1)</a>.</p>
1550 </div>
1551 <div class="paragraph">
1552 <p>When a patch is part of an ongoing discussion, the patch generated by
1553 <em>git format-patch</em> can be tweaked to take advantage of the <em>git am
1554 --scissors</em> feature. After your response to the discussion comes a
1555 line that consists solely of "<code>-- &gt;8 --</code>" (scissors and perforation),
1556 followed by the patch with unnecessary header fields removed:</p>
1557 </div>
1558 <div class="listingblock">
1559 <div class="content">
1560 <pre>...
1561 &gt; So we should do such-and-such.
1563 Makes sense to me. How about this patch?
1565 -- &gt;8 --
1566 Subject: [IA64] Put ia64 config files on the Uwe Kleine-König diet
1568 arch/arm config files were slimmed down using a python script
1569 ...</pre>
1570 </div>
1571 </div>
1572 <div class="paragraph">
1573 <p>When sending a patch this way, most often you are sending your own
1574 patch, so in addition to the "<code>From $SHA1 $magic_timestamp</code>" marker you
1575 should omit <code>From:</code> and <code>Date:</code> lines from the patch file. The patch
1576 title is likely to be different from the subject of the discussion the
1577 patch is in response to, so it is likely that you would want to keep
1578 the Subject: line, like the example above.</p>
1579 </div>
1580 <div class="sect2">
1581 <h3 id="_checking_for_patch_corruption">Checking for patch corruption</h3>
1582 <div class="paragraph">
1583 <p>Many mailers if not set up properly will corrupt whitespace. Here are
1584 two common types of corruption:</p>
1585 </div>
1586 <div class="ulist">
1587 <ul>
1588 <li>
1589 <p>Empty context lines that do not have <em>any</em> whitespace.</p>
1590 </li>
1591 <li>
1592 <p>Non-empty context lines that have one extra whitespace at the
1593 beginning.</p>
1594 </li>
1595 </ul>
1596 </div>
1597 <div class="paragraph">
1598 <p>One way to test if your MUA is set up correctly is:</p>
1599 </div>
1600 <div class="ulist">
1601 <ul>
1602 <li>
1603 <p>Send the patch to yourself, exactly the way you would, except
1604 with To: and Cc: lines that do not contain the list and
1605 maintainer address.</p>
1606 </li>
1607 <li>
1608 <p>Save that patch to a file in UNIX mailbox format. Call it a.patch,
1609 say.</p>
1610 </li>
1611 <li>
1612 <p>Apply it:</p>
1613 <div class="literalblock">
1614 <div class="content">
1615 <pre>$ git fetch &lt;project&gt; master:test-apply
1616 $ git switch test-apply
1617 $ git restore --source=HEAD --staged --worktree :/
1618 $ git am a.patch</pre>
1619 </div>
1620 </div>
1621 </li>
1622 </ul>
1623 </div>
1624 <div class="paragraph">
1625 <p>If it does not apply correctly, there can be various reasons.</p>
1626 </div>
1627 <div class="ulist">
1628 <ul>
1629 <li>
1630 <p>The patch itself does not apply cleanly. That is <em>bad</em> but
1631 does not have much to do with your MUA. You might want to rebase
1632 the patch with <a href="git-rebase.html">git-rebase(1)</a> before regenerating it in
1633 this case.</p>
1634 </li>
1635 <li>
1636 <p>The MUA corrupted your patch; "am" would complain that
1637 the patch does not apply. Look in the .git/rebase-apply/ subdirectory and
1638 see what <em>patch</em> file contains and check for the common
1639 corruption patterns mentioned above.</p>
1640 </li>
1641 <li>
1642 <p>While at it, check the <em>info</em> and <em>final-commit</em> files as well.
1643 If what is in <em>final-commit</em> is not exactly what you would want to
1644 see in the commit log message, it is very likely that the
1645 receiver would end up hand editing the log message when applying
1646 your patch. Things like "Hi, this is my first patch.\n" in the
1647 patch e-mail should come after the three-dash line that signals
1648 the end of the commit message.</p>
1649 </li>
1650 </ul>
1651 </div>
1652 </div>
1653 </div>
1654 </div>
1655 <div class="sect1">
1656 <h2 id="_mua_specific_hints">MUA-SPECIFIC HINTS</h2>
1657 <div class="sectionbody">
1658 <div class="paragraph">
1659 <p>Here are some hints on how to successfully submit patches inline using
1660 various mailers.</p>
1661 </div>
1662 <div class="sect2">
1663 <h3 id="_gmail">GMail</h3>
1664 <div class="paragraph">
1665 <p>GMail does not have any way to turn off line wrapping in the web
1666 interface, so it will mangle any emails that you send. You can however
1667 use "git send-email" and send your patches through the GMail SMTP server, or
1668 use any IMAP email client to connect to the google IMAP server and forward
1669 the emails through that.</p>
1670 </div>
1671 <div class="paragraph">
1672 <p>For hints on using <em>git send-email</em> to send your patches through the
1673 GMail SMTP server, see the EXAMPLE section of <a href="git-send-email.html">git-send-email(1)</a>.</p>
1674 </div>
1675 <div class="paragraph">
1676 <p>For hints on submission using the IMAP interface, see the EXAMPLE
1677 section of <a href="git-imap-send.html">git-imap-send(1)</a>.</p>
1678 </div>
1679 </div>
1680 <div class="sect2">
1681 <h3 id="_thunderbird">Thunderbird</h3>
1682 <div class="paragraph">
1683 <p>By default, Thunderbird will both wrap emails as well as flag
1684 them as being <em>format=flowed</em>, both of which will make the
1685 resulting email unusable by Git.</p>
1686 </div>
1687 <div class="paragraph">
1688 <p>There are three different approaches: use an add-on to turn off line wraps,
1689 configure Thunderbird to not mangle patches, or use
1690 an external editor to keep Thunderbird from mangling the patches.</p>
1691 </div>
1692 <div class="sect3">
1693 <h4 id="_approach_1_add_on">Approach #1 (add-on)</h4>
1694 <div class="paragraph">
1695 <p>Install the Toggle Word Wrap add-on that is available from
1696 <a href="https://addons.mozilla.org/thunderbird/addon/toggle-word-wrap/" class="bare">https://addons.mozilla.org/thunderbird/addon/toggle-word-wrap/</a>
1697 It adds a menu entry "Enable Word Wrap" in the composer&#8217;s "Options" menu
1698 that you can tick off. Now you can compose the message as you otherwise do
1699 (cut + paste, <em>git format-patch</em> | <em>git imap-send</em>, etc), but you have to
1700 insert line breaks manually in any text that you type.</p>
1701 </div>
1702 </div>
1703 <div class="sect3">
1704 <h4 id="_approach_2_configuration">Approach #2 (configuration)</h4>
1705 <div class="paragraph">
1706 <p>Three steps:</p>
1707 </div>
1708 <div class="olist arabic">
1709 <ol class="arabic">
1710 <li>
1711 <p>Configure your mail server composition as plain text:
1712 Edit&#8230;&#8203;Account Settings&#8230;&#8203;Composition &amp; Addressing,
1713 uncheck "Compose Messages in HTML".</p>
1714 </li>
1715 <li>
1716 <p>Configure your general composition window to not wrap.</p>
1717 <div class="paragraph">
1718 <p>In Thunderbird 2:
1719 Edit..Preferences..Composition, wrap plain text messages at 0</p>
1720 </div>
1721 <div class="paragraph">
1722 <p>In Thunderbird 3:
1723 Edit..Preferences..Advanced..Config Editor. Search for
1724 "mail.wrap_long_lines".
1725 Toggle it to make sure it is set to <code>false</code>. Also, search for
1726 "mailnews.wraplength" and set the value to 0.</p>
1727 </div>
1728 </li>
1729 <li>
1730 <p>Disable the use of format=flowed:
1731 Edit..Preferences..Advanced..Config Editor. Search for
1732 "mailnews.send_plaintext_flowed".
1733 Toggle it to make sure it is set to <code>false</code>.</p>
1734 </li>
1735 </ol>
1736 </div>
1737 <div class="paragraph">
1738 <p>After that is done, you should be able to compose email as you
1739 otherwise would (cut + paste, <em>git format-patch</em> | <em>git imap-send</em>, etc),
1740 and the patches will not be mangled.</p>
1741 </div>
1742 </div>
1743 <div class="sect3">
1744 <h4 id="_approach_3_external_editor">Approach #3 (external editor)</h4>
1745 <div class="paragraph">
1746 <p>The following Thunderbird extensions are needed:
1747 AboutConfig from <a href="https://mjg.github.io/AboutConfig/" class="bare">https://mjg.github.io/AboutConfig/</a> and
1748 External Editor from <a href="https://globs.org/articles.php?lng=en&amp;pg=8" class="bare">https://globs.org/articles.php?lng=en&amp;pg=8</a></p>
1749 </div>
1750 <div class="olist arabic">
1751 <ol class="arabic">
1752 <li>
1753 <p>Prepare the patch as a text file using your method of choice.</p>
1754 </li>
1755 <li>
1756 <p>Before opening a compose window, use Edit&#8594;Account Settings to
1757 uncheck the "Compose messages in HTML format" setting in the
1758 "Composition &amp; Addressing" panel of the account to be used to
1759 send the patch.</p>
1760 </li>
1761 <li>
1762 <p>In the main Thunderbird window, <em>before</em> you open the compose
1763 window for the patch, use Tools&#8594;about:config to set the
1764 following to the indicated values:</p>
1765 <div class="listingblock">
1766 <div class="content">
1767 <pre> mailnews.send_plaintext_flowed =&gt; false
1768 mailnews.wraplength =&gt; 0</pre>
1769 </div>
1770 </div>
1771 </li>
1772 <li>
1773 <p>Open a compose window and click the external editor icon.</p>
1774 </li>
1775 <li>
1776 <p>In the external editor window, read in the patch file and exit
1777 the editor normally.</p>
1778 </li>
1779 </ol>
1780 </div>
1781 <div class="paragraph">
1782 <p>Side note: it may be possible to do step 2 with
1783 about:config and the following settings but no one&#8217;s tried yet.</p>
1784 </div>
1785 <div class="listingblock">
1786 <div class="content">
1787 <pre> mail.html_compose =&gt; false
1788 mail.identity.default.compose_html =&gt; false
1789 mail.identity.id?.compose_html =&gt; false</pre>
1790 </div>
1791 </div>
1792 <div class="paragraph">
1793 <p>There is a script in contrib/thunderbird-patch-inline which can help
1794 you include patches with Thunderbird in an easy way. To use it, do the
1795 steps above and then use the script as the external editor.</p>
1796 </div>
1797 </div>
1798 </div>
1799 <div class="sect2">
1800 <h3 id="_kmail">KMail</h3>
1801 <div class="paragraph">
1802 <p>This should help you to submit patches inline using KMail.</p>
1803 </div>
1804 <div class="olist arabic">
1805 <ol class="arabic">
1806 <li>
1807 <p>Prepare the patch as a text file.</p>
1808 </li>
1809 <li>
1810 <p>Click on New Mail.</p>
1811 </li>
1812 <li>
1813 <p>Go under "Options" in the Composer window and be sure that
1814 "Word wrap" is not set.</p>
1815 </li>
1816 <li>
1817 <p>Use Message &#8594; Insert file&#8230;&#8203; and insert the patch.</p>
1818 </li>
1819 <li>
1820 <p>Back in the compose window: add whatever other text you wish to the
1821 message, complete the addressing and subject fields, and press send.</p>
1822 </li>
1823 </ol>
1824 </div>
1825 </div>
1826 </div>
1827 </div>
1828 <div class="sect1">
1829 <h2 id="_base_tree_information">BASE TREE INFORMATION</h2>
1830 <div class="sectionbody">
1831 <div class="paragraph">
1832 <p>The base tree information block is used for maintainers or third party
1833 testers to know the exact state the patch series applies to. It consists
1834 of the <em>base commit</em>, which is a well-known commit that is part of the
1835 stable part of the project history everybody else works off of, and zero
1836 or more <em>prerequisite patches</em>, which are well-known patches in flight
1837 that is not yet part of the <em>base commit</em> that need to be applied on top
1838 of <em>base commit</em> in topological order before the patches can be applied.</p>
1839 </div>
1840 <div class="paragraph">
1841 <p>The <em>base commit</em> is shown as "base-commit: " followed by the 40-hex of
1842 the commit object name. A <em>prerequisite patch</em> is shown as
1843 "prerequisite-patch-id: " followed by the 40-hex <em>patch id</em>, which can
1844 be obtained by passing the patch through the <code>git patch-id --stable</code>
1845 command.</p>
1846 </div>
1847 <div class="paragraph">
1848 <p>Imagine that on top of the public commit P, you applied well-known
1849 patches X, Y and Z from somebody else, and then built your three-patch
1850 series A, B, C, the history would be like:</p>
1851 </div>
1852 <div class="literalblock">
1853 <div class="content">
1854 <pre>---P---X---Y---Z---A---B---C</pre>
1855 </div>
1856 </div>
1857 <div class="paragraph">
1858 <p>With <code>git format-patch --base=P -3 C</code> (or variants thereof, e.g. with
1859 <code>--cover-letter</code> or using <code>Z..C</code> instead of <code>-3 C</code> to specify the
1860 range), the base tree information block is shown at the end of the
1861 first message the command outputs (either the first patch, or the
1862 cover letter), like this:</p>
1863 </div>
1864 <div class="listingblock">
1865 <div class="content">
1866 <pre>base-commit: P
1867 prerequisite-patch-id: X
1868 prerequisite-patch-id: Y
1869 prerequisite-patch-id: Z</pre>
1870 </div>
1871 </div>
1872 <div class="paragraph">
1873 <p>For non-linear topology, such as</p>
1874 </div>
1875 <div class="literalblock">
1876 <div class="content">
1877 <pre>---P---X---A---M---C
1879 Y---Z---B</pre>
1880 </div>
1881 </div>
1882 <div class="paragraph">
1883 <p>You can also use <code>git format-patch --base=P -3 C</code> to generate patches
1884 for A, B and C, and the identifiers for P, X, Y, Z are appended at the
1885 end of the first message.</p>
1886 </div>
1887 <div class="paragraph">
1888 <p>If set <code>--base=auto</code> in cmdline, it will automatically compute
1889 the base commit as the merge base of tip commit of the remote-tracking
1890 branch and revision-range specified in cmdline.
1891 For a local branch, you need to make it to track a remote branch by <code>git branch
1892 --set-upstream-to</code> before using this option.</p>
1893 </div>
1894 </div>
1895 </div>
1896 <div class="sect1">
1897 <h2 id="_examples">EXAMPLES</h2>
1898 <div class="sectionbody">
1899 <div class="ulist">
1900 <ul>
1901 <li>
1902 <p>Extract commits between revisions R1 and R2, and apply them on top of
1903 the current branch using <em>git am</em> to cherry-pick them:</p>
1904 <div class="listingblock">
1905 <div class="content">
1906 <pre>$ git format-patch -k --stdout R1..R2 | git am -3 -k</pre>
1907 </div>
1908 </div>
1909 </li>
1910 <li>
1911 <p>Extract all commits which are in the current branch but not in the
1912 origin branch:</p>
1913 <div class="listingblock">
1914 <div class="content">
1915 <pre>$ git format-patch origin</pre>
1916 </div>
1917 </div>
1918 <div class="paragraph">
1919 <p>For each commit a separate file is created in the current directory.</p>
1920 </div>
1921 </li>
1922 <li>
1923 <p>Extract all commits that lead to <em>origin</em> since the inception of the
1924 project:</p>
1925 <div class="listingblock">
1926 <div class="content">
1927 <pre>$ git format-patch --root origin</pre>
1928 </div>
1929 </div>
1930 </li>
1931 <li>
1932 <p>The same as the previous one:</p>
1933 <div class="listingblock">
1934 <div class="content">
1935 <pre>$ git format-patch -M -B origin</pre>
1936 </div>
1937 </div>
1938 <div class="paragraph">
1939 <p>Additionally, it detects and handles renames and complete rewrites
1940 intelligently to produce a renaming patch. A renaming patch reduces
1941 the amount of text output, and generally makes it easier to review.
1942 Note that non-Git "patch" programs won&#8217;t understand renaming patches, so
1943 use it only when you know the recipient uses Git to apply your patch.</p>
1944 </div>
1945 </li>
1946 <li>
1947 <p>Extract three topmost commits from the current branch and format them
1948 as e-mailable patches:</p>
1949 <div class="listingblock">
1950 <div class="content">
1951 <pre>$ git format-patch -3</pre>
1952 </div>
1953 </div>
1954 </li>
1955 </ul>
1956 </div>
1957 </div>
1958 </div>
1959 <div class="sect1">
1960 <h2 id="_caveats">CAVEATS</h2>
1961 <div class="sectionbody">
1962 <div class="paragraph">
1963 <p>Note that <code>format-patch</code> will omit merge commits from the output, even
1964 if they are part of the requested range. A simple "patch" does not
1965 include enough information for the receiving end to reproduce the same
1966 merge commit.</p>
1967 </div>
1968 </div>
1969 </div>
1970 <div class="sect1">
1971 <h2 id="_see_also">SEE ALSO</h2>
1972 <div class="sectionbody">
1973 <div class="paragraph">
1974 <p><a href="git-am.html">git-am(1)</a>, <a href="git-send-email.html">git-send-email(1)</a></p>
1975 </div>
1976 </div>
1977 </div>
1978 <div class="sect1">
1979 <h2 id="_git">GIT</h2>
1980 <div class="sectionbody">
1981 <div class="paragraph">
1982 <p>Part of the <a href="git.html">git(1)</a> suite</p>
1983 </div>
1984 </div>
1985 </div>
1986 </div>
1987 <div id="footer">
1988 <div id="footer-text">
1989 Last updated 2024-05-28 13:39:08 -0700
1990 </div>
1991 </div>
1992 </body>
1993 </html>