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-files(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-files(1) Manual Page |
| 574 | </h1> |
| 575 | <h2>NAME</h2> |
| 576 | <div class="sectionbody"> |
| 577 | <p>git-diff-files - |
| 578 | Compares files in the working tree and the index |
| 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 | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 585 | <div class="verseblock"> |
| 586 | <div class="verseblock-content"><em>git diff-files</em> [-q] [-0|-1|-2|-3|-c|--cc] [<common diff options>] [<path>…]</div> |
| 587 | <div class="verseblock-attribution"> |
| 588 | </div></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 589 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 590 | <h2 id="_description">DESCRIPTION</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 591 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 592 | <div class="paragraph"><p>Compares the files in the working tree and the index. When paths |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 593 | are specified, compares only those named paths. Otherwise all |
| 594 | entries in the index are compared. The output format is the |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 595 | same as for <em>git diff-index</em> and <em>git diff-tree</em>.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 596 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 597 | <h2 id="_options">OPTIONS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 598 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 599 | <div class="dlist"><dl> |
| 600 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 601 | -p |
| 602 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 603 | <dt class="hdlist1"> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 604 | -u |
| 605 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 606 | <dt class="hdlist1"> |
Junio C Hamano | e97d577 | 2010-05-19 08:13:58 | [diff] [blame] | 607 | --patch |
| 608 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 609 | <dd> |
| 610 | <p> |
Junio C Hamano | ff97979 | 2007-11-16 10:11:30 | [diff] [blame] | 611 | Generate patch (see section on generating patches). |
| 612 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 613 | </p> |
| 614 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 615 | <dt class="hdlist1"> |
Junio C Hamano | 6936156 | 2007-07-26 02:14:34 | [diff] [blame] | 616 | -U<n> |
| 617 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 618 | <dt class="hdlist1"> |
Junio C Hamano | 6936156 | 2007-07-26 02:14:34 | [diff] [blame] | 619 | --unified=<n> |
| 620 | </dt> |
| 621 | <dd> |
| 622 | <p> |
| 623 | Generate diffs with <n> lines of context instead of |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 624 | the usual three. |
| 625 | Implies <tt>-p</tt>. |
Junio C Hamano | 6936156 | 2007-07-26 02:14:34 | [diff] [blame] | 626 | </p> |
| 627 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 628 | <dt class="hdlist1"> |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 629 | --raw |
| 630 | </dt> |
| 631 | <dd> |
| 632 | <p> |
| 633 | Generate the raw format. |
Junio C Hamano | ff97979 | 2007-11-16 10:11:30 | [diff] [blame] | 634 | This is the default. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 635 | </p> |
| 636 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 637 | <dt class="hdlist1"> |
Junio C Hamano | 54559c8 | 2006-04-13 07:45:12 | [diff] [blame] | 638 | --patch-with-raw |
| 639 | </dt> |
| 640 | <dd> |
| 641 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 642 | Synonym for <tt>-p --raw</tt>. |
Junio C Hamano | 54559c8 | 2006-04-13 07:45:12 | [diff] [blame] | 643 | </p> |
| 644 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 645 | <dt class="hdlist1"> |
Junio C Hamano | 5a73f30 | 2011-10-14 05:58:34 | [diff] [blame] | 646 | --minimal |
| 647 | </dt> |
| 648 | <dd> |
| 649 | <p> |
| 650 | Spend extra time to make sure the smallest possible |
| 651 | diff is produced. |
| 652 | </p> |
| 653 | </dd> |
| 654 | <dt class="hdlist1"> |
Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 655 | --patience |
| 656 | </dt> |
| 657 | <dd> |
| 658 | <p> |
| 659 | Generate a diff using the "patience diff" algorithm. |
| 660 | </p> |
| 661 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 662 | <dt class="hdlist1"> |
Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 663 | --histogram |
| 664 | </dt> |
| 665 | <dd> |
| 666 | <p> |
| 667 | Generate a diff using the "histogram diff" algorithm. |
| 668 | </p> |
| 669 | </dd> |
| 670 | <dt class="hdlist1"> |
Junio C Hamano | 4c4b012 | 2011-06-30 01:19:32 | [diff] [blame] | 671 | --stat[=<width>[,<name-width>[,<count>]]] |
Junio C Hamano | ba7c8d8 | 2006-04-15 06:17:42 | [diff] [blame] | 672 | </dt> |
| 673 | <dd> |
| 674 | <p> |
Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 675 | Generate a diffstat. By default, as much space as necessary |
| 676 | will be used for the filename part, and the rest for the graph |
| 677 | part. Maximum width defaults to terminal width, or 80 columns |
| 678 | if not connected to a terminal, and can be overriden by |
| 679 | <tt><width></tt>. The width of the filename part can be limited by |
| 680 | giving another width <tt><name-width></tt> after a comma. The width |
| 681 | of the graph part can be limited by using |
| 682 | <tt>--stat-graph-width=<width></tt> (affects all commands generating |
| 683 | a stat graph) or by setting <tt>diff.statGraphWidth=<width></tt> |
| 684 | (does not affect <tt>git format-patch</tt>). |
Junio C Hamano | 4c4b012 | 2011-06-30 01:19:32 | [diff] [blame] | 685 | By giving a third parameter <tt><count></tt>, you can limit the |
Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 686 | output to the first <tt><count></tt> lines, followed by <tt>…</tt> if |
| 687 | there are more. |
Junio C Hamano | ba7c8d8 | 2006-04-15 06:17:42 | [diff] [blame] | 688 | </p> |
Junio C Hamano | 4c4b012 | 2011-06-30 01:19:32 | [diff] [blame] | 689 | <div class="paragraph"><p>These parameters can also be set individually with <tt>--stat-width=<width></tt>, |
| 690 | <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] | 691 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 692 | <dt class="hdlist1"> |
Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 693 | --numstat |
| 694 | </dt> |
| 695 | <dd> |
| 696 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 697 | Similar to <tt>--stat</tt>, but shows number of added and |
Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 698 | deleted lines in decimal notation and pathname without |
Junio C Hamano | d793de5 | 2006-12-26 09:11:43 | [diff] [blame] | 699 | abbreviation, to make it more machine friendly. For |
| 700 | binary files, outputs two <tt>-</tt> instead of saying |
| 701 | <tt>0 0</tt>. |
Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 702 | </p> |
| 703 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 704 | <dt class="hdlist1"> |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 705 | --shortstat |
| 706 | </dt> |
| 707 | <dd> |
| 708 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 709 | 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] | 710 | number of modified files, as well as number of added and deleted |
| 711 | lines. |
| 712 | </p> |
| 713 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 714 | <dt class="hdlist1"> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 715 | --dirstat[=<param1,param2,…>] |
Junio C Hamano | 6a45be9 | 2008-04-22 08:19:03 | [diff] [blame] | 716 | </dt> |
| 717 | <dd> |
| 718 | <p> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 719 | Output the distribution of relative amount of changes for each |
| 720 | sub-directory. The behavior of <tt>--dirstat</tt> can be customized by |
| 721 | passing it a comma separated list of parameters. |
| 722 | The defaults are controlled by the <tt>diff.dirstat</tt> configuration |
| 723 | variable (see <a href="git-config.html">git-config(1)</a>). |
| 724 | The following parameters are available: |
Junio C Hamano | 6a45be9 | 2008-04-22 08:19:03 | [diff] [blame] | 725 | </p> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 726 | <div class="dlist"><dl> |
| 727 | <dt class="hdlist1"> |
| 728 | <tt>changes</tt> |
| 729 | </dt> |
| 730 | <dd> |
| 731 | <p> |
| 732 | Compute the dirstat numbers by counting the lines that have been |
| 733 | removed from the source, or added to the destination. This ignores |
| 734 | the amount of pure code movements within a file. In other words, |
| 735 | rearranging lines in a file is not counted as much as other changes. |
| 736 | This is the default behavior when no parameter is given. |
| 737 | </p> |
Junio C Hamano | 6a45be9 | 2008-04-22 08:19:03 | [diff] [blame] | 738 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 739 | <dt class="hdlist1"> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 740 | <tt>lines</tt> |
Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 741 | </dt> |
| 742 | <dd> |
| 743 | <p> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 744 | Compute the dirstat numbers by doing the regular line-based diff |
| 745 | analysis, and summing the removed/added line counts. (For binary |
| 746 | files, count 64-byte chunks instead, since binary files have no |
| 747 | natural concept of lines). This is a more expensive <tt>--dirstat</tt> |
| 748 | behavior than the <tt>changes</tt> behavior, but it does count rearranged |
| 749 | lines within a file as much as other changes. The resulting output |
| 750 | 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] | 751 | </p> |
| 752 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 753 | <dt class="hdlist1"> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 754 | <tt>files</tt> |
| 755 | </dt> |
| 756 | <dd> |
| 757 | <p> |
| 758 | Compute the dirstat numbers by counting the number of files changed. |
| 759 | Each changed file counts equally in the dirstat analysis. This is |
| 760 | the computationally cheapest <tt>--dirstat</tt> behavior, since it does |
| 761 | not have to look at the file contents at all. |
| 762 | </p> |
| 763 | </dd> |
| 764 | <dt class="hdlist1"> |
| 765 | <tt>cumulative</tt> |
| 766 | </dt> |
| 767 | <dd> |
| 768 | <p> |
| 769 | Count changes in a child directory for the parent directory as well. |
| 770 | Note that when using <tt>cumulative</tt>, the sum of the percentages |
| 771 | reported may exceed 100%. The default (non-cumulative) behavior can |
| 772 | be specified with the <tt>noncumulative</tt> parameter. |
| 773 | </p> |
| 774 | </dd> |
| 775 | <dt class="hdlist1"> |
| 776 | <limit> |
| 777 | </dt> |
| 778 | <dd> |
| 779 | <p> |
| 780 | An integer parameter specifies a cut-off percent (3% by default). |
| 781 | Directories contributing less than this percentage of the changes |
| 782 | are not shown in the output. |
| 783 | </p> |
| 784 | </dd> |
| 785 | </dl></div> |
| 786 | <div class="paragraph"><p>Example: The following will count changed files, while ignoring |
| 787 | directories with less than 10% of the total amount of changed files, |
| 788 | and accumulating child directory counts in the parent directories: |
| 789 | <tt>--dirstat=files,10,cumulative</tt>.</p></div> |
| 790 | </dd> |
| 791 | <dt class="hdlist1"> |
Junio C Hamano | 6959c6c | 2006-05-17 10:34:11 | [diff] [blame] | 792 | --summary |
| 793 | </dt> |
| 794 | <dd> |
| 795 | <p> |
| 796 | Output a condensed summary of extended header information |
| 797 | such as creations, renames and mode changes. |
| 798 | </p> |
| 799 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 800 | <dt class="hdlist1"> |
Junio C Hamano | d1308c9 | 2006-04-16 11:01:09 | [diff] [blame] | 801 | --patch-with-stat |
| 802 | </dt> |
| 803 | <dd> |
| 804 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 805 | Synonym for <tt>-p --stat</tt>. |
Junio C Hamano | d1308c9 | 2006-04-16 11:01:09 | [diff] [blame] | 806 | </p> |
| 807 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 808 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 809 | -z |
| 810 | </dt> |
| 811 | <dd> |
| 812 | <p> |
Junio C Hamano | 0c053e8 | 2010-04-19 06:46:34 | [diff] [blame] | 813 | When <tt>--raw</tt>, <tt>--numstat</tt>, <tt>--name-only</tt> or <tt>--name-status</tt> has been |
| 814 | given, do not munge pathnames and use NULs as output field terminators. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 815 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 816 | <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] | 817 | and backslash characters replaced with <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt>, and <tt>\\</tt>, |
| 818 | respectively, and the pathname will be enclosed in double quotes if |
| 819 | any of those replacements occurred.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 820 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 821 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 822 | --name-only |
| 823 | </dt> |
| 824 | <dd> |
| 825 | <p> |
| 826 | Show only names of changed files. |
| 827 | </p> |
| 828 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 829 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 830 | --name-status |
| 831 | </dt> |
| 832 | <dd> |
| 833 | <p> |
Junio C Hamano | a9aee78 | 2008-04-23 16:09:20 | [diff] [blame] | 834 | Show only names and status of changed files. See the description |
| 835 | 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] | 836 | </p> |
| 837 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 838 | <dt class="hdlist1"> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 839 | --submodule[=<format>] |
| 840 | </dt> |
| 841 | <dd> |
| 842 | <p> |
Junio C Hamano | e768cc1 | 2012-03-16 05:43:05 | [diff] [blame^] | 843 | Specify how differences in submodules are shown. When <tt>--submodule</tt> |
| 844 | or <tt>--submodule=log</tt> is given, the <em>log</em> format is used. This format lists |
| 845 | the commits in the range like <a href="git-submodule.html">git-submodule(1)</a> <tt>summary</tt> does. |
| 846 | Omitting the <tt>--submodule</tt> option or specifying <tt>--submodule=short</tt>, |
| 847 | uses the <em>short</em> format. This format just shows the names of the commits |
| 848 | at the beginning and end of the range. |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 849 | </p> |
| 850 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 851 | <dt class="hdlist1"> |
Junio C Hamano | 4aa0bcc | 2010-03-03 05:13:12 | [diff] [blame] | 852 | --color[=<when>] |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 853 | </dt> |
| 854 | <dd> |
| 855 | <p> |
| 856 | Show colored diff. |
Junio C Hamano | 5f2627d | 2011-05-06 20:23:48 | [diff] [blame] | 857 | The value must be <tt>always</tt> (the default for <tt><when></tt>), <tt>never</tt>, or <tt>auto</tt>. |
| 858 | The default value is <tt>never</tt>. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 859 | </p> |
| 860 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 861 | <dt class="hdlist1"> |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 862 | --no-color |
| 863 | </dt> |
| 864 | <dd> |
| 865 | <p> |
Junio C Hamano | 5f2627d | 2011-05-06 20:23:48 | [diff] [blame] | 866 | Turn off colored diff. |
| 867 | It is the same as <tt>--color=never</tt>. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 868 | </p> |
| 869 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 870 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 871 | --word-diff[=<mode>] |
Junio C Hamano | 85e45fa | 2006-08-13 07:47:41 | [diff] [blame] | 872 | </dt> |
| 873 | <dd> |
| 874 | <p> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 875 | Show a word diff, using the <mode> to delimit changed words. |
| 876 | By default, words are delimited by whitespace; see |
| 877 | <tt>--word-diff-regex</tt> below. The <mode> defaults to <em>plain</em>, and |
| 878 | must be one of: |
Junio C Hamano | 85e45fa | 2006-08-13 07:47:41 | [diff] [blame] | 879 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 880 | <div class="dlist"><dl> |
| 881 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 882 | color |
| 883 | </dt> |
| 884 | <dd> |
| 885 | <p> |
| 886 | Highlight changed words using only colors. Implies <tt>--color</tt>. |
| 887 | </p> |
| 888 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 889 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 890 | plain |
| 891 | </dt> |
| 892 | <dd> |
| 893 | <p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 894 | 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] | 895 | attempts to escape the delimiters if they appear in the input, |
| 896 | so the output may be ambiguous. |
| 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 | porcelain |
| 901 | </dt> |
| 902 | <dd> |
| 903 | <p> |
| 904 | Use a special line-based format intended for script |
| 905 | consumption. Added/removed/unchanged runs are printed in the |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 906 | usual unified diff format, starting with a <tt>+</tt>/<tt>-</tt>/` ` |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 907 | character at the beginning of the line and extending to the |
| 908 | end of the line. Newlines in the input are represented by a |
| 909 | tilde <tt>~</tt> on a line of its own. |
| 910 | </p> |
| 911 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 912 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 913 | none |
| 914 | </dt> |
| 915 | <dd> |
| 916 | <p> |
| 917 | Disable word diff again. |
| 918 | </p> |
| 919 | </dd> |
| 920 | </dl></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 921 | <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] | 922 | highlight the changed parts in all modes if enabled.</p></div> |
| 923 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 924 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 925 | --word-diff-regex=<regex> |
| 926 | </dt> |
| 927 | <dd> |
| 928 | <p> |
| 929 | Use <regex> to decide what a word is, instead of considering |
| 930 | runs of non-whitespace to be a word. Also implies |
| 931 | <tt>--word-diff</tt> unless it was already enabled. |
| 932 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 933 | <div class="paragraph"><p>Every non-overlapping match of the |
Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 934 | <regex> is considered a word. Anything between these matches is |
| 935 | considered whitespace and ignored(!) for the purposes of finding |
| 936 | differences. You may want to append <tt>|[^[:space:]]</tt> to your regular |
| 937 | expression to make sure that it matches all non-whitespace characters. |
| 938 | A match that contains a newline is silently truncated(!) at the |
| 939 | newline.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 940 | <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] | 941 | <a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly |
| 942 | overrides any diff driver or configuration setting. Diff drivers |
| 943 | override configuration settings.</p></div> |
Junio C Hamano | 85e45fa | 2006-08-13 07:47:41 | [diff] [blame] | 944 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 945 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 946 | --color-words[=<regex>] |
| 947 | </dt> |
| 948 | <dd> |
| 949 | <p> |
| 950 | Equivalent to <tt>--word-diff=color</tt> plus (if a regex was |
| 951 | specified) <tt>--word-diff-regex=<regex></tt>. |
| 952 | </p> |
| 953 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 954 | <dt class="hdlist1"> |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 955 | --no-renames |
| 956 | </dt> |
| 957 | <dd> |
| 958 | <p> |
| 959 | Turn off rename detection, even when the configuration |
| 960 | file gives the default to do so. |
| 961 | </p> |
| 962 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 963 | <dt class="hdlist1"> |
Junio C Hamano | a890c4f | 2007-01-28 10:29:21 | [diff] [blame] | 964 | --check |
| 965 | </dt> |
| 966 | <dd> |
| 967 | <p> |
Junio C Hamano | 6005bfa | 2011-06-23 00:51:22 | [diff] [blame] | 968 | Warn if changes introduce whitespace errors. What are |
| 969 | considered whitespace errors is controlled by <tt>core.whitespace</tt> |
| 970 | configuration. By default, trailing whitespaces (including |
| 971 | lines that solely consist of whitespaces) and a space character |
| 972 | that is immediately followed by a tab character inside the |
| 973 | initial indent of the line are considered whitespace errors. |
| 974 | Exits with non-zero status if problems are found. Not compatible |
| 975 | with --exit-code. |
Junio C Hamano | a890c4f | 2007-01-28 10:29:21 | [diff] [blame] | 976 | </p> |
| 977 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 978 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 979 | --full-index |
| 980 | </dt> |
| 981 | <dd> |
| 982 | <p> |
Junio C Hamano | 5cf43ca | 2008-08-20 09:14:14 | [diff] [blame] | 983 | Instead of the first handful of characters, show the full |
| 984 | pre- and post-image blob object names on the "index" |
| 985 | line when generating patch format output. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 986 | </p> |
| 987 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 988 | <dt class="hdlist1"> |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 989 | --binary |
| 990 | </dt> |
| 991 | <dd> |
| 992 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 993 | In addition to <tt>--full-index</tt>, output a binary diff that |
| 994 | can be applied with <tt>git-apply</tt>. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [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 | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 998 | --abbrev[=<n>] |
| 999 | </dt> |
| 1000 | <dd> |
| 1001 | <p> |
| 1002 | Instead of showing the full 40-byte hexadecimal object |
| 1003 | name in diff-raw format output and diff-tree header |
Junio C Hamano | 6efe302 | 2009-01-13 16:47:56 | [diff] [blame] | 1004 | lines, show only a partial prefix. This is |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1005 | independent of the <tt>--full-index</tt> option above, which controls |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1006 | the diff-patch output format. Non default number of |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1007 | digits can be specified with <tt>--abbrev=<n></tt>. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1008 | </p> |
| 1009 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1010 | <dt class="hdlist1"> |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1011 | -B[<n>][/<m>] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1012 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1013 | <dt class="hdlist1"> |
Junio C Hamano | 39c7a69 | 2010-10-27 06:08:54 | [diff] [blame] | 1014 | --break-rewrites[=[<n>][/<m>]] |
| 1015 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1016 | <dd> |
| 1017 | <p> |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1018 | Break complete rewrite changes into pairs of delete and |
| 1019 | create. This serves two purposes: |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1020 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1021 | <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] | 1022 | not as a series of deletion and insertion mixed together with a very |
| 1023 | few lines that happen to match textually as the context, but as a |
| 1024 | single deletion of everything old followed by a single insertion of |
| 1025 | everything new, and the number <tt>m</tt> controls this aspect of the -B |
| 1026 | option (defaults to 60%). <tt>-B/70%</tt> specifies that less than 30% of the |
| 1027 | original should remain in the result for git to consider it a total |
| 1028 | rewrite (i.e. otherwise the resulting patch will be a series of |
| 1029 | deletion and insertion mixed together with context lines).</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1030 | <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] | 1031 | source of a rename (usually -M only considers a file that disappeared |
| 1032 | as the source of a rename), and the number <tt>n</tt> controls this aspect of |
| 1033 | 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] | 1034 | 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] | 1035 | eligible for being picked up as a possible source of a rename to |
| 1036 | another file.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1037 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1038 | <dt class="hdlist1"> |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1039 | -M[<n>] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1040 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1041 | <dt class="hdlist1"> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1042 | --find-renames[=<n>] |
Junio C Hamano | 39c7a69 | 2010-10-27 06:08:54 | [diff] [blame] | 1043 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1044 | <dd> |
| 1045 | <p> |
| 1046 | Detect renames. |
Junio C Hamano | 5f2627d | 2011-05-06 20:23:48 | [diff] [blame] | 1047 | 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] | 1048 | index (i.e. amount of addition/deletions compared to the |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1049 | 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] | 1050 | 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] | 1051 | hasn’t changed. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1052 | </p> |
| 1053 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1054 | <dt class="hdlist1"> |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1055 | -C[<n>] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1056 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1057 | <dt class="hdlist1"> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1058 | --find-copies[=<n>] |
Junio C Hamano | 39c7a69 | 2010-10-27 06:08:54 | [diff] [blame] | 1059 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1060 | <dd> |
| 1061 | <p> |
Junio C Hamano | 16f9887 | 2007-06-12 16:09:14 | [diff] [blame] | 1062 | 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] | 1063 | 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] | 1064 | </p> |
| 1065 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1066 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1067 | --find-copies-harder |
| 1068 | </dt> |
| 1069 | <dd> |
| 1070 | <p> |
Junio C Hamano | 16f9887 | 2007-06-12 16:09:14 | [diff] [blame] | 1071 | For performance reasons, by default, <tt>-C</tt> option finds copies only |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1072 | if the original file of the copy was modified in the same |
| 1073 | changeset. This flag makes the command |
| 1074 | inspect unmodified files as candidates for the source of |
| 1075 | copy. This is a very expensive operation for large |
Junio C Hamano | 16f9887 | 2007-06-12 16:09:14 | [diff] [blame] | 1076 | projects, so use it with caution. Giving more than one |
| 1077 | <tt>-C</tt> option has the same effect. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1078 | </p> |
| 1079 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1080 | <dt class="hdlist1"> |
Junio C Hamano | b02377c | 2011-04-28 22:26:02 | [diff] [blame] | 1081 | -D |
| 1082 | </dt> |
| 1083 | <dt class="hdlist1"> |
| 1084 | --irreversible-delete |
| 1085 | </dt> |
| 1086 | <dd> |
| 1087 | <p> |
| 1088 | Omit the preimage for deletes, i.e. print only the header but not |
| 1089 | the diff between the preimage and <tt>/dev/null</tt>. The resulting patch |
| 1090 | is not meant to be applied with <tt>patch</tt> nor <tt>git apply</tt>; this is |
| 1091 | solely for people who want to just concentrate on reviewing the |
| 1092 | text after the change. In addition, the output obviously lack |
| 1093 | enough information to apply such a patch in reverse, even manually, |
| 1094 | hence the name of the option. |
| 1095 | </p> |
| 1096 | <div class="paragraph"><p>When used together with <tt>-B</tt>, omit also the preimage in the deletion part |
| 1097 | of a delete/create pair.</p></div> |
| 1098 | </dd> |
| 1099 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1100 | -l<num> |
| 1101 | </dt> |
| 1102 | <dd> |
| 1103 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1104 | 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] | 1105 | is the number of potential rename/copy targets. This |
| 1106 | option prevents rename/copy detection from running if |
| 1107 | the number of rename/copy targets exceeds the specified |
| 1108 | number. |
| 1109 | </p> |
| 1110 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1111 | <dt class="hdlist1"> |
Junio C Hamano | 982eb11 | 2010-11-18 00:53:09 | [diff] [blame] | 1112 | --diff-filter=[(A|C|D|M|R|T|U|X|B)…[*]] |
| 1113 | </dt> |
| 1114 | <dd> |
| 1115 | <p> |
| 1116 | Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>), |
| 1117 | Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their |
| 1118 | type (i.e. regular file, symlink, submodule, …) changed (<tt>T</tt>), |
| 1119 | are Unmerged (<tt>U</tt>), are |
| 1120 | Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>). |
| 1121 | Any combination of the filter characters (including none) can be used. |
| 1122 | When <tt>*</tt> (All-or-none) is added to the combination, all |
| 1123 | paths are selected if there is any file that matches |
| 1124 | other criteria in the comparison; if there is no file |
| 1125 | that matches other criteria, nothing is selected. |
| 1126 | </p> |
| 1127 | </dd> |
| 1128 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1129 | -S<string> |
| 1130 | </dt> |
| 1131 | <dd> |
| 1132 | <p> |
Junio C Hamano | 5217a27 | 2009-03-21 00:39:33 | [diff] [blame] | 1133 | Look for differences that introduce or remove an instance of |
| 1134 | <string>. Note that this is different than the string simply |
| 1135 | appearing in diff output; see the <em>pickaxe</em> entry in |
| 1136 | <a href="gitdiffcore.html">gitdiffcore(7)</a> for more details. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1137 | </p> |
| 1138 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1139 | <dt class="hdlist1"> |
Junio C Hamano | 3b4609d | 2010-09-30 00:04:34 | [diff] [blame] | 1140 | -G<regex> |
| 1141 | </dt> |
| 1142 | <dd> |
| 1143 | <p> |
| 1144 | Look for differences whose added or removed line matches |
| 1145 | the given <regex>. |
| 1146 | </p> |
| 1147 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1148 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1149 | --pickaxe-all |
| 1150 | </dt> |
| 1151 | <dd> |
| 1152 | <p> |
Junio C Hamano | 3b4609d | 2010-09-30 00:04:34 | [diff] [blame] | 1153 | 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] | 1154 | changeset, not just the files that contain the change |
| 1155 | in <string>. |
| 1156 | </p> |
| 1157 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1158 | <dt class="hdlist1"> |
Junio C Hamano | bfe9e75 | 2006-04-05 21:43:28 | [diff] [blame] | 1159 | --pickaxe-regex |
| 1160 | </dt> |
| 1161 | <dd> |
| 1162 | <p> |
| 1163 | Make the <string> not a plain string but an extended POSIX |
| 1164 | regex to match. |
| 1165 | </p> |
| 1166 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1167 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1168 | -O<orderfile> |
| 1169 | </dt> |
| 1170 | <dd> |
| 1171 | <p> |
| 1172 | Output the patch in the order specified in the |
| 1173 | <orderfile>, which has one shell glob pattern per line. |
| 1174 | </p> |
| 1175 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1176 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1177 | -R |
| 1178 | </dt> |
| 1179 | <dd> |
| 1180 | <p> |
| 1181 | Swap two inputs; that is, show differences from index or |
| 1182 | on-disk file to tree contents. |
| 1183 | </p> |
| 1184 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1185 | <dt class="hdlist1"> |
Junio C Hamano | 24bc09a | 2008-02-28 00:27:44 | [diff] [blame] | 1186 | --relative[=<path>] |
| 1187 | </dt> |
| 1188 | <dd> |
| 1189 | <p> |
| 1190 | When run from a subdirectory of the project, it can be |
| 1191 | told to exclude changes outside the directory and show |
| 1192 | pathnames relative to it with this option. When you are |
| 1193 | not in a subdirectory (e.g. in a bare repository), you |
| 1194 | can name which subdirectory to make the output relative |
| 1195 | to by giving a <path> as an argument. |
| 1196 | </p> |
| 1197 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1198 | <dt class="hdlist1"> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 1199 | -a |
| 1200 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1201 | <dt class="hdlist1"> |
Junio C Hamano | c26f548 | 2006-07-09 09:38:14 | [diff] [blame] | 1202 | --text |
| 1203 | </dt> |
| 1204 | <dd> |
| 1205 | <p> |
| 1206 | Treat all files as text. |
| 1207 | </p> |
| 1208 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1209 | <dt class="hdlist1"> |
Junio C Hamano | fd46896 | 2007-02-14 23:45:04 | [diff] [blame] | 1210 | --ignore-space-at-eol |
| 1211 | </dt> |
| 1212 | <dd> |
| 1213 | <p> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 1214 | Ignore changes in whitespace at EOL. |
Junio C Hamano | fd46896 | 2007-02-14 23:45:04 | [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 | -b |
| 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-space-change |
| 1222 | </dt> |
| 1223 | <dd> |
| 1224 | <p> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 1225 | Ignore changes in amount of whitespace. This ignores whitespace |
| 1226 | at line end, and considers all other sequences of one or |
| 1227 | more whitespace characters to be equivalent. |
Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 1228 | </p> |
| 1229 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1230 | <dt class="hdlist1"> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 1231 | -w |
Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 1232 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1233 | <dt class="hdlist1"> |
Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 1234 | --ignore-all-space |
| 1235 | </dt> |
| 1236 | <dd> |
| 1237 | <p> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 1238 | Ignore whitespace when comparing lines. This ignores |
| 1239 | differences even if one line has whitespace where the other |
Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 1240 | line has none. |
| 1241 | </p> |
| 1242 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1243 | <dt class="hdlist1"> |
Junio C Hamano | 1d40ee8 | 2009-01-07 10:14:16 | [diff] [blame] | 1244 | --inter-hunk-context=<lines> |
| 1245 | </dt> |
| 1246 | <dd> |
| 1247 | <p> |
| 1248 | Show the context between diff hunks, up to the specified number |
| 1249 | of lines, thereby fusing hunks that are close to each other. |
| 1250 | </p> |
| 1251 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1252 | <dt class="hdlist1"> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1253 | -W |
| 1254 | </dt> |
| 1255 | <dt class="hdlist1"> |
| 1256 | --function-context |
| 1257 | </dt> |
| 1258 | <dd> |
| 1259 | <p> |
| 1260 | Show whole surrounding functions of changes. |
| 1261 | </p> |
| 1262 | </dd> |
| 1263 | <dt class="hdlist1"> |
Junio C Hamano | 48fd2f6 | 2007-03-19 02:02:30 | [diff] [blame] | 1264 | --exit-code |
| 1265 | </dt> |
| 1266 | <dd> |
| 1267 | <p> |
| 1268 | Make the program exit with codes similar to diff(1). |
| 1269 | That is, it exits with 1 if there were differences and |
| 1270 | 0 means no differences. |
| 1271 | </p> |
| 1272 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1273 | <dt class="hdlist1"> |
Junio C Hamano | 35e5755 | 2007-03-25 07:54:35 | [diff] [blame] | 1274 | --quiet |
| 1275 | </dt> |
| 1276 | <dd> |
| 1277 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 1278 | Disable all output of the program. Implies <tt>--exit-code</tt>. |
Junio C Hamano | 35e5755 | 2007-03-25 07:54:35 | [diff] [blame] | 1279 | </p> |
| 1280 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1281 | <dt class="hdlist1"> |
Junio C Hamano | bb0f404 | 2007-07-04 06:41:40 | [diff] [blame] | 1282 | --ext-diff |
| 1283 | </dt> |
| 1284 | <dd> |
| 1285 | <p> |
| 1286 | Allow an external diff helper to be executed. If you set an |
Junio C Hamano | 1b50ce9 | 2007-10-03 12:05:53 | [diff] [blame] | 1287 | external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need |
| 1288 | 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] | 1289 | </p> |
| 1290 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1291 | <dt class="hdlist1"> |
Junio C Hamano | bb0f404 | 2007-07-04 06:41:40 | [diff] [blame] | 1292 | --no-ext-diff |
| 1293 | </dt> |
| 1294 | <dd> |
| 1295 | <p> |
| 1296 | Disallow external diff drivers. |
| 1297 | </p> |
| 1298 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1299 | <dt class="hdlist1"> |
Junio C Hamano | c652aed | 2011-07-07 01:14:31 | [diff] [blame] | 1300 | --textconv |
| 1301 | </dt> |
| 1302 | <dt class="hdlist1"> |
| 1303 | --no-textconv |
| 1304 | </dt> |
| 1305 | <dd> |
| 1306 | <p> |
| 1307 | Allow (or disallow) external text conversion filters to be run |
| 1308 | when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for |
| 1309 | details. Because textconv filters are typically a one-way |
| 1310 | conversion, the resulting diff is suitable for human |
| 1311 | consumption, but cannot be applied. For this reason, textconv |
| 1312 | filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and |
| 1313 | <a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or |
| 1314 | diff plumbing commands. |
| 1315 | </p> |
| 1316 | </dd> |
| 1317 | <dt class="hdlist1"> |
Junio C Hamano | 7d44952 | 2010-07-01 00:08:51 | [diff] [blame] | 1318 | --ignore-submodules[=<when>] |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 1319 | </dt> |
| 1320 | <dd> |
| 1321 | <p> |
Junio C Hamano | 7d44952 | 2010-07-01 00:08:51 | [diff] [blame] | 1322 | Ignore changes to submodules in the diff generation. <when> can be |
Junio C Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 1323 | either "none", "untracked", "dirty" or "all", which is the default |
| 1324 | Using "none" will consider the submodule modified when it either contains |
| 1325 | untracked or modified files or its HEAD differs from the commit recorded |
| 1326 | in the superproject and can be used to override any settings of the |
| 1327 | <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] | 1328 | "untracked" is used submodules are not considered dirty when they only |
| 1329 | contain untracked content (but they are still scanned for modified |
| 1330 | content). Using "dirty" ignores all changes to the work tree of submodules, |
| 1331 | only changes to the commits stored in the superproject are shown (this was |
| 1332 | 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] | 1333 | </p> |
| 1334 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1335 | <dt class="hdlist1"> |
Junio C Hamano | e27cbd2 | 2007-12-21 17:57:33 | [diff] [blame] | 1336 | --src-prefix=<prefix> |
| 1337 | </dt> |
| 1338 | <dd> |
| 1339 | <p> |
| 1340 | Show the given source prefix instead of "a/". |
| 1341 | </p> |
| 1342 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1343 | <dt class="hdlist1"> |
Junio C Hamano | e27cbd2 | 2007-12-21 17:57:33 | [diff] [blame] | 1344 | --dst-prefix=<prefix> |
| 1345 | </dt> |
| 1346 | <dd> |
| 1347 | <p> |
| 1348 | Show the given destination prefix instead of "b/". |
| 1349 | </p> |
| 1350 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1351 | <dt class="hdlist1"> |
Junio C Hamano | e27cbd2 | 2007-12-21 17:57:33 | [diff] [blame] | 1352 | --no-prefix |
| 1353 | </dt> |
| 1354 | <dd> |
| 1355 | <p> |
| 1356 | Do not show any source or destination prefix. |
| 1357 | </p> |
| 1358 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1359 | </dl></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1360 | <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] | 1361 | <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1362 | <div class="dlist"><dl> |
| 1363 | <dt class="hdlist1"> |
Junio C Hamano | bd53dbf | 2009-01-18 18:26:37 | [diff] [blame] | 1364 | -1 --base |
| 1365 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1366 | <dt class="hdlist1"> |
Junio C Hamano | bd53dbf | 2009-01-18 18:26:37 | [diff] [blame] | 1367 | -2 --ours |
| 1368 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1369 | <dt class="hdlist1"> |
Junio C Hamano | bd53dbf | 2009-01-18 18:26:37 | [diff] [blame] | 1370 | -3 --theirs |
| 1371 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1372 | <dt class="hdlist1"> |
Junio C Hamano | bd53dbf | 2009-01-18 18:26:37 | [diff] [blame] | 1373 | -0 |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1374 | </dt> |
| 1375 | <dd> |
| 1376 | <p> |
| 1377 | Diff against the "base" version, "our branch" or "their |
| 1378 | branch" respectively. With these options, diffs for |
| 1379 | merged entries are not shown. |
| 1380 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1381 | <div class="paragraph"><p>The default is to diff against our branch (-2) and the |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1382 | cleanly resolved paths. The option -0 can be given to |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1383 | omit diff output for unmerged entries and just show "Unmerged".</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1384 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1385 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1386 | -c |
| 1387 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1388 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1389 | --cc |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 1390 | </dt> |
| 1391 | <dd> |
| 1392 | <p> |
| 1393 | This compares stage 2 (our branch), stage 3 (their |
| 1394 | branch) and the working tree file and outputs a combined |
| 1395 | diff, similar to the way <em>diff-tree</em> shows a merge |
| 1396 | commit with these flags. |
| 1397 | </p> |
| 1398 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1399 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1400 | -q |
| 1401 | </dt> |
| 1402 | <dd> |
| 1403 | <p> |
Junio C Hamano | 51c2ab0 | 2006-07-09 20:38:54 | [diff] [blame] | 1404 | Remain silent even on nonexistent files |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1405 | </p> |
| 1406 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1407 | </dl></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1408 | </div> |
Junio C Hamano | 543f8d6 | 2009-07-29 08:35:21 | [diff] [blame] | 1409 | <h2 id="_raw_output_format">Raw output format</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1410 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1411 | <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] | 1412 | "git-diff-files" and "git diff --raw" are very similar.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1413 | <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] | 1414 | compared differs:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1415 | <div class="dlist"><dl> |
| 1416 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1417 | git-diff-index <tree-ish> |
| 1418 | </dt> |
| 1419 | <dd> |
| 1420 | <p> |
| 1421 | compares the <tree-ish> and the files on the filesystem. |
| 1422 | </p> |
| 1423 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1424 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1425 | git-diff-index --cached <tree-ish> |
| 1426 | </dt> |
| 1427 | <dd> |
| 1428 | <p> |
| 1429 | compares the <tree-ish> and the index. |
| 1430 | </p> |
| 1431 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1432 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1433 | git-diff-tree [-r] <tree-ish-1> <tree-ish-2> [<pattern>…] |
| 1434 | </dt> |
| 1435 | <dd> |
| 1436 | <p> |
| 1437 | compares the trees named by the two arguments. |
| 1438 | </p> |
| 1439 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1440 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1441 | git-diff-files [<pattern>…] |
| 1442 | </dt> |
| 1443 | <dd> |
| 1444 | <p> |
| 1445 | compares the index and the files on the filesystem. |
| 1446 | </p> |
| 1447 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1448 | </dl></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1449 | <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] | 1450 | what is being compared. After that, all the commands print one output |
| 1451 | line per changed file.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1452 | <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] | 1453 | <div class="listingblock"> |
| 1454 | <div class="content"> |
| 1455 | <pre><tt>in-place edit :100644 100644 bcd1234... 0123456... M file0 |
| 1456 | copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2 |
| 1457 | rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3 |
| 1458 | create :000000 100644 0000000... 1234567... A file4 |
| 1459 | delete :100644 000000 1234567... 0000000... D file5 |
| 1460 | unmerged :000000 000000 0000000... 0000000... U file6</tt></pre> |
| 1461 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1462 | <div class="paragraph"><p>That is, from the left to the right:</p></div> |
| 1463 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1464 | <li> |
| 1465 | <p> |
| 1466 | a colon. |
| 1467 | </p> |
| 1468 | </li> |
| 1469 | <li> |
| 1470 | <p> |
| 1471 | mode for "src"; 000000 if creation or unmerged. |
| 1472 | </p> |
| 1473 | </li> |
| 1474 | <li> |
| 1475 | <p> |
| 1476 | a space. |
| 1477 | </p> |
| 1478 | </li> |
| 1479 | <li> |
| 1480 | <p> |
| 1481 | mode for "dst"; 000000 if deletion or unmerged. |
| 1482 | </p> |
| 1483 | </li> |
| 1484 | <li> |
| 1485 | <p> |
| 1486 | a space. |
| 1487 | </p> |
| 1488 | </li> |
| 1489 | <li> |
| 1490 | <p> |
| 1491 | sha1 for "src"; 0{40} if creation or unmerged. |
| 1492 | </p> |
| 1493 | </li> |
| 1494 | <li> |
| 1495 | <p> |
| 1496 | a space. |
| 1497 | </p> |
| 1498 | </li> |
| 1499 | <li> |
| 1500 | <p> |
| 1501 | sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree". |
| 1502 | </p> |
| 1503 | </li> |
| 1504 | <li> |
| 1505 | <p> |
| 1506 | a space. |
| 1507 | </p> |
| 1508 | </li> |
| 1509 | <li> |
| 1510 | <p> |
| 1511 | status, followed by optional "score" number. |
| 1512 | </p> |
| 1513 | </li> |
| 1514 | <li> |
| 1515 | <p> |
| 1516 | a tab or a NUL when <em>-z</em> option is used. |
| 1517 | </p> |
| 1518 | </li> |
| 1519 | <li> |
| 1520 | <p> |
| 1521 | path for "src" |
| 1522 | </p> |
| 1523 | </li> |
| 1524 | <li> |
| 1525 | <p> |
| 1526 | a tab or a NUL when <em>-z</em> option is used; only exists for C or R. |
| 1527 | </p> |
| 1528 | </li> |
| 1529 | <li> |
| 1530 | <p> |
| 1531 | path for "dst"; only exists for C or R. |
| 1532 | </p> |
| 1533 | </li> |
| 1534 | <li> |
| 1535 | <p> |
| 1536 | an LF or a NUL when <em>-z</em> option is used, to terminate the record. |
| 1537 | </p> |
| 1538 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1539 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1540 | <div class="paragraph"><p>Possible status letters are:</p></div> |
| 1541 | <div class="ulist"><ul> |
Junio C Hamano | aa17c7c | 2008-11-03 04:36:58 | [diff] [blame] | 1542 | <li> |
| 1543 | <p> |
| 1544 | A: addition of a file |
| 1545 | </p> |
| 1546 | </li> |
| 1547 | <li> |
| 1548 | <p> |
| 1549 | C: copy of a file into a new one |
| 1550 | </p> |
| 1551 | </li> |
| 1552 | <li> |
| 1553 | <p> |
| 1554 | D: deletion of a file |
| 1555 | </p> |
| 1556 | </li> |
| 1557 | <li> |
| 1558 | <p> |
| 1559 | M: modification of the contents or mode of a file |
| 1560 | </p> |
| 1561 | </li> |
| 1562 | <li> |
| 1563 | <p> |
| 1564 | R: renaming of a file |
| 1565 | </p> |
| 1566 | </li> |
| 1567 | <li> |
| 1568 | <p> |
| 1569 | T: change in the type of the file |
| 1570 | </p> |
| 1571 | </li> |
| 1572 | <li> |
| 1573 | <p> |
| 1574 | U: file is unmerged (you must complete the merge before it can |
| 1575 | be committed) |
| 1576 | </p> |
| 1577 | </li> |
| 1578 | <li> |
| 1579 | <p> |
| 1580 | X: "unknown" change type (most probably a bug, please report it) |
| 1581 | </p> |
| 1582 | </li> |
| 1583 | </ul></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1584 | <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] | 1585 | percentage of similarity between the source and target of the move or |
| 1586 | copy), and are the only ones to be so.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1587 | <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] | 1588 | and it is out of sync with the index.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1589 | <div class="paragraph"><p>Example:</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1590 | <div class="listingblock"> |
| 1591 | <div class="content"> |
| 1592 | <pre><tt>:100644 100644 5be4a4...... 000000...... M file.c</tt></pre> |
| 1593 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1594 | <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] | 1595 | 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] | 1596 | respectively.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1597 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1598 | <h2 id="_diff_format_for_merges">diff format for merges</h2> |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 1599 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1600 | <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] | 1601 | can take <em>-c</em> or <em>--cc</em> option |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 1602 | to generate diff output also for merge commits. The output differs |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1603 | from the format described above in the following way:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1604 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 1605 | <li> |
| 1606 | <p> |
| 1607 | there is a colon for each parent |
| 1608 | </p> |
| 1609 | </li> |
| 1610 | <li> |
| 1611 | <p> |
| 1612 | there are more "src" modes and "src" sha1 |
| 1613 | </p> |
| 1614 | </li> |
| 1615 | <li> |
| 1616 | <p> |
| 1617 | status is concatenated status characters for each parent |
| 1618 | </p> |
| 1619 | </li> |
| 1620 | <li> |
| 1621 | <p> |
| 1622 | no optional "score" number |
| 1623 | </p> |
| 1624 | </li> |
| 1625 | <li> |
| 1626 | <p> |
| 1627 | single path, only for "dst" |
| 1628 | </p> |
| 1629 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1630 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1631 | <div class="paragraph"><p>Example:</p></div> |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 1632 | <div class="listingblock"> |
| 1633 | <div class="content"> |
| 1634 | <pre><tt>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</tt></pre> |
| 1635 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1636 | <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] | 1637 | all parents.</p></div> |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 1638 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1639 | <h2 id="_generating_patches_with_p">Generating patches with -p</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1640 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1641 | <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] | 1642 | with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or |
| 1643 | "git log" with the "-p" option, they |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1644 | do not produce the output described above; instead they produce a |
| 1645 | patch file. You can customize the creation of such patches via the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1646 | GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1647 | <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] | 1648 | diff format:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1649 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1650 | <li> |
| 1651 | <p> |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 1652 | It is preceded with a "git diff" header that looks like this: |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1653 | </p> |
| 1654 | <div class="literalblock"> |
| 1655 | <div class="content"> |
| 1656 | <pre><tt>diff --git a/file1 b/file2</tt></pre> |
| 1657 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1658 | <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] | 1659 | involved. Especially, even for a creation or a deletion, |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1660 | <tt>/dev/null</tt> is <em>not</em> used in place of the <tt>a/</tt> or <tt>b/</tt> filenames.</p></div> |
| 1661 | <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] | 1662 | 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] | 1663 | the file that rename/copy produces, respectively.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1664 | </li> |
| 1665 | <li> |
| 1666 | <p> |
| 1667 | It is followed by one or more extended header lines: |
| 1668 | </p> |
| 1669 | <div class="literalblock"> |
| 1670 | <div class="content"> |
| 1671 | <pre><tt>old mode <mode> |
| 1672 | new mode <mode> |
| 1673 | deleted file mode <mode> |
| 1674 | new file mode <mode> |
| 1675 | copy from <path> |
| 1676 | copy to <path> |
| 1677 | rename from <path> |
| 1678 | rename to <path> |
| 1679 | similarity index <number> |
| 1680 | dissimilarity index <number> |
| 1681 | index <hash>..<hash> <mode></tt></pre> |
| 1682 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1683 | <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] | 1684 | and file permission bits.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1685 | <div class="paragraph"><p>Path names in extended headers do not include the <tt>a/</tt> and <tt>b/</tt> prefixes.</p></div> |
| 1686 | <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] | 1687 | the dissimilarity index is the percentage of changed lines. It |
| 1688 | is a rounded down integer, followed by a percent sign. The |
| 1689 | similarity index value of 100% is thus reserved for two equal |
| 1690 | files, while 100% dissimilarity means that no line from the old |
| 1691 | file made it into the new one.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1692 | <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] | 1693 | The <mode> is included if the file mode does not change; otherwise, |
| 1694 | separate lines indicate the old and the new mode.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1695 | </li> |
| 1696 | <li> |
| 1697 | <p> |
Junio C Hamano | a053d54 | 2006-10-27 09:29:13 | [diff] [blame] | 1698 | TAB, LF, double quote and backslash characters in pathnames |
| 1699 | are represented as <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt> and <tt>\\</tt>, respectively. |
| 1700 | If there is need for such substitution then the whole |
| 1701 | pathname is put in double quotes. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1702 | </p> |
| 1703 | </li> |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 1704 | <li> |
| 1705 | <p> |
| 1706 | All the <tt>file1</tt> files in the output refer to files before the |
| 1707 | commit, and all the <tt>file2</tt> files refer to files after the commit. |
| 1708 | It is incorrect to apply each change to each file sequentially. For |
| 1709 | example, this patch will swap a and b: |
| 1710 | </p> |
| 1711 | <div class="literalblock"> |
| 1712 | <div class="content"> |
| 1713 | <pre><tt>diff --git a/a b/b |
| 1714 | rename from a |
| 1715 | rename to b |
| 1716 | diff --git a/b b/a |
| 1717 | rename from b |
| 1718 | rename to a</tt></pre> |
| 1719 | </div></div> |
| 1720 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1721 | </ol></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1722 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1723 | <h2 id="_combined_diff_format">combined diff format</h2> |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 1724 | <div class="sectionbody"> |
Junio C Hamano | c5be4cc | 2011-03-09 07:20:43 | [diff] [blame] | 1725 | <div class="paragraph"><p>Any diff-generating command can take the ‘-c` or <tt>--cc</tt> option to |
| 1726 | produce a <em>combined diff</em> when showing a merge. This is the default |
| 1727 | format when showing merges with <a href="git-diff.html">git-diff(1)</a> or |
| 1728 | <a href="git-show.html">git-show(1)</a>. Note also that you can give the `-m’ option to any |
| 1729 | of these commands to force generation of diffs with individual parents |
| 1730 | of a merge.</p></div> |
| 1731 | <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] | 1732 | <div class="listingblock"> |
| 1733 | <div class="content"> |
| 1734 | <pre><tt>diff --combined describe.c |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 1735 | index fabadb8,cc95eb0..4866510 |
| 1736 | --- a/describe.c |
| 1737 | +++ b/describe.c |
| 1738 | @@@ -98,20 -98,12 +98,20 @@@ |
| 1739 | return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1; |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 1740 | } |
| 1741 | |
| 1742 | - static void describe(char *arg) |
| 1743 | -static void describe(struct commit *cmit, int last_one) |
| 1744 | ++static void describe(char *arg, int last_one) |
| 1745 | { |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 1746 | + unsigned char sha1[20]; |
| 1747 | + struct commit *cmit; |
| 1748 | struct commit_list *list; |
| 1749 | static int initialized = 0; |
| 1750 | struct commit_name *n; |
| 1751 | |
| 1752 | + if (get_sha1(arg, sha1) < 0) |
| 1753 | + usage(describe_usage); |
| 1754 | + cmit = lookup_commit_reference(sha1); |
| 1755 | + if (!cmit) |
| 1756 | + usage(describe_usage); |
| 1757 | + |
| 1758 | if (!initialized) { |
| 1759 | initialized = 1; |
| 1760 | for_each_ref(get_name);</tt></pre> |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 1761 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1762 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 1763 | <li> |
| 1764 | <p> |
| 1765 | It is preceded with a "git diff" header, that looks like |
| 1766 | this (when <em>-c</em> option is used): |
| 1767 | </p> |
| 1768 | <div class="literalblock"> |
| 1769 | <div class="content"> |
| 1770 | <pre><tt>diff --combined file</tt></pre> |
| 1771 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1772 | <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] | 1773 | <div class="literalblock"> |
| 1774 | <div class="content"> |
Junio C Hamano | 0868a30 | 2008-07-22 09:20:44 | [diff] [blame] | 1775 | <pre><tt>diff --cc file</tt></pre> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 1776 | </div></div> |
| 1777 | </li> |
| 1778 | <li> |
| 1779 | <p> |
| 1780 | It is followed by one or more extended header lines |
| 1781 | (this example shows a merge with two parents): |
| 1782 | </p> |
| 1783 | <div class="literalblock"> |
| 1784 | <div class="content"> |
| 1785 | <pre><tt>index <hash>,<hash>..<hash> |
| 1786 | mode <mode>,<mode>..<mode> |
| 1787 | new file mode <mode> |
| 1788 | deleted file mode <mode>,<mode></tt></pre> |
| 1789 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1790 | <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] | 1791 | the <mode> is different from the rest. Extended headers with |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 1792 | information about detected contents movement (renames and |
| 1793 | copying detection) are designed to work with diff of two |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1794 | <tree-ish> and are not used by combined diff format.</p></div> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 1795 | </li> |
| 1796 | <li> |
| 1797 | <p> |
| 1798 | It is followed by two-line from-file/to-file header |
| 1799 | </p> |
| 1800 | <div class="literalblock"> |
| 1801 | <div class="content"> |
| 1802 | <pre><tt>--- a/file |
| 1803 | +++ b/file</tt></pre> |
| 1804 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1805 | <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] | 1806 | format, <tt>/dev/null</tt> is used to signal created or deleted |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1807 | files.</p></div> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 1808 | </li> |
| 1809 | <li> |
| 1810 | <p> |
| 1811 | Chunk header format is modified to prevent people from |
| 1812 | accidentally feeding it to <tt>patch -p1</tt>. Combined diff format |
| 1813 | was created for review of merge commit changes, and was not |
| 1814 | meant for apply. The change is similar to the change in the |
| 1815 | extended <em>index</em> header: |
| 1816 | </p> |
| 1817 | <div class="literalblock"> |
| 1818 | <div class="content"> |
| 1819 | <pre><tt>@@@ <from-file-range> <from-file-range> <to-file-range> @@@</tt></pre> |
| 1820 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1821 | <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] | 1822 | header for combined diff format.</p></div> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 1823 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1824 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1825 | <div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two |
| 1826 | 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 |
| 1827 | added to B), or <tt>" "</tt> (space — unchanged) prefix, this format |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 1828 | compares two or more files file1, file2,… with one file X, and |
| 1829 | 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] | 1830 | 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] | 1831 | different from it.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1832 | <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] | 1833 | 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] | 1834 | in the column N means that the line appears in the result, |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 1835 | 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] | 1836 | added, from the point of view of that parent).</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1837 | <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] | 1838 | from both files (hence two <tt>-</tt> removals from both file1 and |
Junio C Hamano | 4604fe5 | 2008-09-19 06:37:10 | [diff] [blame] | 1839 | 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] | 1840 | in either file1 nor file2). Also eight other lines are the same |
| 1841 | 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] | 1842 | <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] | 1843 | merge commit with the merge result (i.e. file1..fileN are the |
| 1844 | parents). When shown by <tt>git diff-files -c</tt>, it compares the |
| 1845 | two unresolved merge parents with the working tree file |
| 1846 | (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] | 1847 | "their version").</p></div> |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 1848 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1849 | <h2 id="_other_diff_formats">other diff formats</h2> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 1850 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1851 | <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] | 1852 | copied files. The <tt>--stat</tt> option adds diffstat(1) graph to the |
| 1853 | output. These options can be combined with other options, such as |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1854 | <tt>-p</tt>, and are meant for human consumption.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1855 | <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] | 1856 | formats the pathnames compactly by combining common prefix and suffix of |
| 1857 | 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] | 1858 | <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] | 1859 | <div class="listingblock"> |
| 1860 | <div class="content"> |
| 1861 | <pre><tt>arch/{i386 => x86}/Makefile | 4 +--</tt></pre> |
| 1862 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1863 | <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] | 1864 | for easier machine consumption. An entry in <tt>--numstat</tt> output looks |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1865 | like this:</p></div> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 1866 | <div class="listingblock"> |
| 1867 | <div class="content"> |
| 1868 | <pre><tt>1 2 README |
| 1869 | 3 1 arch/{i386 => x86}/Makefile</tt></pre> |
| 1870 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1871 | <div class="paragraph"><p>That is, from left to right:</p></div> |
| 1872 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 1873 | <li> |
| 1874 | <p> |
| 1875 | the number of added lines; |
| 1876 | </p> |
| 1877 | </li> |
| 1878 | <li> |
| 1879 | <p> |
| 1880 | a tab; |
| 1881 | </p> |
| 1882 | </li> |
| 1883 | <li> |
| 1884 | <p> |
| 1885 | the number of deleted lines; |
| 1886 | </p> |
| 1887 | </li> |
| 1888 | <li> |
| 1889 | <p> |
| 1890 | a tab; |
| 1891 | </p> |
| 1892 | </li> |
| 1893 | <li> |
| 1894 | <p> |
| 1895 | pathname (possibly with rename/copy information); |
| 1896 | </p> |
| 1897 | </li> |
| 1898 | <li> |
| 1899 | <p> |
| 1900 | a newline. |
| 1901 | </p> |
| 1902 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1903 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1904 | <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] | 1905 | <div class="listingblock"> |
| 1906 | <div class="content"> |
| 1907 | <pre><tt>1 2 README NUL |
| 1908 | 3 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</tt></pre> |
| 1909 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1910 | <div class="paragraph"><p>That is:</p></div> |
| 1911 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 1912 | <li> |
| 1913 | <p> |
| 1914 | the number of added lines; |
| 1915 | </p> |
| 1916 | </li> |
| 1917 | <li> |
| 1918 | <p> |
| 1919 | a tab; |
| 1920 | </p> |
| 1921 | </li> |
| 1922 | <li> |
| 1923 | <p> |
| 1924 | the number of deleted lines; |
| 1925 | </p> |
| 1926 | </li> |
| 1927 | <li> |
| 1928 | <p> |
| 1929 | a tab; |
| 1930 | </p> |
| 1931 | </li> |
| 1932 | <li> |
| 1933 | <p> |
| 1934 | a NUL (only exists if renamed/copied); |
| 1935 | </p> |
| 1936 | </li> |
| 1937 | <li> |
| 1938 | <p> |
| 1939 | pathname in preimage; |
| 1940 | </p> |
| 1941 | </li> |
| 1942 | <li> |
| 1943 | <p> |
| 1944 | a NUL (only exists if renamed/copied); |
| 1945 | </p> |
| 1946 | </li> |
| 1947 | <li> |
| 1948 | <p> |
| 1949 | pathname in postimage (only exists if renamed/copied); |
| 1950 | </p> |
| 1951 | </li> |
| 1952 | <li> |
| 1953 | <p> |
| 1954 | a NUL. |
| 1955 | </p> |
| 1956 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1957 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1958 | <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] | 1959 | scripts that read the output to tell if the current record being read is |
| 1960 | a single-path record or a rename/copy record without reading ahead. |
| 1961 | 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] | 1962 | 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] | 1963 | </div> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1964 | <h2 id="_git">GIT</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1965 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1966 | <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] | 1967 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 1968 | </div> |
| 1969 | <div id="footnotes"><hr /></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1970 | <div id="footer"> |
| 1971 | <div id="footer-text"> |
Junio C Hamano | 02194af | 2011-11-17 20:33:59 | [diff] [blame] | 1972 | Last updated 2011-11-15 13:45:02 PDT |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1973 | </div> |
| 1974 | </div> |
| 1975 | </body> |
| 1976 | </html> |