| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
| 2 | "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 4 | <head> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 5 | <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 6 | <meta name="generator" content="AsciiDoc 8.6.9" /> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 7 | <title>git-diff-tree(1)</title> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 8 | <style type="text/css"> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 9 | /* Shared CSS for AsciiDoc xhtml11 and html5 backends */ |
| 10 | |
| 11 | /* Default font. */ |
| 12 | body { |
| 13 | font-family: Georgia,serif; |
| 14 | } |
| 15 | |
| 16 | /* Title font. */ |
| 17 | h1, h2, h3, h4, h5, h6, |
| 18 | div.title, caption.title, |
| 19 | thead, p.table.header, |
| 20 | #toctitle, |
| 21 | #author, #revnumber, #revdate, #revremark, |
| 22 | #footer { |
| 23 | font-family: Arial,Helvetica,sans-serif; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | body { |
| 27 | margin: 1em 5% 1em 5%; |
| 28 | } |
| 29 | |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 30 | a { |
| 31 | color: blue; |
| 32 | text-decoration: underline; |
| 33 | } |
| 34 | a:visited { |
| 35 | color: fuchsia; |
| 36 | } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 37 | |
| 38 | em { |
| 39 | font-style: italic; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 40 | color: navy; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | strong { |
| 44 | font-weight: bold; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 45 | color: #083194; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 46 | } |
| 47 | |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 48 | h1, h2, h3, h4, h5, h6 { |
| 49 | color: #527bbd; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 50 | margin-top: 1.2em; |
| 51 | margin-bottom: 0.5em; |
| 52 | line-height: 1.3; |
| 53 | } |
| 54 | |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 55 | h1, h2, h3 { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 56 | border-bottom: 2px solid silver; |
| 57 | } |
| 58 | h2 { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 59 | padding-top: 0.5em; |
| 60 | } |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 61 | h3 { |
| 62 | float: left; |
| 63 | } |
| 64 | h3 + * { |
| 65 | clear: left; |
| 66 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 67 | h5 { |
| 68 | font-size: 1.0em; |
| 69 | } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 70 | |
| 71 | div.sectionbody { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 72 | margin-left: 0; |
| 73 | } |
| 74 | |
| 75 | hr { |
| 76 | border: 1px solid silver; |
| 77 | } |
| 78 | |
| 79 | p { |
| 80 | margin-top: 0.5em; |
| 81 | margin-bottom: 0.5em; |
| 82 | } |
| 83 | |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 84 | ul, ol, li > p { |
| 85 | margin-top: 0; |
| 86 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 87 | ul > li { color: #aaa; } |
| 88 | ul > li > * { color: black; } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 89 | |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 90 | .monospaced, code, pre { |
| 91 | font-family: "Courier New", Courier, monospace; |
| 92 | font-size: inherit; |
| 93 | color: navy; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 94 | padding: 0; |
| 95 | margin: 0; |
| 96 | } |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 97 | pre { |
| 98 | white-space: pre-wrap; |
| 99 | } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 100 | |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 101 | #author { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 102 | color: #527bbd; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 103 | font-weight: bold; |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 104 | font-size: 1.1em; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 105 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 106 | #email { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 107 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 108 | #revnumber, #revdate, #revremark { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 109 | } |
| 110 | |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 111 | #footer { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 112 | font-size: small; |
| 113 | border-top: 2px solid silver; |
| 114 | padding-top: 0.5em; |
| 115 | margin-top: 4.0em; |
| 116 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 117 | #footer-text { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 118 | float: left; |
| 119 | padding-bottom: 0.5em; |
| 120 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 121 | #footer-badges { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 122 | float: right; |
| 123 | padding-bottom: 0.5em; |
| 124 | } |
| 125 | |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 126 | #preamble { |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 127 | margin-top: 1.5em; |
| 128 | margin-bottom: 1.5em; |
| 129 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 130 | div.imageblock, div.exampleblock, div.verseblock, |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 131 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 132 | div.admonitionblock { |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 133 | margin-top: 1.0em; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 134 | margin-bottom: 1.5em; |
| 135 | } |
| 136 | div.admonitionblock { |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 137 | margin-top: 2.0em; |
| 138 | margin-bottom: 2.0em; |
| 139 | margin-right: 10%; |
| 140 | color: #606060; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | div.content { /* Block element content. */ |
| 144 | padding: 0; |
| 145 | } |
| 146 | |
| 147 | /* Block element titles. */ |
| 148 | div.title, caption.title { |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 149 | color: #527bbd; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 150 | font-weight: bold; |
| 151 | text-align: left; |
| 152 | margin-top: 1.0em; |
| 153 | margin-bottom: 0.5em; |
| 154 | } |
| 155 | div.title + * { |
| 156 | margin-top: 0; |
| 157 | } |
| 158 | |
| 159 | td div.title:first-child { |
| 160 | margin-top: 0.0em; |
| 161 | } |
| 162 | div.content div.title:first-child { |
| 163 | margin-top: 0.0em; |
| 164 | } |
| 165 | div.content + div.title { |
| 166 | margin-top: 0.0em; |
| 167 | } |
| 168 | |
| 169 | div.sidebarblock > div.content { |
| 170 | background: #ffffee; |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 171 | border: 1px solid #dddddd; |
| 172 | border-left: 4px solid #f0f0f0; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 173 | padding: 0.5em; |
| 174 | } |
| 175 | |
| 176 | div.listingblock > div.content { |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 177 | border: 1px solid #dddddd; |
| 178 | border-left: 5px solid #f0f0f0; |
| 179 | background: #f8f8f8; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 180 | padding: 0.5em; |
| 181 | } |
| 182 | |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 183 | div.quoteblock, div.verseblock { |
| 184 | padding-left: 1.0em; |
| 185 | margin-left: 1.0em; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 186 | margin-right: 10%; |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 187 | border-left: 5px solid #f0f0f0; |
| 188 | color: #888; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 189 | } |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 190 | |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 191 | div.quoteblock > div.attribution { |
| 192 | padding-top: 0.5em; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 193 | text-align: right; |
| 194 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 195 | |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 196 | div.verseblock > pre.content { |
| 197 | font-family: inherit; |
| 198 | font-size: inherit; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 199 | } |
| 200 | div.verseblock > div.attribution { |
| 201 | padding-top: 0.75em; |
| 202 | text-align: left; |
| 203 | } |
| 204 | /* DEPRECATED: Pre version 8.2.7 verse style literal block. */ |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 205 | div.verseblock + div.attribution { |
| 206 | text-align: left; |
| 207 | } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 208 | |
| 209 | div.admonitionblock .icon { |
| 210 | vertical-align: top; |
| 211 | font-size: 1.1em; |
| 212 | font-weight: bold; |
| 213 | text-decoration: underline; |
| 214 | color: #527bbd; |
| 215 | padding-right: 0.5em; |
| 216 | } |
| 217 | div.admonitionblock td.content { |
| 218 | padding-left: 0.5em; |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 219 | border-left: 3px solid #dddddd; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 220 | } |
| 221 | |
| 222 | div.exampleblock > div.content { |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 223 | border-left: 3px solid #dddddd; |
| 224 | padding-left: 0.5em; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 225 | } |
| 226 | |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 227 | div.imageblock div.content { padding-left: 0; } |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 228 | span.image img { border-style: none; vertical-align: text-bottom; } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 229 | a.image:visited { color: white; } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 230 | |
| 231 | dl { |
| 232 | margin-top: 0.8em; |
| 233 | margin-bottom: 0.8em; |
| 234 | } |
| 235 | dt { |
| 236 | margin-top: 0.5em; |
| 237 | margin-bottom: 0; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 238 | font-style: normal; |
| 239 | color: navy; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 240 | } |
| 241 | dd > *:first-child { |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 242 | margin-top: 0.1em; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 243 | } |
| 244 | |
| 245 | ul, ol { |
| 246 | list-style-position: outside; |
| 247 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 248 | ol.arabic { |
| 249 | list-style-type: decimal; |
| 250 | } |
| 251 | ol.loweralpha { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 252 | list-style-type: lower-alpha; |
| 253 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 254 | ol.upperalpha { |
| 255 | list-style-type: upper-alpha; |
| 256 | } |
| 257 | ol.lowerroman { |
| 258 | list-style-type: lower-roman; |
| 259 | } |
| 260 | ol.upperroman { |
| 261 | list-style-type: upper-roman; |
| 262 | } |
| 263 | |
| 264 | div.compact ul, div.compact ol, |
| 265 | div.compact p, div.compact p, |
| 266 | div.compact div, div.compact div { |
| 267 | margin-top: 0.1em; |
| 268 | margin-bottom: 0.1em; |
| 269 | } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 270 | |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 271 | tfoot { |
| 272 | font-weight: bold; |
| 273 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 274 | td > div.verse { |
| 275 | white-space: pre; |
| 276 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 277 | |
| 278 | div.hdlist { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 279 | margin-top: 0.8em; |
| 280 | margin-bottom: 0.8em; |
| 281 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 282 | div.hdlist tr { |
| 283 | padding-bottom: 15px; |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 284 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 285 | dt.hdlist1.strong, td.hdlist1.strong { |
| 286 | font-weight: bold; |
| 287 | } |
| 288 | td.hdlist1 { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 289 | vertical-align: top; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 290 | font-style: normal; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 291 | padding-right: 0.8em; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 292 | color: navy; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 293 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 294 | td.hdlist2 { |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 295 | vertical-align: top; |
| 296 | } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 297 | div.hdlist.compact tr { |
| 298 | margin: 0; |
| 299 | padding-bottom: 0; |
| 300 | } |
| 301 | |
| 302 | .comment { |
| 303 | background: yellow; |
| 304 | } |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 305 | |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 306 | .footnote, .footnoteref { |
| 307 | font-size: 0.8em; |
| 308 | } |
| 309 | |
| 310 | span.footnote, span.footnoteref { |
| 311 | vertical-align: super; |
| 312 | } |
| 313 | |
| 314 | #footnotes { |
| 315 | margin: 20px 0 20px 0; |
| 316 | padding: 7px 0 0 0; |
| 317 | } |
| 318 | |
| 319 | #footnotes div.footnote { |
| 320 | margin: 0 0 5px 0; |
| 321 | } |
| 322 | |
| 323 | #footnotes hr { |
| 324 | border: none; |
| 325 | border-top: 1px solid silver; |
| 326 | height: 1px; |
| 327 | text-align: left; |
| 328 | margin-left: 0; |
| 329 | width: 20%; |
| 330 | min-width: 100px; |
| 331 | } |
| 332 | |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 333 | div.colist td { |
| 334 | padding-right: 0.5em; |
| 335 | padding-bottom: 0.3em; |
| 336 | vertical-align: top; |
| 337 | } |
| 338 | div.colist td img { |
| 339 | margin-top: 0.3em; |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 340 | } |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 341 | |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 342 | @media print { |
| 343 | #footer-badges { display: none; } |
| 344 | } |
| 345 | |
| 346 | #toc { |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 347 | margin-bottom: 2.5em; |
| 348 | } |
| 349 | |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 350 | #toctitle { |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 351 | color: #527bbd; |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 352 | font-size: 1.1em; |
| 353 | font-weight: bold; |
| 354 | margin-top: 1.0em; |
| 355 | margin-bottom: 0.1em; |
| 356 | } |
| 357 | |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 358 | div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 359 | margin-top: 0; |
| 360 | margin-bottom: 0; |
| 361 | } |
| 362 | div.toclevel2 { |
| 363 | margin-left: 2em; |
| 364 | font-size: 0.9em; |
| 365 | } |
| 366 | div.toclevel3 { |
| 367 | margin-left: 4em; |
| 368 | font-size: 0.9em; |
| 369 | } |
| 370 | div.toclevel4 { |
| 371 | margin-left: 6em; |
| 372 | font-size: 0.9em; |
| 373 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 374 | |
| 375 | span.aqua { color: aqua; } |
| 376 | span.black { color: black; } |
| 377 | span.blue { color: blue; } |
| 378 | span.fuchsia { color: fuchsia; } |
| 379 | span.gray { color: gray; } |
| 380 | span.green { color: green; } |
| 381 | span.lime { color: lime; } |
| 382 | span.maroon { color: maroon; } |
| 383 | span.navy { color: navy; } |
| 384 | span.olive { color: olive; } |
| 385 | span.purple { color: purple; } |
| 386 | span.red { color: red; } |
| 387 | span.silver { color: silver; } |
| 388 | span.teal { color: teal; } |
| 389 | span.white { color: white; } |
| 390 | span.yellow { color: yellow; } |
| 391 | |
| 392 | span.aqua-background { background: aqua; } |
| 393 | span.black-background { background: black; } |
| 394 | span.blue-background { background: blue; } |
| 395 | span.fuchsia-background { background: fuchsia; } |
| 396 | span.gray-background { background: gray; } |
| 397 | span.green-background { background: green; } |
| 398 | span.lime-background { background: lime; } |
| 399 | span.maroon-background { background: maroon; } |
| 400 | span.navy-background { background: navy; } |
| 401 | span.olive-background { background: olive; } |
| 402 | span.purple-background { background: purple; } |
| 403 | span.red-background { background: red; } |
| 404 | span.silver-background { background: silver; } |
| 405 | span.teal-background { background: teal; } |
| 406 | span.white-background { background: white; } |
| 407 | span.yellow-background { background: yellow; } |
| 408 | |
| 409 | span.big { font-size: 2em; } |
| 410 | span.small { font-size: 0.6em; } |
| 411 | |
| 412 | span.underline { text-decoration: underline; } |
| 413 | span.overline { text-decoration: overline; } |
| 414 | span.line-through { text-decoration: line-through; } |
| 415 | |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 416 | div.unbreakable { page-break-inside: avoid; } |
| 417 | |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 418 | |
| 419 | /* |
| 420 | * xhtml11 specific |
| 421 | * |
| 422 | * */ |
| 423 | |
| 424 | div.tableblock { |
| 425 | margin-top: 1.0em; |
| 426 | margin-bottom: 1.5em; |
| 427 | } |
| 428 | div.tableblock > table { |
| 429 | border: 3px solid #527bbd; |
| 430 | } |
| 431 | thead, p.table.header { |
| 432 | font-weight: bold; |
| 433 | color: #527bbd; |
| 434 | } |
| 435 | p.table { |
| 436 | margin-top: 0; |
| 437 | } |
| 438 | /* Because the table frame attribute is overriden by CSS in most browsers. */ |
| 439 | div.tableblock > table[frame="void"] { |
| 440 | border-style: none; |
| 441 | } |
| 442 | div.tableblock > table[frame="hsides"] { |
| 443 | border-left-style: none; |
| 444 | border-right-style: none; |
| 445 | } |
| 446 | div.tableblock > table[frame="vsides"] { |
| 447 | border-top-style: none; |
| 448 | border-bottom-style: none; |
| 449 | } |
| 450 | |
| 451 | |
| 452 | /* |
| 453 | * html5 specific |
| 454 | * |
| 455 | * */ |
| 456 | |
| 457 | table.tableblock { |
| 458 | margin-top: 1.0em; |
| 459 | margin-bottom: 1.5em; |
| 460 | } |
| 461 | thead, p.tableblock.header { |
| 462 | font-weight: bold; |
| 463 | color: #527bbd; |
| 464 | } |
| 465 | p.tableblock { |
| 466 | margin-top: 0; |
| 467 | } |
| 468 | table.tableblock { |
| 469 | border-width: 3px; |
| 470 | border-spacing: 0px; |
| 471 | border-style: solid; |
| 472 | border-color: #527bbd; |
| 473 | border-collapse: collapse; |
| 474 | } |
| 475 | th.tableblock, td.tableblock { |
| 476 | border-width: 1px; |
| 477 | padding: 4px; |
| 478 | border-style: solid; |
| 479 | border-color: #527bbd; |
| 480 | } |
| 481 | |
| 482 | table.tableblock.frame-topbot { |
| 483 | border-left-style: hidden; |
| 484 | border-right-style: hidden; |
| 485 | } |
| 486 | table.tableblock.frame-sides { |
| 487 | border-top-style: hidden; |
| 488 | border-bottom-style: hidden; |
| 489 | } |
| 490 | table.tableblock.frame-none { |
| 491 | border-style: hidden; |
| 492 | } |
| 493 | |
| 494 | th.tableblock.halign-left, td.tableblock.halign-left { |
| 495 | text-align: left; |
| 496 | } |
| 497 | th.tableblock.halign-center, td.tableblock.halign-center { |
| 498 | text-align: center; |
| 499 | } |
| 500 | th.tableblock.halign-right, td.tableblock.halign-right { |
| 501 | text-align: right; |
| 502 | } |
| 503 | |
| 504 | th.tableblock.valign-top, td.tableblock.valign-top { |
| 505 | vertical-align: top; |
| 506 | } |
| 507 | th.tableblock.valign-middle, td.tableblock.valign-middle { |
| 508 | vertical-align: middle; |
| 509 | } |
| 510 | th.tableblock.valign-bottom, td.tableblock.valign-bottom { |
| 511 | vertical-align: bottom; |
| 512 | } |
| 513 | |
| 514 | |
| 515 | /* |
| 516 | * manpage specific |
| 517 | * |
| 518 | * */ |
| 519 | |
| 520 | body.manpage h1 { |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 521 | padding-top: 0.5em; |
| 522 | padding-bottom: 0.5em; |
| 523 | border-top: 2px solid silver; |
| 524 | border-bottom: 2px solid silver; |
| 525 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 526 | body.manpage h2 { |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 527 | border-style: none; |
| 528 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 529 | body.manpage div.sectionbody { |
| 530 | margin-left: 3em; |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 531 | } |
| 532 | |
| 533 | @media print { |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 534 | body.manpage div#toc { display: none; } |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 535 | } |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 536 | |
| 537 | |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 538 | </style> |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 539 | <script type="text/javascript"> |
| 540 | /*<![CDATA[*/ |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 541 | var asciidoc = { // Namespace. |
| 542 | |
| 543 | ///////////////////////////////////////////////////////////////////// |
| 544 | // Table Of Contents generator |
| 545 | ///////////////////////////////////////////////////////////////////// |
| 546 | |
| 547 | /* Author: Mihai Bazon, September 2002 |
| 548 | * http://students.infoiasi.ro/~mishoo |
| 549 | * |
| 550 | * Table Of Content generator |
| 551 | * Version: 0.4 |
| 552 | * |
| 553 | * Feel free to use this script under the terms of the GNU General Public |
| 554 | * License, as long as you do not remove or alter this notice. |
| 555 | */ |
| 556 | |
| 557 | /* modified by Troy D. Hanson, September 2006. License: GPL */ |
| 558 | /* modified by Stuart Rackham, 2006, 2009. License: GPL */ |
| 559 | |
| 560 | // toclevels = 1..4. |
| 561 | toc: function (toclevels) { |
| 562 | |
| 563 | function getText(el) { |
| 564 | var text = ""; |
| 565 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 566 | if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants. |
| 567 | text += i.data; |
| 568 | else if (i.firstChild != null) |
| 569 | text += getText(i); |
| 570 | } |
| 571 | return text; |
| 572 | } |
| 573 | |
| 574 | function TocEntry(el, text, toclevel) { |
| 575 | this.element = el; |
| 576 | this.text = text; |
| 577 | this.toclevel = toclevel; |
| 578 | } |
| 579 | |
| 580 | function tocEntries(el, toclevels) { |
| 581 | var result = new Array; |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 582 | var re = new RegExp('[hH]([1-'+(toclevels+1)+'])'); |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 583 | // Function that scans the DOM tree for header elements (the DOM2 |
| 584 | // nodeIterator API would be a better technique but not supported by all |
| 585 | // browsers). |
| 586 | var iterate = function (el) { |
| 587 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 588 | if (i.nodeType == 1 /* Node.ELEMENT_NODE */) { |
| 589 | var mo = re.exec(i.tagName); |
| 590 | if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") { |
| 591 | result[result.length] = new TocEntry(i, getText(i), mo[1]-1); |
| 592 | } |
| 593 | iterate(i); |
| 594 | } |
| 595 | } |
| 596 | } |
| 597 | iterate(el); |
| 598 | return result; |
| 599 | } |
| 600 | |
| 601 | var toc = document.getElementById("toc"); |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 602 | if (!toc) { |
| 603 | return; |
| 604 | } |
| 605 | |
| 606 | // Delete existing TOC entries in case we're reloading the TOC. |
| 607 | var tocEntriesToRemove = []; |
| 608 | var i; |
| 609 | for (i = 0; i < toc.childNodes.length; i++) { |
| 610 | var entry = toc.childNodes[i]; |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 611 | if (entry.nodeName.toLowerCase() == 'div' |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 612 | && entry.getAttribute("class") |
| 613 | && entry.getAttribute("class").match(/^toclevel/)) |
| 614 | tocEntriesToRemove.push(entry); |
| 615 | } |
| 616 | for (i = 0; i < tocEntriesToRemove.length; i++) { |
| 617 | toc.removeChild(tocEntriesToRemove[i]); |
| 618 | } |
| 619 | |
| 620 | // Rebuild TOC entries. |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 621 | var entries = tocEntries(document.getElementById("content"), toclevels); |
| 622 | for (var i = 0; i < entries.length; ++i) { |
| 623 | var entry = entries[i]; |
| 624 | if (entry.element.id == "") |
| 625 | entry.element.id = "_toc_" + i; |
| 626 | var a = document.createElement("a"); |
| 627 | a.href = "#" + entry.element.id; |
| 628 | a.appendChild(document.createTextNode(entry.text)); |
| 629 | var div = document.createElement("div"); |
| 630 | div.appendChild(a); |
| 631 | div.className = "toclevel" + entry.toclevel; |
| 632 | toc.appendChild(div); |
| 633 | } |
| 634 | if (entries.length == 0) |
| 635 | toc.parentNode.removeChild(toc); |
| 636 | }, |
| 637 | |
| 638 | |
| 639 | ///////////////////////////////////////////////////////////////////// |
| 640 | // Footnotes generator |
| 641 | ///////////////////////////////////////////////////////////////////// |
| 642 | |
| 643 | /* Based on footnote generation code from: |
| 644 | * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html |
| 645 | */ |
| 646 | |
| 647 | footnotes: function () { |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 648 | // Delete existing footnote entries in case we're reloading the footnodes. |
| 649 | var i; |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 650 | var noteholder = document.getElementById("footnotes"); |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 651 | if (!noteholder) { |
| 652 | return; |
| 653 | } |
| 654 | var entriesToRemove = []; |
| 655 | for (i = 0; i < noteholder.childNodes.length; i++) { |
| 656 | var entry = noteholder.childNodes[i]; |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 657 | if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote") |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 658 | entriesToRemove.push(entry); |
| 659 | } |
| 660 | for (i = 0; i < entriesToRemove.length; i++) { |
| 661 | noteholder.removeChild(entriesToRemove[i]); |
| 662 | } |
| 663 | |
| 664 | // Rebuild footnote entries. |
| 665 | var cont = document.getElementById("content"); |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 666 | var spans = cont.getElementsByTagName("span"); |
| 667 | var refs = {}; |
| 668 | var n = 0; |
| 669 | for (i=0; i<spans.length; i++) { |
| 670 | if (spans[i].className == "footnote") { |
| 671 | n++; |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 672 | var note = spans[i].getAttribute("data-note"); |
| 673 | if (!note) { |
| 674 | // Use [\s\S] in place of . so multi-line matches work. |
| 675 | // Because JavaScript has no s (dotall) regex flag. |
| 676 | note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1]; |
| 677 | spans[i].innerHTML = |
| 678 | "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n + |
| 679 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 680 | spans[i].setAttribute("data-note", note); |
| 681 | } |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 682 | noteholder.innerHTML += |
| 683 | "<div class='footnote' id='_footnote_" + n + "'>" + |
| 684 | "<a href='#_footnoteref_" + n + "' title='Return to text'>" + |
| 685 | n + "</a>. " + note + "</div>"; |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 686 | var id =spans[i].getAttribute("id"); |
| 687 | if (id != null) refs["#"+id] = n; |
| 688 | } |
| 689 | } |
| 690 | if (n == 0) |
| 691 | noteholder.parentNode.removeChild(noteholder); |
| 692 | else { |
| 693 | // Process footnoterefs. |
| 694 | for (i=0; i<spans.length; i++) { |
| 695 | if (spans[i].className == "footnoteref") { |
| 696 | var href = spans[i].getElementsByTagName("a")[0].getAttribute("href"); |
| 697 | href = href.match(/#.*/)[0]; // Because IE return full URL. |
| 698 | n = refs[href]; |
| 699 | spans[i].innerHTML = |
| 700 | "[<a href='#_footnote_" + n + |
| 701 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 702 | } |
| 703 | } |
| 704 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 705 | }, |
| 706 | |
| 707 | install: function(toclevels) { |
| 708 | var timerId; |
| 709 | |
| 710 | function reinstall() { |
| 711 | asciidoc.footnotes(); |
| 712 | if (toclevels) { |
| 713 | asciidoc.toc(toclevels); |
| 714 | } |
| 715 | } |
| 716 | |
| 717 | function reinstallAndRemoveTimer() { |
| 718 | clearInterval(timerId); |
| 719 | reinstall(); |
| 720 | } |
| 721 | |
| 722 | timerId = setInterval(reinstall, 500); |
| 723 | if (document.addEventListener) |
| 724 | document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false); |
| 725 | else |
| 726 | window.onload = reinstallAndRemoveTimer; |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 727 | } |
| 728 | |
| 729 | } |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 730 | asciidoc.install(); |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 731 | /*]]>*/ |
| 732 | </script> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 733 | </head> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 734 | <body class="manpage"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 735 | <div id="header"> |
| 736 | <h1> |
| 737 | git-diff-tree(1) Manual Page |
| 738 | </h1> |
| 739 | <h2>NAME</h2> |
| 740 | <div class="sectionbody"> |
| 741 | <p>git-diff-tree - |
| 742 | Compares the content and mode of blobs found via two tree objects |
| 743 | </p> |
| 744 | </div> |
| 745 | </div> |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 746 | <div id="content"> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 747 | <div class="sect1"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 748 | <h2 id="_synopsis">SYNOPSIS</h2> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 749 | <div class="sectionbody"> |
| Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 750 | <div class="verseblock"> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 751 | <pre class="content"><em>git diff-tree</em> [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty] |
| Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 752 | [-t] [-r] [-c | --cc] [--root] [<common diff options>] |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 753 | <tree-ish> [<tree-ish>] [<path>…]</pre> |
| 754 | <div class="attribution"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 755 | </div></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 756 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 757 | </div> |
| 758 | <div class="sect1"> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 759 | <h2 id="_description">DESCRIPTION</h2> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 760 | <div class="sectionbody"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 761 | <div class="paragraph"><p>Compares the content and mode of the blobs found via two tree objects.</p></div> |
| 762 | <div class="paragraph"><p>If there is only one <tree-ish> given, the commit is compared with its parents |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 763 | (see --stdin below).</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 764 | <div class="paragraph"><p>Note that <em>git diff-tree</em> can use the tree encapsulated in a commit object.</p></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 765 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 766 | </div> |
| 767 | <div class="sect1"> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 768 | <h2 id="_options">OPTIONS</h2> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 769 | <div class="sectionbody"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 770 | <div class="dlist"><dl> |
| 771 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 772 | -p |
| 773 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 774 | <dt class="hdlist1"> |
| Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 775 | -u |
| 776 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 777 | <dt class="hdlist1"> |
| Junio C Hamano | e97d577 | 2010-05-19 08:13:58 | [diff] [blame] | 778 | --patch |
| 779 | </dt> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 780 | <dd> |
| 781 | <p> |
| Junio C Hamano | ff97979 | 2007-11-16 10:11:30 | [diff] [blame] | 782 | Generate patch (see section on generating patches). |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 783 | </p> |
| 784 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 785 | <dt class="hdlist1"> |
| Junio C Hamano | 58f587a | 2013-07-22 19:20:59 | [diff] [blame] | 786 | -s |
| 787 | </dt> |
| 788 | <dt class="hdlist1"> |
| 789 | --no-patch |
| 790 | </dt> |
| 791 | <dd> |
| 792 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 793 | Suppress diff output. Useful for commands like <code>git show</code> that |
| 794 | show the patch by default, or to cancel the effect of <code>--patch</code>. |
| Junio C Hamano | 58f587a | 2013-07-22 19:20:59 | [diff] [blame] | 795 | </p> |
| 796 | </dd> |
| 797 | <dt class="hdlist1"> |
| Junio C Hamano | 6936156 | 2007-07-26 02:14:34 | [diff] [blame] | 798 | -U<n> |
| 799 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 800 | <dt class="hdlist1"> |
| Junio C Hamano | 6936156 | 2007-07-26 02:14:34 | [diff] [blame] | 801 | --unified=<n> |
| 802 | </dt> |
| 803 | <dd> |
| 804 | <p> |
| 805 | Generate diffs with <n> lines of context instead of |
| Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 806 | the usual three. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 807 | Implies <code>-p</code>. |
| Junio C Hamano | 6936156 | 2007-07-26 02:14:34 | [diff] [blame] | 808 | </p> |
| 809 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 810 | <dt class="hdlist1"> |
| Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 811 | --raw |
| 812 | </dt> |
| 813 | <dd> |
| 814 | <p> |
| Junio C Hamano | 85f1fde | 2015-06-01 20:37:32 | [diff] [blame] | 815 | Generate the diff in raw format. |
| Junio C Hamano | 1dbca52 | 2015-05-22 20:48:55 | [diff] [blame] | 816 | This is the default. |
| Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 817 | </p> |
| 818 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 819 | <dt class="hdlist1"> |
| Junio C Hamano | 54559c8 | 2006-04-13 07:45:12 | [diff] [blame] | 820 | --patch-with-raw |
| 821 | </dt> |
| 822 | <dd> |
| 823 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 824 | Synonym for <code>-p --raw</code>. |
| Junio C Hamano | 54559c8 | 2006-04-13 07:45:12 | [diff] [blame] | 825 | </p> |
| 826 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 827 | <dt class="hdlist1"> |
| Junio C Hamano | ad70bf0 | 2016-09-26 23:44:27 | [diff] [blame] | 828 | --indent-heuristic |
| 829 | </dt> |
| Junio C Hamano | a65b676 | 2017-11-06 04:45:42 | [diff] [blame] | 830 | <dd> |
| 831 | <p> |
| 832 | Enable the heuristic that shift diff hunk boundaries to make patches |
| 833 | easier to read. This is the default. |
| 834 | </p> |
| 835 | </dd> |
| Junio C Hamano | ad70bf0 | 2016-09-26 23:44:27 | [diff] [blame] | 836 | <dt class="hdlist1"> |
| 837 | --no-indent-heuristic |
| 838 | </dt> |
| Junio C Hamano | 5f88833 | 2016-06-13 19:28:31 | [diff] [blame] | 839 | <dd> |
| 840 | <p> |
| Junio C Hamano | a65b676 | 2017-11-06 04:45:42 | [diff] [blame] | 841 | Disable the indent heuristic. |
| Junio C Hamano | 5f88833 | 2016-06-13 19:28:31 | [diff] [blame] | 842 | </p> |
| 843 | </dd> |
| 844 | <dt class="hdlist1"> |
| Junio C Hamano | 5a73f30 | 2011-10-14 05:58:34 | [diff] [blame] | 845 | --minimal |
| 846 | </dt> |
| 847 | <dd> |
| 848 | <p> |
| 849 | Spend extra time to make sure the smallest possible |
| 850 | diff is produced. |
| 851 | </p> |
| 852 | </dd> |
| 853 | <dt class="hdlist1"> |
| Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 854 | --patience |
| 855 | </dt> |
| 856 | <dd> |
| 857 | <p> |
| 858 | Generate a diff using the "patience diff" algorithm. |
| 859 | </p> |
| 860 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 861 | <dt class="hdlist1"> |
| Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 862 | --histogram |
| 863 | </dt> |
| 864 | <dd> |
| 865 | <p> |
| 866 | Generate a diff using the "histogram diff" algorithm. |
| 867 | </p> |
| 868 | </dd> |
| 869 | <dt class="hdlist1"> |
| Junio C Hamano | 047135e | 2017-12-19 21:57:54 | [diff] [blame] | 870 | --anchored=<text> |
| 871 | </dt> |
| 872 | <dd> |
| 873 | <p> |
| 874 | Generate a diff using the "anchored diff" algorithm. |
| 875 | </p> |
| 876 | <div class="paragraph"><p>This option may be specified more than once.</p></div> |
| 877 | <div class="paragraph"><p>If a line exists in both the source and destination, exists only once, |
| 878 | and starts with this text, this algorithm attempts to prevent it from |
| 879 | appearing as a deletion or addition in the output. It uses the "patience |
| 880 | diff" algorithm internally.</p></div> |
| 881 | </dd> |
| 882 | <dt class="hdlist1"> |
| Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 883 | --diff-algorithm={patience|minimal|histogram|myers} |
| 884 | </dt> |
| 885 | <dd> |
| 886 | <p> |
| 887 | Choose a diff algorithm. The variants are as follows: |
| 888 | </p> |
| 889 | <div class="openblock"> |
| 890 | <div class="content"> |
| 891 | <div class="dlist"><dl> |
| 892 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 893 | <code>default</code>, <code>myers</code> |
| Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 894 | </dt> |
| 895 | <dd> |
| 896 | <p> |
| 897 | The basic greedy diff algorithm. Currently, this is the default. |
| 898 | </p> |
| 899 | </dd> |
| 900 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 901 | <code>minimal</code> |
| Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 902 | </dt> |
| 903 | <dd> |
| 904 | <p> |
| 905 | Spend extra time to make sure the smallest possible diff is |
| 906 | produced. |
| 907 | </p> |
| 908 | </dd> |
| 909 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 910 | <code>patience</code> |
| Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 911 | </dt> |
| 912 | <dd> |
| 913 | <p> |
| 914 | Use "patience diff" algorithm when generating patches. |
| 915 | </p> |
| 916 | </dd> |
| 917 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 918 | <code>histogram</code> |
| Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 919 | </dt> |
| 920 | <dd> |
| 921 | <p> |
| 922 | This algorithm extends the patience algorithm to "support |
| 923 | low-occurrence common elements". |
| 924 | </p> |
| 925 | </dd> |
| 926 | </dl></div> |
| 927 | </div></div> |
| 928 | <div class="paragraph"><p>For instance, if you configured diff.algorithm variable to a |
| 929 | non-default value and want to use the default one, then you |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 930 | have to use <code>--diff-algorithm=default</code> option.</p></div> |
| Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 931 | </dd> |
| 932 | <dt class="hdlist1"> |
| Junio C Hamano | 4c4b012 | 2011-06-30 01:19:32 | [diff] [blame] | 933 | --stat[=<width>[,<name-width>[,<count>]]] |
| Junio C Hamano | ba7c8d8 | 2006-04-15 06:17:42 | [diff] [blame] | 934 | </dt> |
| 935 | <dd> |
| 936 | <p> |
| Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 937 | Generate a diffstat. By default, as much space as necessary |
| 938 | will be used for the filename part, and the rest for the graph |
| 939 | part. Maximum width defaults to terminal width, or 80 columns |
| Junio C Hamano | 7f2b3cb | 2012-06-22 22:42:39 | [diff] [blame] | 940 | if not connected to a terminal, and can be overridden by |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 941 | <code><width></code>. The width of the filename part can be limited by |
| 942 | giving another width <code><name-width></code> after a comma. The width |
| Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 943 | of the graph part can be limited by using |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 944 | <code>--stat-graph-width=<width></code> (affects all commands generating |
| 945 | a stat graph) or by setting <code>diff.statGraphWidth=<width></code> |
| 946 | (does not affect <code>git format-patch</code>). |
| 947 | By giving a third parameter <code><count></code>, you can limit the |
| 948 | output to the first <code><count></code> lines, followed by <code>...</code> if |
| Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 949 | there are more. |
| Junio C Hamano | ba7c8d8 | 2006-04-15 06:17:42 | [diff] [blame] | 950 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 951 | <div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=<width></code>, |
| 952 | <code>--stat-name-width=<name-width></code> and <code>--stat-count=<count></code>.</p></div> |
| Junio C Hamano | ba7c8d8 | 2006-04-15 06:17:42 | [diff] [blame] | 953 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 954 | <dt class="hdlist1"> |
| Junio C Hamano | 45badf0 | 2018-03-14 21:56:41 | [diff] [blame] | 955 | --compact-summary |
| 956 | </dt> |
| 957 | <dd> |
| 958 | <p> |
| 959 | Output a condensed summary of extended header information such |
| 960 | as file creations or deletions ("new" or "gone", optionally "+l" |
| 961 | if it’s a symlink) and mode changes ("+x" or "-x" for adding |
| 962 | or removing executable bit respectively) in diffstat. The |
| 963 | information is put betwen the filename part and the graph |
| 964 | part. Implies <code>--stat</code>. |
| 965 | </p> |
| 966 | </dd> |
| 967 | <dt class="hdlist1"> |
| Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 968 | --numstat |
| 969 | </dt> |
| 970 | <dd> |
| 971 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 972 | Similar to <code>--stat</code>, but shows number of added and |
| Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 973 | deleted lines in decimal notation and pathname without |
| Junio C Hamano | d793de5 | 2006-12-26 09:11:43 | [diff] [blame] | 974 | abbreviation, to make it more machine friendly. For |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 975 | binary files, outputs two <code>-</code> instead of saying |
| 976 | <code>0 0</code>. |
| Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 977 | </p> |
| 978 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 979 | <dt class="hdlist1"> |
| Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 980 | --shortstat |
| 981 | </dt> |
| 982 | <dd> |
| 983 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 984 | Output only the last line of the <code>--stat</code> format containing total |
| Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 985 | number of modified files, as well as number of added and deleted |
| 986 | lines. |
| 987 | </p> |
| 988 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 989 | <dt class="hdlist1"> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 990 | --dirstat[=<param1,param2,…>] |
| Junio C Hamano | 6a45be9 | 2008-04-22 08:19:03 | [diff] [blame] | 991 | </dt> |
| 992 | <dd> |
| 993 | <p> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 994 | Output the distribution of relative amount of changes for each |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 995 | sub-directory. The behavior of <code>--dirstat</code> can be customized by |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 996 | passing it a comma separated list of parameters. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 997 | The defaults are controlled by the <code>diff.dirstat</code> configuration |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 998 | variable (see <a href="git-config.html">git-config(1)</a>). |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 999 | The following parameters are available: |
| Junio C Hamano | 6a45be9 | 2008-04-22 08:19:03 | [diff] [blame] | 1000 | </p> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1001 | <div class="openblock"> |
| 1002 | <div class="content"> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1003 | <div class="dlist"><dl> |
| 1004 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1005 | <code>changes</code> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1006 | </dt> |
| 1007 | <dd> |
| 1008 | <p> |
| 1009 | Compute the dirstat numbers by counting the lines that have been |
| 1010 | removed from the source, or added to the destination. This ignores |
| 1011 | the amount of pure code movements within a file. In other words, |
| 1012 | rearranging lines in a file is not counted as much as other changes. |
| 1013 | This is the default behavior when no parameter is given. |
| 1014 | </p> |
| Junio C Hamano | 6a45be9 | 2008-04-22 08:19:03 | [diff] [blame] | 1015 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1016 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1017 | <code>lines</code> |
| Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 1018 | </dt> |
| 1019 | <dd> |
| 1020 | <p> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1021 | Compute the dirstat numbers by doing the regular line-based diff |
| 1022 | analysis, and summing the removed/added line counts. (For binary |
| 1023 | files, count 64-byte chunks instead, since binary files have no |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1024 | natural concept of lines). This is a more expensive <code>--dirstat</code> |
| 1025 | behavior than the <code>changes</code> behavior, but it does count rearranged |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1026 | lines within a file as much as other changes. The resulting output |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1027 | is consistent with what you get from the other <code>--*stat</code> options. |
| Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 1028 | </p> |
| 1029 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1030 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1031 | <code>files</code> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1032 | </dt> |
| 1033 | <dd> |
| 1034 | <p> |
| 1035 | Compute the dirstat numbers by counting the number of files changed. |
| 1036 | Each changed file counts equally in the dirstat analysis. This is |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1037 | the computationally cheapest <code>--dirstat</code> behavior, since it does |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1038 | not have to look at the file contents at all. |
| 1039 | </p> |
| 1040 | </dd> |
| 1041 | <dt class="hdlist1"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1042 | <code>cumulative</code> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1043 | </dt> |
| 1044 | <dd> |
| 1045 | <p> |
| 1046 | Count changes in a child directory for the parent directory as well. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1047 | Note that when using <code>cumulative</code>, the sum of the percentages |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1048 | reported may exceed 100%. The default (non-cumulative) behavior can |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1049 | be specified with the <code>noncumulative</code> parameter. |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1050 | </p> |
| 1051 | </dd> |
| 1052 | <dt class="hdlist1"> |
| 1053 | <limit> |
| 1054 | </dt> |
| 1055 | <dd> |
| 1056 | <p> |
| 1057 | An integer parameter specifies a cut-off percent (3% by default). |
| 1058 | Directories contributing less than this percentage of the changes |
| 1059 | are not shown in the output. |
| 1060 | </p> |
| 1061 | </dd> |
| 1062 | </dl></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1063 | </div></div> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1064 | <div class="paragraph"><p>Example: The following will count changed files, while ignoring |
| 1065 | directories with less than 10% of the total amount of changed files, |
| 1066 | and accumulating child directory counts in the parent directories: |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1067 | <code>--dirstat=files,10,cumulative</code>.</p></div> |
| Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1068 | </dd> |
| 1069 | <dt class="hdlist1"> |
| Junio C Hamano | 6959c6c | 2006-05-17 10:34:11 | [diff] [blame] | 1070 | --summary |
| 1071 | </dt> |
| 1072 | <dd> |
| 1073 | <p> |
| 1074 | Output a condensed summary of extended header information |
| 1075 | such as creations, renames and mode changes. |
| 1076 | </p> |
| 1077 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1078 | <dt class="hdlist1"> |
| Junio C Hamano | d1308c9 | 2006-04-16 11:01:09 | [diff] [blame] | 1079 | --patch-with-stat |
| 1080 | </dt> |
| 1081 | <dd> |
| 1082 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1083 | Synonym for <code>-p --stat</code>. |
| Junio C Hamano | d1308c9 | 2006-04-16 11:01:09 | [diff] [blame] | 1084 | </p> |
| 1085 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1086 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1087 | -z |
| 1088 | </dt> |
| 1089 | <dd> |
| 1090 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1091 | When <code>--raw</code>, <code>--numstat</code>, <code>--name-only</code> or <code>--name-status</code> has been |
| Junio C Hamano | 0c053e8 | 2010-04-19 06:46:34 | [diff] [blame] | 1092 | given, do not munge pathnames and use NULs as output field terminators. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1093 | </p> |
| Junio C Hamano | 0f6f3bf | 2017-03-13 07:01:53 | [diff] [blame] | 1094 | <div class="paragraph"><p>Without this option, pathnames with "unusual" characters are quoted as |
| 1095 | explained for the configuration variable <code>core.quotePath</code> (see |
| 1096 | <a href="git-config.html">git-config(1)</a>).</p></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1097 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1098 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1099 | --name-only |
| 1100 | </dt> |
| 1101 | <dd> |
| 1102 | <p> |
| 1103 | Show only names of changed files. |
| 1104 | </p> |
| 1105 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1106 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1107 | --name-status |
| 1108 | </dt> |
| 1109 | <dd> |
| 1110 | <p> |
| Junio C Hamano | a9aee78 | 2008-04-23 16:09:20 | [diff] [blame] | 1111 | Show only names and status of changed files. See the description |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1112 | of the <code>--diff-filter</code> option on what the status letters mean. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1113 | </p> |
| 1114 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1115 | <dt class="hdlist1"> |
| Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 1116 | --submodule[=<format>] |
| 1117 | </dt> |
| 1118 | <dd> |
| 1119 | <p> |
| Junio C Hamano | cd45166 | 2016-09-13 00:54:09 | [diff] [blame] | 1120 | Specify how differences in submodules are shown. When specifying |
| 1121 | <code>--submodule=short</code> the <em>short</em> format is used. This format just |
| 1122 | shows the names of the commits at the beginning and end of the range. |
| 1123 | When <code>--submodule</code> or <code>--submodule=log</code> is specified, the <em>log</em> |
| 1124 | format is used. This format lists the commits in the range like |
| 1125 | <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does. When <code>--submodule=diff</code> |
| 1126 | is specified, the <em>diff</em> format is used. This format shows an |
| 1127 | inline diff of the changes in the submodule contents between the |
| 1128 | commit range. Defaults to <code>diff.submodule</code> or the <em>short</em> format |
| 1129 | if the config option is unset. |
| Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 1130 | </p> |
| 1131 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1132 | <dt class="hdlist1"> |
| Junio C Hamano | 4aa0bcc | 2010-03-03 05:13:12 | [diff] [blame] | 1133 | --color[=<when>] |
| Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 1134 | </dt> |
| 1135 | <dd> |
| 1136 | <p> |
| 1137 | Show colored diff. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1138 | <code>--color</code> (i.e. without <em>=<when></em>) is the same as <code>--color=always</code>. |
| 1139 | <em><when></em> can be one of <code>always</code>, <code>never</code>, or <code>auto</code>. |
| Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 1140 | </p> |
| 1141 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1142 | <dt class="hdlist1"> |
| Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 1143 | --no-color |
| 1144 | </dt> |
| 1145 | <dd> |
| 1146 | <p> |
| Junio C Hamano | 5f2627d | 2011-05-06 20:23:48 | [diff] [blame] | 1147 | Turn off colored diff. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1148 | It is the same as <code>--color=never</code>. |
| Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 1149 | </p> |
| 1150 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1151 | <dt class="hdlist1"> |
| Junio C Hamano | fb1fdf1 | 2017-08-27 06:14:59 | [diff] [blame] | 1152 | --color-moved[=<mode>] |
| 1153 | </dt> |
| 1154 | <dd> |
| 1155 | <p> |
| 1156 | Moved lines of code are colored differently. |
| 1157 | The <mode> defaults to <em>no</em> if the option is not given |
| 1158 | and to <em>zebra</em> if the option with no mode is given. |
| 1159 | The mode must be one of: |
| 1160 | </p> |
| 1161 | <div class="openblock"> |
| 1162 | <div class="content"> |
| 1163 | <div class="dlist"><dl> |
| 1164 | <dt class="hdlist1"> |
| 1165 | no |
| 1166 | </dt> |
| 1167 | <dd> |
| 1168 | <p> |
| 1169 | Moved lines are not highlighted. |
| 1170 | </p> |
| 1171 | </dd> |
| 1172 | <dt class="hdlist1"> |
| 1173 | default |
| 1174 | </dt> |
| 1175 | <dd> |
| 1176 | <p> |
| 1177 | Is a synonym for <code>zebra</code>. This may change to a more sensible mode |
| 1178 | in the future. |
| 1179 | </p> |
| 1180 | </dd> |
| 1181 | <dt class="hdlist1"> |
| 1182 | plain |
| 1183 | </dt> |
| 1184 | <dd> |
| 1185 | <p> |
| 1186 | Any line that is added in one location and was removed |
| 1187 | in another location will be colored with <em>color.diff.newMoved</em>. |
| 1188 | Similarly <em>color.diff.oldMoved</em> will be used for removed lines |
| 1189 | that are added somewhere else in the diff. This mode picks up any |
| 1190 | moved line, but it is not very useful in a review to determine |
| 1191 | if a block of code was moved without permutation. |
| 1192 | </p> |
| 1193 | </dd> |
| 1194 | <dt class="hdlist1"> |
| 1195 | zebra |
| 1196 | </dt> |
| 1197 | <dd> |
| 1198 | <p> |
| 1199 | Blocks of moved text of at least 20 alphanumeric characters |
| 1200 | are detected greedily. The detected blocks are |
| 1201 | painted using either the <em>color.diff.{old,new}Moved</em> color or |
| 1202 | <em>color.diff.{old,new}MovedAlternative</em>. The change between |
| 1203 | the two colors indicates that a new block was detected. |
| 1204 | </p> |
| 1205 | </dd> |
| 1206 | <dt class="hdlist1"> |
| 1207 | dimmed_zebra |
| 1208 | </dt> |
| 1209 | <dd> |
| 1210 | <p> |
| 1211 | Similar to <em>zebra</em>, but additional dimming of uninteresting parts |
| 1212 | of moved code is performed. The bordering lines of two adjacent |
| 1213 | blocks are considered interesting, the rest is uninteresting. |
| 1214 | </p> |
| 1215 | </dd> |
| 1216 | </dl></div> |
| 1217 | </div></div> |
| 1218 | </dd> |
| 1219 | <dt class="hdlist1"> |
| Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1220 | --word-diff[=<mode>] |
| Junio C Hamano | 85e45fa | 2006-08-13 07:47:41 | [diff] [blame] | 1221 | </dt> |
| 1222 | <dd> |
| 1223 | <p> |
| Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1224 | Show a word diff, using the <mode> to delimit changed words. |
| 1225 | By default, words are delimited by whitespace; see |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1226 | <code>--word-diff-regex</code> below. The <mode> defaults to <em>plain</em>, and |
| Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1227 | must be one of: |
| Junio C Hamano | 85e45fa | 2006-08-13 07:47:41 | [diff] [blame] | 1228 | </p> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1229 | <div class="openblock"> |
| 1230 | <div class="content"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1231 | <div class="dlist"><dl> |
| 1232 | <dt class="hdlist1"> |
| Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1233 | color |
| 1234 | </dt> |
| 1235 | <dd> |
| 1236 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1237 | Highlight changed words using only colors. Implies <code>--color</code>. |
| Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1238 | </p> |
| 1239 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1240 | <dt class="hdlist1"> |
| Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1241 | plain |
| 1242 | </dt> |
| 1243 | <dd> |
| 1244 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1245 | Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no |
| Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1246 | attempts to escape the delimiters if they appear in the input, |
| 1247 | so the output may be ambiguous. |
| 1248 | </p> |
| 1249 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1250 | <dt class="hdlist1"> |
| Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1251 | porcelain |
| 1252 | </dt> |
| 1253 | <dd> |
| 1254 | <p> |
| 1255 | Use a special line-based format intended for script |
| 1256 | consumption. Added/removed/unchanged runs are printed in the |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1257 | usual unified diff format, starting with a <code>+</code>/<code>-</code>/` ` |
| Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1258 | character at the beginning of the line and extending to the |
| 1259 | end of the line. Newlines in the input are represented by a |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1260 | tilde <code>~</code> on a line of its own. |
| Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1261 | </p> |
| 1262 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1263 | <dt class="hdlist1"> |
| Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1264 | none |
| 1265 | </dt> |
| 1266 | <dd> |
| 1267 | <p> |
| 1268 | Disable word diff again. |
| 1269 | </p> |
| 1270 | </dd> |
| 1271 | </dl></div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1272 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1273 | <div class="paragraph"><p>Note that despite the name of the first mode, color is used to |
| Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1274 | highlight the changed parts in all modes if enabled.</p></div> |
| 1275 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1276 | <dt class="hdlist1"> |
| Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1277 | --word-diff-regex=<regex> |
| 1278 | </dt> |
| 1279 | <dd> |
| 1280 | <p> |
| 1281 | Use <regex> to decide what a word is, instead of considering |
| 1282 | runs of non-whitespace to be a word. Also implies |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1283 | <code>--word-diff</code> unless it was already enabled. |
| Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1284 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1285 | <div class="paragraph"><p>Every non-overlapping match of the |
| Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 1286 | <regex> is considered a word. Anything between these matches is |
| 1287 | considered whitespace and ignored(!) for the purposes of finding |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1288 | differences. You may want to append <code>|[^[:space:]]</code> to your regular |
| Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 1289 | expression to make sure that it matches all non-whitespace characters. |
| 1290 | A match that contains a newline is silently truncated(!) at the |
| 1291 | newline.</p></div> |
| Junio C Hamano | 713eded | 2015-12-03 00:24:02 | [diff] [blame] | 1292 | <div class="paragraph"><p>For example, <code>--word-diff-regex=.</code> will treat each character as a word |
| 1293 | and, correspondingly, show differences character by character.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1294 | <div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see |
| Junio C Hamano | 198b1f1 | 2016-05-17 22:27:24 | [diff] [blame] | 1295 | <a href="gitattributes.html">gitattributes(5)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly |
| Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 1296 | overrides any diff driver or configuration setting. Diff drivers |
| 1297 | override configuration settings.</p></div> |
| Junio C Hamano | 85e45fa | 2006-08-13 07:47:41 | [diff] [blame] | 1298 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1299 | <dt class="hdlist1"> |
| Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1300 | --color-words[=<regex>] |
| 1301 | </dt> |
| 1302 | <dd> |
| 1303 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1304 | Equivalent to <code>--word-diff=color</code> plus (if a regex was |
| 1305 | specified) <code>--word-diff-regex=<regex></code>. |
| Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1306 | </p> |
| 1307 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1308 | <dt class="hdlist1"> |
| Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 1309 | --no-renames |
| 1310 | </dt> |
| 1311 | <dd> |
| 1312 | <p> |
| 1313 | Turn off rename detection, even when the configuration |
| 1314 | file gives the default to do so. |
| 1315 | </p> |
| 1316 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1317 | <dt class="hdlist1"> |
| Junio C Hamano | a890c4f | 2007-01-28 10:29:21 | [diff] [blame] | 1318 | --check |
| 1319 | </dt> |
| 1320 | <dd> |
| 1321 | <p> |
| Junio C Hamano | 84ea1e4 | 2016-04-08 21:53:48 | [diff] [blame] | 1322 | Warn if changes introduce conflict markers or whitespace errors. |
| 1323 | What are considered whitespace errors is controlled by <code>core.whitespace</code> |
| Junio C Hamano | 6005bfa | 2011-06-23 00:51:22 | [diff] [blame] | 1324 | configuration. By default, trailing whitespaces (including |
| 1325 | lines that solely consist of whitespaces) and a space character |
| 1326 | that is immediately followed by a tab character inside the |
| 1327 | initial indent of the line are considered whitespace errors. |
| 1328 | Exits with non-zero status if problems are found. Not compatible |
| 1329 | with --exit-code. |
| Junio C Hamano | a890c4f | 2007-01-28 10:29:21 | [diff] [blame] | 1330 | </p> |
| 1331 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1332 | <dt class="hdlist1"> |
| Junio C Hamano | 8c5d594 | 2015-06-11 19:37:48 | [diff] [blame] | 1333 | --ws-error-highlight=<kind> |
| 1334 | </dt> |
| 1335 | <dd> |
| 1336 | <p> |
| Junio C Hamano | 4b2a6c1 | 2017-08-22 18:32:37 | [diff] [blame] | 1337 | Highlight whitespace errors in the <code>context</code>, <code>old</code> or <code>new</code> |
| 1338 | lines of the diff. Multiple values are separated by comma, |
| 1339 | <code>none</code> resets previous values, <code>default</code> reset the list to |
| 1340 | <code>new</code> and <code>all</code> is a shorthand for <code>old,new,context</code>. When |
| 1341 | this option is not given, and the configuration variable |
| 1342 | <code>diff.wsErrorHighlight</code> is not set, only whitespace errors in |
| 1343 | <code>new</code> lines are highlighted. The whitespace errors are colored |
| 1344 | whith <code>color.diff.whitespace</code>. |
| Junio C Hamano | 8c5d594 | 2015-06-11 19:37:48 | [diff] [blame] | 1345 | </p> |
| 1346 | </dd> |
| 1347 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1348 | --full-index |
| 1349 | </dt> |
| 1350 | <dd> |
| 1351 | <p> |
| Junio C Hamano | 5cf43ca | 2008-08-20 09:14:14 | [diff] [blame] | 1352 | Instead of the first handful of characters, show the full |
| 1353 | pre- and post-image blob object names on the "index" |
| 1354 | line when generating patch format output. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1355 | </p> |
| 1356 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1357 | <dt class="hdlist1"> |
| Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 1358 | --binary |
| 1359 | </dt> |
| 1360 | <dd> |
| 1361 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1362 | In addition to <code>--full-index</code>, output a binary diff that |
| 1363 | can be applied with <code>git-apply</code>. |
| Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 1364 | </p> |
| 1365 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1366 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1367 | --abbrev[=<n>] |
| 1368 | </dt> |
| 1369 | <dd> |
| 1370 | <p> |
| 1371 | Instead of showing the full 40-byte hexadecimal object |
| 1372 | name in diff-raw format output and diff-tree header |
| Junio C Hamano | 6efe302 | 2009-01-13 16:47:56 | [diff] [blame] | 1373 | lines, show only a partial prefix. This is |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1374 | independent of the <code>--full-index</code> option above, which controls |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1375 | the diff-patch output format. Non default number of |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1376 | digits can be specified with <code>--abbrev=<n></code>. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1377 | </p> |
| 1378 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1379 | <dt class="hdlist1"> |
| Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1380 | -B[<n>][/<m>] |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1381 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1382 | <dt class="hdlist1"> |
| Junio C Hamano | 39c7a69 | 2010-10-27 06:08:54 | [diff] [blame] | 1383 | --break-rewrites[=[<n>][/<m>]] |
| 1384 | </dt> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1385 | <dd> |
| 1386 | <p> |
| Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1387 | Break complete rewrite changes into pairs of delete and |
| 1388 | create. This serves two purposes: |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1389 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1390 | <div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file |
| Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1391 | not as a series of deletion and insertion mixed together with a very |
| 1392 | few lines that happen to match textually as the context, but as a |
| 1393 | single deletion of everything old followed by a single insertion of |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1394 | everything new, and the number <code>m</code> controls this aspect of the -B |
| 1395 | option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the |
| Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 1396 | original should remain in the result for Git to consider it a total |
| Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1397 | rewrite (i.e. otherwise the resulting patch will be a series of |
| 1398 | deletion and insertion mixed together with context lines).</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1399 | <div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the |
| Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1400 | source of a rename (usually -M only considers a file that disappeared |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1401 | as the source of a rename), and the number <code>n</code> controls this aspect of |
| 1402 | the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1403 | addition and deletion compared to 20% or more of the file’s size are |
| Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1404 | eligible for being picked up as a possible source of a rename to |
| 1405 | another file.</p></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1406 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1407 | <dt class="hdlist1"> |
| Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1408 | -M[<n>] |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1409 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1410 | <dt class="hdlist1"> |
| Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1411 | --find-renames[=<n>] |
| Junio C Hamano | 39c7a69 | 2010-10-27 06:08:54 | [diff] [blame] | 1412 | </dt> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1413 | <dd> |
| 1414 | <p> |
| 1415 | Detect renames. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1416 | If <code>n</code> is specified, it is a threshold on the similarity |
| Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1417 | index (i.e. amount of addition/deletions compared to the |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1418 | file’s size). For example, <code>-M90%</code> means Git should consider a |
| Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1419 | delete/add pair to be a rename if more than 90% of the file |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1420 | hasn’t changed. Without a <code>%</code> sign, the number is to be read as |
| 1421 | a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes |
| 1422 | 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is |
| 1423 | the same as <code>-M5%</code>. To limit detection to exact renames, use |
| 1424 | <code>-M100%</code>. The default similarity index is 50%. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1425 | </p> |
| 1426 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1427 | <dt class="hdlist1"> |
| Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1428 | -C[<n>] |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1429 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1430 | <dt class="hdlist1"> |
| Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1431 | --find-copies[=<n>] |
| Junio C Hamano | 39c7a69 | 2010-10-27 06:08:54 | [diff] [blame] | 1432 | </dt> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1433 | <dd> |
| 1434 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1435 | Detect copies as well as renames. See also <code>--find-copies-harder</code>. |
| 1436 | If <code>n</code> is specified, it has the same meaning as for <code>-M<n></code>. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1437 | </p> |
| 1438 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1439 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1440 | --find-copies-harder |
| 1441 | </dt> |
| 1442 | <dd> |
| 1443 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1444 | For performance reasons, by default, <code>-C</code> option finds copies only |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1445 | if the original file of the copy was modified in the same |
| 1446 | changeset. This flag makes the command |
| 1447 | inspect unmodified files as candidates for the source of |
| 1448 | copy. This is a very expensive operation for large |
| Junio C Hamano | 16f9887 | 2007-06-12 16:09:14 | [diff] [blame] | 1449 | projects, so use it with caution. Giving more than one |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1450 | <code>-C</code> option has the same effect. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1451 | </p> |
| 1452 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1453 | <dt class="hdlist1"> |
| Junio C Hamano | b02377c | 2011-04-28 22:26:02 | [diff] [blame] | 1454 | -D |
| 1455 | </dt> |
| 1456 | <dt class="hdlist1"> |
| 1457 | --irreversible-delete |
| 1458 | </dt> |
| 1459 | <dd> |
| 1460 | <p> |
| 1461 | Omit the preimage for deletes, i.e. print only the header but not |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1462 | the diff between the preimage and <code>/dev/null</code>. The resulting patch |
| 1463 | is not meant to be applied with <code>patch</code> or <code>git apply</code>; this is |
| Junio C Hamano | b02377c | 2011-04-28 22:26:02 | [diff] [blame] | 1464 | solely for people who want to just concentrate on reviewing the |
| Junio C Hamano | d16fd1b | 2017-08-04 16:41:51 | [diff] [blame] | 1465 | text after the change. In addition, the output obviously lacks |
| Junio C Hamano | b02377c | 2011-04-28 22:26:02 | [diff] [blame] | 1466 | enough information to apply such a patch in reverse, even manually, |
| 1467 | hence the name of the option. |
| 1468 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1469 | <div class="paragraph"><p>When used together with <code>-B</code>, omit also the preimage in the deletion part |
| Junio C Hamano | b02377c | 2011-04-28 22:26:02 | [diff] [blame] | 1470 | of a delete/create pair.</p></div> |
| 1471 | </dd> |
| 1472 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1473 | -l<num> |
| 1474 | </dt> |
| 1475 | <dd> |
| 1476 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1477 | The <code>-M</code> and <code>-C</code> options require O(n^2) processing time where n |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1478 | is the number of potential rename/copy targets. This |
| 1479 | option prevents rename/copy detection from running if |
| 1480 | the number of rename/copy targets exceeds the specified |
| 1481 | number. |
| 1482 | </p> |
| 1483 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1484 | <dt class="hdlist1"> |
| Junio C Hamano | 982eb11 | 2010-11-18 00:53:09 | [diff] [blame] | 1485 | --diff-filter=[(A|C|D|M|R|T|U|X|B)…[*]] |
| 1486 | </dt> |
| 1487 | <dd> |
| 1488 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1489 | Select only files that are Added (<code>A</code>), Copied (<code>C</code>), |
| 1490 | Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their |
| 1491 | type (i.e. regular file, symlink, submodule, …) changed (<code>T</code>), |
| 1492 | are Unmerged (<code>U</code>), are |
| 1493 | Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>). |
| Junio C Hamano | 982eb11 | 2010-11-18 00:53:09 | [diff] [blame] | 1494 | Any combination of the filter characters (including none) can be used. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1495 | When <code>*</code> (All-or-none) is added to the combination, all |
| Junio C Hamano | 982eb11 | 2010-11-18 00:53:09 | [diff] [blame] | 1496 | paths are selected if there is any file that matches |
| 1497 | other criteria in the comparison; if there is no file |
| 1498 | that matches other criteria, nothing is selected. |
| 1499 | </p> |
| Junio C Hamano | eed15af | 2016-07-25 22:49:42 | [diff] [blame] | 1500 | <div class="paragraph"><p>Also, these upper-case letters can be downcased to exclude. E.g. |
| 1501 | <code>--diff-filter=ad</code> excludes added and deleted paths.</p></div> |
| Junio C Hamano | 3a34f15 | 2018-01-09 23:09:38 | [diff] [blame] | 1502 | <div class="paragraph"><p>Note that not all diffs can feature all types. For instance, diffs |
| 1503 | from the index to the working tree can never have Added entries |
| 1504 | (because the set of paths included in the diff is limited by what is in |
| 1505 | the index). Similarly, copied and renamed entries cannot appear if |
| 1506 | detection for those types is disabled.</p></div> |
| Junio C Hamano | 982eb11 | 2010-11-18 00:53:09 | [diff] [blame] | 1507 | </dd> |
| 1508 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1509 | -S<string> |
| 1510 | </dt> |
| 1511 | <dd> |
| 1512 | <p> |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 1513 | Look for differences that change the number of occurrences of |
| 1514 | the specified string (i.e. addition/deletion) in a file. |
| 1515 | Intended for the scripter’s use. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1516 | </p> |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 1517 | <div class="paragraph"><p>It is useful when you’re looking for an exact block of code (like a |
| 1518 | struct), and want to know the history of that block since it first |
| 1519 | came into being: use the feature iteratively to feed the interesting |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1520 | block in the preimage back into <code>-S</code>, and keep going until you get the |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 1521 | very first version of the block.</p></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1522 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1523 | <dt class="hdlist1"> |
| Junio C Hamano | 3b4609d | 2010-09-30 00:04:34 | [diff] [blame] | 1524 | -G<regex> |
| 1525 | </dt> |
| 1526 | <dd> |
| 1527 | <p> |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 1528 | Look for differences whose patch text contains added/removed |
| 1529 | lines that match <regex>. |
| Junio C Hamano | 3b4609d | 2010-09-30 00:04:34 | [diff] [blame] | 1530 | </p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1531 | <div class="paragraph"><p>To illustrate the difference between <code>-S<regex> --pickaxe-regex</code> and |
| 1532 | <code>-G<regex></code>, consider a commit with the following diff in the same |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 1533 | file:</p></div> |
| 1534 | <div class="listingblock"> |
| 1535 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1536 | <pre><code>+ return !regexec(regexp, two->ptr, 1, &regmatch, 0); |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 1537 | ... |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1538 | - hit = !regexec(regexp, mf2.ptr, 1, &regmatch, 0);</code></pre> |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 1539 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1540 | <div class="paragraph"><p>While <code>git log -G"regexec\(regexp"</code> will show this commit, <code>git log |
| 1541 | -S"regexec\(regexp" --pickaxe-regex</code> will not (because the number of |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 1542 | occurrences of that string did not change).</p></div> |
| 1543 | <div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more |
| 1544 | information.</p></div> |
| Junio C Hamano | 3b4609d | 2010-09-30 00:04:34 | [diff] [blame] | 1545 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1546 | <dt class="hdlist1"> |
| Junio C Hamano | 7b9cce9 | 2018-01-23 22:34:27 | [diff] [blame] | 1547 | --find-object=<object-id> |
| 1548 | </dt> |
| 1549 | <dd> |
| 1550 | <p> |
| 1551 | Look for differences that change the number of occurrences of |
| 1552 | the specified object. Similar to <code>-S</code>, just the argument is different |
| 1553 | in that it doesn’t search for a specific string but for a specific |
| 1554 | object id. |
| 1555 | </p> |
| 1556 | <div class="paragraph"><p>The object can be a blob or a submodule commit. It implies the <code>-t</code> option in |
| 1557 | <code>git-log</code> to also find trees.</p></div> |
| 1558 | </dd> |
| 1559 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1560 | --pickaxe-all |
| 1561 | </dt> |
| 1562 | <dd> |
| 1563 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1564 | When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1565 | changeset, not just the files that contain the change |
| 1566 | in <string>. |
| 1567 | </p> |
| 1568 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1569 | <dt class="hdlist1"> |
| Junio C Hamano | bfe9e75 | 2006-04-05 21:43:28 | [diff] [blame] | 1570 | --pickaxe-regex |
| 1571 | </dt> |
| 1572 | <dd> |
| 1573 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1574 | Treat the <string> given to <code>-S</code> as an extended POSIX regular |
| Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 1575 | expression to match. |
| Junio C Hamano | bfe9e75 | 2006-04-05 21:43:28 | [diff] [blame] | 1576 | </p> |
| 1577 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1578 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1579 | -O<orderfile> |
| 1580 | </dt> |
| 1581 | <dd> |
| 1582 | <p> |
| Junio C Hamano | bcd98f4 | 2017-01-24 00:12:16 | [diff] [blame] | 1583 | Control the order in which files appear in the output. |
| Junio C Hamano | 322c624 | 2015-03-23 21:32:46 | [diff] [blame] | 1584 | This overrides the <code>diff.orderFile</code> configuration variable |
| 1585 | (see <a href="git-config.html">git-config(1)</a>). To cancel <code>diff.orderFile</code>, |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1586 | use <code>-O/dev/null</code>. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1587 | </p> |
| Junio C Hamano | bcd98f4 | 2017-01-24 00:12:16 | [diff] [blame] | 1588 | <div class="paragraph"><p>The output order is determined by the order of glob patterns in |
| 1589 | <orderfile>. |
| 1590 | All files with pathnames that match the first pattern are output |
| 1591 | first, all files with pathnames that match the second pattern (but not |
| 1592 | the first) are output next, and so on. |
| 1593 | All files with pathnames that do not match any pattern are output |
| 1594 | last, as if there was an implicit match-all pattern at the end of the |
| 1595 | file. |
| 1596 | If multiple pathnames have the same rank (they match the same pattern |
| 1597 | but no earlier patterns), their output order relative to each other is |
| 1598 | the normal order.</p></div> |
| 1599 | <div class="paragraph"><p><orderfile> is parsed as follows:</p></div> |
| 1600 | <div class="openblock"> |
| 1601 | <div class="content"> |
| 1602 | <div class="ulist"><ul> |
| 1603 | <li> |
| 1604 | <p> |
| 1605 | Blank lines are ignored, so they can be used as separators for |
| 1606 | readability. |
| 1607 | </p> |
| 1608 | </li> |
| 1609 | <li> |
| 1610 | <p> |
| 1611 | Lines starting with a hash ("<code>#</code>") are ignored, so they can be used |
| 1612 | for comments. Add a backslash ("<code>\</code>") to the beginning of the |
| 1613 | pattern if it starts with a hash. |
| 1614 | </p> |
| 1615 | </li> |
| 1616 | <li> |
| 1617 | <p> |
| 1618 | Each other line contains a single pattern. |
| 1619 | </p> |
| 1620 | </li> |
| 1621 | </ul></div> |
| 1622 | </div></div> |
| 1623 | <div class="paragraph"><p>Patterns have the same syntax and semantics as patterns used for |
| 1624 | fnmantch(3) without the FNM_PATHNAME flag, except a pathname also |
| 1625 | matches a pattern if removing any number of the final pathname |
| 1626 | components matches the pattern. For example, the pattern "<code>foo*bar</code>" |
| 1627 | matches "<code>fooasdfbar</code>" and "<code>foo/bar/baz/asdf</code>" but not "<code>foobarx</code>".</p></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1628 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1629 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1630 | -R |
| 1631 | </dt> |
| 1632 | <dd> |
| 1633 | <p> |
| 1634 | Swap two inputs; that is, show differences from index or |
| 1635 | on-disk file to tree contents. |
| 1636 | </p> |
| 1637 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1638 | <dt class="hdlist1"> |
| Junio C Hamano | 24bc09a | 2008-02-28 00:27:44 | [diff] [blame] | 1639 | --relative[=<path>] |
| 1640 | </dt> |
| 1641 | <dd> |
| 1642 | <p> |
| 1643 | When run from a subdirectory of the project, it can be |
| 1644 | told to exclude changes outside the directory and show |
| 1645 | pathnames relative to it with this option. When you are |
| 1646 | not in a subdirectory (e.g. in a bare repository), you |
| 1647 | can name which subdirectory to make the output relative |
| 1648 | to by giving a <path> as an argument. |
| 1649 | </p> |
| 1650 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1651 | <dt class="hdlist1"> |
| Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 1652 | -a |
| 1653 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1654 | <dt class="hdlist1"> |
| Junio C Hamano | c26f548 | 2006-07-09 09:38:14 | [diff] [blame] | 1655 | --text |
| 1656 | </dt> |
| 1657 | <dd> |
| 1658 | <p> |
| 1659 | Treat all files as text. |
| 1660 | </p> |
| 1661 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1662 | <dt class="hdlist1"> |
| Junio C Hamano | 4886c77 | 2017-11-27 03:33:28 | [diff] [blame] | 1663 | --ignore-cr-at-eol |
| 1664 | </dt> |
| 1665 | <dd> |
| 1666 | <p> |
| 1667 | Ignore carrige-return at the end of line when doing a comparison. |
| 1668 | </p> |
| 1669 | </dd> |
| 1670 | <dt class="hdlist1"> |
| Junio C Hamano | fd46896 | 2007-02-14 23:45:04 | [diff] [blame] | 1671 | --ignore-space-at-eol |
| 1672 | </dt> |
| 1673 | <dd> |
| 1674 | <p> |
| Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 1675 | Ignore changes in whitespace at EOL. |
| Junio C Hamano | fd46896 | 2007-02-14 23:45:04 | [diff] [blame] | 1676 | </p> |
| 1677 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1678 | <dt class="hdlist1"> |
| Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 1679 | -b |
| 1680 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1681 | <dt class="hdlist1"> |
| Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 1682 | --ignore-space-change |
| 1683 | </dt> |
| 1684 | <dd> |
| 1685 | <p> |
| Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 1686 | Ignore changes in amount of whitespace. This ignores whitespace |
| 1687 | at line end, and considers all other sequences of one or |
| 1688 | more whitespace characters to be equivalent. |
| Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 1689 | </p> |
| 1690 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1691 | <dt class="hdlist1"> |
| Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 1692 | -w |
| Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 1693 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1694 | <dt class="hdlist1"> |
| Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 1695 | --ignore-all-space |
| 1696 | </dt> |
| 1697 | <dd> |
| 1698 | <p> |
| Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 1699 | Ignore whitespace when comparing lines. This ignores |
| 1700 | differences even if one line has whitespace where the other |
| Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 1701 | line has none. |
| 1702 | </p> |
| 1703 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1704 | <dt class="hdlist1"> |
| Junio C Hamano | a195230 | 2013-07-01 21:31:18 | [diff] [blame] | 1705 | --ignore-blank-lines |
| 1706 | </dt> |
| 1707 | <dd> |
| 1708 | <p> |
| 1709 | Ignore changes whose lines are all blank. |
| 1710 | </p> |
| 1711 | </dd> |
| 1712 | <dt class="hdlist1"> |
| Junio C Hamano | 1d40ee8 | 2009-01-07 10:14:16 | [diff] [blame] | 1713 | --inter-hunk-context=<lines> |
| 1714 | </dt> |
| 1715 | <dd> |
| 1716 | <p> |
| 1717 | Show the context between diff hunks, up to the specified number |
| 1718 | of lines, thereby fusing hunks that are close to each other. |
| Junio C Hamano | bcd98f4 | 2017-01-24 00:12:16 | [diff] [blame] | 1719 | Defaults to <code>diff.interHunkContext</code> or 0 if the config option |
| 1720 | is unset. |
| Junio C Hamano | 1d40ee8 | 2009-01-07 10:14:16 | [diff] [blame] | 1721 | </p> |
| 1722 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1723 | <dt class="hdlist1"> |
| Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1724 | -W |
| 1725 | </dt> |
| 1726 | <dt class="hdlist1"> |
| 1727 | --function-context |
| 1728 | </dt> |
| 1729 | <dd> |
| 1730 | <p> |
| 1731 | Show whole surrounding functions of changes. |
| 1732 | </p> |
| 1733 | </dd> |
| 1734 | <dt class="hdlist1"> |
| Junio C Hamano | 48fd2f6 | 2007-03-19 02:02:30 | [diff] [blame] | 1735 | --exit-code |
| 1736 | </dt> |
| 1737 | <dd> |
| 1738 | <p> |
| 1739 | Make the program exit with codes similar to diff(1). |
| 1740 | That is, it exits with 1 if there were differences and |
| 1741 | 0 means no differences. |
| 1742 | </p> |
| 1743 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1744 | <dt class="hdlist1"> |
| Junio C Hamano | 35e5755 | 2007-03-25 07:54:35 | [diff] [blame] | 1745 | --quiet |
| 1746 | </dt> |
| 1747 | <dd> |
| 1748 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1749 | Disable all output of the program. Implies <code>--exit-code</code>. |
| Junio C Hamano | 35e5755 | 2007-03-25 07:54:35 | [diff] [blame] | 1750 | </p> |
| 1751 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1752 | <dt class="hdlist1"> |
| Junio C Hamano | bb0f404 | 2007-07-04 06:41:40 | [diff] [blame] | 1753 | --ext-diff |
| 1754 | </dt> |
| 1755 | <dd> |
| 1756 | <p> |
| 1757 | Allow an external diff helper to be executed. If you set an |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1758 | external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need |
| 1759 | to use this option with <a href="git-log.html">git-log(1)</a> and friends. |
| Junio C Hamano | bb0f404 | 2007-07-04 06:41:40 | [diff] [blame] | 1760 | </p> |
| 1761 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1762 | <dt class="hdlist1"> |
| Junio C Hamano | bb0f404 | 2007-07-04 06:41:40 | [diff] [blame] | 1763 | --no-ext-diff |
| 1764 | </dt> |
| 1765 | <dd> |
| 1766 | <p> |
| 1767 | Disallow external diff drivers. |
| 1768 | </p> |
| 1769 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1770 | <dt class="hdlist1"> |
| Junio C Hamano | c652aed | 2011-07-07 01:14:31 | [diff] [blame] | 1771 | --textconv |
| 1772 | </dt> |
| 1773 | <dt class="hdlist1"> |
| 1774 | --no-textconv |
| 1775 | </dt> |
| 1776 | <dd> |
| 1777 | <p> |
| 1778 | Allow (or disallow) external text conversion filters to be run |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1779 | when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for |
| Junio C Hamano | c652aed | 2011-07-07 01:14:31 | [diff] [blame] | 1780 | details. Because textconv filters are typically a one-way |
| 1781 | conversion, the resulting diff is suitable for human |
| 1782 | consumption, but cannot be applied. For this reason, textconv |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1783 | filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and |
| 1784 | <a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or |
| Junio C Hamano | c652aed | 2011-07-07 01:14:31 | [diff] [blame] | 1785 | diff plumbing commands. |
| 1786 | </p> |
| 1787 | </dd> |
| 1788 | <dt class="hdlist1"> |
| Junio C Hamano | 7d44952 | 2010-07-01 00:08:51 | [diff] [blame] | 1789 | --ignore-submodules[=<when>] |
| Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 1790 | </dt> |
| 1791 | <dd> |
| 1792 | <p> |
| Junio C Hamano | 7d44952 | 2010-07-01 00:08:51 | [diff] [blame] | 1793 | Ignore changes to submodules in the diff generation. <when> can be |
| Junio C Hamano | c710296 | 2013-05-29 23:57:17 | [diff] [blame] | 1794 | either "none", "untracked", "dirty" or "all", which is the default. |
| Junio C Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 1795 | Using "none" will consider the submodule modified when it either contains |
| 1796 | untracked or modified files or its HEAD differs from the commit recorded |
| 1797 | in the superproject and can be used to override any settings of the |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1798 | <em>ignore</em> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When |
| Junio C Hamano | 7d44952 | 2010-07-01 00:08:51 | [diff] [blame] | 1799 | "untracked" is used submodules are not considered dirty when they only |
| 1800 | contain untracked content (but they are still scanned for modified |
| 1801 | content). Using "dirty" ignores all changes to the work tree of submodules, |
| 1802 | only changes to the commits stored in the superproject are shown (this was |
| 1803 | the behavior until 1.7.0). Using "all" hides all changes to submodules. |
| Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 1804 | </p> |
| 1805 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1806 | <dt class="hdlist1"> |
| Junio C Hamano | e27cbd2 | 2007-12-21 17:57:33 | [diff] [blame] | 1807 | --src-prefix=<prefix> |
| 1808 | </dt> |
| 1809 | <dd> |
| 1810 | <p> |
| 1811 | Show the given source prefix instead of "a/". |
| 1812 | </p> |
| 1813 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1814 | <dt class="hdlist1"> |
| Junio C Hamano | e27cbd2 | 2007-12-21 17:57:33 | [diff] [blame] | 1815 | --dst-prefix=<prefix> |
| 1816 | </dt> |
| 1817 | <dd> |
| 1818 | <p> |
| 1819 | Show the given destination prefix instead of "b/". |
| 1820 | </p> |
| 1821 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1822 | <dt class="hdlist1"> |
| Junio C Hamano | e27cbd2 | 2007-12-21 17:57:33 | [diff] [blame] | 1823 | --no-prefix |
| 1824 | </dt> |
| 1825 | <dd> |
| 1826 | <p> |
| 1827 | Do not show any source or destination prefix. |
| 1828 | </p> |
| 1829 | </dd> |
| Junio C Hamano | cd45166 | 2016-09-13 00:54:09 | [diff] [blame] | 1830 | <dt class="hdlist1"> |
| 1831 | --line-prefix=<prefix> |
| 1832 | </dt> |
| 1833 | <dd> |
| 1834 | <p> |
| 1835 | Prepend an additional prefix to every line of output. |
| 1836 | </p> |
| 1837 | </dd> |
| Junio C Hamano | f7017f1 | 2016-10-27 23:31:34 | [diff] [blame] | 1838 | <dt class="hdlist1"> |
| 1839 | --ita-invisible-in-index |
| 1840 | </dt> |
| 1841 | <dd> |
| 1842 | <p> |
| 1843 | By default entries added by "git add -N" appear as an existing |
| 1844 | empty file in "git diff" and a new file in "git diff --cached". |
| 1845 | This option makes the entry appear as a new file in "git diff" |
| 1846 | and non-existent in "git diff --cached". This option could be |
| 1847 | reverted with <code>--ita-visible-in-index</code>. Both options are |
| 1848 | experimental and could be removed in future. |
| 1849 | </p> |
| 1850 | </dd> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1851 | </dl></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1852 | <div class="paragraph"><p>For more detailed explanation on these common options, see also |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1853 | <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1854 | <div class="dlist"><dl> |
| 1855 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1856 | <tree-ish> |
| 1857 | </dt> |
| 1858 | <dd> |
| 1859 | <p> |
| 1860 | The id of a tree object. |
| 1861 | </p> |
| 1862 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1863 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1864 | <path>… |
| 1865 | </dt> |
| 1866 | <dd> |
| 1867 | <p> |
| 1868 | If provided, the results are limited to a subset of files |
| 1869 | matching one of these prefix strings. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1870 | i.e., file matches <code>/^<pattern1>|<pattern2>|.../</code> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1871 | Note that this parameter does not provide any wildcard or regexp |
| 1872 | features. |
| 1873 | </p> |
| 1874 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1875 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1876 | -r |
| 1877 | </dt> |
| 1878 | <dd> |
| 1879 | <p> |
| 1880 | recurse into sub-trees |
| 1881 | </p> |
| 1882 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1883 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1884 | -t |
| 1885 | </dt> |
| 1886 | <dd> |
| 1887 | <p> |
| 1888 | show tree entry itself as well as subtrees. Implies -r. |
| 1889 | </p> |
| 1890 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1891 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1892 | --root |
| 1893 | </dt> |
| 1894 | <dd> |
| 1895 | <p> |
| Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 1896 | When <code>--root</code> is specified the initial commit will be shown as a big |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1897 | creation event. This is equivalent to a diff against the NULL tree. |
| 1898 | </p> |
| 1899 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1900 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1901 | --stdin |
| 1902 | </dt> |
| 1903 | <dd> |
| 1904 | <p> |
| Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 1905 | When <code>--stdin</code> is specified, the command does not take |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1906 | <tree-ish> arguments from the command line. Instead, it |
| Junio C Hamano | 3f2f6e5 | 2008-08-21 10:34:22 | [diff] [blame] | 1907 | reads lines containing either two <tree>, one <commit>, or a |
| 1908 | list of <commit> from its standard input. (Use a single space |
| 1909 | as separator.) |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1910 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1911 | <div class="paragraph"><p>When two trees are given, it compares the first tree with the second. |
| Junio C Hamano | 3f2f6e5 | 2008-08-21 10:34:22 | [diff] [blame] | 1912 | When a single commit is given, it compares the commit with its |
| 1913 | parents. The remaining commits, when given, are used as if they are |
| Junio C Hamano | b53db3c | 2008-08-07 00:17:52 | [diff] [blame] | 1914 | parents of the first commit.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1915 | <div class="paragraph"><p>When comparing two trees, the ID of both trees (separated by a space |
| Junio C Hamano | 3f2f6e5 | 2008-08-21 10:34:22 | [diff] [blame] | 1916 | and terminated by a newline) is printed before the difference. When |
| 1917 | comparing commits, the ID of the first (or only) commit, followed by a |
| 1918 | newline, is printed.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1919 | <div class="paragraph"><p>The following flags further affect the behavior when comparing |
| Junio C Hamano | 3f2f6e5 | 2008-08-21 10:34:22 | [diff] [blame] | 1920 | commits (but not trees).</p></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1921 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1922 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1923 | -m |
| 1924 | </dt> |
| 1925 | <dd> |
| 1926 | <p> |
| Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1927 | By default, <em>git diff-tree --stdin</em> does not show |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1928 | differences for merge commits. With this flag, it shows |
| Junio C Hamano | a8adb1e | 2006-04-10 23:46:16 | [diff] [blame] | 1929 | differences to that commit from all of its parents. See |
| Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 1930 | also <code>-c</code>. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1931 | </p> |
| 1932 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1933 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1934 | -s |
| 1935 | </dt> |
| 1936 | <dd> |
| 1937 | <p> |
| Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1938 | By default, <em>git diff-tree --stdin</em> shows differences, |
| Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 1939 | either in machine-readable form (without <code>-p</code>) or in patch |
| 1940 | form (with <code>-p</code>). This output can be suppressed. It is |
| 1941 | only useful with <code>-v</code> flag. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1942 | </p> |
| 1943 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1944 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1945 | -v |
| 1946 | </dt> |
| 1947 | <dd> |
| 1948 | <p> |
| Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1949 | This flag causes <em>git diff-tree --stdin</em> to also show |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1950 | the commit message before the differences. |
| 1951 | </p> |
| 1952 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1953 | <dt class="hdlist1"> |
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1954 | --pretty[=<format>] |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1955 | </dt> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1956 | <dt class="hdlist1"> |
| Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1957 | --format=<format> |
| Junio C Hamano | 0a23522 | 2009-03-06 08:21:09 | [diff] [blame] | 1958 | </dt> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1959 | <dd> |
| 1960 | <p> |
| Junio C Hamano | a3770f9 | 2007-07-25 08:53:33 | [diff] [blame] | 1961 | Pretty-print the contents of the commit logs in a given format, |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1962 | where <em><format></em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>, |
| Junio C Hamano | 6bb32e6 | 2015-02-17 22:11:26 | [diff] [blame] | 1963 | <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em>, <em>format:<string></em> |
| 1964 | and <em>tformat:<string></em>. When <em><format></em> is none of the above, |
| 1965 | and has <em>%placeholder</em> in it, it acts as if |
| 1966 | <em>--pretty=tformat:<format></em> were given. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1967 | </p> |
| Junio C Hamano | 6bb32e6 | 2015-02-17 22:11:26 | [diff] [blame] | 1968 | <div class="paragraph"><p>See the "PRETTY FORMATS" section for some additional details for each |
| 1969 | format. When <em>=<format></em> part is omitted, it defaults to <em>medium</em>.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1970 | <div class="paragraph"><p>Note: you can specify the default pretty format in the repository |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1971 | configuration (see <a href="git-config.html">git-config(1)</a>).</p></div> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1972 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1973 | <dt class="hdlist1"> |
| Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 1974 | --abbrev-commit |
| 1975 | </dt> |
| 1976 | <dd> |
| 1977 | <p> |
| 1978 | Instead of showing the full 40-byte hexadecimal commit object |
| Junio C Hamano | 6efe302 | 2009-01-13 16:47:56 | [diff] [blame] | 1979 | name, show only a partial prefix. Non default number of |
| Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 1980 | digits can be specified with "--abbrev=<n>" (which also modifies |
| 1981 | diff output, if it is displayed). |
| 1982 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1983 | <div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1984 | people using 80-column terminals.</p></div> |
| Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 1985 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1986 | <dt class="hdlist1"> |
| Junio C Hamano | f93530e | 2011-05-25 23:59:59 | [diff] [blame] | 1987 | --no-abbrev-commit |
| 1988 | </dt> |
| 1989 | <dd> |
| 1990 | <p> |
| 1991 | Show the full 40-byte hexadecimal commit object name. This negates |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1992 | <code>--abbrev-commit</code> and those options which imply it such as |
| Junio C Hamano | 042f214 | 2016-06-27 18:05:05 | [diff] [blame] | 1993 | "--oneline". It also overrides the <code>log.abbrevCommit</code> variable. |
| Junio C Hamano | f93530e | 2011-05-25 23:59:59 | [diff] [blame] | 1994 | </p> |
| 1995 | </dd> |
| 1996 | <dt class="hdlist1"> |
| Junio C Hamano | 0a23522 | 2009-03-06 08:21:09 | [diff] [blame] | 1997 | --oneline |
| 1998 | </dt> |
| 1999 | <dd> |
| 2000 | <p> |
| 2001 | This is a shorthand for "--pretty=oneline --abbrev-commit" |
| 2002 | used together. |
| 2003 | </p> |
| 2004 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2005 | <dt class="hdlist1"> |
| Junio C Hamano | c5bb3b3 | 2013-08-05 22:43:36 | [diff] [blame] | 2006 | --encoding=<encoding> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2007 | </dt> |
| 2008 | <dd> |
| 2009 | <p> |
| 2010 | The commit objects record the encoding used for the log message |
| 2011 | in their encoding header; this option can be used to tell the |
| 2012 | command to re-code the commit log message in the encoding |
| 2013 | preferred by the user. For non plumbing commands this |
| Junio C Hamano | 823eebb | 2015-07-10 22:29:34 | [diff] [blame] | 2014 | defaults to UTF-8. Note that if an object claims to be encoded |
| 2015 | in <code>X</code> and we are outputting in <code>X</code>, we will output the object |
| 2016 | verbatim; this means that invalid sequences in the original |
| 2017 | commit may be copied to the output. |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2018 | </p> |
| 2019 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2020 | <dt class="hdlist1"> |
| Junio C Hamano | 5996b67 | 2016-04-13 22:01:41 | [diff] [blame] | 2021 | --expand-tabs=<n> |
| 2022 | </dt> |
| 2023 | <dt class="hdlist1"> |
| 2024 | --expand-tabs |
| 2025 | </dt> |
| 2026 | <dt class="hdlist1"> |
| 2027 | --no-expand-tabs |
| 2028 | </dt> |
| 2029 | <dd> |
| 2030 | <p> |
| 2031 | Perform a tab expansion (replace each tab with enough spaces |
| 2032 | to fill to the next display column that is multiple of <em><n></em>) |
| 2033 | in the log message before showing it in the output. |
| 2034 | <code>--expand-tabs</code> is a short-hand for <code>--expand-tabs=8</code>, and |
| 2035 | <code>--no-expand-tabs</code> is a short-hand for <code>--expand-tabs=0</code>, |
| 2036 | which disables tab expansion. |
| 2037 | </p> |
| 2038 | <div class="paragraph"><p>By default, tabs are expanded in pretty formats that indent the log |
| 2039 | message by 4 spaces (i.e. <em>medium</em>, which is the default, <em>full</em>, |
| 2040 | and <em>fuller</em>).</p></div> |
| 2041 | </dd> |
| 2042 | <dt class="hdlist1"> |
| Junio C Hamano | 4e6ba27 | 2016-01-20 23:23:19 | [diff] [blame] | 2043 | --notes[=<treeish>] |
| Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 2044 | </dt> |
| 2045 | <dd> |
| 2046 | <p> |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 2047 | Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the |
| Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 2048 | commit, when showing the commit log message. This is the default |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2049 | for <code>git log</code>, <code>git show</code> and <code>git whatchanged</code> commands when |
| 2050 | there is no <code>--pretty</code>, <code>--format</code>, or <code>--oneline</code> option given |
| Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 2051 | on the command line. |
| Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 2052 | </p> |
| Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 2053 | <div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the |
| Junio C Hamano | 042f214 | 2016-06-27 18:05:05 | [diff] [blame] | 2054 | <code>core.notesRef</code> and <code>notes.displayRef</code> variables (or corresponding |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 2055 | environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div> |
| Junio C Hamano | 4e6ba27 | 2016-01-20 23:23:19 | [diff] [blame] | 2056 | <div class="paragraph"><p>With an optional <em><treeish></em> argument, use the treeish to find the notes |
| 2057 | to display. The treeish can specify the full refname when it begins |
| Junio C Hamano | 1f7c4a5 | 2015-10-14 22:15:51 | [diff] [blame] | 2058 | with <code>refs/notes/</code>; when it begins with <code>notes/</code>, <code>refs/</code> and otherwise |
| 2059 | <code>refs/notes/</code> is prefixed to form a full name of the ref.</p></div> |
| Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 2060 | <div class="paragraph"><p>Multiple --notes options can be combined to control which notes are |
| 2061 | being displayed. Examples: "--notes=foo" will show only notes from |
| 2062 | "refs/notes/foo"; "--notes=foo --notes" will show both notes from |
| 2063 | "refs/notes/foo" and from the default notes ref(s).</p></div> |
| Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 2064 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2065 | <dt class="hdlist1"> |
| Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 2066 | --no-notes |
| 2067 | </dt> |
| 2068 | <dd> |
| 2069 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2070 | Do not show notes. This negates the above <code>--notes</code> option, by |
| Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 2071 | resetting the list of notes refs from which notes are shown. |
| 2072 | Options are parsed in the order given on the command line, so e.g. |
| 2073 | "--notes --notes=foo --no-notes --notes=bar" will only show notes |
| 2074 | from "refs/notes/bar". |
| 2075 | </p> |
| 2076 | </dd> |
| 2077 | <dt class="hdlist1"> |
| Junio C Hamano | 4e6ba27 | 2016-01-20 23:23:19 | [diff] [blame] | 2078 | --show-notes[=<treeish>] |
| Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 2079 | </dt> |
| 2080 | <dt class="hdlist1"> |
| Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 2081 | --[no-]standard-notes |
| 2082 | </dt> |
| 2083 | <dd> |
| 2084 | <p> |
| Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 2085 | These options are deprecated. Use the above --notes/--no-notes |
| 2086 | options instead. |
| Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 2087 | </p> |
| Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 2088 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2089 | <dt class="hdlist1"> |
| Junio C Hamano | 0acb1ae | 2012-09-24 21:28:13 | [diff] [blame] | 2090 | --show-signature |
| 2091 | </dt> |
| 2092 | <dd> |
| 2093 | <p> |
| 2094 | Check the validity of a signed commit object by passing the signature |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2095 | to <code>gpg --verify</code> and show the output. |
| Junio C Hamano | 0acb1ae | 2012-09-24 21:28:13 | [diff] [blame] | 2096 | </p> |
| 2097 | </dd> |
| 2098 | <dt class="hdlist1"> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2099 | --no-commit-id |
| 2100 | </dt> |
| 2101 | <dd> |
| 2102 | <p> |
| Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 2103 | <em>git diff-tree</em> outputs a line with the commit ID when |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2104 | applicable. This flag suppressed the commit ID output. |
| 2105 | </p> |
| 2106 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2107 | <dt class="hdlist1"> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2108 | -c |
| 2109 | </dt> |
| 2110 | <dd> |
| 2111 | <p> |
| 2112 | This flag changes the way a merge commit is displayed |
| 2113 | (which means it is useful only when the command is given |
| Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 2114 | one <tree-ish>, or <code>--stdin</code>). It shows the differences |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2115 | from each of the parents to the merge result simultaneously |
| 2116 | instead of showing pairwise diff between a parent and the |
| Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 2117 | result one at a time (which is what the <code>-m</code> option does). |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2118 | Furthermore, it lists only files which were modified |
| 2119 | from all parents. |
| 2120 | </p> |
| 2121 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2122 | <dt class="hdlist1"> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2123 | --cc |
| 2124 | </dt> |
| 2125 | <dd> |
| 2126 | <p> |
| 2127 | This flag changes the way a merge commit patch is displayed, |
| Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 2128 | in a similar way to the <code>-c</code> option. It implies the <code>-c</code> |
| 2129 | and <code>-p</code> options and further compresses the patch output |
| Junio C Hamano | ccc2f76 | 2008-07-24 04:03:33 | [diff] [blame] | 2130 | by omitting uninteresting hunks whose the contents in the parents |
| 2131 | have only two variants and the merge result picks one of them |
| 2132 | without modification. When all hunks are uninteresting, the commit |
| 2133 | itself and the commit log message is not shown, just like in any other |
| 2134 | "empty diff" case. |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2135 | </p> |
| 2136 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2137 | <dt class="hdlist1"> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2138 | --always |
| 2139 | </dt> |
| 2140 | <dd> |
| 2141 | <p> |
| 2142 | Show the commit itself and the commit log message even |
| 2143 | if the diff itself is empty. |
| 2144 | </p> |
| 2145 | </dd> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2146 | </dl></div> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2147 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2148 | </div> |
| 2149 | <div class="sect1"> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2150 | <h2 id="_pretty_formats">PRETTY FORMATS</h2> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2151 | <div class="sectionbody"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2152 | <div class="paragraph"><p>If the commit is a merge, and if the pretty-format |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2153 | is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is |
| 2154 | inserted before the <em>Author:</em> line. This line begins with |
| 2155 | "Merge: " and the sha1s of ancestral commits are printed, |
| 2156 | separated by spaces. Note that the listed commits may not |
| 2157 | necessarily be the list of the <strong>direct</strong> parent commits if you |
| 2158 | have limited your view of history: for example, if you are |
| 2159 | only interested in changes related to a certain directory or |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2160 | file.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2161 | <div class="paragraph"><p>There are several built-in formats, and you can define |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 2162 | additional formats by setting a pretty.<name> |
| 2163 | config option to either another format name, or a |
| 2164 | <em>format:</em> string, as described below (see |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 2165 | <a href="git-config.html">git-config(1)</a>). Here are the details of the |
| Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 2166 | built-in formats:</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2167 | <div class="ulist"><ul> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2168 | <li> |
| 2169 | <p> |
| 2170 | <em>oneline</em> |
| 2171 | </p> |
| 2172 | <div class="literalblock"> |
| 2173 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2174 | <pre><code><sha1> <title line></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2175 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2176 | <div class="paragraph"><p>This is designed to be as compact as possible.</p></div> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2177 | </li> |
| 2178 | <li> |
| 2179 | <p> |
| 2180 | <em>short</em> |
| 2181 | </p> |
| 2182 | <div class="literalblock"> |
| 2183 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2184 | <pre><code>commit <sha1> |
| 2185 | Author: <author></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2186 | </div></div> |
| 2187 | <div class="literalblock"> |
| 2188 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2189 | <pre><code><title line></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2190 | </div></div> |
| 2191 | </li> |
| 2192 | <li> |
| 2193 | <p> |
| 2194 | <em>medium</em> |
| 2195 | </p> |
| 2196 | <div class="literalblock"> |
| 2197 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2198 | <pre><code>commit <sha1> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2199 | Author: <author> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2200 | Date: <author date></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2201 | </div></div> |
| 2202 | <div class="literalblock"> |
| 2203 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2204 | <pre><code><title line></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2205 | </div></div> |
| 2206 | <div class="literalblock"> |
| 2207 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2208 | <pre><code><full commit message></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2209 | </div></div> |
| 2210 | </li> |
| 2211 | <li> |
| 2212 | <p> |
| 2213 | <em>full</em> |
| 2214 | </p> |
| 2215 | <div class="literalblock"> |
| 2216 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2217 | <pre><code>commit <sha1> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2218 | Author: <author> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2219 | Commit: <committer></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2220 | </div></div> |
| 2221 | <div class="literalblock"> |
| 2222 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2223 | <pre><code><title line></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2224 | </div></div> |
| 2225 | <div class="literalblock"> |
| 2226 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2227 | <pre><code><full commit message></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2228 | </div></div> |
| 2229 | </li> |
| 2230 | <li> |
| 2231 | <p> |
| 2232 | <em>fuller</em> |
| 2233 | </p> |
| 2234 | <div class="literalblock"> |
| 2235 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2236 | <pre><code>commit <sha1> |
| Junio C Hamano | 6a3c827 | 2008-12-19 21:38:18 | [diff] [blame] | 2237 | Author: <author> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2238 | AuthorDate: <author date> |
| Junio C Hamano | 6a3c827 | 2008-12-19 21:38:18 | [diff] [blame] | 2239 | Commit: <committer> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2240 | CommitDate: <committer date></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2241 | </div></div> |
| 2242 | <div class="literalblock"> |
| 2243 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2244 | <pre><code><title line></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2245 | </div></div> |
| 2246 | <div class="literalblock"> |
| 2247 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2248 | <pre><code><full commit message></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2249 | </div></div> |
| 2250 | </li> |
| 2251 | <li> |
| 2252 | <p> |
| 2253 | <em>email</em> |
| 2254 | </p> |
| 2255 | <div class="literalblock"> |
| 2256 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2257 | <pre><code>From <sha1> <date> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2258 | From: <author> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2259 | Date: <author date> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2260 | Subject: [PATCH] <title line></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2261 | </div></div> |
| 2262 | <div class="literalblock"> |
| 2263 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2264 | <pre><code><full commit message></code></pre> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2265 | </div></div> |
| 2266 | </li> |
| 2267 | <li> |
| 2268 | <p> |
| 2269 | <em>raw</em> |
| 2270 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2271 | <div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as |
| Junio C Hamano | e3f080d | 2013-04-22 02:27:13 | [diff] [blame] | 2272 | stored in the commit object. Notably, the SHA-1s are |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2273 | displayed in full, regardless of whether --abbrev or |
| 2274 | --no-abbrev are used, and <em>parents</em> information show the |
| Junio C Hamano | d75148a | 2014-04-08 19:48:38 | [diff] [blame] | 2275 | true parent commits, without taking grafts or history |
| Junio C Hamano | 85f1fde | 2015-06-01 20:37:32 | [diff] [blame] | 2276 | simplification into account. Note that this format affects the way |
| 2277 | commits are displayed, but not the way the diff is shown e.g. with |
| 2278 | <code>git log --raw</code>. To get full object names in a raw diff format, |
| 2279 | use <code>--no-abbrev</code>.</p></div> |
| Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2280 | </li> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2281 | <li> |
| 2282 | <p> |
| Junio C Hamano | e32ec8b | 2010-06-02 23:32:31 | [diff] [blame] | 2283 | <em>format:<string></em> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2284 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2285 | <div class="paragraph"><p>The <em>format:<string></em> format allows you to specify which information |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2286 | you want to show. It works a little bit like printf format, |
| 2287 | with the notable exception that you get a newline with <em>%n</em> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2288 | instead of <em>\n</em>.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2289 | <div class="paragraph"><p>E.g, <em>format:"The author of %h was %an, %ar%nThe title was >>%s<<%n"</em> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2290 | would show something like this:</p></div> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2291 | <div class="listingblock"> |
| 2292 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2293 | <pre><code>The author of fe6e0ee was Junio C Hamano, 23 hours ago |
| 2294 | The title was >>t4119: test autocomputing -p<n> for traditional diff input.<<</code></pre> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2295 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2296 | <div class="paragraph"><p>The placeholders are:</p></div> |
| 2297 | <div class="ulist"><ul> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2298 | <li> |
| 2299 | <p> |
| 2300 | <em>%H</em>: commit hash |
| 2301 | </p> |
| 2302 | </li> |
| 2303 | <li> |
| 2304 | <p> |
| 2305 | <em>%h</em>: abbreviated commit hash |
| 2306 | </p> |
| 2307 | </li> |
| 2308 | <li> |
| 2309 | <p> |
| 2310 | <em>%T</em>: tree hash |
| 2311 | </p> |
| 2312 | </li> |
| 2313 | <li> |
| 2314 | <p> |
| 2315 | <em>%t</em>: abbreviated tree hash |
| 2316 | </p> |
| 2317 | </li> |
| 2318 | <li> |
| 2319 | <p> |
| 2320 | <em>%P</em>: parent hashes |
| 2321 | </p> |
| 2322 | </li> |
| 2323 | <li> |
| 2324 | <p> |
| 2325 | <em>%p</em>: abbreviated parent hashes |
| 2326 | </p> |
| 2327 | </li> |
| 2328 | <li> |
| 2329 | <p> |
| 2330 | <em>%an</em>: author name |
| 2331 | </p> |
| 2332 | </li> |
| 2333 | <li> |
| 2334 | <p> |
| Junio C Hamano | 04e768d | 2013-04-23 19:19:26 | [diff] [blame] | 2335 | <em>%aN</em>: author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> |
| 2336 | or <a href="git-blame.html">git-blame(1)</a>) |
| Junio C Hamano | f5a9362 | 2008-07-16 03:23:57 | [diff] [blame] | 2337 | </p> |
| 2338 | </li> |
| 2339 | <li> |
| 2340 | <p> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2341 | <em>%ae</em>: author email |
| 2342 | </p> |
| 2343 | </li> |
| 2344 | <li> |
| 2345 | <p> |
| Junio C Hamano | 04e768d | 2013-04-23 19:19:26 | [diff] [blame] | 2346 | <em>%aE</em>: author email (respecting .mailmap, see |
| 2347 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 2348 | </p> |
| 2349 | </li> |
| 2350 | <li> |
| 2351 | <p> |
| Junio C Hamano | a387df3 | 2008-08-29 08:56:58 | [diff] [blame] | 2352 | <em>%ad</em>: author date (format respects --date= option) |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2353 | </p> |
| 2354 | </li> |
| 2355 | <li> |
| 2356 | <p> |
| 2357 | <em>%aD</em>: author date, RFC2822 style |
| 2358 | </p> |
| 2359 | </li> |
| 2360 | <li> |
| 2361 | <p> |
| 2362 | <em>%ar</em>: author date, relative |
| 2363 | </p> |
| 2364 | </li> |
| 2365 | <li> |
| 2366 | <p> |
| 2367 | <em>%at</em>: author date, UNIX timestamp |
| 2368 | </p> |
| 2369 | </li> |
| 2370 | <li> |
| 2371 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2372 | <em>%ai</em>: author date, ISO 8601-like format |
| 2373 | </p> |
| 2374 | </li> |
| 2375 | <li> |
| 2376 | <p> |
| 2377 | <em>%aI</em>: author date, strict ISO 8601 format |
| Junio C Hamano | 02f130b | 2007-07-14 08:26:56 | [diff] [blame] | 2378 | </p> |
| 2379 | </li> |
| 2380 | <li> |
| 2381 | <p> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2382 | <em>%cn</em>: committer name |
| 2383 | </p> |
| 2384 | </li> |
| 2385 | <li> |
| 2386 | <p> |
| Junio C Hamano | 04e768d | 2013-04-23 19:19:26 | [diff] [blame] | 2387 | <em>%cN</em>: committer name (respecting .mailmap, see |
| 2388 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| Junio C Hamano | f5a9362 | 2008-07-16 03:23:57 | [diff] [blame] | 2389 | </p> |
| 2390 | </li> |
| 2391 | <li> |
| 2392 | <p> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2393 | <em>%ce</em>: committer email |
| 2394 | </p> |
| 2395 | </li> |
| 2396 | <li> |
| 2397 | <p> |
| Junio C Hamano | 04e768d | 2013-04-23 19:19:26 | [diff] [blame] | 2398 | <em>%cE</em>: committer email (respecting .mailmap, see |
| 2399 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 2400 | </p> |
| 2401 | </li> |
| 2402 | <li> |
| 2403 | <p> |
| Junio C Hamano | 53fe031 | 2014-09-09 21:16:17 | [diff] [blame] | 2404 | <em>%cd</em>: committer date (format respects --date= option) |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2405 | </p> |
| 2406 | </li> |
| 2407 | <li> |
| 2408 | <p> |
| 2409 | <em>%cD</em>: committer date, RFC2822 style |
| 2410 | </p> |
| 2411 | </li> |
| 2412 | <li> |
| 2413 | <p> |
| 2414 | <em>%cr</em>: committer date, relative |
| 2415 | </p> |
| 2416 | </li> |
| 2417 | <li> |
| 2418 | <p> |
| 2419 | <em>%ct</em>: committer date, UNIX timestamp |
| 2420 | </p> |
| 2421 | </li> |
| 2422 | <li> |
| 2423 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2424 | <em>%ci</em>: committer date, ISO 8601-like format |
| 2425 | </p> |
| 2426 | </li> |
| 2427 | <li> |
| 2428 | <p> |
| 2429 | <em>%cI</em>: committer date, strict ISO 8601 format |
| Junio C Hamano | 02f130b | 2007-07-14 08:26:56 | [diff] [blame] | 2430 | </p> |
| 2431 | </li> |
| 2432 | <li> |
| 2433 | <p> |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 2434 | <em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a> |
| Junio C Hamano | 5e4d8de | 2008-09-19 06:27:02 | [diff] [blame] | 2435 | </p> |
| 2436 | </li> |
| 2437 | <li> |
| 2438 | <p> |
| Junio C Hamano | 00b9f1a | 2014-09-29 23:11:28 | [diff] [blame] | 2439 | <em>%D</em>: ref names without the " (", ")" wrapping. |
| 2440 | </p> |
| 2441 | </li> |
| 2442 | <li> |
| 2443 | <p> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2444 | <em>%e</em>: encoding |
| 2445 | </p> |
| 2446 | </li> |
| 2447 | <li> |
| 2448 | <p> |
| 2449 | <em>%s</em>: subject |
| 2450 | </p> |
| 2451 | </li> |
| 2452 | <li> |
| 2453 | <p> |
| Junio C Hamano | 5f9a6f0 | 2009-04-06 08:26:56 | [diff] [blame] | 2454 | <em>%f</em>: sanitized subject line, suitable for a filename |
| 2455 | </p> |
| 2456 | </li> |
| 2457 | <li> |
| 2458 | <p> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2459 | <em>%b</em>: body |
| 2460 | </p> |
| 2461 | </li> |
| 2462 | <li> |
| 2463 | <p> |
| Junio C Hamano | cb39aea | 2010-05-09 07:24:48 | [diff] [blame] | 2464 | <em>%B</em>: raw body (unwrapped subject and body) |
| 2465 | </p> |
| 2466 | </li> |
| 2467 | <li> |
| 2468 | <p> |
| Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 2469 | <em>%N</em>: commit notes |
| 2470 | </p> |
| 2471 | </li> |
| 2472 | <li> |
| 2473 | <p> |
| Junio C Hamano | 0acb1ae | 2012-09-24 21:28:13 | [diff] [blame] | 2474 | <em>%GG</em>: raw verification message from GPG for a signed commit |
| 2475 | </p> |
| 2476 | </li> |
| 2477 | <li> |
| 2478 | <p> |
| Junio C Hamano | 4a401d5 | 2016-10-26 22:24:37 | [diff] [blame] | 2479 | <em>%G?</em>: show "G" for a good (valid) signature, |
| 2480 | "B" for a bad signature, |
| 2481 | "U" for a good signature with unknown validity, |
| 2482 | "X" for a good signature that has expired, |
| 2483 | "Y" for a good signature made by an expired key, |
| 2484 | "R" for a good signature made by a revoked key, |
| 2485 | "E" if the signature cannot be checked (e.g. missing key) |
| 2486 | and "N" for no signature |
| Junio C Hamano | 0acb1ae | 2012-09-24 21:28:13 | [diff] [blame] | 2487 | </p> |
| 2488 | </li> |
| 2489 | <li> |
| 2490 | <p> |
| 2491 | <em>%GS</em>: show the name of the signer for a signed commit |
| 2492 | </p> |
| 2493 | </li> |
| 2494 | <li> |
| 2495 | <p> |
| Junio C Hamano | 5e7f131 | 2013-03-21 22:49:01 | [diff] [blame] | 2496 | <em>%GK</em>: show the key used to sign a signed commit |
| 2497 | </p> |
| 2498 | </li> |
| 2499 | <li> |
| 2500 | <p> |
| Junio C Hamano | e548d1b | 2016-08-08 22:26:49 | [diff] [blame] | 2501 | <em>%gD</em>: reflog selector, e.g., <code>refs/stash@{1}</code> or |
| 2502 | <code>refs/stash@{2 minutes ago</code>}; the format follows the rules described |
| 2503 | for the <code>-g</code> option. The portion before the <code>@</code> is the refname as |
| 2504 | given on the command line (so <code>git log -g refs/heads/master</code> would |
| 2505 | yield <code>refs/heads/master@{0}</code>). |
| Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 2506 | </p> |
| 2507 | </li> |
| 2508 | <li> |
| 2509 | <p> |
| Junio C Hamano | e548d1b | 2016-08-08 22:26:49 | [diff] [blame] | 2510 | <em>%gd</em>: shortened reflog selector; same as <code>%gD</code>, but the refname |
| 2511 | portion is shortened for human readability (so <code>refs/heads/master</code> |
| 2512 | becomes just <code>master</code>). |
| Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 2513 | </p> |
| 2514 | </li> |
| 2515 | <li> |
| 2516 | <p> |
| Junio C Hamano | 962f3a3 | 2011-12-22 20:21:44 | [diff] [blame] | 2517 | <em>%gn</em>: reflog identity name |
| 2518 | </p> |
| 2519 | </li> |
| 2520 | <li> |
| 2521 | <p> |
| Junio C Hamano | 04e768d | 2013-04-23 19:19:26 | [diff] [blame] | 2522 | <em>%gN</em>: reflog identity name (respecting .mailmap, see |
| 2523 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| Junio C Hamano | 962f3a3 | 2011-12-22 20:21:44 | [diff] [blame] | 2524 | </p> |
| 2525 | </li> |
| 2526 | <li> |
| 2527 | <p> |
| 2528 | <em>%ge</em>: reflog identity email |
| 2529 | </p> |
| 2530 | </li> |
| 2531 | <li> |
| 2532 | <p> |
| Junio C Hamano | 04e768d | 2013-04-23 19:19:26 | [diff] [blame] | 2533 | <em>%gE</em>: reflog identity email (respecting .mailmap, see |
| 2534 | <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| Junio C Hamano | 962f3a3 | 2011-12-22 20:21:44 | [diff] [blame] | 2535 | </p> |
| 2536 | </li> |
| 2537 | <li> |
| 2538 | <p> |
| Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 2539 | <em>%gs</em>: reflog subject |
| 2540 | </p> |
| 2541 | </li> |
| 2542 | <li> |
| 2543 | <p> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2544 | <em>%Cred</em>: switch color to red |
| 2545 | </p> |
| 2546 | </li> |
| 2547 | <li> |
| 2548 | <p> |
| 2549 | <em>%Cgreen</em>: switch color to green |
| 2550 | </p> |
| 2551 | </li> |
| 2552 | <li> |
| 2553 | <p> |
| 2554 | <em>%Cblue</em>: switch color to blue |
| 2555 | </p> |
| 2556 | </li> |
| 2557 | <li> |
| 2558 | <p> |
| 2559 | <em>%Creset</em>: reset color |
| 2560 | </p> |
| 2561 | </li> |
| 2562 | <li> |
| 2563 | <p> |
| Junio C Hamano | c0859f7 | 2016-10-17 22:22:57 | [diff] [blame] | 2564 | <em>%C(…)</em>: color specification, as described under Values in the |
| Junio C Hamano | 4b2a6c1 | 2017-08-22 18:32:37 | [diff] [blame] | 2565 | "CONFIGURATION FILE" section of <a href="git-config.html">git-config(1)</a>. |
| 2566 | By default, colors are shown only when enabled for log output (by |
| 2567 | <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and respecting the <code>auto</code> |
| 2568 | settings of the former if we are going to a terminal). <code>%C(auto,...)</code> |
| 2569 | is accepted as a historical synonym for the default (e.g., |
| 2570 | <code>%C(auto,red)</code>). Specifying <code>%C(always,...) will show the colors |
| 2571 | even when color is not otherwise enabled (though consider |
| 2572 | just using `--color=always</code> to enable color for the whole output, |
| 2573 | including this format and anything else git might color). <code>auto</code> |
| 2574 | alone (i.e. <code>%C(auto)</code>) will turn on auto coloring on the next |
| 2575 | placeholders until the color is switched again. |
| Junio C Hamano | cc0cb31 | 2009-01-22 03:38:50 | [diff] [blame] | 2576 | </p> |
| 2577 | </li> |
| 2578 | <li> |
| 2579 | <p> |
| Junio C Hamano | cd45166 | 2016-09-13 00:54:09 | [diff] [blame] | 2580 | <em>%m</em>: left (<code><</code>), right (<code>></code>) or boundary (<code>-</code>) mark |
| Junio C Hamano | d9e0e5d | 2007-04-14 16:22:04 | [diff] [blame] | 2581 | </p> |
| 2582 | </li> |
| 2583 | <li> |
| 2584 | <p> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2585 | <em>%n</em>: newline |
| 2586 | </p> |
| Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2587 | </li> |
| Junio C Hamano | b78d259 | 2008-04-09 09:39:08 | [diff] [blame] | 2588 | <li> |
| 2589 | <p> |
| Junio C Hamano | a9701f0 | 2010-01-21 00:42:16 | [diff] [blame] | 2590 | <em>%%</em>: a raw <em>%</em> |
| 2591 | </p> |
| 2592 | </li> |
| 2593 | <li> |
| 2594 | <p> |
| Junio C Hamano | b78d259 | 2008-04-09 09:39:08 | [diff] [blame] | 2595 | <em>%x00</em>: print a byte from a hex code |
| 2596 | </p> |
| 2597 | </li> |
| Junio C Hamano | bf984de | 2009-11-23 06:11:19 | [diff] [blame] | 2598 | <li> |
| 2599 | <p> |
| 2600 | <em>%w([<w>[,<i1>[,<i2>]]])</em>: switch line wrapping, like the -w option of |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 2601 | <a href="git-shortlog.html">git-shortlog(1)</a>. |
| Junio C Hamano | bf984de | 2009-11-23 06:11:19 | [diff] [blame] | 2602 | </p> |
| 2603 | </li> |
| Junio C Hamano | 04e768d | 2013-04-23 19:19:26 | [diff] [blame] | 2604 | <li> |
| 2605 | <p> |
| 2606 | <em>%<(<N>[,trunc|ltrunc|mtrunc])</em>: make the next placeholder take at |
| 2607 | least N columns, padding spaces on the right if necessary. |
| 2608 | Optionally truncate at the beginning (ltrunc), the middle (mtrunc) |
| 2609 | or the end (trunc) if the output is longer than N columns. |
| 2610 | Note that truncating only works correctly with N >= 2. |
| 2611 | </p> |
| 2612 | </li> |
| 2613 | <li> |
| 2614 | <p> |
| 2615 | <em>%<|(<N>)</em>: make the next placeholder take at least until Nth |
| 2616 | columns, padding spaces on the right if necessary |
| 2617 | </p> |
| 2618 | </li> |
| 2619 | <li> |
| 2620 | <p> |
| 2621 | <em>%>(<N>)</em>, <em>%>|(<N>)</em>: similar to <em>%<(<N>)</em>, <em>%<|(<N>)</em> |
| 2622 | respectively, but padding spaces on the left |
| 2623 | </p> |
| 2624 | </li> |
| 2625 | <li> |
| 2626 | <p> |
| 2627 | <em>%>>(<N>)</em>, <em>%>>|(<N>)</em>: similar to <em>%>(<N>)</em>, <em>%>|(<N>)</em> |
| 2628 | respectively, except that if the next placeholder takes more spaces |
| 2629 | than given and there are spaces on its left, use those spaces |
| 2630 | </p> |
| 2631 | </li> |
| 2632 | <li> |
| 2633 | <p> |
| Junio C Hamano | a25ccc4 | 2018-03-08 21:36:14 | [diff] [blame] | 2634 | <em>%><(<N>)</em>, <em>%><|(<N>)</em>: similar to <em>%<(<N>)</em>, <em>%<|(<N>)</em> |
| Junio C Hamano | 04e768d | 2013-04-23 19:19:26 | [diff] [blame] | 2635 | respectively, but padding both sides (i.e. the text is centered) |
| Junio C Hamano | 222ed82 | 2017-06-02 06:24:06 | [diff] [blame] | 2636 | </p> |
| 2637 | </li> |
| 2638 | <li> |
| 2639 | <p> |
| Junio C Hamano | 0f1291d | 2017-12-27 19:58:35 | [diff] [blame] | 2640 | %(trailers[:options]): display the trailers of the body as interpreted |
| 2641 | by <a href="git-interpret-trailers.html">git-interpret-trailers(1)</a>. The <code>trailers</code> string may be |
| 2642 | followed by a colon and zero or more comma-separated options. If the |
| 2643 | <code>only</code> option is given, omit non-trailer lines from the trailer block. |
| 2644 | If the <code>unfold</code> option is given, behave as if interpret-trailer’s |
| 2645 | <code>--unfold</code> option was given. E.g., <code>%(trailers:only,unfold)</code> to do |
| 2646 | both. |
| Junio C Hamano | 04e768d | 2013-04-23 19:19:26 | [diff] [blame] | 2647 | </p> |
| 2648 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2649 | </ul></div> |
| Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2650 | </li> |
| Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 2651 | </ul></div> |
| 2652 | <div class="admonitionblock"> |
| 2653 | <table><tr> |
| 2654 | <td class="icon"> |
| 2655 | <div class="title">Note</div> |
| 2656 | </td> |
| 2657 | <td class="content">Some placeholders may depend on other options given to the |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2658 | revision traversal engine. For example, the <code>%g*</code> reflog options will |
| Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 2659 | insert an empty string unless we are traversing reflog entries (e.g., by |
| Junio C Hamano | 00b9f1a | 2014-09-29 23:11:28 | [diff] [blame] | 2660 | <code>git log -g</code>). The <code>%d</code> and <code>%D</code> placeholders will use the "short" |
| 2661 | decoration format if <code>--decorate</code> was not already provided on the command |
| 2662 | line.</td> |
| Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 2663 | </tr></table> |
| 2664 | </div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2665 | <div class="paragraph"><p>If you add a <code>+</code> (plus sign) after <em>%</em> of a placeholder, a line-feed |
| Junio C Hamano | 2bd8a74 | 2009-12-01 21:16:59 | [diff] [blame] | 2666 | is inserted immediately before the expansion if and only if the |
| 2667 | placeholder expands to a non-empty string.</p></div> |
| Junio C Hamano | 535c65c | 2017-06-24 22:51:58 | [diff] [blame] | 2668 | <div class="paragraph"><p>If you add a <code>-</code> (minus sign) after <em>%</em> of a placeholder, all consecutive |
| 2669 | line-feeds immediately preceding the expansion are deleted if and only if the |
| Junio C Hamano | 2bd8a74 | 2009-12-01 21:16:59 | [diff] [blame] | 2670 | placeholder expands to an empty string.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2671 | <div class="paragraph"><p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space |
| Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 2672 | is inserted immediately before the expansion if and only if the |
| 2673 | placeholder expands to a non-empty string.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2674 | <div class="ulist"><ul> |
| Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 2675 | <li> |
| 2676 | <p> |
| 2677 | <em>tformat:</em> |
| 2678 | </p> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2679 | <div class="paragraph"><p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it |
| Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 2680 | provides "terminator" semantics instead of "separator" semantics. In |
| 2681 | other words, each commit has the message terminator character (usually a |
| 2682 | newline) appended, rather than a separator placed between entries. |
| 2683 | This means that the final entry of a single-line format will be properly |
| 2684 | terminated with a new line, just as the "oneline" format does. |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2685 | For example:</p></div> |
| Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 2686 | <div class="listingblock"> |
| 2687 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2688 | <pre><code>$ git log -2 --pretty=format:%h 4da45bef \ |
| Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 2689 | | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/' |
| 2690 | 4da45be |
| 2691 | 7134973 -- NO NEWLINE |
| 2692 | |
| 2693 | $ git log -2 --pretty=tformat:%h 4da45bef \ |
| 2694 | | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/' |
| 2695 | 4da45be |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2696 | 7134973</code></pre> |
| Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 2697 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2698 | <div class="paragraph"><p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted |
| 2699 | as if it has <code>tformat:</code> in front of it. For example, these two are |
| Junio C Hamano | 0a23522 | 2009-03-06 08:21:09 | [diff] [blame] | 2700 | equivalent:</p></div> |
| 2701 | <div class="listingblock"> |
| 2702 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2703 | <pre><code>$ git log -2 --pretty=tformat:%h 4da45bef |
| 2704 | $ git log -2 --pretty=%h 4da45bef</code></pre> |
| Junio C Hamano | 0a23522 | 2009-03-06 08:21:09 | [diff] [blame] | 2705 | </div></div> |
| Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 2706 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2707 | </ul></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2708 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2709 | </div> |
| 2710 | <div class="sect1"> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2711 | <h2 id="_limiting_output">Limiting Output</h2> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2712 | <div class="sectionbody"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2713 | <div class="paragraph"><p>If you’re only interested in differences in a subset of files, for |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2714 | example some architecture-specific files, you might do:</p></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2715 | <div class="literalblock"> |
| 2716 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2717 | <pre><code>git diff-tree -r <tree-ish> <tree-ish> arch/ia64 include/asm-ia64</code></pre> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2718 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2719 | <div class="paragraph"><p>and it will only show you what changed in those two directories.</p></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2720 | <div class="paragraph"><p>Or if you are searching for what changed in just <code>kernel/sched.c</code>, just do</p></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2721 | <div class="literalblock"> |
| 2722 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2723 | <pre><code>git diff-tree -r <tree-ish> <tree-ish> kernel/sched.c</code></pre> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2724 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2725 | <div class="paragraph"><p>and it will ignore all differences to other files.</p></div> |
| 2726 | <div class="paragraph"><p>The pattern is always the prefix, and is matched exactly. There are no |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2727 | wildcards. Even stricter, it has to match a complete path component. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2728 | I.e. "foo" does not pick up <code>foobar.h</code>. "foo" does match <code>foo/bar.h</code> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2729 | so it can be used to name subdirectories.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2730 | <div class="paragraph"><p>An example of normal usage is:</p></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2731 | <div class="literalblock"> |
| 2732 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2733 | <pre><code>torvalds@ppc970:~/git> git diff-tree --abbrev 5319e4 |
| 2734 | :100664 100664 ac348b... a01513... git-fsck-objects.c</code></pre> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2735 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2736 | <div class="paragraph"><p>which tells you that the last commit changed just one file (it’s from |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2737 | this one:</p></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2738 | <div class="listingblock"> |
| 2739 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2740 | <pre><code>commit 3c6f7ca19ad4043e9e72fa94106f352897e651a8 |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2741 | tree 5319e4d609cdd282069cc4dce33c1db559539b03 |
| 2742 | parent b4e628ea30d5ab3606119d2ea5caeab141d38df7 |
| 2743 | author Linus Torvalds <torvalds@ppc970.osdl.org> Sat Apr 9 12:02:30 2005 |
| 2744 | committer Linus Torvalds <torvalds@ppc970.osdl.org> Sat Apr 9 12:02:30 2005 |
| 2745 | |
| 2746 | Make "git-fsck-objects" print out all the root commits it finds. |
| 2747 | |
| 2748 | Once I do the reference tracking, I'll also make it print out all the |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2749 | HEAD commits it finds, which is even more interesting.</code></pre> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2750 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2751 | <div class="paragraph"><p>in case you care).</p></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2752 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2753 | </div> |
| 2754 | <div class="sect1"> |
| Junio C Hamano | 543f8d6 | 2009-07-29 08:35:21 | [diff] [blame] | 2755 | <h2 id="_raw_output_format">Raw output format</h2> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2756 | <div class="sectionbody"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2757 | <div class="paragraph"><p>The raw output format from "git-diff-index", "git-diff-tree", |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2758 | "git-diff-files" and "git diff --raw" are very similar.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2759 | <div class="paragraph"><p>These commands all compare two sets of things; what is |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2760 | compared differs:</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2761 | <div class="dlist"><dl> |
| 2762 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2763 | git-diff-index <tree-ish> |
| 2764 | </dt> |
| 2765 | <dd> |
| 2766 | <p> |
| 2767 | compares the <tree-ish> and the files on the filesystem. |
| 2768 | </p> |
| 2769 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2770 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2771 | git-diff-index --cached <tree-ish> |
| 2772 | </dt> |
| 2773 | <dd> |
| 2774 | <p> |
| 2775 | compares the <tree-ish> and the index. |
| 2776 | </p> |
| 2777 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2778 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2779 | git-diff-tree [-r] <tree-ish-1> <tree-ish-2> [<pattern>…] |
| 2780 | </dt> |
| 2781 | <dd> |
| 2782 | <p> |
| 2783 | compares the trees named by the two arguments. |
| 2784 | </p> |
| 2785 | </dd> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2786 | <dt class="hdlist1"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2787 | git-diff-files [<pattern>…] |
| 2788 | </dt> |
| 2789 | <dd> |
| 2790 | <p> |
| 2791 | compares the index and the files on the filesystem. |
| 2792 | </p> |
| 2793 | </dd> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2794 | </dl></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2795 | <div class="paragraph"><p>The "git-diff-tree" command begins its output by printing the hash of |
| Junio C Hamano | 543f8d6 | 2009-07-29 08:35:21 | [diff] [blame] | 2796 | what is being compared. After that, all the commands print one output |
| 2797 | line per changed file.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2798 | <div class="paragraph"><p>An output line is formatted this way:</p></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2799 | <div class="listingblock"> |
| 2800 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2801 | <pre><code>in-place edit :100644 100644 bcd1234... 0123456... M file0 |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2802 | copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2 |
| 2803 | rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3 |
| 2804 | create :000000 100644 0000000... 1234567... A file4 |
| 2805 | delete :100644 000000 1234567... 0000000... D file5 |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2806 | unmerged :000000 000000 0000000... 0000000... U file6</code></pre> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2807 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2808 | <div class="paragraph"><p>That is, from the left to the right:</p></div> |
| 2809 | <div class="olist arabic"><ol class="arabic"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2810 | <li> |
| 2811 | <p> |
| 2812 | a colon. |
| 2813 | </p> |
| 2814 | </li> |
| 2815 | <li> |
| 2816 | <p> |
| 2817 | mode for "src"; 000000 if creation or unmerged. |
| 2818 | </p> |
| 2819 | </li> |
| 2820 | <li> |
| 2821 | <p> |
| 2822 | a space. |
| 2823 | </p> |
| 2824 | </li> |
| 2825 | <li> |
| 2826 | <p> |
| 2827 | mode for "dst"; 000000 if deletion or unmerged. |
| 2828 | </p> |
| 2829 | </li> |
| 2830 | <li> |
| 2831 | <p> |
| 2832 | a space. |
| 2833 | </p> |
| 2834 | </li> |
| 2835 | <li> |
| 2836 | <p> |
| 2837 | sha1 for "src"; 0{40} if creation or unmerged. |
| 2838 | </p> |
| 2839 | </li> |
| 2840 | <li> |
| 2841 | <p> |
| 2842 | a space. |
| 2843 | </p> |
| 2844 | </li> |
| 2845 | <li> |
| 2846 | <p> |
| 2847 | sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree". |
| 2848 | </p> |
| 2849 | </li> |
| 2850 | <li> |
| 2851 | <p> |
| 2852 | a space. |
| 2853 | </p> |
| 2854 | </li> |
| 2855 | <li> |
| 2856 | <p> |
| 2857 | status, followed by optional "score" number. |
| 2858 | </p> |
| 2859 | </li> |
| 2860 | <li> |
| 2861 | <p> |
| Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 2862 | a tab or a NUL when <code>-z</code> option is used. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2863 | </p> |
| 2864 | </li> |
| 2865 | <li> |
| 2866 | <p> |
| 2867 | path for "src" |
| 2868 | </p> |
| 2869 | </li> |
| 2870 | <li> |
| 2871 | <p> |
| Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 2872 | a tab or a NUL when <code>-z</code> option is used; only exists for C or R. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2873 | </p> |
| 2874 | </li> |
| 2875 | <li> |
| 2876 | <p> |
| 2877 | path for "dst"; only exists for C or R. |
| 2878 | </p> |
| 2879 | </li> |
| 2880 | <li> |
| 2881 | <p> |
| Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 2882 | an LF or a NUL when <code>-z</code> option is used, to terminate the record. |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2883 | </p> |
| 2884 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2885 | </ol></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2886 | <div class="paragraph"><p>Possible status letters are:</p></div> |
| 2887 | <div class="ulist"><ul> |
| Junio C Hamano | aa17c7c | 2008-11-03 04:36:58 | [diff] [blame] | 2888 | <li> |
| 2889 | <p> |
| 2890 | A: addition of a file |
| 2891 | </p> |
| 2892 | </li> |
| 2893 | <li> |
| 2894 | <p> |
| 2895 | C: copy of a file into a new one |
| 2896 | </p> |
| 2897 | </li> |
| 2898 | <li> |
| 2899 | <p> |
| 2900 | D: deletion of a file |
| 2901 | </p> |
| 2902 | </li> |
| 2903 | <li> |
| 2904 | <p> |
| 2905 | M: modification of the contents or mode of a file |
| 2906 | </p> |
| 2907 | </li> |
| 2908 | <li> |
| 2909 | <p> |
| 2910 | R: renaming of a file |
| 2911 | </p> |
| 2912 | </li> |
| 2913 | <li> |
| 2914 | <p> |
| 2915 | T: change in the type of the file |
| 2916 | </p> |
| 2917 | </li> |
| 2918 | <li> |
| 2919 | <p> |
| 2920 | U: file is unmerged (you must complete the merge before it can |
| 2921 | be committed) |
| 2922 | </p> |
| 2923 | </li> |
| 2924 | <li> |
| 2925 | <p> |
| 2926 | X: "unknown" change type (most probably a bug, please report it) |
| 2927 | </p> |
| 2928 | </li> |
| 2929 | </ul></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2930 | <div class="paragraph"><p>Status letters C and R are always followed by a score (denoting the |
| Junio C Hamano | aa17c7c | 2008-11-03 04:36:58 | [diff] [blame] | 2931 | percentage of similarity between the source and target of the move or |
| Junio C Hamano | 6bb32e6 | 2015-02-17 22:11:26 | [diff] [blame] | 2932 | copy). Status letter M may be followed by a score (denoting the |
| 2933 | percentage of dissimilarity) for file rewrites.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2934 | <div class="paragraph"><p><sha1> is shown as all 0’s if a file is new on the filesystem |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2935 | and it is out of sync with the index.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2936 | <div class="paragraph"><p>Example:</p></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2937 | <div class="listingblock"> |
| 2938 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2939 | <pre><code>:100644 100644 5be4a4...... 000000...... M file.c</code></pre> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2940 | </div></div> |
| Junio C Hamano | 0f6f3bf | 2017-03-13 07:01:53 | [diff] [blame] | 2941 | <div class="paragraph"><p>Without the <code>-z</code> option, pathnames with "unusual" characters are |
| 2942 | quoted as explained for the configuration variable <code>core.quotePath</code> |
| 2943 | (see <a href="git-config.html">git-config(1)</a>). Using <code>-z</code> the filename is output |
| 2944 | verbatim and the line is terminated by a NUL byte.</p></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2945 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2946 | </div> |
| 2947 | <div class="sect1"> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2948 | <h2 id="_diff_format_for_merges">diff format for merges</h2> |
| Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 2949 | <div class="sectionbody"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2950 | <div class="paragraph"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw" |
| Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 2951 | can take <code>-c</code> or <code>--cc</code> option |
| Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 2952 | to generate diff output also for merge commits. The output differs |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2953 | from the format described above in the following way:</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2954 | <div class="olist arabic"><ol class="arabic"> |
| Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 2955 | <li> |
| 2956 | <p> |
| 2957 | there is a colon for each parent |
| 2958 | </p> |
| 2959 | </li> |
| 2960 | <li> |
| 2961 | <p> |
| 2962 | there are more "src" modes and "src" sha1 |
| 2963 | </p> |
| 2964 | </li> |
| 2965 | <li> |
| 2966 | <p> |
| 2967 | status is concatenated status characters for each parent |
| 2968 | </p> |
| 2969 | </li> |
| 2970 | <li> |
| 2971 | <p> |
| 2972 | no optional "score" number |
| 2973 | </p> |
| 2974 | </li> |
| 2975 | <li> |
| 2976 | <p> |
| 2977 | single path, only for "dst" |
| 2978 | </p> |
| 2979 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2980 | </ol></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2981 | <div class="paragraph"><p>Example:</p></div> |
| Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 2982 | <div class="listingblock"> |
| 2983 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2984 | <pre><code>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</code></pre> |
| Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 2985 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2986 | <div class="paragraph"><p>Note that <em>combined diff</em> lists only files which were modified from |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2987 | all parents.</p></div> |
| Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 2988 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2989 | </div> |
| 2990 | <div class="sect1"> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2991 | <h2 id="_generating_patches_with_p">Generating patches with -p</h2> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2992 | <div class="sectionbody"> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2993 | <div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run |
| Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 2994 | with a <code>-p</code> option, "git diff" without the <code>--raw</code> option, or |
| Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2995 | "git log" with the "-p" option, they |
| Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2996 | do not produce the output described above; instead they produce a |
| 2997 | patch file. You can customize the creation of such patches via the |
| Junio C Hamano | 042f214 | 2016-06-27 18:05:05 | [diff] [blame] | 2998 | <code>GIT_EXTERNAL_DIFF</code> and the <code>GIT_DIFF_OPTS</code> environment variables.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2999 | <div class="paragraph"><p>What the -p option produces is slightly different from the traditional |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 3000 | diff format:</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3001 | <div class="olist arabic"><ol class="arabic"> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3002 | <li> |
| 3003 | <p> |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 3004 | It is preceded with a "git diff" header that looks like this: |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3005 | </p> |
| 3006 | <div class="literalblock"> |
| 3007 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3008 | <pre><code>diff --git a/file1 b/file2</code></pre> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3009 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3010 | <div class="paragraph"><p>The <code>a/</code> and <code>b/</code> filenames are the same unless rename/copy is |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3011 | involved. Especially, even for a creation or a deletion, |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3012 | <code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div> |
| 3013 | <div class="paragraph"><p>When rename/copy is involved, <code>file1</code> and <code>file2</code> show the |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3014 | name of the source file of the rename/copy and the name of |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3015 | the file that rename/copy produces, respectively.</p></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3016 | </li> |
| 3017 | <li> |
| 3018 | <p> |
| 3019 | It is followed by one or more extended header lines: |
| 3020 | </p> |
| 3021 | <div class="literalblock"> |
| 3022 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3023 | <pre><code>old mode <mode> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3024 | new mode <mode> |
| 3025 | deleted file mode <mode> |
| 3026 | new file mode <mode> |
| 3027 | copy from <path> |
| 3028 | copy to <path> |
| 3029 | rename from <path> |
| 3030 | rename to <path> |
| 3031 | similarity index <number> |
| 3032 | dissimilarity index <number> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3033 | index <hash>..<hash> <mode></code></pre> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3034 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3035 | <div class="paragraph"><p>File modes are printed as 6-digit octal numbers including the file type |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 3036 | and file permission bits.</p></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3037 | <div class="paragraph"><p>Path names in extended headers do not include the <code>a/</code> and <code>b/</code> prefixes.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3038 | <div class="paragraph"><p>The similarity index is the percentage of unchanged lines, and |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 3039 | the dissimilarity index is the percentage of changed lines. It |
| 3040 | is a rounded down integer, followed by a percent sign. The |
| 3041 | similarity index value of 100% is thus reserved for two equal |
| 3042 | files, while 100% dissimilarity means that no line from the old |
| 3043 | file made it into the new one.</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3044 | <div class="paragraph"><p>The index line includes the SHA-1 checksum before and after the change. |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 3045 | The <mode> is included if the file mode does not change; otherwise, |
| 3046 | separate lines indicate the old and the new mode.</p></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3047 | </li> |
| 3048 | <li> |
| 3049 | <p> |
| Junio C Hamano | 0f6f3bf | 2017-03-13 07:01:53 | [diff] [blame] | 3050 | Pathnames with "unusual" characters are quoted as explained for |
| 3051 | the configuration variable <code>core.quotePath</code> (see |
| 3052 | <a href="git-config.html">git-config(1)</a>). |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3053 | </p> |
| 3054 | </li> |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 3055 | <li> |
| 3056 | <p> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3057 | All the <code>file1</code> files in the output refer to files before the |
| 3058 | commit, and all the <code>file2</code> files refer to files after the commit. |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 3059 | It is incorrect to apply each change to each file sequentially. For |
| 3060 | example, this patch will swap a and b: |
| 3061 | </p> |
| 3062 | <div class="literalblock"> |
| 3063 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3064 | <pre><code>diff --git a/a b/b |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 3065 | rename from a |
| 3066 | rename to b |
| 3067 | diff --git a/b b/a |
| 3068 | rename from b |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3069 | rename to a</code></pre> |
| Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 3070 | </div></div> |
| 3071 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3072 | </ol></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3073 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 3074 | </div> |
| 3075 | <div class="sect1"> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3076 | <h2 id="_combined_diff_format">combined diff format</h2> |
| Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 3077 | <div class="sectionbody"> |
| Junio C Hamano | 1dbca52 | 2015-05-22 20:48:55 | [diff] [blame] | 3078 | <div class="paragraph"><p>Any diff-generating command can take the <code>-c</code> or <code>--cc</code> option to |
| Junio C Hamano | c5be4cc | 2011-03-09 07:20:43 | [diff] [blame] | 3079 | produce a <em>combined diff</em> when showing a merge. This is the default |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 3080 | format when showing merges with <a href="git-diff.html">git-diff(1)</a> or |
| Junio C Hamano | 1dbca52 | 2015-05-22 20:48:55 | [diff] [blame] | 3081 | <a href="git-show.html">git-show(1)</a>. Note also that you can give the <code>-m</code> option to any |
| Junio C Hamano | c5be4cc | 2011-03-09 07:20:43 | [diff] [blame] | 3082 | of these commands to force generation of diffs with individual parents |
| 3083 | of a merge.</p></div> |
| 3084 | <div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div> |
| Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 3085 | <div class="listingblock"> |
| 3086 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3087 | <pre><code>diff --combined describe.c |
| Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 3088 | index fabadb8,cc95eb0..4866510 |
| 3089 | --- a/describe.c |
| 3090 | +++ b/describe.c |
| 3091 | @@@ -98,20 -98,12 +98,20 @@@ |
| 3092 | return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1; |
| Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 3093 | } |
| 3094 | |
| 3095 | - static void describe(char *arg) |
| 3096 | -static void describe(struct commit *cmit, int last_one) |
| 3097 | ++static void describe(char *arg, int last_one) |
| 3098 | { |
| Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 3099 | + unsigned char sha1[20]; |
| 3100 | + struct commit *cmit; |
| 3101 | struct commit_list *list; |
| 3102 | static int initialized = 0; |
| 3103 | struct commit_name *n; |
| 3104 | |
| 3105 | + if (get_sha1(arg, sha1) < 0) |
| 3106 | + usage(describe_usage); |
| 3107 | + cmit = lookup_commit_reference(sha1); |
| 3108 | + if (!cmit) |
| 3109 | + usage(describe_usage); |
| 3110 | + |
| 3111 | if (!initialized) { |
| 3112 | initialized = 1; |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3113 | for_each_ref(get_name);</code></pre> |
| Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 3114 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3115 | <div class="olist arabic"><ol class="arabic"> |
| Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 3116 | <li> |
| 3117 | <p> |
| 3118 | It is preceded with a "git diff" header, that looks like |
| Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 3119 | this (when <code>-c</code> option is used): |
| Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 3120 | </p> |
| 3121 | <div class="literalblock"> |
| 3122 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3123 | <pre><code>diff --combined file</code></pre> |
| Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 3124 | </div></div> |
| Junio C Hamano | 92d8037 | 2016-07-13 22:00:05 | [diff] [blame] | 3125 | <div class="paragraph"><p>or like this (when <code>--cc</code> option is used):</p></div> |
| Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 3126 | <div class="literalblock"> |
| 3127 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3128 | <pre><code>diff --cc file</code></pre> |
| Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 3129 | </div></div> |
| 3130 | </li> |
| 3131 | <li> |
| 3132 | <p> |
| 3133 | It is followed by one or more extended header lines |
| 3134 | (this example shows a merge with two parents): |
| 3135 | </p> |
| 3136 | <div class="literalblock"> |
| 3137 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3138 | <pre><code>index <hash>,<hash>..<hash> |
| Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 3139 | mode <mode>,<mode>..<mode> |
| 3140 | new file mode <mode> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3141 | deleted file mode <mode>,<mode></code></pre> |
| Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 3142 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3143 | <div class="paragraph"><p>The <code>mode <mode>,<mode>..<mode></code> line appears only if at least one of |
| Junio C Hamano | ee1e428 | 2007-02-04 08:32:04 | [diff] [blame] | 3144 | the <mode> is different from the rest. Extended headers with |
| Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 3145 | information about detected contents movement (renames and |
| 3146 | copying detection) are designed to work with diff of two |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3147 | <tree-ish> and are not used by combined diff format.</p></div> |
| Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 3148 | </li> |
| 3149 | <li> |
| 3150 | <p> |
| 3151 | It is followed by two-line from-file/to-file header |
| 3152 | </p> |
| 3153 | <div class="literalblock"> |
| 3154 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3155 | <pre><code>--- a/file |
| 3156 | +++ b/file</code></pre> |
| Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 3157 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3158 | <div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3159 | format, <code>/dev/null</code> is used to signal created or deleted |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3160 | files.</p></div> |
| Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 3161 | </li> |
| 3162 | <li> |
| 3163 | <p> |
| 3164 | Chunk header format is modified to prevent people from |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3165 | accidentally feeding it to <code>patch -p1</code>. Combined diff format |
| Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 3166 | was created for review of merge commit changes, and was not |
| 3167 | meant for apply. The change is similar to the change in the |
| 3168 | extended <em>index</em> header: |
| 3169 | </p> |
| 3170 | <div class="literalblock"> |
| 3171 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3172 | <pre><code>@@@ <from-file-range> <from-file-range> <to-file-range> @@@</code></pre> |
| Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 3173 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3174 | <div class="paragraph"><p>There are (number of parents + 1) <code>@</code> characters in the chunk |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3175 | header for combined diff format.</p></div> |
| Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 3176 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3177 | </ol></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3178 | <div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3179 | files A and B with a single column that has <code>-</code> (minus — appears in A but removed in B), <code>+</code> (plus — missing in A but |
| 3180 | added to B), or <code>" "</code> (space — unchanged) prefix, this format |
| Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 3181 | compares two or more files file1, file2,… with one file X, and |
| 3182 | shows how X differs from each of fileN. One column for each of |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3183 | fileN is prepended to the output line to note how X’s line is |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3184 | different from it.</p></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3185 | <div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in |
| 3186 | fileN but it does not appear in the result. A <code>+</code> character |
| Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 3187 | in the column N means that the line appears in the result, |
| Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 3188 | and fileN does not have that line (in other words, the line was |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3189 | added, from the point of view of that parent).</p></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3190 | <div class="paragraph"><p>In the above example output, the function signature was changed |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3191 | from both files (hence two <code>-</code> removals from both file1 and |
| 3192 | file2, plus <code>++</code> to mean one line that was added does not appear |
| Junio C Hamano | d75148a | 2014-04-08 19:48:38 | [diff] [blame] | 3193 | in either file1 or file2). Also eight other lines are the same |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3194 | from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div> |
| 3195 | <div class="paragraph"><p>When shown by <code>git diff-tree -c</code>, it compares the parents of a |
| Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 3196 | merge commit with the merge result (i.e. file1..fileN are the |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3197 | parents). When shown by <code>git diff-files -c</code>, it compares the |
| Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 3198 | two unresolved merge parents with the working tree file |
| 3199 | (i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3200 | "their version").</p></div> |
| Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 3201 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 3202 | </div> |
| 3203 | <div class="sect1"> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3204 | <h2 id="_other_diff_formats">other diff formats</h2> |
| Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 3205 | <div class="sectionbody"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3206 | <div class="paragraph"><p>The <code>--summary</code> option describes newly added, deleted, renamed and |
| 3207 | copied files. The <code>--stat</code> option adds diffstat(1) graph to the |
| Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 3208 | output. These options can be combined with other options, such as |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3209 | <code>-p</code>, and are meant for human consumption.</p></div> |
| 3210 | <div class="paragraph"><p>When showing a change that involves a rename or a copy, <code>--stat</code> output |
| Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 3211 | formats the pathnames compactly by combining common prefix and suffix of |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3212 | the pathnames. For example, a change that moves <code>arch/i386/Makefile</code> to |
| 3213 | <code>arch/x86/Makefile</code> while modifying 4 lines will be shown like this:</p></div> |
| Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 3214 | <div class="listingblock"> |
| 3215 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3216 | <pre><code>arch/{i386 => x86}/Makefile | 4 +--</code></pre> |
| Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 3217 | </div></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3218 | <div class="paragraph"><p>The <code>--numstat</code> option gives the diffstat(1) information but is designed |
| 3219 | for easier machine consumption. An entry in <code>--numstat</code> output looks |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3220 | like this:</p></div> |
| Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 3221 | <div class="listingblock"> |
| 3222 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3223 | <pre><code>1 2 README |
| 3224 | 3 1 arch/{i386 => x86}/Makefile</code></pre> |
| Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 3225 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3226 | <div class="paragraph"><p>That is, from left to right:</p></div> |
| 3227 | <div class="olist arabic"><ol class="arabic"> |
| Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 3228 | <li> |
| 3229 | <p> |
| 3230 | the number of added lines; |
| 3231 | </p> |
| 3232 | </li> |
| 3233 | <li> |
| 3234 | <p> |
| 3235 | a tab; |
| 3236 | </p> |
| 3237 | </li> |
| 3238 | <li> |
| 3239 | <p> |
| 3240 | the number of deleted lines; |
| 3241 | </p> |
| 3242 | </li> |
| 3243 | <li> |
| 3244 | <p> |
| 3245 | a tab; |
| 3246 | </p> |
| 3247 | </li> |
| 3248 | <li> |
| 3249 | <p> |
| 3250 | pathname (possibly with rename/copy information); |
| 3251 | </p> |
| 3252 | </li> |
| 3253 | <li> |
| 3254 | <p> |
| 3255 | a newline. |
| 3256 | </p> |
| 3257 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3258 | </ol></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3259 | <div class="paragraph"><p>When <code>-z</code> output option is in effect, the output is formatted this way:</p></div> |
| Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 3260 | <div class="listingblock"> |
| 3261 | <div class="content"> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3262 | <pre><code>1 2 README NUL |
| 3263 | 3 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</code></pre> |
| Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 3264 | </div></div> |
| Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3265 | <div class="paragraph"><p>That is:</p></div> |
| 3266 | <div class="olist arabic"><ol class="arabic"> |
| Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 3267 | <li> |
| 3268 | <p> |
| 3269 | the number of added lines; |
| 3270 | </p> |
| 3271 | </li> |
| 3272 | <li> |
| 3273 | <p> |
| 3274 | a tab; |
| 3275 | </p> |
| 3276 | </li> |
| 3277 | <li> |
| 3278 | <p> |
| 3279 | the number of deleted lines; |
| 3280 | </p> |
| 3281 | </li> |
| 3282 | <li> |
| 3283 | <p> |
| 3284 | a tab; |
| 3285 | </p> |
| 3286 | </li> |
| 3287 | <li> |
| 3288 | <p> |
| 3289 | a NUL (only exists if renamed/copied); |
| 3290 | </p> |
| 3291 | </li> |
| 3292 | <li> |
| 3293 | <p> |
| 3294 | pathname in preimage; |
| 3295 | </p> |
| 3296 | </li> |
| 3297 | <li> |
| 3298 | <p> |
| 3299 | a NUL (only exists if renamed/copied); |
| 3300 | </p> |
| 3301 | </li> |
| 3302 | <li> |
| 3303 | <p> |
| 3304 | pathname in postimage (only exists if renamed/copied); |
| 3305 | </p> |
| 3306 | </li> |
| 3307 | <li> |
| 3308 | <p> |
| 3309 | a NUL. |
| 3310 | </p> |
| 3311 | </li> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3312 | </ol></div> |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3313 | <div class="paragraph"><p>The extra <code>NUL</code> before the preimage path in renamed case is to allow |
| Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 3314 | scripts that read the output to tell if the current record being read is |
| 3315 | a single-path record or a rename/copy record without reading ahead. |
| Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3316 | After reading added and deleted lines, reading up to <code>NUL</code> would yield |
| 3317 | the pathname, but if that is <code>NUL</code>, the record will show two paths.</p></div> |
| Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 3318 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 3319 | </div> |
| 3320 | <div class="sect1"> |
| Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3321 | <h2 id="_git">GIT</h2> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3322 | <div class="sectionbody"> |
| Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 3323 | <div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3324 | </div> |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 3325 | </div> |
| Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 3326 | </div> |
| Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 3327 | <div id="footnotes"><hr /></div> |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3328 | <div id="footer"> |
| 3329 | <div id="footer-text"> |
| Junio C Hamano | 2ef0ba3 | 2018-01-26 23:13:53 | [diff] [blame] | 3330 | Last updated |
| 3331 | 2018-01-26 15:11:04 PST |
| Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3332 | </div> |
| 3333 | </div> |
| 3334 | </body> |
| 3335 | </html> |