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> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 6 | <meta name="generator" content="AsciiDoc 8.5.2" /> |
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"> |
| 9 | /* Debug borders */ |
| 10 | p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 { |
| 11 | /* |
| 12 | border: 1px solid red; |
| 13 | */ |
| 14 | } |
| 15 | |
| 16 | body { |
| 17 | margin: 1em 5% 1em 5%; |
| 18 | } |
| 19 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 20 | a { |
| 21 | color: blue; |
| 22 | text-decoration: underline; |
| 23 | } |
| 24 | a:visited { |
| 25 | color: fuchsia; |
| 26 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 27 | |
| 28 | em { |
| 29 | font-style: italic; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 30 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | strong { |
| 34 | font-weight: bold; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 35 | color: #083194; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | tt { |
| 39 | color: navy; |
| 40 | } |
| 41 | |
| 42 | h1, h2, h3, h4, h5, h6 { |
| 43 | color: #527bbd; |
| 44 | font-family: sans-serif; |
| 45 | margin-top: 1.2em; |
| 46 | margin-bottom: 0.5em; |
| 47 | line-height: 1.3; |
| 48 | } |
| 49 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 50 | h1, h2, h3 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 51 | border-bottom: 2px solid silver; |
| 52 | } |
| 53 | h2 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 54 | padding-top: 0.5em; |
| 55 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 56 | h3 { |
| 57 | float: left; |
| 58 | } |
| 59 | h3 + * { |
| 60 | clear: left; |
| 61 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 62 | |
| 63 | div.sectionbody { |
| 64 | font-family: serif; |
| 65 | margin-left: 0; |
| 66 | } |
| 67 | |
| 68 | hr { |
| 69 | border: 1px solid silver; |
| 70 | } |
| 71 | |
| 72 | p { |
| 73 | margin-top: 0.5em; |
| 74 | margin-bottom: 0.5em; |
| 75 | } |
| 76 | |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 77 | ul, ol, li > p { |
| 78 | margin-top: 0; |
| 79 | } |
| 80 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 81 | pre { |
| 82 | padding: 0; |
| 83 | margin: 0; |
| 84 | } |
| 85 | |
| 86 | span#author { |
| 87 | color: #527bbd; |
| 88 | font-family: sans-serif; |
| 89 | font-weight: bold; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 90 | font-size: 1.1em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 91 | } |
| 92 | span#email { |
| 93 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 94 | span#revnumber, span#revdate, span#revremark { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 95 | font-family: sans-serif; |
| 96 | } |
| 97 | |
| 98 | div#footer { |
| 99 | font-family: sans-serif; |
| 100 | font-size: small; |
| 101 | border-top: 2px solid silver; |
| 102 | padding-top: 0.5em; |
| 103 | margin-top: 4.0em; |
| 104 | } |
| 105 | div#footer-text { |
| 106 | float: left; |
| 107 | padding-bottom: 0.5em; |
| 108 | } |
| 109 | div#footer-badges { |
| 110 | float: right; |
| 111 | padding-bottom: 0.5em; |
| 112 | } |
| 113 | |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 114 | div#preamble { |
| 115 | margin-top: 1.5em; |
| 116 | margin-bottom: 1.5em; |
| 117 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 118 | div.tableblock, div.imageblock, div.exampleblock, div.verseblock, |
| 119 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 120 | div.admonitionblock { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 121 | margin-top: 1.0em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 122 | margin-bottom: 1.5em; |
| 123 | } |
| 124 | div.admonitionblock { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 125 | margin-top: 2.0em; |
| 126 | margin-bottom: 2.0em; |
| 127 | margin-right: 10%; |
| 128 | color: #606060; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | div.content { /* Block element content. */ |
| 132 | padding: 0; |
| 133 | } |
| 134 | |
| 135 | /* Block element titles. */ |
| 136 | div.title, caption.title { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 137 | color: #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 138 | font-family: sans-serif; |
| 139 | font-weight: bold; |
| 140 | text-align: left; |
| 141 | margin-top: 1.0em; |
| 142 | margin-bottom: 0.5em; |
| 143 | } |
| 144 | div.title + * { |
| 145 | margin-top: 0; |
| 146 | } |
| 147 | |
| 148 | td div.title:first-child { |
| 149 | margin-top: 0.0em; |
| 150 | } |
| 151 | div.content div.title:first-child { |
| 152 | margin-top: 0.0em; |
| 153 | } |
| 154 | div.content + div.title { |
| 155 | margin-top: 0.0em; |
| 156 | } |
| 157 | |
| 158 | div.sidebarblock > div.content { |
| 159 | background: #ffffee; |
| 160 | border: 1px solid silver; |
| 161 | padding: 0.5em; |
| 162 | } |
| 163 | |
| 164 | div.listingblock > div.content { |
| 165 | border: 1px solid silver; |
| 166 | background: #f4f4f4; |
| 167 | padding: 0.5em; |
| 168 | } |
| 169 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 170 | div.quoteblock, div.verseblock { |
| 171 | padding-left: 1.0em; |
| 172 | margin-left: 1.0em; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 173 | margin-right: 10%; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 174 | border-left: 5px solid #dddddd; |
| 175 | color: #777777; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 176 | } |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 177 | |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 178 | div.quoteblock > div.attribution { |
| 179 | padding-top: 0.5em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 180 | text-align: right; |
| 181 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 182 | |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 183 | div.verseblock > div.content { |
| 184 | white-space: pre; |
| 185 | } |
| 186 | div.verseblock > div.attribution { |
| 187 | padding-top: 0.75em; |
| 188 | text-align: left; |
| 189 | } |
| 190 | /* DEPRECATED: Pre version 8.2.7 verse style literal block. */ |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 191 | div.verseblock + div.attribution { |
| 192 | text-align: left; |
| 193 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 194 | |
| 195 | div.admonitionblock .icon { |
| 196 | vertical-align: top; |
| 197 | font-size: 1.1em; |
| 198 | font-weight: bold; |
| 199 | text-decoration: underline; |
| 200 | color: #527bbd; |
| 201 | padding-right: 0.5em; |
| 202 | } |
| 203 | div.admonitionblock td.content { |
| 204 | padding-left: 0.5em; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 205 | border-left: 3px solid #dddddd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 206 | } |
| 207 | |
| 208 | div.exampleblock > div.content { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 209 | border-left: 3px solid #dddddd; |
| 210 | padding-left: 0.5em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 211 | } |
| 212 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 213 | div.imageblock div.content { padding-left: 0; } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 214 | span.image img { border-style: none; } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 215 | a.image:visited { color: white; } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 216 | |
| 217 | dl { |
| 218 | margin-top: 0.8em; |
| 219 | margin-bottom: 0.8em; |
| 220 | } |
| 221 | dt { |
| 222 | margin-top: 0.5em; |
| 223 | margin-bottom: 0; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 224 | font-style: normal; |
| 225 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 226 | } |
| 227 | dd > *:first-child { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 228 | margin-top: 0.1em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 229 | } |
| 230 | |
| 231 | ul, ol { |
| 232 | list-style-position: outside; |
| 233 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 234 | ol.arabic { |
| 235 | list-style-type: decimal; |
| 236 | } |
| 237 | ol.loweralpha { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 238 | list-style-type: lower-alpha; |
| 239 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 240 | ol.upperalpha { |
| 241 | list-style-type: upper-alpha; |
| 242 | } |
| 243 | ol.lowerroman { |
| 244 | list-style-type: lower-roman; |
| 245 | } |
| 246 | ol.upperroman { |
| 247 | list-style-type: upper-roman; |
| 248 | } |
| 249 | |
| 250 | div.compact ul, div.compact ol, |
| 251 | div.compact p, div.compact p, |
| 252 | div.compact div, div.compact div { |
| 253 | margin-top: 0.1em; |
| 254 | margin-bottom: 0.1em; |
| 255 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 256 | |
| 257 | div.tableblock > table { |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 258 | border: 3px solid #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 259 | } |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 260 | thead, p.table.header { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 261 | font-family: sans-serif; |
| 262 | font-weight: bold; |
| 263 | } |
| 264 | tfoot { |
| 265 | font-weight: bold; |
| 266 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 267 | td > div.verse { |
| 268 | white-space: pre; |
| 269 | } |
| 270 | p.table { |
| 271 | margin-top: 0; |
| 272 | } |
| 273 | /* Because the table frame attribute is overriden by CSS in most browsers. */ |
| 274 | div.tableblock > table[frame="void"] { |
| 275 | border-style: none; |
| 276 | } |
| 277 | div.tableblock > table[frame="hsides"] { |
| 278 | border-left-style: none; |
| 279 | border-right-style: none; |
| 280 | } |
| 281 | div.tableblock > table[frame="vsides"] { |
| 282 | border-top-style: none; |
| 283 | border-bottom-style: none; |
| 284 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 285 | |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 286 | |
| 287 | div.hdlist { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 288 | margin-top: 0.8em; |
| 289 | margin-bottom: 0.8em; |
| 290 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 291 | div.hdlist tr { |
| 292 | padding-bottom: 15px; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 293 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 294 | dt.hdlist1.strong, td.hdlist1.strong { |
| 295 | font-weight: bold; |
| 296 | } |
| 297 | td.hdlist1 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 298 | vertical-align: top; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 299 | font-style: normal; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 300 | padding-right: 0.8em; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 301 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 302 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 303 | td.hdlist2 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 304 | vertical-align: top; |
| 305 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 306 | div.hdlist.compact tr { |
| 307 | margin: 0; |
| 308 | padding-bottom: 0; |
| 309 | } |
| 310 | |
| 311 | .comment { |
| 312 | background: yellow; |
| 313 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 314 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 315 | .footnote, .footnoteref { |
| 316 | font-size: 0.8em; |
| 317 | } |
| 318 | |
| 319 | span.footnote, span.footnoteref { |
| 320 | vertical-align: super; |
| 321 | } |
| 322 | |
| 323 | #footnotes { |
| 324 | margin: 20px 0 20px 0; |
| 325 | padding: 7px 0 0 0; |
| 326 | } |
| 327 | |
| 328 | #footnotes div.footnote { |
| 329 | margin: 0 0 5px 0; |
| 330 | } |
| 331 | |
| 332 | #footnotes hr { |
| 333 | border: none; |
| 334 | border-top: 1px solid silver; |
| 335 | height: 1px; |
| 336 | text-align: left; |
| 337 | margin-left: 0; |
| 338 | width: 20%; |
| 339 | min-width: 100px; |
| 340 | } |
| 341 | |
| 342 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 343 | @media print { |
| 344 | div#footer-badges { display: none; } |
| 345 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 346 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 347 | div#toc { |
| 348 | margin-bottom: 2.5em; |
| 349 | } |
| 350 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 351 | div#toctitle { |
| 352 | color: #527bbd; |
| 353 | font-family: sans-serif; |
| 354 | font-size: 1.1em; |
| 355 | font-weight: bold; |
| 356 | margin-top: 1.0em; |
| 357 | margin-bottom: 0.1em; |
| 358 | } |
| 359 | |
| 360 | div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
| 361 | margin-top: 0; |
| 362 | margin-bottom: 0; |
| 363 | } |
| 364 | div.toclevel2 { |
| 365 | margin-left: 2em; |
| 366 | font-size: 0.9em; |
| 367 | } |
| 368 | div.toclevel3 { |
| 369 | margin-left: 4em; |
| 370 | font-size: 0.9em; |
| 371 | } |
| 372 | div.toclevel4 { |
| 373 | margin-left: 6em; |
| 374 | font-size: 0.9em; |
| 375 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 376 | /* Overrides for manpage documents */ |
| 377 | h1 { |
| 378 | padding-top: 0.5em; |
| 379 | padding-bottom: 0.5em; |
| 380 | border-top: 2px solid silver; |
| 381 | border-bottom: 2px solid silver; |
| 382 | } |
| 383 | h2 { |
| 384 | border-style: none; |
| 385 | } |
| 386 | div.sectionbody { |
| 387 | margin-left: 5%; |
| 388 | } |
| 389 | |
| 390 | @media print { |
| 391 | div#toc { display: none; } |
| 392 | } |
| 393 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 394 | /* Workarounds for IE6's broken and incomplete CSS2. */ |
| 395 | |
| 396 | div.sidebar-content { |
| 397 | background: #ffffee; |
| 398 | border: 1px solid silver; |
| 399 | padding: 0.5em; |
| 400 | } |
| 401 | div.sidebar-title, div.image-title { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 402 | color: #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 403 | font-family: sans-serif; |
| 404 | font-weight: bold; |
| 405 | margin-top: 0.0em; |
| 406 | margin-bottom: 0.5em; |
| 407 | } |
| 408 | |
| 409 | div.listingblock div.content { |
| 410 | border: 1px solid silver; |
| 411 | background: #f4f4f4; |
| 412 | padding: 0.5em; |
| 413 | } |
| 414 | |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 415 | div.quoteblock-attribution { |
| 416 | padding-top: 0.5em; |
| 417 | text-align: right; |
| 418 | } |
| 419 | |
| 420 | div.verseblock-content { |
| 421 | white-space: pre; |
| 422 | } |
| 423 | div.verseblock-attribution { |
| 424 | padding-top: 0.75em; |
| 425 | text-align: left; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 426 | } |
| 427 | |
| 428 | div.exampleblock-content { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 429 | border-left: 3px solid #dddddd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 430 | padding-left: 0.5em; |
| 431 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 432 | |
| 433 | /* IE6 sets dynamically generated links as visited. */ |
| 434 | div#toc a:visited { color: blue; } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 435 | </style> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 436 | <script type="text/javascript"> |
| 437 | /*<+'])'); |
| 481 | // Function that scans the DOM tree for header elements (the DOM2 |
| 482 | // nodeIterator API would be a better technique but not supported by all |
| 483 | // browsers). |
| 484 | var iterate = function (el) { |
| 485 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 486 | if (i.nodeType == 1 /* Node.ELEMENT_NODE */) { |
| 487 | var mo = re.exec(i.tagName); |
| 488 | if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") { |
| 489 | result[result.length] = new TocEntry(i, getText(i), mo[1]-1); |
| 490 | } |
| 491 | iterate(i); |
| 492 | } |
| 493 | } |
| 494 | } |
| 495 | iterate(el); |
| 496 | return result; |
| 497 | } |
| 498 | |
| 499 | var toc = document.getElementById("toc"); |
| 500 | var entries = tocEntries(document.getElementById("content"), toclevels); |
| 501 | for (var i = 0; i < entries.length; ++i) { |
| 502 | var entry = entries[i]; |
| 503 | if (entry.element.id == "") |
| 504 | entry.element.id = "_toc_" + i; |
| 505 | var a = document.createElement("a"); |
| 506 | a.href = "#" + entry.element.id; |
| 507 | a.appendChild(document.createTextNode(entry.text)); |
| 508 | var div = document.createElement("div"); |
| 509 | div.appendChild(a); |
| 510 | div.className = "toclevel" + entry.toclevel; |
| 511 | toc.appendChild(div); |
| 512 | } |
| 513 | if (entries.length == 0) |
| 514 | toc.parentNode.removeChild(toc); |
| 515 | }, |
| 516 | |
| 517 | |
| 518 | ///////////////////////////////////////////////////////////////////// |
| 519 | // Footnotes generator |
| 520 | ///////////////////////////////////////////////////////////////////// |
| 521 | |
| 522 | /* Based on footnote generation code from: |
| 523 | * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html |
| 524 | */ |
| 525 | |
| 526 | footnotes: function () { |
| 527 | var cont = document.getElementById("content"); |
| 528 | var noteholder = document.getElementById("footnotes"); |
| 529 | var spans = cont.getElementsByTagName("span"); |
| 530 | var refs = {}; |
| 531 | var n = 0; |
| 532 | for (i=0; i<spans.length; i++) { |
| 533 | if (spans[i].className == "footnote") { |
| 534 | n++; |
| 535 | // Use [\s\S] in place of . so multi-line matches work. |
| 536 | // Because JavaScript has no s (dotall) regex flag. |
| 537 | note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1]; |
| 538 | noteholder.innerHTML += |
| 539 | "<div class='footnote' id='_footnote_" + n + "'>" + |
| 540 | "<a href='#_footnoteref_" + n + "' title='Return to text'>" + |
| 541 | n + "</a>. " + note + "</div>"; |
| 542 | spans[i].innerHTML = |
| 543 | "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n + |
| 544 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 545 | var id =spans[i].getAttribute("id"); |
| 546 | if (id != null) refs["#"+id] = n; |
| 547 | } |
| 548 | } |
| 549 | if (n == 0) |
| 550 | noteholder.parentNode.removeChild(noteholder); |
| 551 | else { |
| 552 | // Process footnoterefs. |
| 553 | for (i=0; i<spans.length; i++) { |
| 554 | if (spans[i].className == "footnoteref") { |
| 555 | var href = spans[i].getElementsByTagName("a")[0].getAttribute("href"); |
| 556 | href = href.match(/#.*/)[0]; // Because IE return full URL. |
| 557 | n = refs[href]; |
| 558 | spans[i].innerHTML = |
| 559 | "[<a href='#_footnote_" + n + |
| 560 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 561 | } |
| 562 | } |
| 563 | } |
| 564 | } |
| 565 | |
| 566 | } |
| 567 | /*]]>*/ |
| 568 | </script> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 569 | </head> |
| 570 | <body> |
| 571 | <div id="header"> |
| 572 | <h1> |
| 573 | git-diff-tree(1) Manual Page |
| 574 | </h1> |
| 575 | <h2>NAME</h2> |
| 576 | <div class="sectionbody"> |
| 577 | <p>git-diff-tree - |
| 578 | Compares the content and mode of blobs found via two tree objects |
| 579 | </p> |
| 580 | </div> |
| 581 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 582 | <div id="content"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 583 | <h2 id="_synopsis">SYNOPSIS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 584 | <div class="sectionbody"> |
Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 585 | <div class="verseblock"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 586 | <div class="verseblock-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] | 587 | [-t] [-r] [-c | --cc] [--root] [<common diff options>] |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 588 | <tree-ish> [<tree-ish>] [<path>…]</div> |
| 589 | <div class="verseblock-attribution"> |
| 590 | </div></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 591 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 592 | <h2 id="_description">DESCRIPTION</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 593 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 594 | <div class="paragraph"><p>Compares the content and mode of the blobs found via two tree objects.</p></div> |
| 595 | <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] | 596 | (see --stdin below).</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 597 | <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] | 598 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 599 | <h2 id="_options">OPTIONS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 600 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 601 | <div class="dlist"><dl> |
| 602 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 603 | -p |
| 604 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 605 | <dt class="hdlist1"> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 606 | -u |
| 607 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 608 | <dt class="hdlist1"> |
Junio C Hamano | e97d577 | 2010-05-19 08:13:58 | [diff] [blame] | 609 | --patch |
| 610 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 611 | <dd> |
| 612 | <p> |
Junio C Hamano | ff97979 | 2007-11-16 10:11:30 | [diff] [blame] | 613 | Generate patch (see section on generating patches). |
| 614 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 615 | </p> |
| 616 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 617 | <dt class="hdlist1"> |
Junio C Hamano | 6936156 | 2007-07-26 02:14:34 | [diff] [blame] | 618 | -U<n> |
| 619 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 620 | <dt class="hdlist1"> |
Junio C Hamano | 6936156 | 2007-07-26 02:14:34 | [diff] [blame] | 621 | --unified=<n> |
| 622 | </dt> |
| 623 | <dd> |
| 624 | <p> |
| 625 | Generate diffs with <n> lines of context instead of |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 626 | the usual three. |
| 627 | Implies <tt>-p</tt>. |
Junio C Hamano | 6936156 | 2007-07-26 02:14:34 | [diff] [blame] | 628 | </p> |
| 629 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 630 | <dt class="hdlist1"> |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 631 | --raw |
| 632 | </dt> |
| 633 | <dd> |
| 634 | <p> |
| 635 | Generate the raw format. |
Junio C Hamano | ff97979 | 2007-11-16 10:11:30 | [diff] [blame] | 636 | This is the default. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 637 | </p> |
| 638 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 639 | <dt class="hdlist1"> |
Junio C Hamano | 54559c8 | 2006-04-13 07:45:12 | [diff] [blame] | 640 | --patch-with-raw |
| 641 | </dt> |
| 642 | <dd> |
| 643 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 644 | Synonym for <tt>-p --raw</tt>. |
Junio C Hamano | 54559c8 | 2006-04-13 07:45:12 | [diff] [blame] | 645 | </p> |
| 646 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 647 | <dt class="hdlist1"> |
Junio C Hamano | 5a73f30 | 2011-10-14 05:58:34 | [diff] [blame] | 648 | --minimal |
| 649 | </dt> |
| 650 | <dd> |
| 651 | <p> |
| 652 | Spend extra time to make sure the smallest possible |
| 653 | diff is produced. |
| 654 | </p> |
| 655 | </dd> |
| 656 | <dt class="hdlist1"> |
Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 657 | --patience |
| 658 | </dt> |
| 659 | <dd> |
| 660 | <p> |
| 661 | Generate a diff using the "patience diff" algorithm. |
| 662 | </p> |
| 663 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 664 | <dt class="hdlist1"> |
Junio C Hamano | 4c4b012 | 2011-06-30 01:19:32 | [diff] [blame] | 665 | --stat[=<width>[,<name-width>[,<count>]]] |
Junio C Hamano | ba7c8d8 | 2006-04-15 06:17:42 | [diff] [blame] | 666 | </dt> |
| 667 | <dd> |
| 668 | <p> |
Junio C Hamano | 4a9a76a | 2006-10-01 05:40:29 | [diff] [blame] | 669 | Generate a diffstat. You can override the default |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 670 | output width for 80-column terminal by <tt>--stat=<width></tt>. |
Junio C Hamano | 4a9a76a | 2006-10-01 05:40:29 | [diff] [blame] | 671 | The width of the filename part can be controlled by |
| 672 | giving another width to it separated by a comma. |
Junio C Hamano | 4c4b012 | 2011-06-30 01:19:32 | [diff] [blame] | 673 | By giving a third parameter <tt><count></tt>, you can limit the |
| 674 | output to the first <tt><count></tt> lines, followed by |
| 675 | <tt>…</tt> if there are more. |
Junio C Hamano | ba7c8d8 | 2006-04-15 06:17:42 | [diff] [blame] | 676 | </p> |
Junio C Hamano | 4c4b012 | 2011-06-30 01:19:32 | [diff] [blame] | 677 | <div class="paragraph"><p>These parameters can also be set individually with <tt>--stat-width=<width></tt>, |
| 678 | <tt>--stat-name-width=<name-width></tt> and <tt>--stat-count=<count></tt>.</p></div> |
Junio C Hamano | ba7c8d8 | 2006-04-15 06:17:42 | [diff] [blame] | 679 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 680 | <dt class="hdlist1"> |
Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 681 | --numstat |
| 682 | </dt> |
| 683 | <dd> |
| 684 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 685 | Similar to <tt>--stat</tt>, but shows number of added and |
Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 686 | deleted lines in decimal notation and pathname without |
Junio C Hamano | d793de5 | 2006-12-26 09:11:43 | [diff] [blame] | 687 | abbreviation, to make it more machine friendly. For |
| 688 | binary files, outputs two <tt>-</tt> instead of saying |
| 689 | <tt>0 0</tt>. |
Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 690 | </p> |
| 691 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 692 | <dt class="hdlist1"> |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 693 | --shortstat |
| 694 | </dt> |
| 695 | <dd> |
| 696 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 697 | Output only the last line of the <tt>--stat</tt> format containing total |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 698 | number of modified files, as well as number of added and deleted |
| 699 | lines. |
| 700 | </p> |
| 701 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 702 | <dt class="hdlist1"> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 703 | --dirstat[=<param1,param2,…>] |
Junio C Hamano | 6a45be9 | 2008-04-22 08:19:03 | [diff] [blame] | 704 | </dt> |
| 705 | <dd> |
| 706 | <p> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 707 | Output the distribution of relative amount of changes for each |
| 708 | sub-directory. The behavior of <tt>--dirstat</tt> can be customized by |
| 709 | passing it a comma separated list of parameters. |
| 710 | The defaults are controlled by the <tt>diff.dirstat</tt> configuration |
| 711 | variable (see <a href="git-config.html">git-config(1)</a>). |
| 712 | The following parameters are available: |
Junio C Hamano | 6a45be9 | 2008-04-22 08:19:03 | [diff] [blame] | 713 | </p> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 714 | <div class="dlist"><dl> |
| 715 | <dt class="hdlist1"> |
| 716 | <tt>changes</tt> |
| 717 | </dt> |
| 718 | <dd> |
| 719 | <p> |
| 720 | Compute the dirstat numbers by counting the lines that have been |
| 721 | removed from the source, or added to the destination. This ignores |
| 722 | the amount of pure code movements within a file. In other words, |
| 723 | rearranging lines in a file is not counted as much as other changes. |
| 724 | This is the default behavior when no parameter is given. |
| 725 | </p> |
Junio C Hamano | 6a45be9 | 2008-04-22 08:19:03 | [diff] [blame] | 726 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 727 | <dt class="hdlist1"> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 728 | <tt>lines</tt> |
Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 729 | </dt> |
| 730 | <dd> |
| 731 | <p> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 732 | Compute the dirstat numbers by doing the regular line-based diff |
| 733 | analysis, and summing the removed/added line counts. (For binary |
| 734 | files, count 64-byte chunks instead, since binary files have no |
| 735 | natural concept of lines). This is a more expensive <tt>--dirstat</tt> |
| 736 | behavior than the <tt>changes</tt> behavior, but it does count rearranged |
| 737 | lines within a file as much as other changes. The resulting output |
| 738 | is consistent with what you get from the other <tt>--*stat</tt> options. |
Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 739 | </p> |
| 740 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 741 | <dt class="hdlist1"> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 742 | <tt>files</tt> |
| 743 | </dt> |
| 744 | <dd> |
| 745 | <p> |
| 746 | Compute the dirstat numbers by counting the number of files changed. |
| 747 | Each changed file counts equally in the dirstat analysis. This is |
| 748 | the computationally cheapest <tt>--dirstat</tt> behavior, since it does |
| 749 | not have to look at the file contents at all. |
| 750 | </p> |
| 751 | </dd> |
| 752 | <dt class="hdlist1"> |
| 753 | <tt>cumulative</tt> |
| 754 | </dt> |
| 755 | <dd> |
| 756 | <p> |
| 757 | Count changes in a child directory for the parent directory as well. |
| 758 | Note that when using <tt>cumulative</tt>, the sum of the percentages |
| 759 | reported may exceed 100%. The default (non-cumulative) behavior can |
| 760 | be specified with the <tt>noncumulative</tt> parameter. |
| 761 | </p> |
| 762 | </dd> |
| 763 | <dt class="hdlist1"> |
| 764 | <limit> |
| 765 | </dt> |
| 766 | <dd> |
| 767 | <p> |
| 768 | An integer parameter specifies a cut-off percent (3% by default). |
| 769 | Directories contributing less than this percentage of the changes |
| 770 | are not shown in the output. |
| 771 | </p> |
| 772 | </dd> |
| 773 | </dl></div> |
| 774 | <div class="paragraph"><p>Example: The following will count changed files, while ignoring |
| 775 | directories with less than 10% of the total amount of changed files, |
| 776 | and accumulating child directory counts in the parent directories: |
| 777 | <tt>--dirstat=files,10,cumulative</tt>.</p></div> |
| 778 | </dd> |
| 779 | <dt class="hdlist1"> |
Junio C Hamano | 6959c6c | 2006-05-17 10:34:11 | [diff] [blame] | 780 | --summary |
| 781 | </dt> |
| 782 | <dd> |
| 783 | <p> |
| 784 | Output a condensed summary of extended header information |
| 785 | such as creations, renames and mode changes. |
| 786 | </p> |
| 787 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 788 | <dt class="hdlist1"> |
Junio C Hamano | d1308c9 | 2006-04-16 11:01:09 | [diff] [blame] | 789 | --patch-with-stat |
| 790 | </dt> |
| 791 | <dd> |
| 792 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 793 | Synonym for <tt>-p --stat</tt>. |
Junio C Hamano | d1308c9 | 2006-04-16 11:01:09 | [diff] [blame] | 794 | </p> |
| 795 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 796 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 797 | -z |
| 798 | </dt> |
| 799 | <dd> |
| 800 | <p> |
Junio C Hamano | 0c053e8 | 2010-04-19 06:46:34 | [diff] [blame] | 801 | When <tt>--raw</tt>, <tt>--numstat</tt>, <tt>--name-only</tt> or <tt>--name-status</tt> has been |
| 802 | given, do not munge pathnames and use NULs as output field terminators. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 803 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 804 | <div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes, |
Junio C Hamano | 5706e0b | 2009-11-24 10:54:16 | [diff] [blame] | 805 | and backslash characters replaced with <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt>, and <tt>\\</tt>, |
| 806 | respectively, and the pathname will be enclosed in double quotes if |
| 807 | any of those replacements occurred.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 808 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 809 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 810 | --name-only |
| 811 | </dt> |
| 812 | <dd> |
| 813 | <p> |
| 814 | Show only names of changed files. |
| 815 | </p> |
| 816 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 817 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 818 | --name-status |
| 819 | </dt> |
| 820 | <dd> |
| 821 | <p> |
Junio C Hamano | a9aee78 | 2008-04-23 16:09:20 | [diff] [blame] | 822 | Show only names and status of changed files. See the description |
| 823 | of the <tt>--diff-filter</tt> option on what the status letters mean. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 824 | </p> |
| 825 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 826 | <dt class="hdlist1"> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 827 | --submodule[=<format>] |
| 828 | </dt> |
| 829 | <dd> |
| 830 | <p> |
| 831 | Chose the output format for submodule differences. <format> can be one of |
| 832 | <em>short</em> and <em>log</em>. <em>short</em> just shows pairs of commit names, this format |
| 833 | is used when this option is not given. <em>log</em> is the default value for this |
| 834 | option and lists the commits in that commit range like the <em>summary</em> |
| 835 | option of <a href="git-submodule.html">git-submodule(1)</a> does. |
| 836 | </p> |
| 837 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 838 | <dt class="hdlist1"> |
Junio C Hamano | 4aa0bcc | 2010-03-03 05:13:12 | [diff] [blame] | 839 | --color[=<when>] |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 840 | </dt> |
| 841 | <dd> |
| 842 | <p> |
| 843 | Show colored diff. |
Junio C Hamano | 5f2627d | 2011-05-06 20:23:48 | [diff] [blame] | 844 | The value must be <tt>always</tt> (the default for <tt><when></tt>), <tt>never</tt>, or <tt>auto</tt>. |
| 845 | The default value is <tt>never</tt>. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 846 | </p> |
| 847 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 848 | <dt class="hdlist1"> |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 849 | --no-color |
| 850 | </dt> |
| 851 | <dd> |
| 852 | <p> |
Junio C Hamano | 5f2627d | 2011-05-06 20:23:48 | [diff] [blame] | 853 | Turn off colored diff. |
| 854 | It is the same as <tt>--color=never</tt>. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 855 | </p> |
| 856 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 857 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 858 | --word-diff[=<mode>] |
Junio C Hamano | 85e45fa | 2006-08-13 07:47:41 | [diff] [blame] | 859 | </dt> |
| 860 | <dd> |
| 861 | <p> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 862 | Show a word diff, using the <mode> to delimit changed words. |
| 863 | By default, words are delimited by whitespace; see |
| 864 | <tt>--word-diff-regex</tt> below. The <mode> defaults to <em>plain</em>, and |
| 865 | must be one of: |
Junio C Hamano | 85e45fa | 2006-08-13 07:47:41 | [diff] [blame] | 866 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 867 | <div class="dlist"><dl> |
| 868 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 869 | color |
| 870 | </dt> |
| 871 | <dd> |
| 872 | <p> |
| 873 | Highlight changed words using only colors. Implies <tt>--color</tt>. |
| 874 | </p> |
| 875 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 876 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 877 | plain |
| 878 | </dt> |
| 879 | <dd> |
| 880 | <p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 881 | Show words as <tt>[-removed-]</tt> and <tt>{<tt>added</tt>}</tt>. Makes no |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 882 | attempts to escape the delimiters if they appear in the input, |
| 883 | so the output may be ambiguous. |
| 884 | </p> |
| 885 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 886 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 887 | porcelain |
| 888 | </dt> |
| 889 | <dd> |
| 890 | <p> |
| 891 | Use a special line-based format intended for script |
| 892 | consumption. Added/removed/unchanged runs are printed in the |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 893 | usual unified diff format, starting with a <tt>+</tt>/<tt>-</tt>/` ` |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 894 | character at the beginning of the line and extending to the |
| 895 | end of the line. Newlines in the input are represented by a |
| 896 | tilde <tt>~</tt> on a line of its own. |
| 897 | </p> |
| 898 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 899 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 900 | none |
| 901 | </dt> |
| 902 | <dd> |
| 903 | <p> |
| 904 | Disable word diff again. |
| 905 | </p> |
| 906 | </dd> |
| 907 | </dl></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 908 | <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] | 909 | highlight the changed parts in all modes if enabled.</p></div> |
| 910 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 911 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 912 | --word-diff-regex=<regex> |
| 913 | </dt> |
| 914 | <dd> |
| 915 | <p> |
| 916 | Use <regex> to decide what a word is, instead of considering |
| 917 | runs of non-whitespace to be a word. Also implies |
| 918 | <tt>--word-diff</tt> unless it was already enabled. |
| 919 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 920 | <div class="paragraph"><p>Every non-overlapping match of the |
Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 921 | <regex> is considered a word. Anything between these matches is |
| 922 | considered whitespace and ignored(!) for the purposes of finding |
| 923 | differences. You may want to append <tt>|[^[:space:]]</tt> to your regular |
| 924 | expression to make sure that it matches all non-whitespace characters. |
| 925 | A match that contains a newline is silently truncated(!) at the |
| 926 | newline.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 927 | <div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see |
Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 928 | <a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly |
| 929 | overrides any diff driver or configuration setting. Diff drivers |
| 930 | override configuration settings.</p></div> |
Junio C Hamano | 85e45fa | 2006-08-13 07:47:41 | [diff] [blame] | 931 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 932 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 933 | --color-words[=<regex>] |
| 934 | </dt> |
| 935 | <dd> |
| 936 | <p> |
| 937 | Equivalent to <tt>--word-diff=color</tt> plus (if a regex was |
| 938 | specified) <tt>--word-diff-regex=<regex></tt>. |
| 939 | </p> |
| 940 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 941 | <dt class="hdlist1"> |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 942 | --no-renames |
| 943 | </dt> |
| 944 | <dd> |
| 945 | <p> |
| 946 | Turn off rename detection, even when the configuration |
| 947 | file gives the default to do so. |
| 948 | </p> |
| 949 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 950 | <dt class="hdlist1"> |
Junio C Hamano | a890c4f | 2007-01-28 10:29:21 | [diff] [blame] | 951 | --check |
| 952 | </dt> |
| 953 | <dd> |
| 954 | <p> |
Junio C Hamano | 6005bfa | 2011-06-23 00:51:22 | [diff] [blame] | 955 | Warn if changes introduce whitespace errors. What are |
| 956 | considered whitespace errors is controlled by <tt>core.whitespace</tt> |
| 957 | configuration. By default, trailing whitespaces (including |
| 958 | lines that solely consist of whitespaces) and a space character |
| 959 | that is immediately followed by a tab character inside the |
| 960 | initial indent of the line are considered whitespace errors. |
| 961 | Exits with non-zero status if problems are found. Not compatible |
| 962 | with --exit-code. |
Junio C Hamano | a890c4f | 2007-01-28 10:29:21 | [diff] [blame] | 963 | </p> |
| 964 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 965 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 966 | --full-index |
| 967 | </dt> |
| 968 | <dd> |
| 969 | <p> |
Junio C Hamano | 5cf43ca | 2008-08-20 09:14:14 | [diff] [blame] | 970 | Instead of the first handful of characters, show the full |
| 971 | pre- and post-image blob object names on the "index" |
| 972 | line when generating patch format output. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 973 | </p> |
| 974 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 975 | <dt class="hdlist1"> |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 976 | --binary |
| 977 | </dt> |
| 978 | <dd> |
| 979 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 980 | In addition to <tt>--full-index</tt>, output a binary diff that |
| 981 | can be applied with <tt>git-apply</tt>. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 982 | </p> |
| 983 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 984 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 985 | --abbrev[=<n>] |
| 986 | </dt> |
| 987 | <dd> |
| 988 | <p> |
| 989 | Instead of showing the full 40-byte hexadecimal object |
| 990 | name in diff-raw format output and diff-tree header |
Junio C Hamano | 6efe302 | 2009-01-13 16:47:56 | [diff] [blame] | 991 | lines, show only a partial prefix. This is |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 992 | independent of the <tt>--full-index</tt> option above, which controls |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 993 | the diff-patch output format. Non default number of |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 994 | digits can be specified with <tt>--abbrev=<n></tt>. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 995 | </p> |
| 996 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 997 | <dt class="hdlist1"> |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 998 | -B[<n>][/<m>] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 999 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1000 | <dt class="hdlist1"> |
Junio C Hamano | 39c7a69 | 2010-10-27 06:08:54 | [diff] [blame] | 1001 | --break-rewrites[=[<n>][/<m>]] |
| 1002 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1003 | <dd> |
| 1004 | <p> |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1005 | Break complete rewrite changes into pairs of delete and |
| 1006 | create. This serves two purposes: |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1007 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1008 | <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] | 1009 | not as a series of deletion and insertion mixed together with a very |
| 1010 | few lines that happen to match textually as the context, but as a |
| 1011 | single deletion of everything old followed by a single insertion of |
| 1012 | everything new, and the number <tt>m</tt> controls this aspect of the -B |
| 1013 | option (defaults to 60%). <tt>-B/70%</tt> specifies that less than 30% of the |
| 1014 | original should remain in the result for git to consider it a total |
| 1015 | rewrite (i.e. otherwise the resulting patch will be a series of |
| 1016 | deletion and insertion mixed together with context lines).</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1017 | <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] | 1018 | source of a rename (usually -M only considers a file that disappeared |
| 1019 | as the source of a rename), and the number <tt>n</tt> controls this aspect of |
| 1020 | the -B option (defaults to 50%). <tt>-B20%</tt> specifies that a change with |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1021 | 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] | 1022 | eligible for being picked up as a possible source of a rename to |
| 1023 | another file.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1024 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1025 | <dt class="hdlist1"> |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1026 | -M[<n>] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1027 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1028 | <dt class="hdlist1"> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1029 | --find-renames[=<n>] |
Junio C Hamano | 39c7a69 | 2010-10-27 06:08:54 | [diff] [blame] | 1030 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1031 | <dd> |
| 1032 | <p> |
| 1033 | Detect renames. |
Junio C Hamano | 5f2627d | 2011-05-06 20:23:48 | [diff] [blame] | 1034 | If <tt>n</tt> is specified, it is a threshold on the similarity |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1035 | index (i.e. amount of addition/deletions compared to the |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1036 | file’s size). For example, <tt>-M90%</tt> means git should consider a |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1037 | delete/add pair to be a rename if more than 90% of the file |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1038 | hasn’t changed. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1039 | </p> |
| 1040 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1041 | <dt class="hdlist1"> |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1042 | -C[<n>] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1043 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1044 | <dt class="hdlist1"> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1045 | --find-copies[=<n>] |
Junio C Hamano | 39c7a69 | 2010-10-27 06:08:54 | [diff] [blame] | 1046 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1047 | <dd> |
| 1048 | <p> |
Junio C Hamano | 16f9887 | 2007-06-12 16:09:14 | [diff] [blame] | 1049 | Detect copies as well as renames. See also <tt>--find-copies-harder</tt>. |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1050 | If <tt>n</tt> is specified, it has the same meaning as for <tt>-M<n></tt>. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1051 | </p> |
| 1052 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1053 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1054 | --find-copies-harder |
| 1055 | </dt> |
| 1056 | <dd> |
| 1057 | <p> |
Junio C Hamano | 16f9887 | 2007-06-12 16:09:14 | [diff] [blame] | 1058 | For performance reasons, by default, <tt>-C</tt> option finds copies only |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1059 | if the original file of the copy was modified in the same |
| 1060 | changeset. This flag makes the command |
| 1061 | inspect unmodified files as candidates for the source of |
| 1062 | copy. This is a very expensive operation for large |
Junio C Hamano | 16f9887 | 2007-06-12 16:09:14 | [diff] [blame] | 1063 | projects, so use it with caution. Giving more than one |
| 1064 | <tt>-C</tt> option has the same effect. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1065 | </p> |
| 1066 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1067 | <dt class="hdlist1"> |
Junio C Hamano | b02377c | 2011-04-28 22:26:02 | [diff] [blame] | 1068 | -D |
| 1069 | </dt> |
| 1070 | <dt class="hdlist1"> |
| 1071 | --irreversible-delete |
| 1072 | </dt> |
| 1073 | <dd> |
| 1074 | <p> |
| 1075 | Omit the preimage for deletes, i.e. print only the header but not |
| 1076 | the diff between the preimage and <tt>/dev/null</tt>. The resulting patch |
| 1077 | is not meant to be applied with <tt>patch</tt> nor <tt>git apply</tt>; this is |
| 1078 | solely for people who want to just concentrate on reviewing the |
| 1079 | text after the change. In addition, the output obviously lack |
| 1080 | enough information to apply such a patch in reverse, even manually, |
| 1081 | hence the name of the option. |
| 1082 | </p> |
| 1083 | <div class="paragraph"><p>When used together with <tt>-B</tt>, omit also the preimage in the deletion part |
| 1084 | of a delete/create pair.</p></div> |
| 1085 | </dd> |
| 1086 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1087 | -l<num> |
| 1088 | </dt> |
| 1089 | <dd> |
| 1090 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1091 | The <tt>-M</tt> and <tt>-C</tt> options require O(n^2) processing time where n |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1092 | is the number of potential rename/copy targets. This |
| 1093 | option prevents rename/copy detection from running if |
| 1094 | the number of rename/copy targets exceeds the specified |
| 1095 | number. |
| 1096 | </p> |
| 1097 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1098 | <dt class="hdlist1"> |
Junio C Hamano | 982eb11 | 2010-11-18 00:53:09 | [diff] [blame] | 1099 | --diff-filter=[(A|C|D|M|R|T|U|X|B)…[*]] |
| 1100 | </dt> |
| 1101 | <dd> |
| 1102 | <p> |
| 1103 | Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>), |
| 1104 | Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their |
| 1105 | type (i.e. regular file, symlink, submodule, …) changed (<tt>T</tt>), |
| 1106 | are Unmerged (<tt>U</tt>), are |
| 1107 | Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>). |
| 1108 | Any combination of the filter characters (including none) can be used. |
| 1109 | When <tt>*</tt> (All-or-none) is added to the combination, all |
| 1110 | paths are selected if there is any file that matches |
| 1111 | other criteria in the comparison; if there is no file |
| 1112 | that matches other criteria, nothing is selected. |
| 1113 | </p> |
| 1114 | </dd> |
| 1115 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1116 | -S<string> |
| 1117 | </dt> |
| 1118 | <dd> |
| 1119 | <p> |
Junio C Hamano | 5217a27 | 2009-03-21 00:39:33 | [diff] [blame] | 1120 | Look for differences that introduce or remove an instance of |
| 1121 | <string>. Note that this is different than the string simply |
| 1122 | appearing in diff output; see the <em>pickaxe</em> entry in |
| 1123 | <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1124 | </p> |
| 1125 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1126 | <dt class="hdlist1"> |
Junio C Hamano | 3b4609d | 2010-09-30 00:04:34 | [diff] [blame] | 1127 | -G<regex> |
| 1128 | </dt> |
| 1129 | <dd> |
| 1130 | <p> |
| 1131 | Look for differences whose added or removed line matches |
| 1132 | the given <regex>. |
| 1133 | </p> |
| 1134 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1135 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1136 | --pickaxe-all |
| 1137 | </dt> |
| 1138 | <dd> |
| 1139 | <p> |
Junio C Hamano | 3b4609d | 2010-09-30 00:04:34 | [diff] [blame] | 1140 | When <tt>-S</tt> or <tt>-G</tt> finds a change, show all the changes in that |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1141 | changeset, not just the files that contain the change |
| 1142 | in <string>. |
| 1143 | </p> |
| 1144 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1145 | <dt class="hdlist1"> |
Junio C Hamano | bfe9e75 | 2006-04-05 21:43:28 | [diff] [blame] | 1146 | --pickaxe-regex |
| 1147 | </dt> |
| 1148 | <dd> |
| 1149 | <p> |
| 1150 | Make the <string> not a plain string but an extended POSIX |
| 1151 | regex to match. |
| 1152 | </p> |
| 1153 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1154 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1155 | -O<orderfile> |
| 1156 | </dt> |
| 1157 | <dd> |
| 1158 | <p> |
| 1159 | Output the patch in the order specified in the |
| 1160 | <orderfile>, which has one shell glob pattern per line. |
| 1161 | </p> |
| 1162 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1163 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1164 | -R |
| 1165 | </dt> |
| 1166 | <dd> |
| 1167 | <p> |
| 1168 | Swap two inputs; that is, show differences from index or |
| 1169 | on-disk file to tree contents. |
| 1170 | </p> |
| 1171 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1172 | <dt class="hdlist1"> |
Junio C Hamano | 24bc09a | 2008-02-28 00:27:44 | [diff] [blame] | 1173 | --relative[=<path>] |
| 1174 | </dt> |
| 1175 | <dd> |
| 1176 | <p> |
| 1177 | When run from a subdirectory of the project, it can be |
| 1178 | told to exclude changes outside the directory and show |
| 1179 | pathnames relative to it with this option. When you are |
| 1180 | not in a subdirectory (e.g. in a bare repository), you |
| 1181 | can name which subdirectory to make the output relative |
| 1182 | to by giving a <path> as an argument. |
| 1183 | </p> |
| 1184 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1185 | <dt class="hdlist1"> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 1186 | -a |
| 1187 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1188 | <dt class="hdlist1"> |
Junio C Hamano | c26f548 | 2006-07-09 09:38:14 | [diff] [blame] | 1189 | --text |
| 1190 | </dt> |
| 1191 | <dd> |
| 1192 | <p> |
| 1193 | Treat all files as text. |
| 1194 | </p> |
| 1195 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1196 | <dt class="hdlist1"> |
Junio C Hamano | fd46896 | 2007-02-14 23:45:04 | [diff] [blame] | 1197 | --ignore-space-at-eol |
| 1198 | </dt> |
| 1199 | <dd> |
| 1200 | <p> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 1201 | Ignore changes in whitespace at EOL. |
Junio C Hamano | fd46896 | 2007-02-14 23:45:04 | [diff] [blame] | 1202 | </p> |
| 1203 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1204 | <dt class="hdlist1"> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 1205 | -b |
| 1206 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1207 | <dt class="hdlist1"> |
Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 1208 | --ignore-space-change |
| 1209 | </dt> |
| 1210 | <dd> |
| 1211 | <p> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 1212 | Ignore changes in amount of whitespace. This ignores whitespace |
| 1213 | at line end, and considers all other sequences of one or |
| 1214 | more whitespace characters to be equivalent. |
Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 1215 | </p> |
| 1216 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1217 | <dt class="hdlist1"> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 1218 | -w |
Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 1219 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1220 | <dt class="hdlist1"> |
Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 1221 | --ignore-all-space |
| 1222 | </dt> |
| 1223 | <dd> |
| 1224 | <p> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 1225 | Ignore whitespace when comparing lines. This ignores |
| 1226 | differences even if one line has whitespace where the other |
Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 1227 | line has none. |
| 1228 | </p> |
| 1229 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1230 | <dt class="hdlist1"> |
Junio C Hamano | 1d40ee8 | 2009-01-07 10:14:16 | [diff] [blame] | 1231 | --inter-hunk-context=<lines> |
| 1232 | </dt> |
| 1233 | <dd> |
| 1234 | <p> |
| 1235 | Show the context between diff hunks, up to the specified number |
| 1236 | of lines, thereby fusing hunks that are close to each other. |
| 1237 | </p> |
| 1238 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1239 | <dt class="hdlist1"> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1240 | -W |
| 1241 | </dt> |
| 1242 | <dt class="hdlist1"> |
| 1243 | --function-context |
| 1244 | </dt> |
| 1245 | <dd> |
| 1246 | <p> |
| 1247 | Show whole surrounding functions of changes. |
| 1248 | </p> |
| 1249 | </dd> |
| 1250 | <dt class="hdlist1"> |
Junio C Hamano | 48fd2f6 | 2007-03-19 02:02:30 | [diff] [blame] | 1251 | --exit-code |
| 1252 | </dt> |
| 1253 | <dd> |
| 1254 | <p> |
| 1255 | Make the program exit with codes similar to diff(1). |
| 1256 | That is, it exits with 1 if there were differences and |
| 1257 | 0 means no differences. |
| 1258 | </p> |
| 1259 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1260 | <dt class="hdlist1"> |
Junio C Hamano | 35e5755 | 2007-03-25 07:54:35 | [diff] [blame] | 1261 | --quiet |
| 1262 | </dt> |
| 1263 | <dd> |
| 1264 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1265 | Disable all output of the program. Implies <tt>--exit-code</tt>. |
Junio C Hamano | 35e5755 | 2007-03-25 07:54:35 | [diff] [blame] | 1266 | </p> |
| 1267 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1268 | <dt class="hdlist1"> |
Junio C Hamano | bb0f404 | 2007-07-04 06:41:40 | [diff] [blame] | 1269 | --ext-diff |
| 1270 | </dt> |
| 1271 | <dd> |
| 1272 | <p> |
| 1273 | Allow an external diff helper to be executed. If you set an |
Junio C Hamano | 1b50ce9 | 2007-10-03 12:05:53 | [diff] [blame] | 1274 | external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need |
| 1275 | 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] | 1276 | </p> |
| 1277 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1278 | <dt class="hdlist1"> |
Junio C Hamano | bb0f404 | 2007-07-04 06:41:40 | [diff] [blame] | 1279 | --no-ext-diff |
| 1280 | </dt> |
| 1281 | <dd> |
| 1282 | <p> |
| 1283 | Disallow external diff drivers. |
| 1284 | </p> |
| 1285 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1286 | <dt class="hdlist1"> |
Junio C Hamano | c652aed | 2011-07-07 01:14:31 | [diff] [blame] | 1287 | --textconv |
| 1288 | </dt> |
| 1289 | <dt class="hdlist1"> |
| 1290 | --no-textconv |
| 1291 | </dt> |
| 1292 | <dd> |
| 1293 | <p> |
| 1294 | Allow (or disallow) external text conversion filters to be run |
| 1295 | when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for |
| 1296 | details. Because textconv filters are typically a one-way |
| 1297 | conversion, the resulting diff is suitable for human |
| 1298 | consumption, but cannot be applied. For this reason, textconv |
| 1299 | filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and |
| 1300 | <a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or |
| 1301 | diff plumbing commands. |
| 1302 | </p> |
| 1303 | </dd> |
| 1304 | <dt class="hdlist1"> |
Junio C Hamano | 7d44952 | 2010-07-01 00:08:51 | [diff] [blame] | 1305 | --ignore-submodules[=<when>] |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 1306 | </dt> |
| 1307 | <dd> |
| 1308 | <p> |
Junio C Hamano | 7d44952 | 2010-07-01 00:08:51 | [diff] [blame] | 1309 | Ignore changes to submodules in the diff generation. <when> can be |
Junio C Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 1310 | either "none", "untracked", "dirty" or "all", which is the default |
| 1311 | Using "none" will consider the submodule modified when it either contains |
| 1312 | untracked or modified files or its HEAD differs from the commit recorded |
| 1313 | in the superproject and can be used to override any settings of the |
| 1314 | <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] | 1315 | "untracked" is used submodules are not considered dirty when they only |
| 1316 | contain untracked content (but they are still scanned for modified |
| 1317 | content). Using "dirty" ignores all changes to the work tree of submodules, |
| 1318 | only changes to the commits stored in the superproject are shown (this was |
| 1319 | 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] | 1320 | </p> |
| 1321 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1322 | <dt class="hdlist1"> |
Junio C Hamano | e27cbd2 | 2007-12-21 17:57:33 | [diff] [blame] | 1323 | --src-prefix=<prefix> |
| 1324 | </dt> |
| 1325 | <dd> |
| 1326 | <p> |
| 1327 | Show the given source prefix instead of "a/". |
| 1328 | </p> |
| 1329 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1330 | <dt class="hdlist1"> |
Junio C Hamano | e27cbd2 | 2007-12-21 17:57:33 | [diff] [blame] | 1331 | --dst-prefix=<prefix> |
| 1332 | </dt> |
| 1333 | <dd> |
| 1334 | <p> |
| 1335 | Show the given destination prefix instead of "b/". |
| 1336 | </p> |
| 1337 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1338 | <dt class="hdlist1"> |
Junio C Hamano | e27cbd2 | 2007-12-21 17:57:33 | [diff] [blame] | 1339 | --no-prefix |
| 1340 | </dt> |
| 1341 | <dd> |
| 1342 | <p> |
| 1343 | Do not show any source or destination prefix. |
| 1344 | </p> |
| 1345 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1346 | </dl></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1347 | <div class="paragraph"><p>For more detailed explanation on these common options, see also |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1348 | <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1349 | <div class="dlist"><dl> |
| 1350 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1351 | <tree-ish> |
| 1352 | </dt> |
| 1353 | <dd> |
| 1354 | <p> |
| 1355 | The id of a tree object. |
| 1356 | </p> |
| 1357 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1358 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1359 | <path>… |
| 1360 | </dt> |
| 1361 | <dd> |
| 1362 | <p> |
| 1363 | If provided, the results are limited to a subset of files |
| 1364 | matching one of these prefix strings. |
Junio C Hamano | 341071d | 2006-06-04 07:24:48 | [diff] [blame] | 1365 | i.e., file matches <tt>/^<pattern1>|<pattern2>|…/</tt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1366 | Note that this parameter does not provide any wildcard or regexp |
| 1367 | features. |
| 1368 | </p> |
| 1369 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1370 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1371 | -r |
| 1372 | </dt> |
| 1373 | <dd> |
| 1374 | <p> |
| 1375 | recurse into sub-trees |
| 1376 | </p> |
| 1377 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1378 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1379 | -t |
| 1380 | </dt> |
| 1381 | <dd> |
| 1382 | <p> |
| 1383 | show tree entry itself as well as subtrees. Implies -r. |
| 1384 | </p> |
| 1385 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1386 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1387 | --root |
| 1388 | </dt> |
| 1389 | <dd> |
| 1390 | <p> |
Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 1391 | When <em>--root</em> is specified the initial commit will be shown as a big |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1392 | creation event. This is equivalent to a diff against the NULL tree. |
| 1393 | </p> |
| 1394 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1395 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1396 | --stdin |
| 1397 | </dt> |
| 1398 | <dd> |
| 1399 | <p> |
| 1400 | When <em>--stdin</em> is specified, the command does not take |
| 1401 | <tree-ish> arguments from the command line. Instead, it |
Junio C Hamano | 3f2f6e5 | 2008-08-21 10:34:22 | [diff] [blame] | 1402 | reads lines containing either two <tree>, one <commit>, or a |
| 1403 | list of <commit> from its standard input. (Use a single space |
| 1404 | as separator.) |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1405 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1406 | <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] | 1407 | When a single commit is given, it compares the commit with its |
| 1408 | parents. The remaining commits, when given, are used as if they are |
Junio C Hamano | b53db3c | 2008-08-07 00:17:52 | [diff] [blame] | 1409 | parents of the first commit.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1410 | <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] | 1411 | and terminated by a newline) is printed before the difference. When |
| 1412 | comparing commits, the ID of the first (or only) commit, followed by a |
| 1413 | newline, is printed.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1414 | <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] | 1415 | commits (but not trees).</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1416 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1417 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1418 | -m |
| 1419 | </dt> |
| 1420 | <dd> |
| 1421 | <p> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1422 | By default, <em>git diff-tree --stdin</em> does not show |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1423 | differences for merge commits. With this flag, it shows |
Junio C Hamano | a8adb1e | 2006-04-10 23:46:16 | [diff] [blame] | 1424 | differences to that commit from all of its parents. See |
| 1425 | also <em>-c</em>. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1426 | </p> |
| 1427 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1428 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1429 | -s |
| 1430 | </dt> |
| 1431 | <dd> |
| 1432 | <p> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1433 | By default, <em>git diff-tree --stdin</em> shows differences, |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1434 | either in machine-readable form (without <em>-p</em>) or in patch |
Junio C Hamano | 235a91e | 2006-01-07 01:13:58 | [diff] [blame] | 1435 | form (with <em>-p</em>). This output can be suppressed. It is |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1436 | only useful with <em>-v</em> flag. |
| 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 | -v |
| 1441 | </dt> |
| 1442 | <dd> |
| 1443 | <p> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1444 | This flag causes <em>git diff-tree --stdin</em> to also show |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1445 | the commit message before the differences. |
| 1446 | </p> |
| 1447 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1448 | <dt class="hdlist1"> |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1449 | --pretty[=<format>] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1450 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1451 | <dt class="hdlist1"> |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1452 | --format=<format> |
Junio C Hamano | 0a23522 | 2009-03-06 08:21:09 | [diff] [blame] | 1453 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1454 | <dd> |
| 1455 | <p> |
Junio C Hamano | a3770f9 | 2007-07-25 08:53:33 | [diff] [blame] | 1456 | Pretty-print the contents of the commit logs in a given format, |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1457 | where <em><format></em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>, |
Junio C Hamano | e32ec8b | 2010-06-02 23:32:31 | [diff] [blame] | 1458 | <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em> and <em>format:<string></em>. See |
| 1459 | the "PRETTY FORMATS" section for some additional details for each |
| 1460 | format. When omitted, the format defaults to <em>medium</em>. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1461 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1462 | <div class="paragraph"><p>Note: you can specify the default pretty format in the repository |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1463 | 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] | 1464 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1465 | <dt class="hdlist1"> |
Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 1466 | --abbrev-commit |
| 1467 | </dt> |
| 1468 | <dd> |
| 1469 | <p> |
| 1470 | Instead of showing the full 40-byte hexadecimal commit object |
Junio C Hamano | 6efe302 | 2009-01-13 16:47:56 | [diff] [blame] | 1471 | name, show only a partial prefix. Non default number of |
Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 1472 | digits can be specified with "--abbrev=<n>" (which also modifies |
| 1473 | diff output, if it is displayed). |
| 1474 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1475 | <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] | 1476 | people using 80-column terminals.</p></div> |
Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 1477 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1478 | <dt class="hdlist1"> |
Junio C Hamano | f93530e | 2011-05-25 23:59:59 | [diff] [blame] | 1479 | --no-abbrev-commit |
| 1480 | </dt> |
| 1481 | <dd> |
| 1482 | <p> |
| 1483 | Show the full 40-byte hexadecimal commit object name. This negates |
| 1484 | <tt>--abbrev-commit</tt> and those options which imply it such as |
| 1485 | "--oneline". It also overrides the <em>log.abbrevCommit</em> variable. |
| 1486 | </p> |
| 1487 | </dd> |
| 1488 | <dt class="hdlist1"> |
Junio C Hamano | 0a23522 | 2009-03-06 08:21:09 | [diff] [blame] | 1489 | --oneline |
| 1490 | </dt> |
| 1491 | <dd> |
| 1492 | <p> |
| 1493 | This is a shorthand for "--pretty=oneline --abbrev-commit" |
| 1494 | used together. |
| 1495 | </p> |
| 1496 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1497 | <dt class="hdlist1"> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1498 | --encoding[=<encoding>] |
| 1499 | </dt> |
| 1500 | <dd> |
| 1501 | <p> |
| 1502 | The commit objects record the encoding used for the log message |
| 1503 | in their encoding header; this option can be used to tell the |
| 1504 | command to re-code the commit log message in the encoding |
| 1505 | preferred by the user. For non plumbing commands this |
| 1506 | defaults to UTF-8. |
| 1507 | </p> |
| 1508 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1509 | <dt class="hdlist1"> |
Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 1510 | --notes[=<ref>] |
Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1511 | </dt> |
| 1512 | <dd> |
| 1513 | <p> |
| 1514 | Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the |
| 1515 | commit, when showing the commit log message. This is the default |
| 1516 | for <tt>git log</tt>, <tt>git show</tt> and <tt>git whatchanged</tt> commands when |
Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 1517 | there is no <tt>--pretty</tt>, <tt>--format</tt> nor <tt>--oneline</tt> option given |
| 1518 | on the command line. |
Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1519 | </p> |
Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 1520 | <div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the |
| 1521 | <em>core.notesRef</em> and <em>notes.displayRef</em> variables (or corresponding |
| 1522 | environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div> |
| 1523 | <div class="paragraph"><p>With an optional <em><ref></em> argument, show this notes ref instead of the |
| 1524 | default notes ref(s). The ref is taken to be in <tt>refs/notes/</tt> if it |
| 1525 | is not qualified.</p></div> |
| 1526 | <div class="paragraph"><p>Multiple --notes options can be combined to control which notes are |
| 1527 | being displayed. Examples: "--notes=foo" will show only notes from |
| 1528 | "refs/notes/foo"; "--notes=foo --notes" will show both notes from |
| 1529 | "refs/notes/foo" and from the default notes ref(s).</p></div> |
Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 1530 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1531 | <dt class="hdlist1"> |
Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 1532 | --no-notes |
| 1533 | </dt> |
| 1534 | <dd> |
| 1535 | <p> |
| 1536 | Do not show notes. This negates the above <tt>--notes</tt> option, by |
| 1537 | resetting the list of notes refs from which notes are shown. |
| 1538 | Options are parsed in the order given on the command line, so e.g. |
| 1539 | "--notes --notes=foo --no-notes --notes=bar" will only show notes |
| 1540 | from "refs/notes/bar". |
| 1541 | </p> |
| 1542 | </dd> |
| 1543 | <dt class="hdlist1"> |
| 1544 | --show-notes[=<ref>] |
| 1545 | </dt> |
| 1546 | <dt class="hdlist1"> |
Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 1547 | --[no-]standard-notes |
| 1548 | </dt> |
| 1549 | <dd> |
| 1550 | <p> |
Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 1551 | These options are deprecated. Use the above --notes/--no-notes |
| 1552 | options instead. |
Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 1553 | </p> |
Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1554 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1555 | <dt class="hdlist1"> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1556 | --no-commit-id |
| 1557 | </dt> |
| 1558 | <dd> |
| 1559 | <p> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1560 | <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] | 1561 | applicable. This flag suppressed the commit ID output. |
| 1562 | </p> |
| 1563 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1564 | <dt class="hdlist1"> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1565 | -c |
| 1566 | </dt> |
| 1567 | <dd> |
| 1568 | <p> |
| 1569 | This flag changes the way a merge commit is displayed |
| 1570 | (which means it is useful only when the command is given |
| 1571 | one <tree-ish>, or <em>--stdin</em>). It shows the differences |
| 1572 | from each of the parents to the merge result simultaneously |
| 1573 | instead of showing pairwise diff between a parent and the |
| 1574 | result one at a time (which is what the <em>-m</em> option does). |
| 1575 | Furthermore, it lists only files which were modified |
| 1576 | from all parents. |
| 1577 | </p> |
| 1578 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1579 | <dt class="hdlist1"> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1580 | --cc |
| 1581 | </dt> |
| 1582 | <dd> |
| 1583 | <p> |
| 1584 | This flag changes the way a merge commit patch is displayed, |
| 1585 | in a similar way to the <em>-c</em> option. It implies the <em>-c</em> |
| 1586 | and <em>-p</em> options and further compresses the patch output |
Junio C Hamano | ccc2f76 | 2008-07-24 04:03:33 | [diff] [blame] | 1587 | by omitting uninteresting hunks whose the contents in the parents |
| 1588 | have only two variants and the merge result picks one of them |
| 1589 | without modification. When all hunks are uninteresting, the commit |
| 1590 | itself and the commit log message is not shown, just like in any other |
| 1591 | "empty diff" case. |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1592 | </p> |
| 1593 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1594 | <dt class="hdlist1"> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1595 | --always |
| 1596 | </dt> |
| 1597 | <dd> |
| 1598 | <p> |
| 1599 | Show the commit itself and the commit log message even |
| 1600 | if the diff itself is empty. |
| 1601 | </p> |
| 1602 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1603 | </dl></div> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1604 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1605 | <h2 id="_pretty_formats">PRETTY FORMATS</h2> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1606 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1607 | <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] | 1608 | is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is |
| 1609 | inserted before the <em>Author:</em> line. This line begins with |
| 1610 | "Merge: " and the sha1s of ancestral commits are printed, |
| 1611 | separated by spaces. Note that the listed commits may not |
| 1612 | necessarily be the list of the <strong>direct</strong> parent commits if you |
| 1613 | have limited your view of history: for example, if you are |
| 1614 | only interested in changes related to a certain directory or |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1615 | file.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1616 | <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] | 1617 | additional formats by setting a pretty.<name> |
| 1618 | config option to either another format name, or a |
| 1619 | <em>format:</em> string, as described below (see |
| 1620 | <a href="git-config.html">git-config(1)</a>). Here are the details of the |
| 1621 | built-in formats:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1622 | <div class="ulist"><ul> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1623 | <li> |
| 1624 | <p> |
| 1625 | <em>oneline</em> |
| 1626 | </p> |
| 1627 | <div class="literalblock"> |
| 1628 | <div class="content"> |
| 1629 | <pre><tt><sha1> <title line></tt></pre> |
| 1630 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1631 | <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] | 1632 | </li> |
| 1633 | <li> |
| 1634 | <p> |
| 1635 | <em>short</em> |
| 1636 | </p> |
| 1637 | <div class="literalblock"> |
| 1638 | <div class="content"> |
| 1639 | <pre><tt>commit <sha1> |
| 1640 | Author: <author></tt></pre> |
| 1641 | </div></div> |
| 1642 | <div class="literalblock"> |
| 1643 | <div class="content"> |
| 1644 | <pre><tt><title line></tt></pre> |
| 1645 | </div></div> |
| 1646 | </li> |
| 1647 | <li> |
| 1648 | <p> |
| 1649 | <em>medium</em> |
| 1650 | </p> |
| 1651 | <div class="literalblock"> |
| 1652 | <div class="content"> |
| 1653 | <pre><tt>commit <sha1> |
| 1654 | Author: <author> |
Junio C Hamano | 6a3c827 | 2008-12-19 21:38:18 | [diff] [blame] | 1655 | Date: <author date></tt></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1656 | </div></div> |
| 1657 | <div class="literalblock"> |
| 1658 | <div class="content"> |
| 1659 | <pre><tt><title line></tt></pre> |
| 1660 | </div></div> |
| 1661 | <div class="literalblock"> |
| 1662 | <div class="content"> |
| 1663 | <pre><tt><full commit message></tt></pre> |
| 1664 | </div></div> |
| 1665 | </li> |
| 1666 | <li> |
| 1667 | <p> |
| 1668 | <em>full</em> |
| 1669 | </p> |
| 1670 | <div class="literalblock"> |
| 1671 | <div class="content"> |
| 1672 | <pre><tt>commit <sha1> |
| 1673 | Author: <author> |
| 1674 | Commit: <committer></tt></pre> |
| 1675 | </div></div> |
| 1676 | <div class="literalblock"> |
| 1677 | <div class="content"> |
| 1678 | <pre><tt><title line></tt></pre> |
| 1679 | </div></div> |
| 1680 | <div class="literalblock"> |
| 1681 | <div class="content"> |
| 1682 | <pre><tt><full commit message></tt></pre> |
| 1683 | </div></div> |
| 1684 | </li> |
| 1685 | <li> |
| 1686 | <p> |
| 1687 | <em>fuller</em> |
| 1688 | </p> |
| 1689 | <div class="literalblock"> |
| 1690 | <div class="content"> |
| 1691 | <pre><tt>commit <sha1> |
Junio C Hamano | 6a3c827 | 2008-12-19 21:38:18 | [diff] [blame] | 1692 | Author: <author> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1693 | AuthorDate: <author date> |
Junio C Hamano | 6a3c827 | 2008-12-19 21:38:18 | [diff] [blame] | 1694 | Commit: <committer> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1695 | CommitDate: <committer date></tt></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1696 | </div></div> |
| 1697 | <div class="literalblock"> |
| 1698 | <div class="content"> |
| 1699 | <pre><tt><title line></tt></pre> |
| 1700 | </div></div> |
| 1701 | <div class="literalblock"> |
| 1702 | <div class="content"> |
| 1703 | <pre><tt><full commit message></tt></pre> |
| 1704 | </div></div> |
| 1705 | </li> |
| 1706 | <li> |
| 1707 | <p> |
| 1708 | <em>email</em> |
| 1709 | </p> |
| 1710 | <div class="literalblock"> |
| 1711 | <div class="content"> |
| 1712 | <pre><tt>From <sha1> <date> |
| 1713 | From: <author> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1714 | Date: <author date> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1715 | Subject: [PATCH] <title line></tt></pre> |
| 1716 | </div></div> |
| 1717 | <div class="literalblock"> |
| 1718 | <div class="content"> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1719 | <pre><tt><full commit message></tt></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1720 | </div></div> |
| 1721 | </li> |
| 1722 | <li> |
| 1723 | <p> |
| 1724 | <em>raw</em> |
| 1725 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1726 | <div class="paragraph"><p>The <em>raw</em> format shows the entire commit exactly as |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1727 | stored in the commit object. Notably, the SHA1s are |
| 1728 | displayed in full, regardless of whether --abbrev or |
| 1729 | --no-abbrev are used, and <em>parents</em> information show the |
| 1730 | true parent commits, without taking grafts nor history |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1731 | simplification into account.</p></div> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 1732 | </li> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1733 | <li> |
| 1734 | <p> |
Junio C Hamano | e32ec8b | 2010-06-02 23:32:31 | [diff] [blame] | 1735 | <em>format:<string></em> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1736 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1737 | <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] | 1738 | you want to show. It works a little bit like printf format, |
| 1739 | 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] | 1740 | instead of <em>\n</em>.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1741 | <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] | 1742 | would show something like this:</p></div> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1743 | <div class="listingblock"> |
| 1744 | <div class="content"> |
| 1745 | <pre><tt>The author of fe6e0ee was Junio C Hamano, 23 hours ago |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1746 | The title was >>t4119: test autocomputing -p<n> for traditional diff input.<<</tt></pre> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1747 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1748 | <div class="paragraph"><p>The placeholders are:</p></div> |
| 1749 | <div class="ulist"><ul> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1750 | <li> |
| 1751 | <p> |
| 1752 | <em>%H</em>: commit hash |
| 1753 | </p> |
| 1754 | </li> |
| 1755 | <li> |
| 1756 | <p> |
| 1757 | <em>%h</em>: abbreviated commit hash |
| 1758 | </p> |
| 1759 | </li> |
| 1760 | <li> |
| 1761 | <p> |
| 1762 | <em>%T</em>: tree hash |
| 1763 | </p> |
| 1764 | </li> |
| 1765 | <li> |
| 1766 | <p> |
| 1767 | <em>%t</em>: abbreviated tree hash |
| 1768 | </p> |
| 1769 | </li> |
| 1770 | <li> |
| 1771 | <p> |
| 1772 | <em>%P</em>: parent hashes |
| 1773 | </p> |
| 1774 | </li> |
| 1775 | <li> |
| 1776 | <p> |
| 1777 | <em>%p</em>: abbreviated parent hashes |
| 1778 | </p> |
| 1779 | </li> |
| 1780 | <li> |
| 1781 | <p> |
| 1782 | <em>%an</em>: author name |
| 1783 | </p> |
| 1784 | </li> |
| 1785 | <li> |
| 1786 | <p> |
Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 1787 | <em>%aN</em>: author name (respecting .mailmap, see <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] | 1788 | </p> |
| 1789 | </li> |
| 1790 | <li> |
| 1791 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1792 | <em>%ae</em>: author email |
| 1793 | </p> |
| 1794 | </li> |
| 1795 | <li> |
| 1796 | <p> |
Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 1797 | <em>%aE</em>: author email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| 1798 | </p> |
| 1799 | </li> |
| 1800 | <li> |
| 1801 | <p> |
Junio C Hamano | a387df3 | 2008-08-29 08:56:58 | [diff] [blame] | 1802 | <em>%ad</em>: author date (format respects --date= option) |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1803 | </p> |
| 1804 | </li> |
| 1805 | <li> |
| 1806 | <p> |
| 1807 | <em>%aD</em>: author date, RFC2822 style |
| 1808 | </p> |
| 1809 | </li> |
| 1810 | <li> |
| 1811 | <p> |
| 1812 | <em>%ar</em>: author date, relative |
| 1813 | </p> |
| 1814 | </li> |
| 1815 | <li> |
| 1816 | <p> |
| 1817 | <em>%at</em>: author date, UNIX timestamp |
| 1818 | </p> |
| 1819 | </li> |
| 1820 | <li> |
| 1821 | <p> |
Junio C Hamano | 02f130b | 2007-07-14 08:26:56 | [diff] [blame] | 1822 | <em>%ai</em>: author date, ISO 8601 format |
| 1823 | </p> |
| 1824 | </li> |
| 1825 | <li> |
| 1826 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1827 | <em>%cn</em>: committer name |
| 1828 | </p> |
| 1829 | </li> |
| 1830 | <li> |
| 1831 | <p> |
Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 1832 | <em>%cN</em>: committer name (respecting .mailmap, see <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] | 1833 | </p> |
| 1834 | </li> |
| 1835 | <li> |
| 1836 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1837 | <em>%ce</em>: committer email |
| 1838 | </p> |
| 1839 | </li> |
| 1840 | <li> |
| 1841 | <p> |
Junio C Hamano | 8bc410e | 2009-02-15 10:38:19 | [diff] [blame] | 1842 | <em>%cE</em>: committer email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>) |
| 1843 | </p> |
| 1844 | </li> |
| 1845 | <li> |
| 1846 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1847 | <em>%cd</em>: committer date |
| 1848 | </p> |
| 1849 | </li> |
| 1850 | <li> |
| 1851 | <p> |
| 1852 | <em>%cD</em>: committer date, RFC2822 style |
| 1853 | </p> |
| 1854 | </li> |
| 1855 | <li> |
| 1856 | <p> |
| 1857 | <em>%cr</em>: committer date, relative |
| 1858 | </p> |
| 1859 | </li> |
| 1860 | <li> |
| 1861 | <p> |
| 1862 | <em>%ct</em>: committer date, UNIX timestamp |
| 1863 | </p> |
| 1864 | </li> |
| 1865 | <li> |
| 1866 | <p> |
Junio C Hamano | 02f130b | 2007-07-14 08:26:56 | [diff] [blame] | 1867 | <em>%ci</em>: committer date, ISO 8601 format |
| 1868 | </p> |
| 1869 | </li> |
| 1870 | <li> |
| 1871 | <p> |
Junio C Hamano | 5e4d8de | 2008-09-19 06:27:02 | [diff] [blame] | 1872 | <em>%d</em>: ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a> |
| 1873 | </p> |
| 1874 | </li> |
| 1875 | <li> |
| 1876 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1877 | <em>%e</em>: encoding |
| 1878 | </p> |
| 1879 | </li> |
| 1880 | <li> |
| 1881 | <p> |
| 1882 | <em>%s</em>: subject |
| 1883 | </p> |
| 1884 | </li> |
| 1885 | <li> |
| 1886 | <p> |
Junio C Hamano | 5f9a6f0 | 2009-04-06 08:26:56 | [diff] [blame] | 1887 | <em>%f</em>: sanitized subject line, suitable for a filename |
| 1888 | </p> |
| 1889 | </li> |
| 1890 | <li> |
| 1891 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1892 | <em>%b</em>: body |
| 1893 | </p> |
| 1894 | </li> |
| 1895 | <li> |
| 1896 | <p> |
Junio C Hamano | cb39aea | 2010-05-09 07:24:48 | [diff] [blame] | 1897 | <em>%B</em>: raw body (unwrapped subject and body) |
| 1898 | </p> |
| 1899 | </li> |
| 1900 | <li> |
| 1901 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1902 | <em>%N</em>: commit notes |
| 1903 | </p> |
| 1904 | </li> |
| 1905 | <li> |
| 1906 | <p> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 1907 | <em>%gD</em>: reflog selector, e.g., <tt>refs/stash@{1}</tt> |
| 1908 | </p> |
| 1909 | </li> |
| 1910 | <li> |
| 1911 | <p> |
| 1912 | <em>%gd</em>: shortened reflog selector, e.g., <tt>stash@{1}</tt> |
| 1913 | </p> |
| 1914 | </li> |
| 1915 | <li> |
| 1916 | <p> |
| 1917 | <em>%gs</em>: reflog subject |
| 1918 | </p> |
| 1919 | </li> |
| 1920 | <li> |
| 1921 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1922 | <em>%Cred</em>: switch color to red |
| 1923 | </p> |
| 1924 | </li> |
| 1925 | <li> |
| 1926 | <p> |
| 1927 | <em>%Cgreen</em>: switch color to green |
| 1928 | </p> |
| 1929 | </li> |
| 1930 | <li> |
| 1931 | <p> |
| 1932 | <em>%Cblue</em>: switch color to blue |
| 1933 | </p> |
| 1934 | </li> |
| 1935 | <li> |
| 1936 | <p> |
| 1937 | <em>%Creset</em>: reset color |
| 1938 | </p> |
| 1939 | </li> |
| 1940 | <li> |
| 1941 | <p> |
Junio C Hamano | cc0cb31 | 2009-01-22 03:38:50 | [diff] [blame] | 1942 | <em>%C(…)</em>: color specification, as described in color.branch.* config option |
| 1943 | </p> |
| 1944 | </li> |
| 1945 | <li> |
| 1946 | <p> |
Junio C Hamano | d9e0e5d | 2007-04-14 16:22:04 | [diff] [blame] | 1947 | <em>%m</em>: left, right or boundary mark |
| 1948 | </p> |
| 1949 | </li> |
| 1950 | <li> |
| 1951 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1952 | <em>%n</em>: newline |
| 1953 | </p> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 1954 | </li> |
Junio C Hamano | b78d259 | 2008-04-09 09:39:08 | [diff] [blame] | 1955 | <li> |
| 1956 | <p> |
Junio C Hamano | a9701f0 | 2010-01-21 00:42:16 | [diff] [blame] | 1957 | <em>%%</em>: a raw <em>%</em> |
| 1958 | </p> |
| 1959 | </li> |
| 1960 | <li> |
| 1961 | <p> |
Junio C Hamano | b78d259 | 2008-04-09 09:39:08 | [diff] [blame] | 1962 | <em>%x00</em>: print a byte from a hex code |
| 1963 | </p> |
| 1964 | </li> |
Junio C Hamano | bf984de | 2009-11-23 06:11:19 | [diff] [blame] | 1965 | <li> |
| 1966 | <p> |
| 1967 | <em>%w([<w>[,<i1>[,<i2>]]])</em>: switch line wrapping, like the -w option of |
Junio C Hamano | 5706e0b | 2009-11-24 10:54:16 | [diff] [blame] | 1968 | <a href="git-shortlog.html">git-shortlog(1)</a>. |
Junio C Hamano | bf984de | 2009-11-23 06:11:19 | [diff] [blame] | 1969 | </p> |
| 1970 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1971 | </ul></div> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 1972 | </li> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 1973 | </ul></div> |
| 1974 | <div class="admonitionblock"> |
| 1975 | <table><tr> |
| 1976 | <td class="icon"> |
| 1977 | <div class="title">Note</div> |
| 1978 | </td> |
| 1979 | <td class="content">Some placeholders may depend on other options given to the |
| 1980 | revision traversal engine. For example, the <tt>%g*</tt> reflog options will |
| 1981 | insert an empty string unless we are traversing reflog entries (e.g., by |
| 1982 | <tt>git log -g</tt>). The <tt>%d</tt> placeholder will use the "short" decoration |
| 1983 | format if <tt>--decorate</tt> was not already provided on the command line.</td> |
| 1984 | </tr></table> |
| 1985 | </div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1986 | <div class="paragraph"><p>If you add a <tt>+</tt> (plus sign) after <em>%</em> of a placeholder, a line-feed |
Junio C Hamano | 2bd8a74 | 2009-12-01 21:16:59 | [diff] [blame] | 1987 | is inserted immediately before the expansion if and only if the |
| 1988 | placeholder expands to a non-empty string.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1989 | <div class="paragraph"><p>If you add a <tt>-</tt> (minus sign) after <em>%</em> of a placeholder, line-feeds that |
Junio C Hamano | 2bd8a74 | 2009-12-01 21:16:59 | [diff] [blame] | 1990 | immediately precede the expansion are deleted if and only if the |
| 1991 | placeholder expands to an empty string.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1992 | <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] | 1993 | is inserted immediately before the expansion if and only if the |
| 1994 | placeholder expands to a non-empty string.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1995 | <div class="ulist"><ul> |
Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 1996 | <li> |
| 1997 | <p> |
| 1998 | <em>tformat:</em> |
| 1999 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2000 | <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] | 2001 | provides "terminator" semantics instead of "separator" semantics. In |
| 2002 | other words, each commit has the message terminator character (usually a |
| 2003 | newline) appended, rather than a separator placed between entries. |
| 2004 | This means that the final entry of a single-line format will be properly |
| 2005 | terminated with a new line, just as the "oneline" format does. |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2006 | For example:</p></div> |
Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 2007 | <div class="listingblock"> |
| 2008 | <div class="content"> |
| 2009 | <pre><tt>$ git log -2 --pretty=format:%h 4da45bef \ |
| 2010 | | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/' |
| 2011 | 4da45be |
| 2012 | 7134973 -- NO NEWLINE |
| 2013 | |
| 2014 | $ git log -2 --pretty=tformat:%h 4da45bef \ |
| 2015 | | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/' |
| 2016 | 4da45be |
| 2017 | 7134973</tt></pre> |
| 2018 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2019 | <div class="paragraph"><p>In addition, any unrecognized string that has a <tt>%</tt> in it is interpreted |
Junio C Hamano | 0a23522 | 2009-03-06 08:21:09 | [diff] [blame] | 2020 | as if it has <tt>tformat:</tt> in front of it. For example, these two are |
| 2021 | equivalent:</p></div> |
| 2022 | <div class="listingblock"> |
| 2023 | <div class="content"> |
| 2024 | <pre><tt>$ git log -2 --pretty=tformat:%h 4da45bef |
| 2025 | $ git log -2 --pretty=%h 4da45bef</tt></pre> |
| 2026 | </div></div> |
Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 2027 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2028 | </ul></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2029 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2030 | <h2 id="_limiting_output">Limiting Output</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2031 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2032 | <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] | 2033 | example some architecture-specific files, you might do:</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2034 | <div class="literalblock"> |
| 2035 | <div class="content"> |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 2036 | <pre><tt>git diff-tree -r <tree-ish> <tree-ish> arch/ia64 include/asm-ia64</tt></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2037 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2038 | <div class="paragraph"><p>and it will only show you what changed in those two directories.</p></div> |
| 2039 | <div class="paragraph"><p>Or if you are searching for what changed in just <tt>kernel/sched.c</tt>, just do</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2040 | <div class="literalblock"> |
| 2041 | <div class="content"> |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 2042 | <pre><tt>git diff-tree -r <tree-ish> <tree-ish> kernel/sched.c</tt></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2043 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2044 | <div class="paragraph"><p>and it will ignore all differences to other files.</p></div> |
| 2045 | <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] | 2046 | wildcards. Even stricter, it has to match a complete path component. |
| 2047 | I.e. "foo" does not pick up <tt>foobar.h</tt>. "foo" does match <tt>foo/bar.h</tt> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2048 | so it can be used to name subdirectories.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2049 | <div class="paragraph"><p>An example of normal usage is:</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2050 | <div class="literalblock"> |
| 2051 | <div class="content"> |
Junio C Hamano | ef5a2f9 | 2011-05-31 19:53:33 | [diff] [blame] | 2052 | <pre><tt>torvalds@ppc970:~/git> git diff-tree --abbrev 5319e4 |
| 2053 | :100664 100664 ac348b... a01513... git-fsck-objects.c</tt></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2054 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2055 | <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] | 2056 | this one:</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2057 | <div class="listingblock"> |
| 2058 | <div class="content"> |
| 2059 | <pre><tt>commit 3c6f7ca19ad4043e9e72fa94106f352897e651a8 |
| 2060 | tree 5319e4d609cdd282069cc4dce33c1db559539b03 |
| 2061 | parent b4e628ea30d5ab3606119d2ea5caeab141d38df7 |
| 2062 | author Linus Torvalds <torvalds@ppc970.osdl.org> Sat Apr 9 12:02:30 2005 |
| 2063 | committer Linus Torvalds <torvalds@ppc970.osdl.org> Sat Apr 9 12:02:30 2005 |
| 2064 | |
| 2065 | Make "git-fsck-objects" print out all the root commits it finds. |
| 2066 | |
| 2067 | Once I do the reference tracking, I'll also make it print out all the |
| 2068 | HEAD commits it finds, which is even more interesting.</tt></pre> |
| 2069 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2070 | <div class="paragraph"><p>in case you care).</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2071 | </div> |
Junio C Hamano | 543f8d6 | 2009-07-29 08:35:21 | [diff] [blame] | 2072 | <h2 id="_raw_output_format">Raw output format</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2073 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2074 | <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] | 2075 | "git-diff-files" and "git diff --raw" are very similar.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2076 | <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] | 2077 | compared differs:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2078 | <div class="dlist"><dl> |
| 2079 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2080 | git-diff-index <tree-ish> |
| 2081 | </dt> |
| 2082 | <dd> |
| 2083 | <p> |
| 2084 | compares the <tree-ish> and the files on the filesystem. |
| 2085 | </p> |
| 2086 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2087 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2088 | git-diff-index --cached <tree-ish> |
| 2089 | </dt> |
| 2090 | <dd> |
| 2091 | <p> |
| 2092 | compares the <tree-ish> and the index. |
| 2093 | </p> |
| 2094 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2095 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2096 | git-diff-tree [-r] <tree-ish-1> <tree-ish-2> [<pattern>…] |
| 2097 | </dt> |
| 2098 | <dd> |
| 2099 | <p> |
| 2100 | compares the trees named by the two arguments. |
| 2101 | </p> |
| 2102 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2103 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2104 | git-diff-files [<pattern>…] |
| 2105 | </dt> |
| 2106 | <dd> |
| 2107 | <p> |
| 2108 | compares the index and the files on the filesystem. |
| 2109 | </p> |
| 2110 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2111 | </dl></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2112 | <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] | 2113 | what is being compared. After that, all the commands print one output |
| 2114 | line per changed file.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2115 | <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] | 2116 | <div class="listingblock"> |
| 2117 | <div class="content"> |
| 2118 | <pre><tt>in-place edit :100644 100644 bcd1234... 0123456... M file0 |
| 2119 | copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2 |
| 2120 | rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3 |
| 2121 | create :000000 100644 0000000... 1234567... A file4 |
| 2122 | delete :100644 000000 1234567... 0000000... D file5 |
| 2123 | unmerged :000000 000000 0000000... 0000000... U file6</tt></pre> |
| 2124 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2125 | <div class="paragraph"><p>That is, from the left to the right:</p></div> |
| 2126 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2127 | <li> |
| 2128 | <p> |
| 2129 | a colon. |
| 2130 | </p> |
| 2131 | </li> |
| 2132 | <li> |
| 2133 | <p> |
| 2134 | mode for "src"; 000000 if creation or unmerged. |
| 2135 | </p> |
| 2136 | </li> |
| 2137 | <li> |
| 2138 | <p> |
| 2139 | a space. |
| 2140 | </p> |
| 2141 | </li> |
| 2142 | <li> |
| 2143 | <p> |
| 2144 | mode for "dst"; 000000 if deletion or unmerged. |
| 2145 | </p> |
| 2146 | </li> |
| 2147 | <li> |
| 2148 | <p> |
| 2149 | a space. |
| 2150 | </p> |
| 2151 | </li> |
| 2152 | <li> |
| 2153 | <p> |
| 2154 | sha1 for "src"; 0{40} if creation or unmerged. |
| 2155 | </p> |
| 2156 | </li> |
| 2157 | <li> |
| 2158 | <p> |
| 2159 | a space. |
| 2160 | </p> |
| 2161 | </li> |
| 2162 | <li> |
| 2163 | <p> |
| 2164 | sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree". |
| 2165 | </p> |
| 2166 | </li> |
| 2167 | <li> |
| 2168 | <p> |
| 2169 | a space. |
| 2170 | </p> |
| 2171 | </li> |
| 2172 | <li> |
| 2173 | <p> |
| 2174 | status, followed by optional "score" number. |
| 2175 | </p> |
| 2176 | </li> |
| 2177 | <li> |
| 2178 | <p> |
| 2179 | a tab or a NUL when <em>-z</em> option is used. |
| 2180 | </p> |
| 2181 | </li> |
| 2182 | <li> |
| 2183 | <p> |
| 2184 | path for "src" |
| 2185 | </p> |
| 2186 | </li> |
| 2187 | <li> |
| 2188 | <p> |
| 2189 | a tab or a NUL when <em>-z</em> option is used; only exists for C or R. |
| 2190 | </p> |
| 2191 | </li> |
| 2192 | <li> |
| 2193 | <p> |
| 2194 | path for "dst"; only exists for C or R. |
| 2195 | </p> |
| 2196 | </li> |
| 2197 | <li> |
| 2198 | <p> |
| 2199 | an LF or a NUL when <em>-z</em> option is used, to terminate the record. |
| 2200 | </p> |
| 2201 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2202 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2203 | <div class="paragraph"><p>Possible status letters are:</p></div> |
| 2204 | <div class="ulist"><ul> |
Junio C Hamano | aa17c7c | 2008-11-03 04:36:58 | [diff] [blame] | 2205 | <li> |
| 2206 | <p> |
| 2207 | A: addition of a file |
| 2208 | </p> |
| 2209 | </li> |
| 2210 | <li> |
| 2211 | <p> |
| 2212 | C: copy of a file into a new one |
| 2213 | </p> |
| 2214 | </li> |
| 2215 | <li> |
| 2216 | <p> |
| 2217 | D: deletion of a file |
| 2218 | </p> |
| 2219 | </li> |
| 2220 | <li> |
| 2221 | <p> |
| 2222 | M: modification of the contents or mode of a file |
| 2223 | </p> |
| 2224 | </li> |
| 2225 | <li> |
| 2226 | <p> |
| 2227 | R: renaming of a file |
| 2228 | </p> |
| 2229 | </li> |
| 2230 | <li> |
| 2231 | <p> |
| 2232 | T: change in the type of the file |
| 2233 | </p> |
| 2234 | </li> |
| 2235 | <li> |
| 2236 | <p> |
| 2237 | U: file is unmerged (you must complete the merge before it can |
| 2238 | be committed) |
| 2239 | </p> |
| 2240 | </li> |
| 2241 | <li> |
| 2242 | <p> |
| 2243 | X: "unknown" change type (most probably a bug, please report it) |
| 2244 | </p> |
| 2245 | </li> |
| 2246 | </ul></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2247 | <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] | 2248 | percentage of similarity between the source and target of the move or |
| 2249 | copy), and are the only ones to be so.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2250 | <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] | 2251 | and it is out of sync with the index.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2252 | <div class="paragraph"><p>Example:</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2253 | <div class="listingblock"> |
| 2254 | <div class="content"> |
| 2255 | <pre><tt>:100644 100644 5be4a4...... 000000...... M file.c</tt></pre> |
| 2256 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2257 | <div class="paragraph"><p>When <tt>-z</tt> option is not used, TAB, LF, and backslash characters |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2258 | in pathnames are represented as <tt>\t</tt>, <tt>\n</tt>, and <tt>\\</tt>, |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2259 | respectively.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2260 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2261 | <h2 id="_diff_format_for_merges">diff format for merges</h2> |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 2262 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2263 | <div class="paragraph"><p>"git-diff-tree", "git-diff-files" and "git-diff --raw" |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2264 | can take <em>-c</em> or <em>--cc</em> option |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 2265 | to generate diff output also for merge commits. The output differs |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2266 | from the format described above in the following way:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2267 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 2268 | <li> |
| 2269 | <p> |
| 2270 | there is a colon for each parent |
| 2271 | </p> |
| 2272 | </li> |
| 2273 | <li> |
| 2274 | <p> |
| 2275 | there are more "src" modes and "src" sha1 |
| 2276 | </p> |
| 2277 | </li> |
| 2278 | <li> |
| 2279 | <p> |
| 2280 | status is concatenated status characters for each parent |
| 2281 | </p> |
| 2282 | </li> |
| 2283 | <li> |
| 2284 | <p> |
| 2285 | no optional "score" number |
| 2286 | </p> |
| 2287 | </li> |
| 2288 | <li> |
| 2289 | <p> |
| 2290 | single path, only for "dst" |
| 2291 | </p> |
| 2292 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2293 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2294 | <div class="paragraph"><p>Example:</p></div> |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 2295 | <div class="listingblock"> |
| 2296 | <div class="content"> |
| 2297 | <pre><tt>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</tt></pre> |
| 2298 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2299 | <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] | 2300 | all parents.</p></div> |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 2301 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2302 | <h2 id="_generating_patches_with_p">Generating patches with -p</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2303 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2304 | <div class="paragraph"><p>When "git-diff-index", "git-diff-tree", or "git-diff-files" are run |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 2305 | with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or |
| 2306 | "git log" with the "-p" option, they |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 2307 | do not produce the output described above; instead they produce a |
| 2308 | patch file. You can customize the creation of such patches via the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2309 | GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2310 | <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] | 2311 | diff format:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2312 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2313 | <li> |
| 2314 | <p> |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 2315 | It is preceded with a "git diff" header that looks like this: |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2316 | </p> |
| 2317 | <div class="literalblock"> |
| 2318 | <div class="content"> |
| 2319 | <pre><tt>diff --git a/file1 b/file2</tt></pre> |
| 2320 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2321 | <div class="paragraph"><p>The <tt>a/</tt> and <tt>b/</tt> filenames are the same unless rename/copy is |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2322 | involved. Especially, even for a creation or a deletion, |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2323 | <tt>/dev/null</tt> is <em>not</em> used in place of the <tt>a/</tt> or <tt>b/</tt> filenames.</p></div> |
| 2324 | <div class="paragraph"><p>When rename/copy is involved, <tt>file1</tt> and <tt>file2</tt> show the |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2325 | 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] | 2326 | the file that rename/copy produces, respectively.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2327 | </li> |
| 2328 | <li> |
| 2329 | <p> |
| 2330 | It is followed by one or more extended header lines: |
| 2331 | </p> |
| 2332 | <div class="literalblock"> |
| 2333 | <div class="content"> |
| 2334 | <pre><tt>old mode <mode> |
| 2335 | new mode <mode> |
| 2336 | deleted file mode <mode> |
| 2337 | new file mode <mode> |
| 2338 | copy from <path> |
| 2339 | copy to <path> |
| 2340 | rename from <path> |
| 2341 | rename to <path> |
| 2342 | similarity index <number> |
| 2343 | dissimilarity index <number> |
| 2344 | index <hash>..<hash> <mode></tt></pre> |
| 2345 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2346 | <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] | 2347 | and file permission bits.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2348 | <div class="paragraph"><p>Path names in extended headers do not include the <tt>a/</tt> and <tt>b/</tt> prefixes.</p></div> |
| 2349 | <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] | 2350 | the dissimilarity index is the percentage of changed lines. It |
| 2351 | is a rounded down integer, followed by a percent sign. The |
| 2352 | similarity index value of 100% is thus reserved for two equal |
| 2353 | files, while 100% dissimilarity means that no line from the old |
| 2354 | file made it into the new one.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2355 | <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] | 2356 | The <mode> is included if the file mode does not change; otherwise, |
| 2357 | separate lines indicate the old and the new mode.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2358 | </li> |
| 2359 | <li> |
| 2360 | <p> |
Junio C Hamano | a053d54 | 2006-10-27 09:29:13 | [diff] [blame] | 2361 | TAB, LF, double quote and backslash characters in pathnames |
| 2362 | are represented as <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt> and <tt>\\</tt>, respectively. |
| 2363 | If there is need for such substitution then the whole |
| 2364 | pathname is put in double quotes. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2365 | </p> |
| 2366 | </li> |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 2367 | <li> |
| 2368 | <p> |
| 2369 | All the <tt>file1</tt> files in the output refer to files before the |
| 2370 | commit, and all the <tt>file2</tt> files refer to files after the commit. |
| 2371 | It is incorrect to apply each change to each file sequentially. For |
| 2372 | example, this patch will swap a and b: |
| 2373 | </p> |
| 2374 | <div class="literalblock"> |
| 2375 | <div class="content"> |
| 2376 | <pre><tt>diff --git a/a b/b |
| 2377 | rename from a |
| 2378 | rename to b |
| 2379 | diff --git a/b b/a |
| 2380 | rename from b |
| 2381 | rename to a</tt></pre> |
| 2382 | </div></div> |
| 2383 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2384 | </ol></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2385 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2386 | <h2 id="_combined_diff_format">combined diff format</h2> |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 2387 | <div class="sectionbody"> |
Junio C Hamano | c5be4cc | 2011-03-09 07:20:43 | [diff] [blame] | 2388 | <div class="paragraph"><p>Any diff-generating command can take the ‘-c` or <tt>--cc</tt> option to |
| 2389 | produce a <em>combined diff</em> when showing a merge. This is the default |
| 2390 | format when showing merges with <a href="git-diff.html">git-diff(1)</a> or |
| 2391 | <a href="git-show.html">git-show(1)</a>. Note also that you can give the `-m’ option to any |
| 2392 | of these commands to force generation of diffs with individual parents |
| 2393 | of a merge.</p></div> |
| 2394 | <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] | 2395 | <div class="listingblock"> |
| 2396 | <div class="content"> |
| 2397 | <pre><tt>diff --combined describe.c |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2398 | index fabadb8,cc95eb0..4866510 |
| 2399 | --- a/describe.c |
| 2400 | +++ b/describe.c |
| 2401 | @@@ -98,20 -98,12 +98,20 @@@ |
| 2402 | return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1; |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 2403 | } |
| 2404 | |
| 2405 | - static void describe(char *arg) |
| 2406 | -static void describe(struct commit *cmit, int last_one) |
| 2407 | ++static void describe(char *arg, int last_one) |
| 2408 | { |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2409 | + unsigned char sha1[20]; |
| 2410 | + struct commit *cmit; |
| 2411 | struct commit_list *list; |
| 2412 | static int initialized = 0; |
| 2413 | struct commit_name *n; |
| 2414 | |
| 2415 | + if (get_sha1(arg, sha1) < 0) |
| 2416 | + usage(describe_usage); |
| 2417 | + cmit = lookup_commit_reference(sha1); |
| 2418 | + if (!cmit) |
| 2419 | + usage(describe_usage); |
| 2420 | + |
| 2421 | if (!initialized) { |
| 2422 | initialized = 1; |
| 2423 | for_each_ref(get_name);</tt></pre> |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 2424 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2425 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2426 | <li> |
| 2427 | <p> |
| 2428 | It is preceded with a "git diff" header, that looks like |
| 2429 | this (when <em>-c</em> option is used): |
| 2430 | </p> |
| 2431 | <div class="literalblock"> |
| 2432 | <div class="content"> |
| 2433 | <pre><tt>diff --combined file</tt></pre> |
| 2434 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2435 | <div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2436 | <div class="literalblock"> |
| 2437 | <div class="content"> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 2438 | <pre><tt>diff --cc file</tt></pre> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2439 | </div></div> |
| 2440 | </li> |
| 2441 | <li> |
| 2442 | <p> |
| 2443 | It is followed by one or more extended header lines |
| 2444 | (this example shows a merge with two parents): |
| 2445 | </p> |
| 2446 | <div class="literalblock"> |
| 2447 | <div class="content"> |
| 2448 | <pre><tt>index <hash>,<hash>..<hash> |
| 2449 | mode <mode>,<mode>..<mode> |
| 2450 | new file mode <mode> |
| 2451 | deleted file mode <mode>,<mode></tt></pre> |
| 2452 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2453 | <div class="paragraph"><p>The <tt>mode <mode>,<mode>..<mode></tt> line appears only if at least one of |
Junio C Hamano | ee1e428 | 2007-02-04 08:32:04 | [diff] [blame] | 2454 | the <mode> is different from the rest. Extended headers with |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2455 | information about detected contents movement (renames and |
| 2456 | copying detection) are designed to work with diff of two |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2457 | <tree-ish> and are not used by combined diff format.</p></div> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2458 | </li> |
| 2459 | <li> |
| 2460 | <p> |
| 2461 | It is followed by two-line from-file/to-file header |
| 2462 | </p> |
| 2463 | <div class="literalblock"> |
| 2464 | <div class="content"> |
| 2465 | <pre><tt>--- a/file |
| 2466 | +++ b/file</tt></pre> |
| 2467 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2468 | <div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2469 | format, <tt>/dev/null</tt> is used to signal created or deleted |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2470 | files.</p></div> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2471 | </li> |
| 2472 | <li> |
| 2473 | <p> |
| 2474 | Chunk header format is modified to prevent people from |
| 2475 | accidentally feeding it to <tt>patch -p1</tt>. Combined diff format |
| 2476 | was created for review of merge commit changes, and was not |
| 2477 | meant for apply. The change is similar to the change in the |
| 2478 | extended <em>index</em> header: |
| 2479 | </p> |
| 2480 | <div class="literalblock"> |
| 2481 | <div class="content"> |
| 2482 | <pre><tt>@@@ <from-file-range> <from-file-range> <to-file-range> @@@</tt></pre> |
| 2483 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2484 | <div class="paragraph"><p>There are (number of parents + 1) <tt>@</tt> characters in the chunk |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2485 | header for combined diff format.</p></div> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2486 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2487 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2488 | <div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two |
| 2489 | files A and B with a single column that has <tt>-</tt> (minus — appears in A but removed in B), <tt>+</tt> (plus — missing in A but |
| 2490 | added to B), or <tt>" "</tt> (space — unchanged) prefix, this format |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 2491 | compares two or more files file1, file2,… with one file X, and |
| 2492 | 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] | 2493 | 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] | 2494 | different from it.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2495 | <div class="paragraph"><p>A <tt>-</tt> character in the column N means that the line appears in |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2496 | fileN but it does not appear in the result. A <tt>+</tt> character |
Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 2497 | in the column N means that the line appears in the result, |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2498 | 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] | 2499 | added, from the point of view of that parent).</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2500 | <div class="paragraph"><p>In the above example output, the function signature was changed |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 2501 | from both files (hence two <tt>-</tt> removals from both file1 and |
Junio C Hamano | 5e4d8de | 2008-09-19 06:27:02 | [diff] [blame] | 2502 | file2, plus <tt>++</tt> to mean one line that was added does not appear |
Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 2503 | in either file1 nor file2). Also eight other lines are the same |
| 2504 | from file1 but do not appear in file2 (hence prefixed with <tt>+</tt>).</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2505 | <div class="paragraph"><p>When shown by <tt>git diff-tree -c</tt>, it compares the parents of a |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 2506 | merge commit with the merge result (i.e. file1..fileN are the |
| 2507 | parents). When shown by <tt>git diff-files -c</tt>, it compares the |
| 2508 | two unresolved merge parents with the working tree file |
| 2509 | (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] | 2510 | "their version").</p></div> |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 2511 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2512 | <h2 id="_other_diff_formats">other diff formats</h2> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2513 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2514 | <div class="paragraph"><p>The <tt>--summary</tt> option describes newly added, deleted, renamed and |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2515 | copied files. The <tt>--stat</tt> option adds diffstat(1) graph to the |
| 2516 | output. These options can be combined with other options, such as |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2517 | <tt>-p</tt>, and are meant for human consumption.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2518 | <div class="paragraph"><p>When showing a change that involves a rename or a copy, <tt>--stat</tt> output |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2519 | formats the pathnames compactly by combining common prefix and suffix of |
| 2520 | the pathnames. For example, a change that moves <tt>arch/i386/Makefile</tt> to |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2521 | <tt>arch/x86/Makefile</tt> while modifying 4 lines will be shown like this:</p></div> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2522 | <div class="listingblock"> |
| 2523 | <div class="content"> |
| 2524 | <pre><tt>arch/{i386 => x86}/Makefile | 4 +--</tt></pre> |
| 2525 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2526 | <div class="paragraph"><p>The <tt>--numstat</tt> option gives the diffstat(1) information but is designed |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2527 | for easier machine consumption. An entry in <tt>--numstat</tt> output looks |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2528 | like this:</p></div> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2529 | <div class="listingblock"> |
| 2530 | <div class="content"> |
| 2531 | <pre><tt>1 2 README |
| 2532 | 3 1 arch/{i386 => x86}/Makefile</tt></pre> |
| 2533 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2534 | <div class="paragraph"><p>That is, from left to right:</p></div> |
| 2535 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2536 | <li> |
| 2537 | <p> |
| 2538 | the number of added lines; |
| 2539 | </p> |
| 2540 | </li> |
| 2541 | <li> |
| 2542 | <p> |
| 2543 | a tab; |
| 2544 | </p> |
| 2545 | </li> |
| 2546 | <li> |
| 2547 | <p> |
| 2548 | the number of deleted lines; |
| 2549 | </p> |
| 2550 | </li> |
| 2551 | <li> |
| 2552 | <p> |
| 2553 | a tab; |
| 2554 | </p> |
| 2555 | </li> |
| 2556 | <li> |
| 2557 | <p> |
| 2558 | pathname (possibly with rename/copy information); |
| 2559 | </p> |
| 2560 | </li> |
| 2561 | <li> |
| 2562 | <p> |
| 2563 | a newline. |
| 2564 | </p> |
| 2565 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2566 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2567 | <div class="paragraph"><p>When <tt>-z</tt> 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] | 2568 | <div class="listingblock"> |
| 2569 | <div class="content"> |
| 2570 | <pre><tt>1 2 README NUL |
| 2571 | 3 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</tt></pre> |
| 2572 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2573 | <div class="paragraph"><p>That is:</p></div> |
| 2574 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2575 | <li> |
| 2576 | <p> |
| 2577 | the number of added lines; |
| 2578 | </p> |
| 2579 | </li> |
| 2580 | <li> |
| 2581 | <p> |
| 2582 | a tab; |
| 2583 | </p> |
| 2584 | </li> |
| 2585 | <li> |
| 2586 | <p> |
| 2587 | the number of deleted lines; |
| 2588 | </p> |
| 2589 | </li> |
| 2590 | <li> |
| 2591 | <p> |
| 2592 | a tab; |
| 2593 | </p> |
| 2594 | </li> |
| 2595 | <li> |
| 2596 | <p> |
| 2597 | a NUL (only exists if renamed/copied); |
| 2598 | </p> |
| 2599 | </li> |
| 2600 | <li> |
| 2601 | <p> |
| 2602 | pathname in preimage; |
| 2603 | </p> |
| 2604 | </li> |
| 2605 | <li> |
| 2606 | <p> |
| 2607 | a NUL (only exists if renamed/copied); |
| 2608 | </p> |
| 2609 | </li> |
| 2610 | <li> |
| 2611 | <p> |
| 2612 | pathname in postimage (only exists if renamed/copied); |
| 2613 | </p> |
| 2614 | </li> |
| 2615 | <li> |
| 2616 | <p> |
| 2617 | a NUL. |
| 2618 | </p> |
| 2619 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2620 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2621 | <div class="paragraph"><p>The extra <tt>NUL</tt> before the preimage path in renamed case is to allow |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2622 | scripts that read the output to tell if the current record being read is |
| 2623 | a single-path record or a rename/copy record without reading ahead. |
| 2624 | After reading added and deleted lines, reading up to <tt>NUL</tt> would yield |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2625 | the pathname, but if that is <tt>NUL</tt>, the record will show two paths.</p></div> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2626 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2627 | <h2 id="_git">GIT</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2628 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2629 | <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] | 2630 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 2631 | </div> |
| 2632 | <div id="footnotes"><hr /></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2633 | <div id="footer"> |
| 2634 | <div id="footer-text"> |
Junio C Hamano | 02194af | 2011-11-17 20:33:59 | [diff] [blame] | 2635 | Last updated 2011-11-15 13:45:02 PDT |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2636 | </div> |
| 2637 | </div> |
| 2638 | </body> |
| 2639 | </html> |