Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" |
| 2 | "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> |
| 4 | <head> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 5 | <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 6 | <meta name="generator" content="AsciiDoc 8.6.6" /> |
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"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 9 | /* Shared CSS for AsciiDoc xhtml11 and html5 backends */ |
| 10 | |
| 11 | /* Default font. */ |
| 12 | body { |
| 13 | font-family: Georgia,serif; |
| 14 | } |
| 15 | |
| 16 | /* Title font. */ |
| 17 | h1, h2, h3, h4, h5, h6, |
| 18 | div.title, caption.title, |
| 19 | thead, p.table.header, |
| 20 | #toctitle, |
| 21 | #author, #revnumber, #revdate, #revremark, |
| 22 | #footer { |
| 23 | font-family: Arial,Helvetica,sans-serif; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | body { |
| 27 | margin: 1em 5% 1em 5%; |
| 28 | } |
| 29 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 30 | a { |
| 31 | color: blue; |
| 32 | text-decoration: underline; |
| 33 | } |
| 34 | a:visited { |
| 35 | color: fuchsia; |
| 36 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 37 | |
| 38 | em { |
| 39 | font-style: italic; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 40 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | strong { |
| 44 | font-weight: bold; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 45 | color: #083194; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 46 | } |
| 47 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 48 | h1, h2, h3, h4, h5, h6 { |
| 49 | color: #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 50 | margin-top: 1.2em; |
| 51 | margin-bottom: 0.5em; |
| 52 | line-height: 1.3; |
| 53 | } |
| 54 | |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 55 | h1, h2, h3 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 56 | border-bottom: 2px solid silver; |
| 57 | } |
| 58 | h2 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 59 | padding-top: 0.5em; |
| 60 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 61 | h3 { |
| 62 | float: left; |
| 63 | } |
| 64 | h3 + * { |
| 65 | clear: left; |
| 66 | } |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 67 | h5 { |
| 68 | font-size: 1.0em; |
| 69 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 70 | |
| 71 | div.sectionbody { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 72 | margin-left: 0; |
| 73 | } |
| 74 | |
| 75 | hr { |
| 76 | border: 1px solid silver; |
| 77 | } |
| 78 | |
| 79 | p { |
| 80 | margin-top: 0.5em; |
| 81 | margin-bottom: 0.5em; |
| 82 | } |
| 83 | |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 84 | ul, ol, li > p { |
| 85 | margin-top: 0; |
| 86 | } |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 87 | ul > li { color: #aaa; } |
| 88 | ul > li > * { color: black; } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 89 | |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 90 | pre { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 91 | padding: 0; |
| 92 | margin: 0; |
| 93 | } |
| 94 | |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 95 | #author { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 96 | color: #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 97 | font-weight: bold; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 98 | font-size: 1.1em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 99 | } |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 100 | #email { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 101 | } |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 102 | #revnumber, #revdate, #revremark { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 103 | } |
| 104 | |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 105 | #footer { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 106 | font-size: small; |
| 107 | border-top: 2px solid silver; |
| 108 | padding-top: 0.5em; |
| 109 | margin-top: 4.0em; |
| 110 | } |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 111 | #footer-text { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 112 | float: left; |
| 113 | padding-bottom: 0.5em; |
| 114 | } |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 115 | #footer-badges { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 116 | float: right; |
| 117 | padding-bottom: 0.5em; |
| 118 | } |
| 119 | |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 120 | #preamble { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 121 | margin-top: 1.5em; |
| 122 | margin-bottom: 1.5em; |
| 123 | } |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 124 | div.imageblock, div.exampleblock, div.verseblock, |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 125 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 126 | div.admonitionblock { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 127 | margin-top: 1.0em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 128 | margin-bottom: 1.5em; |
| 129 | } |
| 130 | div.admonitionblock { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 131 | margin-top: 2.0em; |
| 132 | margin-bottom: 2.0em; |
| 133 | margin-right: 10%; |
| 134 | color: #606060; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 135 | } |
| 136 | |
| 137 | div.content { /* Block element content. */ |
| 138 | padding: 0; |
| 139 | } |
| 140 | |
| 141 | /* Block element titles. */ |
| 142 | div.title, caption.title { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 143 | color: #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 144 | font-weight: bold; |
| 145 | text-align: left; |
| 146 | margin-top: 1.0em; |
| 147 | margin-bottom: 0.5em; |
| 148 | } |
| 149 | div.title + * { |
| 150 | margin-top: 0; |
| 151 | } |
| 152 | |
| 153 | td div.title:first-child { |
| 154 | margin-top: 0.0em; |
| 155 | } |
| 156 | div.content div.title:first-child { |
| 157 | margin-top: 0.0em; |
| 158 | } |
| 159 | div.content + div.title { |
| 160 | margin-top: 0.0em; |
| 161 | } |
| 162 | |
| 163 | div.sidebarblock > div.content { |
| 164 | background: #ffffee; |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 165 | border: 1px solid #dddddd; |
| 166 | border-left: 4px solid #f0f0f0; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 167 | padding: 0.5em; |
| 168 | } |
| 169 | |
| 170 | div.listingblock > div.content { |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 171 | border: 1px solid #dddddd; |
| 172 | border-left: 5px solid #f0f0f0; |
| 173 | background: #f8f8f8; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 174 | padding: 0.5em; |
| 175 | } |
| 176 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 177 | div.quoteblock, div.verseblock { |
| 178 | padding-left: 1.0em; |
| 179 | margin-left: 1.0em; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 180 | margin-right: 10%; |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 181 | border-left: 5px solid #f0f0f0; |
| 182 | color: #888; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 183 | } |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 184 | |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 185 | div.quoteblock > div.attribution { |
| 186 | padding-top: 0.5em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 187 | text-align: right; |
| 188 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 189 | |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 190 | div.verseblock > pre.content { |
| 191 | font-family: inherit; |
| 192 | font-size: inherit; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 193 | } |
| 194 | div.verseblock > div.attribution { |
| 195 | padding-top: 0.75em; |
| 196 | text-align: left; |
| 197 | } |
| 198 | /* DEPRECATED: Pre version 8.2.7 verse style literal block. */ |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 199 | div.verseblock + div.attribution { |
| 200 | text-align: left; |
| 201 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 202 | |
| 203 | div.admonitionblock .icon { |
| 204 | vertical-align: top; |
| 205 | font-size: 1.1em; |
| 206 | font-weight: bold; |
| 207 | text-decoration: underline; |
| 208 | color: #527bbd; |
| 209 | padding-right: 0.5em; |
| 210 | } |
| 211 | div.admonitionblock td.content { |
| 212 | padding-left: 0.5em; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 213 | border-left: 3px solid #dddddd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 214 | } |
| 215 | |
| 216 | div.exampleblock > div.content { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 217 | border-left: 3px solid #dddddd; |
| 218 | padding-left: 0.5em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 219 | } |
| 220 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 221 | div.imageblock div.content { padding-left: 0; } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 222 | span.image img { border-style: none; } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 223 | a.image:visited { color: white; } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 224 | |
| 225 | dl { |
| 226 | margin-top: 0.8em; |
| 227 | margin-bottom: 0.8em; |
| 228 | } |
| 229 | dt { |
| 230 | margin-top: 0.5em; |
| 231 | margin-bottom: 0; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 232 | font-style: normal; |
| 233 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 234 | } |
| 235 | dd > *:first-child { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 236 | margin-top: 0.1em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 237 | } |
| 238 | |
| 239 | ul, ol { |
| 240 | list-style-position: outside; |
| 241 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 242 | ol.arabic { |
| 243 | list-style-type: decimal; |
| 244 | } |
| 245 | ol.loweralpha { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 246 | list-style-type: lower-alpha; |
| 247 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 248 | ol.upperalpha { |
| 249 | list-style-type: upper-alpha; |
| 250 | } |
| 251 | ol.lowerroman { |
| 252 | list-style-type: lower-roman; |
| 253 | } |
| 254 | ol.upperroman { |
| 255 | list-style-type: upper-roman; |
| 256 | } |
| 257 | |
| 258 | div.compact ul, div.compact ol, |
| 259 | div.compact p, div.compact p, |
| 260 | div.compact div, div.compact div { |
| 261 | margin-top: 0.1em; |
| 262 | margin-bottom: 0.1em; |
| 263 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 264 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 265 | tfoot { |
| 266 | font-weight: bold; |
| 267 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 268 | td > div.verse { |
| 269 | white-space: pre; |
| 270 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 271 | |
| 272 | div.hdlist { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 273 | margin-top: 0.8em; |
| 274 | margin-bottom: 0.8em; |
| 275 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 276 | div.hdlist tr { |
| 277 | padding-bottom: 15px; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 278 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 279 | dt.hdlist1.strong, td.hdlist1.strong { |
| 280 | font-weight: bold; |
| 281 | } |
| 282 | td.hdlist1 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 283 | vertical-align: top; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 284 | font-style: normal; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 285 | padding-right: 0.8em; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 286 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 287 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 288 | td.hdlist2 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 289 | vertical-align: top; |
| 290 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 291 | div.hdlist.compact tr { |
| 292 | margin: 0; |
| 293 | padding-bottom: 0; |
| 294 | } |
| 295 | |
| 296 | .comment { |
| 297 | background: yellow; |
| 298 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 299 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 300 | .footnote, .footnoteref { |
| 301 | font-size: 0.8em; |
| 302 | } |
| 303 | |
| 304 | span.footnote, span.footnoteref { |
| 305 | vertical-align: super; |
| 306 | } |
| 307 | |
| 308 | #footnotes { |
| 309 | margin: 20px 0 20px 0; |
| 310 | padding: 7px 0 0 0; |
| 311 | } |
| 312 | |
| 313 | #footnotes div.footnote { |
| 314 | margin: 0 0 5px 0; |
| 315 | } |
| 316 | |
| 317 | #footnotes hr { |
| 318 | border: none; |
| 319 | border-top: 1px solid silver; |
| 320 | height: 1px; |
| 321 | text-align: left; |
| 322 | margin-left: 0; |
| 323 | width: 20%; |
| 324 | min-width: 100px; |
| 325 | } |
| 326 | |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 327 | div.colist td { |
| 328 | padding-right: 0.5em; |
| 329 | padding-bottom: 0.3em; |
| 330 | vertical-align: top; |
| 331 | } |
| 332 | div.colist td img { |
| 333 | margin-top: 0.3em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 334 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 335 | |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 336 | @media print { |
| 337 | #footer-badges { display: none; } |
| 338 | } |
| 339 | |
| 340 | #toc { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 341 | margin-bottom: 2.5em; |
| 342 | } |
| 343 | |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 344 | #toctitle { |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 345 | color: #527bbd; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 346 | font-size: 1.1em; |
| 347 | font-weight: bold; |
| 348 | margin-top: 1.0em; |
| 349 | margin-bottom: 0.1em; |
| 350 | } |
| 351 | |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 352 | div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 353 | margin-top: 0; |
| 354 | margin-bottom: 0; |
| 355 | } |
| 356 | div.toclevel2 { |
| 357 | margin-left: 2em; |
| 358 | font-size: 0.9em; |
| 359 | } |
| 360 | div.toclevel3 { |
| 361 | margin-left: 4em; |
| 362 | font-size: 0.9em; |
| 363 | } |
| 364 | div.toclevel4 { |
| 365 | margin-left: 6em; |
| 366 | font-size: 0.9em; |
| 367 | } |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 368 | |
| 369 | span.aqua { color: aqua; } |
| 370 | span.black { color: black; } |
| 371 | span.blue { color: blue; } |
| 372 | span.fuchsia { color: fuchsia; } |
| 373 | span.gray { color: gray; } |
| 374 | span.green { color: green; } |
| 375 | span.lime { color: lime; } |
| 376 | span.maroon { color: maroon; } |
| 377 | span.navy { color: navy; } |
| 378 | span.olive { color: olive; } |
| 379 | span.purple { color: purple; } |
| 380 | span.red { color: red; } |
| 381 | span.silver { color: silver; } |
| 382 | span.teal { color: teal; } |
| 383 | span.white { color: white; } |
| 384 | span.yellow { color: yellow; } |
| 385 | |
| 386 | span.aqua-background { background: aqua; } |
| 387 | span.black-background { background: black; } |
| 388 | span.blue-background { background: blue; } |
| 389 | span.fuchsia-background { background: fuchsia; } |
| 390 | span.gray-background { background: gray; } |
| 391 | span.green-background { background: green; } |
| 392 | span.lime-background { background: lime; } |
| 393 | span.maroon-background { background: maroon; } |
| 394 | span.navy-background { background: navy; } |
| 395 | span.olive-background { background: olive; } |
| 396 | span.purple-background { background: purple; } |
| 397 | span.red-background { background: red; } |
| 398 | span.silver-background { background: silver; } |
| 399 | span.teal-background { background: teal; } |
| 400 | span.white-background { background: white; } |
| 401 | span.yellow-background { background: yellow; } |
| 402 | |
| 403 | span.big { font-size: 2em; } |
| 404 | span.small { font-size: 0.6em; } |
| 405 | |
| 406 | span.underline { text-decoration: underline; } |
| 407 | span.overline { text-decoration: overline; } |
| 408 | span.line-through { text-decoration: line-through; } |
| 409 | |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 410 | |
| 411 | /* |
| 412 | * xhtml11 specific |
| 413 | * |
| 414 | * */ |
| 415 | |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 416 | tt { |
| 417 | font-family: monospace; |
| 418 | font-size: inherit; |
| 419 | color: navy; |
| 420 | } |
| 421 | |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 422 | div.tableblock { |
| 423 | margin-top: 1.0em; |
| 424 | margin-bottom: 1.5em; |
| 425 | } |
| 426 | div.tableblock > table { |
| 427 | border: 3px solid #527bbd; |
| 428 | } |
| 429 | thead, p.table.header { |
| 430 | font-weight: bold; |
| 431 | color: #527bbd; |
| 432 | } |
| 433 | p.table { |
| 434 | margin-top: 0; |
| 435 | } |
| 436 | /* Because the table frame attribute is overriden by CSS in most browsers. */ |
| 437 | div.tableblock > table[frame="void"] { |
| 438 | border-style: none; |
| 439 | } |
| 440 | div.tableblock > table[frame="hsides"] { |
| 441 | border-left-style: none; |
| 442 | border-right-style: none; |
| 443 | } |
| 444 | div.tableblock > table[frame="vsides"] { |
| 445 | border-top-style: none; |
| 446 | border-bottom-style: none; |
| 447 | } |
| 448 | |
| 449 | |
| 450 | /* |
| 451 | * html5 specific |
| 452 | * |
| 453 | * */ |
| 454 | |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 455 | .monospaced { |
| 456 | font-family: monospace; |
| 457 | font-size: inherit; |
| 458 | color: navy; |
| 459 | } |
| 460 | |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 461 | table.tableblock { |
| 462 | margin-top: 1.0em; |
| 463 | margin-bottom: 1.5em; |
| 464 | } |
| 465 | thead, p.tableblock.header { |
| 466 | font-weight: bold; |
| 467 | color: #527bbd; |
| 468 | } |
| 469 | p.tableblock { |
| 470 | margin-top: 0; |
| 471 | } |
| 472 | table.tableblock { |
| 473 | border-width: 3px; |
| 474 | border-spacing: 0px; |
| 475 | border-style: solid; |
| 476 | border-color: #527bbd; |
| 477 | border-collapse: collapse; |
| 478 | } |
| 479 | th.tableblock, td.tableblock { |
| 480 | border-width: 1px; |
| 481 | padding: 4px; |
| 482 | border-style: solid; |
| 483 | border-color: #527bbd; |
| 484 | } |
| 485 | |
| 486 | table.tableblock.frame-topbot { |
| 487 | border-left-style: hidden; |
| 488 | border-right-style: hidden; |
| 489 | } |
| 490 | table.tableblock.frame-sides { |
| 491 | border-top-style: hidden; |
| 492 | border-bottom-style: hidden; |
| 493 | } |
| 494 | table.tableblock.frame-none { |
| 495 | border-style: hidden; |
| 496 | } |
| 497 | |
| 498 | th.tableblock.halign-left, td.tableblock.halign-left { |
| 499 | text-align: left; |
| 500 | } |
| 501 | th.tableblock.halign-center, td.tableblock.halign-center { |
| 502 | text-align: center; |
| 503 | } |
| 504 | th.tableblock.halign-right, td.tableblock.halign-right { |
| 505 | text-align: right; |
| 506 | } |
| 507 | |
| 508 | th.tableblock.valign-top, td.tableblock.valign-top { |
| 509 | vertical-align: top; |
| 510 | } |
| 511 | th.tableblock.valign-middle, td.tableblock.valign-middle { |
| 512 | vertical-align: middle; |
| 513 | } |
| 514 | th.tableblock.valign-bottom, td.tableblock.valign-bottom { |
| 515 | vertical-align: bottom; |
| 516 | } |
| 517 | |
| 518 | |
| 519 | /* |
| 520 | * manpage specific |
| 521 | * |
| 522 | * */ |
| 523 | |
| 524 | body.manpage h1 { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 525 | padding-top: 0.5em; |
| 526 | padding-bottom: 0.5em; |
| 527 | border-top: 2px solid silver; |
| 528 | border-bottom: 2px solid silver; |
| 529 | } |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 530 | body.manpage h2 { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 531 | border-style: none; |
| 532 | } |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 533 | body.manpage div.sectionbody { |
| 534 | margin-left: 3em; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 535 | } |
| 536 | |
| 537 | @media print { |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 538 | body.manpage div#toc { display: none; } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 539 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 540 | </style> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 541 | <script type="text/javascript"> |
| 542 | /*<![CDATA[*/ |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 543 | var asciidoc = { // Namespace. |
| 544 | |
| 545 | ///////////////////////////////////////////////////////////////////// |
| 546 | // Table Of Contents generator |
| 547 | ///////////////////////////////////////////////////////////////////// |
| 548 | |
| 549 | /* Author: Mihai Bazon, September 2002 |
| 550 | * http://students.infoiasi.ro/~mishoo |
| 551 | * |
| 552 | * Table Of Content generator |
| 553 | * Version: 0.4 |
| 554 | * |
| 555 | * Feel free to use this script under the terms of the GNU General Public |
| 556 | * License, as long as you do not remove or alter this notice. |
| 557 | */ |
| 558 | |
| 559 | /* modified by Troy D. Hanson, September 2006. License: GPL */ |
| 560 | /* modified by Stuart Rackham, 2006, 2009. License: GPL */ |
| 561 | |
| 562 | // toclevels = 1..4. |
| 563 | toc: function (toclevels) { |
| 564 | |
| 565 | function getText(el) { |
| 566 | var text = ""; |
| 567 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 568 | if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants. |
| 569 | text += i.data; |
| 570 | else if (i.firstChild != null) |
| 571 | text += getText(i); |
| 572 | } |
| 573 | return text; |
| 574 | } |
| 575 | |
| 576 | function TocEntry(el, text, toclevel) { |
| 577 | this.element = el; |
| 578 | this.text = text; |
| 579 | this.toclevel = toclevel; |
| 580 | } |
| 581 | |
| 582 | function tocEntries(el, toclevels) { |
| 583 | var result = new Array; |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 584 | var re = new RegExp('[hH]([2-'+(toclevels+1)+'])'); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 585 | // Function that scans the DOM tree for header elements (the DOM2 |
| 586 | // nodeIterator API would be a better technique but not supported by all |
| 587 | // browsers). |
| 588 | var iterate = function (el) { |
| 589 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 590 | if (i.nodeType == 1 /* Node.ELEMENT_NODE */) { |
| 591 | var mo = re.exec(i.tagName); |
| 592 | if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") { |
| 593 | result[result.length] = new TocEntry(i, getText(i), mo[1]-1); |
| 594 | } |
| 595 | iterate(i); |
| 596 | } |
| 597 | } |
| 598 | } |
| 599 | iterate(el); |
| 600 | return result; |
| 601 | } |
| 602 | |
| 603 | var toc = document.getElementById("toc"); |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 604 | if (!toc) { |
| 605 | return; |
| 606 | } |
| 607 | |
| 608 | // Delete existing TOC entries in case we're reloading the TOC. |
| 609 | var tocEntriesToRemove = []; |
| 610 | var i; |
| 611 | for (i = 0; i < toc.childNodes.length; i++) { |
| 612 | var entry = toc.childNodes[i]; |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 613 | if (entry.nodeName == 'div' |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 614 | && entry.getAttribute("class") |
| 615 | && entry.getAttribute("class").match(/^toclevel/)) |
| 616 | tocEntriesToRemove.push(entry); |
| 617 | } |
| 618 | for (i = 0; i < tocEntriesToRemove.length; i++) { |
| 619 | toc.removeChild(tocEntriesToRemove[i]); |
| 620 | } |
| 621 | |
| 622 | // Rebuild TOC entries. |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 623 | var entries = tocEntries(document.getElementById("content"), toclevels); |
| 624 | for (var i = 0; i < entries.length; ++i) { |
| 625 | var entry = entries[i]; |
| 626 | if (entry.element.id == "") |
| 627 | entry.element.id = "_toc_" + i; |
| 628 | var a = document.createElement("a"); |
| 629 | a.href = "#" + entry.element.id; |
| 630 | a.appendChild(document.createTextNode(entry.text)); |
| 631 | var div = document.createElement("div"); |
| 632 | div.appendChild(a); |
| 633 | div.className = "toclevel" + entry.toclevel; |
| 634 | toc.appendChild(div); |
| 635 | } |
| 636 | if (entries.length == 0) |
| 637 | toc.parentNode.removeChild(toc); |
| 638 | }, |
| 639 | |
| 640 | |
| 641 | ///////////////////////////////////////////////////////////////////// |
| 642 | // Footnotes generator |
| 643 | ///////////////////////////////////////////////////////////////////// |
| 644 | |
| 645 | /* Based on footnote generation code from: |
| 646 | * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html |
| 647 | */ |
| 648 | |
| 649 | footnotes: function () { |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 650 | // Delete existing footnote entries in case we're reloading the footnodes. |
| 651 | var i; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 652 | var noteholder = document.getElementById("footnotes"); |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 653 | if (!noteholder) { |
| 654 | return; |
| 655 | } |
| 656 | var entriesToRemove = []; |
| 657 | for (i = 0; i < noteholder.childNodes.length; i++) { |
| 658 | var entry = noteholder.childNodes[i]; |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 659 | if (entry.nodeName == 'div' && entry.getAttribute("class") == "footnote") |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 660 | entriesToRemove.push(entry); |
| 661 | } |
| 662 | for (i = 0; i < entriesToRemove.length; i++) { |
| 663 | noteholder.removeChild(entriesToRemove[i]); |
| 664 | } |
| 665 | |
| 666 | // Rebuild footnote entries. |
| 667 | var cont = document.getElementById("content"); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 668 | var spans = cont.getElementsByTagName("span"); |
| 669 | var refs = {}; |
| 670 | var n = 0; |
| 671 | for (i=0; i<spans.length; i++) { |
| 672 | if (spans[i].className == "footnote") { |
| 673 | n++; |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 674 | var note = spans[i].getAttribute("data-note"); |
| 675 | if (!note) { |
| 676 | // Use [\s\S] in place of . so multi-line matches work. |
| 677 | // Because JavaScript has no s (dotall) regex flag. |
| 678 | note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1]; |
| 679 | spans[i].innerHTML = |
| 680 | "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n + |
| 681 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 682 | spans[i].setAttribute("data-note", note); |
| 683 | } |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 684 | noteholder.innerHTML += |
| 685 | "<div class='footnote' id='_footnote_" + n + "'>" + |
| 686 | "<a href='#_footnoteref_" + n + "' title='Return to text'>" + |
| 687 | n + "</a>. " + note + "</div>"; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 688 | var id =spans[i].getAttribute("id"); |
| 689 | if (id != null) refs["#"+id] = n; |
| 690 | } |
| 691 | } |
| 692 | if (n == 0) |
| 693 | noteholder.parentNode.removeChild(noteholder); |
| 694 | else { |
| 695 | // Process footnoterefs. |
| 696 | for (i=0; i<spans.length; i++) { |
| 697 | if (spans[i].className == "footnoteref") { |
| 698 | var href = spans[i].getElementsByTagName("a")[0].getAttribute("href"); |
| 699 | href = href.match(/#.*/)[0]; // Because IE return full URL. |
| 700 | n = refs[href]; |
| 701 | spans[i].innerHTML = |
| 702 | "[<a href='#_footnote_" + n + |
| 703 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 704 | } |
| 705 | } |
| 706 | } |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 707 | }, |
| 708 | |
| 709 | install: function(toclevels) { |
| 710 | var timerId; |
| 711 | |
| 712 | function reinstall() { |
| 713 | asciidoc.footnotes(); |
| 714 | if (toclevels) { |
| 715 | asciidoc.toc(toclevels); |
| 716 | } |
| 717 | } |
| 718 | |
| 719 | function reinstallAndRemoveTimer() { |
| 720 | clearInterval(timerId); |
| 721 | reinstall(); |
| 722 | } |
| 723 | |
| 724 | timerId = setInterval(reinstall, 500); |
| 725 | if (document.addEventListener) |
| 726 | document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false); |
| 727 | else |
| 728 | window.onload = reinstallAndRemoveTimer; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 729 | } |
| 730 | |
| 731 | } |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 732 | asciidoc.install(); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 733 | /*]]>*/ |
| 734 | </script> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 735 | </head> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 736 | <body class="manpage"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 737 | <div id="header"> |
| 738 | <h1> |
| 739 | git-diff-files(1) Manual Page |
| 740 | </h1> |
| 741 | <h2>NAME</h2> |
| 742 | <div class="sectionbody"> |
| 743 | <p>git-diff-files - |
| 744 | Compares files in the working tree and the index |
| 745 | </p> |
| 746 | </div> |
| 747 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 748 | <div id="content"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 749 | <div class="sect1"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 750 | <h2 id="_synopsis">SYNOPSIS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 751 | <div class="sectionbody"> |
Junio C Hamano | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 752 | <div class="verseblock"> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 753 | <pre class="content"><em>git diff-files</em> [-q] [-0|-1|-2|-3|-c|--cc] [<common diff options>] [<path>…]</pre> |
| 754 | <div class="attribution"> |
Junio C Hamano | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 755 | </div></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 756 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 757 | </div> |
| 758 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 759 | <h2 id="_description">DESCRIPTION</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 760 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 761 | <div class="paragraph"><p>Compares the files in the working tree and the index. When paths |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 762 | are specified, compares only those named paths. Otherwise all |
| 763 | entries in the index are compared. The output format is the |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 764 | 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] | 765 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 766 | </div> |
| 767 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 768 | <h2 id="_options">OPTIONS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 769 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 770 | <div class="dlist"><dl> |
| 771 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 772 | -p |
| 773 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 774 | <dt class="hdlist1"> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 775 | -u |
| 776 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 777 | <dt class="hdlist1"> |
Junio C Hamano | e97d577 | 2010-05-19 08:13:58 | [diff] [blame] | 778 | --patch |
| 779 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 780 | <dd> |
| 781 | <p> |
Junio C Hamano | ff97979 | 2007-11-16 10:11:30 | [diff] [blame] | 782 | Generate patch (see section on generating patches). |
| 783 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 784 | </p> |
| 785 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 786 | <dt class="hdlist1"> |
Junio C Hamano | 58f587a | 2013-07-22 19:20:59 | [diff] [blame] | 787 | -s |
| 788 | </dt> |
| 789 | <dt class="hdlist1"> |
| 790 | --no-patch |
| 791 | </dt> |
| 792 | <dd> |
| 793 | <p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 794 | Suppress diff output. Useful for commands like <tt>git show</tt> that |
| 795 | show the patch by default, or to cancel the effect of <tt>--patch</tt>. |
Junio C Hamano | 58f587a | 2013-07-22 19:20:59 | [diff] [blame] | 796 | </p> |
| 797 | </dd> |
| 798 | <dt class="hdlist1"> |
Junio C Hamano | 6936156 | 2007-07-26 02:14:34 | [diff] [blame] | 799 | -U<n> |
| 800 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 801 | <dt class="hdlist1"> |
Junio C Hamano | 6936156 | 2007-07-26 02:14:34 | [diff] [blame] | 802 | --unified=<n> |
| 803 | </dt> |
| 804 | <dd> |
| 805 | <p> |
| 806 | Generate diffs with <n> lines of context instead of |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 807 | the usual three. |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 808 | Implies <tt>-p</tt>. |
Junio C Hamano | 6936156 | 2007-07-26 02:14:34 | [diff] [blame] | 809 | </p> |
| 810 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 811 | <dt class="hdlist1"> |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 812 | --raw |
| 813 | </dt> |
| 814 | <dd> |
| 815 | <p> |
| 816 | Generate the raw format. |
Junio C Hamano | ff97979 | 2007-11-16 10:11:30 | [diff] [blame] | 817 | This is the default. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 818 | </p> |
| 819 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 820 | <dt class="hdlist1"> |
Junio C Hamano | 54559c8 | 2006-04-13 07:45:12 | [diff] [blame] | 821 | --patch-with-raw |
| 822 | </dt> |
| 823 | <dd> |
| 824 | <p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 825 | Synonym for <tt>-p --raw</tt>. |
Junio C Hamano | 54559c8 | 2006-04-13 07:45:12 | [diff] [blame] | 826 | </p> |
| 827 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 828 | <dt class="hdlist1"> |
Junio C Hamano | 5a73f30 | 2011-10-14 05:58:34 | [diff] [blame] | 829 | --minimal |
| 830 | </dt> |
| 831 | <dd> |
| 832 | <p> |
| 833 | Spend extra time to make sure the smallest possible |
| 834 | diff is produced. |
| 835 | </p> |
| 836 | </dd> |
| 837 | <dt class="hdlist1"> |
Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 838 | --patience |
| 839 | </dt> |
| 840 | <dd> |
| 841 | <p> |
| 842 | Generate a diff using the "patience diff" algorithm. |
| 843 | </p> |
| 844 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 845 | <dt class="hdlist1"> |
Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 846 | --histogram |
| 847 | </dt> |
| 848 | <dd> |
| 849 | <p> |
| 850 | Generate a diff using the "histogram diff" algorithm. |
| 851 | </p> |
| 852 | </dd> |
| 853 | <dt class="hdlist1"> |
Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 854 | --diff-algorithm={patience|minimal|histogram|myers} |
| 855 | </dt> |
| 856 | <dd> |
| 857 | <p> |
| 858 | Choose a diff algorithm. The variants are as follows: |
| 859 | </p> |
| 860 | <div class="openblock"> |
| 861 | <div class="content"> |
| 862 | <div class="dlist"><dl> |
| 863 | <dt class="hdlist1"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 864 | <tt>default</tt>, <tt>myers</tt> |
Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 865 | </dt> |
| 866 | <dd> |
| 867 | <p> |
| 868 | The basic greedy diff algorithm. Currently, this is the default. |
| 869 | </p> |
| 870 | </dd> |
| 871 | <dt class="hdlist1"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 872 | <tt>minimal</tt> |
Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 873 | </dt> |
| 874 | <dd> |
| 875 | <p> |
| 876 | Spend extra time to make sure the smallest possible diff is |
| 877 | produced. |
| 878 | </p> |
| 879 | </dd> |
| 880 | <dt class="hdlist1"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 881 | <tt>patience</tt> |
Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 882 | </dt> |
| 883 | <dd> |
| 884 | <p> |
| 885 | Use "patience diff" algorithm when generating patches. |
| 886 | </p> |
| 887 | </dd> |
| 888 | <dt class="hdlist1"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 889 | <tt>histogram</tt> |
Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 890 | </dt> |
| 891 | <dd> |
| 892 | <p> |
| 893 | This algorithm extends the patience algorithm to "support |
| 894 | low-occurrence common elements". |
| 895 | </p> |
| 896 | </dd> |
| 897 | </dl></div> |
| 898 | </div></div> |
| 899 | <div class="paragraph"><p>For instance, if you configured diff.algorithm variable to a |
| 900 | non-default value and want to use the default one, then you |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 901 | have to use <tt>--diff-algorithm=default</tt> option.</p></div> |
Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 902 | </dd> |
| 903 | <dt class="hdlist1"> |
Junio C Hamano | 4c4b012 | 2011-06-30 01:19:32 | [diff] [blame] | 904 | --stat[=<width>[,<name-width>[,<count>]]] |
Junio C Hamano | ba7c8d8 | 2006-04-15 06:17:42 | [diff] [blame] | 905 | </dt> |
| 906 | <dd> |
| 907 | <p> |
Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 908 | Generate a diffstat. By default, as much space as necessary |
| 909 | will be used for the filename part, and the rest for the graph |
| 910 | part. Maximum width defaults to terminal width, or 80 columns |
Junio C Hamano | 7f2b3cb | 2012-06-22 22:42:39 | [diff] [blame] | 911 | if not connected to a terminal, and can be overridden by |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 912 | <tt><width></tt>. The width of the filename part can be limited by |
| 913 | giving another width <tt><name-width></tt> after a comma. The width |
Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 914 | of the graph part can be limited by using |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 915 | <tt>--stat-graph-width=<width></tt> (affects all commands generating |
| 916 | a stat graph) or by setting <tt>diff.statGraphWidth=<width></tt> |
| 917 | (does not affect <tt>git format-patch</tt>). |
| 918 | By giving a third parameter <tt><count></tt>, you can limit the |
| 919 | output to the first <tt><count></tt> lines, followed by <tt>...</tt> if |
Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 920 | there are more. |
Junio C Hamano | ba7c8d8 | 2006-04-15 06:17:42 | [diff] [blame] | 921 | </p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 922 | <div class="paragraph"><p>These parameters can also be set individually with <tt>--stat-width=<width></tt>, |
| 923 | <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] | 924 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 925 | <dt class="hdlist1"> |
Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 926 | --numstat |
| 927 | </dt> |
| 928 | <dd> |
| 929 | <p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 930 | Similar to <tt>--stat</tt>, but shows number of added and |
Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 931 | deleted lines in decimal notation and pathname without |
Junio C Hamano | d793de5 | 2006-12-26 09:11:43 | [diff] [blame] | 932 | abbreviation, to make it more machine friendly. For |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 933 | binary files, outputs two <tt>-</tt> instead of saying |
| 934 | <tt>0 0</tt>. |
Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 935 | </p> |
| 936 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 937 | <dt class="hdlist1"> |
Junio C Hamano | 7d23f5e | 2006-12-16 07:44:04 | [diff] [blame] | 938 | --shortstat |
| 939 | </dt> |
| 940 | <dd> |
| 941 | <p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 942 | 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] | 943 | number of modified files, as well as number of added and deleted |
| 944 | lines. |
| 945 | </p> |
| 946 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 947 | <dt class="hdlist1"> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 948 | --dirstat[=<param1,param2,…>] |
Junio C Hamano | 6a45be9 | 2008-04-22 08:19:03 | [diff] [blame] | 949 | </dt> |
| 950 | <dd> |
| 951 | <p> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 952 | Output the distribution of relative amount of changes for each |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 953 | sub-directory. The behavior of <tt>--dirstat</tt> can be customized by |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 954 | passing it a comma separated list of parameters. |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 955 | The defaults are controlled by the <tt>diff.dirstat</tt> configuration |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 956 | variable (see <a href="git-config.html">git-config(1)</a>). |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 957 | The following parameters are available: |
Junio C Hamano | 6a45be9 | 2008-04-22 08:19:03 | [diff] [blame] | 958 | </p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 959 | <div class="openblock"> |
| 960 | <div class="content"> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 961 | <div class="dlist"><dl> |
| 962 | <dt class="hdlist1"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 963 | <tt>changes</tt> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 964 | </dt> |
| 965 | <dd> |
| 966 | <p> |
| 967 | Compute the dirstat numbers by counting the lines that have been |
| 968 | removed from the source, or added to the destination. This ignores |
| 969 | the amount of pure code movements within a file. In other words, |
| 970 | rearranging lines in a file is not counted as much as other changes. |
| 971 | This is the default behavior when no parameter is given. |
| 972 | </p> |
Junio C Hamano | 6a45be9 | 2008-04-22 08:19:03 | [diff] [blame] | 973 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 974 | <dt class="hdlist1"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 975 | <tt>lines</tt> |
Junio C Hamano | a476efa | 2008-10-10 15:31:42 | [diff] [blame] | 976 | </dt> |
| 977 | <dd> |
| 978 | <p> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 979 | Compute the dirstat numbers by doing the regular line-based diff |
| 980 | analysis, and summing the removed/added line counts. (For binary |
| 981 | files, count 64-byte chunks instead, since binary files have no |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 982 | natural concept of lines). This is a more expensive <tt>--dirstat</tt> |
| 983 | behavior than the <tt>changes</tt> behavior, but it does count rearranged |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 984 | lines within a file as much as other changes. The resulting output |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 985 | 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] | 986 | </p> |
| 987 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 988 | <dt class="hdlist1"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 989 | <tt>files</tt> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 990 | </dt> |
| 991 | <dd> |
| 992 | <p> |
| 993 | Compute the dirstat numbers by counting the number of files changed. |
| 994 | Each changed file counts equally in the dirstat analysis. This is |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 995 | the computationally cheapest <tt>--dirstat</tt> behavior, since it does |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 996 | not have to look at the file contents at all. |
| 997 | </p> |
| 998 | </dd> |
| 999 | <dt class="hdlist1"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1000 | <tt>cumulative</tt> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1001 | </dt> |
| 1002 | <dd> |
| 1003 | <p> |
| 1004 | Count changes in a child directory for the parent directory as well. |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1005 | Note that when using <tt>cumulative</tt>, the sum of the percentages |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1006 | reported may exceed 100%. The default (non-cumulative) behavior can |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1007 | be specified with the <tt>noncumulative</tt> parameter. |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1008 | </p> |
| 1009 | </dd> |
| 1010 | <dt class="hdlist1"> |
| 1011 | <limit> |
| 1012 | </dt> |
| 1013 | <dd> |
| 1014 | <p> |
| 1015 | An integer parameter specifies a cut-off percent (3% by default). |
| 1016 | Directories contributing less than this percentage of the changes |
| 1017 | are not shown in the output. |
| 1018 | </p> |
| 1019 | </dd> |
| 1020 | </dl></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1021 | </div></div> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1022 | <div class="paragraph"><p>Example: The following will count changed files, while ignoring |
| 1023 | directories with less than 10% of the total amount of changed files, |
| 1024 | and accumulating child directory counts in the parent directories: |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1025 | <tt>--dirstat=files,10,cumulative</tt>.</p></div> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 1026 | </dd> |
| 1027 | <dt class="hdlist1"> |
Junio C Hamano | 6959c6c | 2006-05-17 10:34:11 | [diff] [blame] | 1028 | --summary |
| 1029 | </dt> |
| 1030 | <dd> |
| 1031 | <p> |
| 1032 | Output a condensed summary of extended header information |
| 1033 | such as creations, renames and mode changes. |
| 1034 | </p> |
| 1035 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1036 | <dt class="hdlist1"> |
Junio C Hamano | d1308c9 | 2006-04-16 11:01:09 | [diff] [blame] | 1037 | --patch-with-stat |
| 1038 | </dt> |
| 1039 | <dd> |
| 1040 | <p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1041 | Synonym for <tt>-p --stat</tt>. |
Junio C Hamano | d1308c9 | 2006-04-16 11:01:09 | [diff] [blame] | 1042 | </p> |
| 1043 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1044 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1045 | -z |
| 1046 | </dt> |
| 1047 | <dd> |
| 1048 | <p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1049 | When <tt>--raw</tt>, <tt>--numstat</tt>, <tt>--name-only</tt> or <tt>--name-status</tt> has been |
Junio C Hamano | 0c053e8 | 2010-04-19 06:46:34 | [diff] [blame] | 1050 | given, do not munge pathnames and use NULs as output field terminators. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1051 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1052 | <div class="paragraph"><p>Without this option, each pathname output will have TAB, LF, double quotes, |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1053 | and backslash characters replaced with <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt>, and <tt>\\</tt>, |
Junio C Hamano | 5706e0b | 2009-11-24 10:54:16 | [diff] [blame] | 1054 | respectively, and the pathname will be enclosed in double quotes if |
| 1055 | any of those replacements occurred.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1056 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1057 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1058 | --name-only |
| 1059 | </dt> |
| 1060 | <dd> |
| 1061 | <p> |
| 1062 | Show only names of changed files. |
| 1063 | </p> |
| 1064 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1065 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1066 | --name-status |
| 1067 | </dt> |
| 1068 | <dd> |
| 1069 | <p> |
Junio C Hamano | a9aee78 | 2008-04-23 16:09:20 | [diff] [blame] | 1070 | Show only names and status of changed files. See the description |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1071 | 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] | 1072 | </p> |
| 1073 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1074 | <dt class="hdlist1"> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 1075 | --submodule[=<format>] |
| 1076 | </dt> |
| 1077 | <dd> |
| 1078 | <p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1079 | Specify how differences in submodules are shown. When <tt>--submodule</tt> |
| 1080 | or <tt>--submodule=log</tt> is given, the <em>log</em> format is used. This format lists |
| 1081 | the commits in the range like <a href="git-submodule.html">git-submodule(1)</a> <tt>summary</tt> does. |
| 1082 | Omitting the <tt>--submodule</tt> option or specifying <tt>--submodule=short</tt>, |
Junio C Hamano | e768cc1 | 2012-03-16 05:43:05 | [diff] [blame] | 1083 | uses the <em>short</em> format. This format just shows the names of the commits |
Junio C Hamano | b4e58b1 | 2012-11-26 03:13:06 | [diff] [blame] | 1084 | at the beginning and end of the range. Can be tweaked via the |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1085 | <tt>diff.submodule</tt> configuration variable. |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 1086 | </p> |
| 1087 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1088 | <dt class="hdlist1"> |
Junio C Hamano | 4aa0bcc | 2010-03-03 05:13:12 | [diff] [blame] | 1089 | --color[=<when>] |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 1090 | </dt> |
| 1091 | <dd> |
| 1092 | <p> |
| 1093 | Show colored diff. |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1094 | <tt>--color</tt> (i.e. without <em>=<when></em>) is the same as <tt>--color=always</tt>. |
| 1095 | <em><when></em> can be one of <tt>always</tt>, <tt>never</tt>, or <tt>auto</tt>. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 1096 | </p> |
| 1097 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1098 | <dt class="hdlist1"> |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 1099 | --no-color |
| 1100 | </dt> |
| 1101 | <dd> |
| 1102 | <p> |
Junio C Hamano | 5f2627d | 2011-05-06 20:23:48 | [diff] [blame] | 1103 | Turn off colored diff. |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1104 | It is the same as <tt>--color=never</tt>. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 1105 | </p> |
| 1106 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1107 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1108 | --word-diff[=<mode>] |
Junio C Hamano | 85e45fa | 2006-08-13 07:47:41 | [diff] [blame] | 1109 | </dt> |
| 1110 | <dd> |
| 1111 | <p> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1112 | Show a word diff, using the <mode> to delimit changed words. |
| 1113 | By default, words are delimited by whitespace; see |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1114 | <tt>--word-diff-regex</tt> below. The <mode> defaults to <em>plain</em>, and |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1115 | must be one of: |
Junio C Hamano | 85e45fa | 2006-08-13 07:47:41 | [diff] [blame] | 1116 | </p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1117 | <div class="openblock"> |
| 1118 | <div class="content"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1119 | <div class="dlist"><dl> |
| 1120 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1121 | color |
| 1122 | </dt> |
| 1123 | <dd> |
| 1124 | <p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1125 | Highlight changed words using only colors. Implies <tt>--color</tt>. |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1126 | </p> |
| 1127 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1128 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1129 | plain |
| 1130 | </dt> |
| 1131 | <dd> |
| 1132 | <p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1133 | Show words as <tt>[-removed-]</tt> and <tt>{+added+}</tt>. Makes no |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1134 | attempts to escape the delimiters if they appear in the input, |
| 1135 | so the output may be ambiguous. |
| 1136 | </p> |
| 1137 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1138 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1139 | porcelain |
| 1140 | </dt> |
| 1141 | <dd> |
| 1142 | <p> |
| 1143 | Use a special line-based format intended for script |
| 1144 | consumption. Added/removed/unchanged runs are printed in the |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1145 | usual unified diff format, starting with a <tt>+</tt>/<tt>-</tt>/` ` |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1146 | character at the beginning of the line and extending to the |
| 1147 | end of the line. Newlines in the input are represented by a |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1148 | tilde <tt>~</tt> on a line of its own. |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1149 | </p> |
| 1150 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1151 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1152 | none |
| 1153 | </dt> |
| 1154 | <dd> |
| 1155 | <p> |
| 1156 | Disable word diff again. |
| 1157 | </p> |
| 1158 | </dd> |
| 1159 | </dl></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1160 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1161 | <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] | 1162 | highlight the changed parts in all modes if enabled.</p></div> |
| 1163 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1164 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1165 | --word-diff-regex=<regex> |
| 1166 | </dt> |
| 1167 | <dd> |
| 1168 | <p> |
| 1169 | Use <regex> to decide what a word is, instead of considering |
| 1170 | runs of non-whitespace to be a word. Also implies |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1171 | <tt>--word-diff</tt> unless it was already enabled. |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1172 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1173 | <div class="paragraph"><p>Every non-overlapping match of the |
Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 1174 | <regex> is considered a word. Anything between these matches is |
| 1175 | considered whitespace and ignored(!) for the purposes of finding |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1176 | differences. You may want to append <tt>|[^[:space:]]</tt> to your regular |
Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 1177 | expression to make sure that it matches all non-whitespace characters. |
| 1178 | A match that contains a newline is silently truncated(!) at the |
| 1179 | newline.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1180 | <div class="paragraph"><p>The regex can also be set via a diff driver or configuration option, see |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1181 | <a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly |
Junio C Hamano | 20d47e3 | 2009-01-26 06:36:02 | [diff] [blame] | 1182 | overrides any diff driver or configuration setting. Diff drivers |
| 1183 | override configuration settings.</p></div> |
Junio C Hamano | 85e45fa | 2006-08-13 07:47:41 | [diff] [blame] | 1184 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1185 | <dt class="hdlist1"> |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1186 | --color-words[=<regex>] |
| 1187 | </dt> |
| 1188 | <dd> |
| 1189 | <p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1190 | Equivalent to <tt>--word-diff=color</tt> plus (if a regex was |
| 1191 | specified) <tt>--word-diff-regex=<regex></tt>. |
Junio C Hamano | cc7636a | 2010-05-21 14:57:53 | [diff] [blame] | 1192 | </p> |
| 1193 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1194 | <dt class="hdlist1"> |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 1195 | --no-renames |
| 1196 | </dt> |
| 1197 | <dd> |
| 1198 | <p> |
| 1199 | Turn off rename detection, even when the configuration |
| 1200 | file gives the default to do so. |
| 1201 | </p> |
| 1202 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1203 | <dt class="hdlist1"> |
Junio C Hamano | a890c4f | 2007-01-28 10:29:21 | [diff] [blame] | 1204 | --check |
| 1205 | </dt> |
| 1206 | <dd> |
| 1207 | <p> |
Junio C Hamano | 6005bfa | 2011-06-23 00:51:22 | [diff] [blame] | 1208 | Warn if changes introduce whitespace errors. What are |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1209 | considered whitespace errors is controlled by <tt>core.whitespace</tt> |
Junio C Hamano | 6005bfa | 2011-06-23 00:51:22 | [diff] [blame] | 1210 | configuration. By default, trailing whitespaces (including |
| 1211 | lines that solely consist of whitespaces) and a space character |
| 1212 | that is immediately followed by a tab character inside the |
| 1213 | initial indent of the line are considered whitespace errors. |
| 1214 | Exits with non-zero status if problems are found. Not compatible |
| 1215 | with --exit-code. |
Junio C Hamano | a890c4f | 2007-01-28 10:29:21 | [diff] [blame] | 1216 | </p> |
| 1217 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1218 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1219 | --full-index |
| 1220 | </dt> |
| 1221 | <dd> |
| 1222 | <p> |
Junio C Hamano | 5cf43ca | 2008-08-20 09:14:14 | [diff] [blame] | 1223 | Instead of the first handful of characters, show the full |
| 1224 | pre- and post-image blob object names on the "index" |
| 1225 | line when generating patch format output. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1226 | </p> |
| 1227 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1228 | <dt class="hdlist1"> |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 1229 | --binary |
| 1230 | </dt> |
| 1231 | <dd> |
| 1232 | <p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1233 | In addition to <tt>--full-index</tt>, output a binary diff that |
| 1234 | can be applied with <tt>git-apply</tt>. |
Junio C Hamano | 9ae1a06 | 2006-07-10 08:12:34 | [diff] [blame] | 1235 | </p> |
| 1236 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1237 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1238 | --abbrev[=<n>] |
| 1239 | </dt> |
| 1240 | <dd> |
| 1241 | <p> |
| 1242 | Instead of showing the full 40-byte hexadecimal object |
| 1243 | name in diff-raw format output and diff-tree header |
Junio C Hamano | 6efe302 | 2009-01-13 16:47:56 | [diff] [blame] | 1244 | lines, show only a partial prefix. This is |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1245 | independent of the <tt>--full-index</tt> option above, which controls |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1246 | the diff-patch output format. Non default number of |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1247 | digits can be specified with <tt>--abbrev=<n></tt>. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1248 | </p> |
| 1249 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1250 | <dt class="hdlist1"> |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1251 | -B[<n>][/<m>] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1252 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1253 | <dt class="hdlist1"> |
Junio C Hamano | 39c7a69 | 2010-10-27 06:08:54 | [diff] [blame] | 1254 | --break-rewrites[=[<n>][/<m>]] |
| 1255 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1256 | <dd> |
| 1257 | <p> |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1258 | Break complete rewrite changes into pairs of delete and |
| 1259 | create. This serves two purposes: |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1260 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1261 | <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] | 1262 | not as a series of deletion and insertion mixed together with a very |
| 1263 | few lines that happen to match textually as the context, but as a |
| 1264 | single deletion of everything old followed by a single insertion of |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1265 | everything new, and the number <tt>m</tt> controls this aspect of the -B |
| 1266 | option (defaults to 60%). <tt>-B/70%</tt> specifies that less than 30% of the |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 1267 | original should remain in the result for Git to consider it a total |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1268 | rewrite (i.e. otherwise the resulting patch will be a series of |
| 1269 | deletion and insertion mixed together with context lines).</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1270 | <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] | 1271 | source of a rename (usually -M only considers a file that disappeared |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1272 | as the source of a rename), and the number <tt>n</tt> controls this aspect of |
| 1273 | 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] | 1274 | 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] | 1275 | eligible for being picked up as a possible source of a rename to |
| 1276 | another file.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1277 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1278 | <dt class="hdlist1"> |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1279 | -M[<n>] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1280 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1281 | <dt class="hdlist1"> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1282 | --find-renames[=<n>] |
Junio C Hamano | 39c7a69 | 2010-10-27 06:08:54 | [diff] [blame] | 1283 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1284 | <dd> |
| 1285 | <p> |
| 1286 | Detect renames. |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1287 | 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] | 1288 | index (i.e. amount of addition/deletions compared to the |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1289 | 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] | 1290 | delete/add pair to be a rename if more than 90% of the file |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1291 | hasn’t changed. Without a <tt>%</tt> sign, the number is to be read as |
| 1292 | a fraction, with a decimal point before it. I.e., <tt>-M5</tt> becomes |
| 1293 | 0.5, and is thus the same as <tt>-M50%</tt>. Similarly, <tt>-M05</tt> is |
| 1294 | the same as <tt>-M5%</tt>. To limit detection to exact renames, use |
| 1295 | <tt>-M100%</tt>. The default similarity index is 50%. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1296 | </p> |
| 1297 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1298 | <dt class="hdlist1"> |
Junio C Hamano | e85e36f | 2010-08-10 05:30:14 | [diff] [blame] | 1299 | -C[<n>] |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1300 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1301 | <dt class="hdlist1"> |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1302 | --find-copies[=<n>] |
Junio C Hamano | 39c7a69 | 2010-10-27 06:08:54 | [diff] [blame] | 1303 | </dt> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1304 | <dd> |
| 1305 | <p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1306 | Detect copies as well as renames. See also <tt>--find-copies-harder</tt>. |
| 1307 | 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] | 1308 | </p> |
| 1309 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1310 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1311 | --find-copies-harder |
| 1312 | </dt> |
| 1313 | <dd> |
| 1314 | <p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1315 | For performance reasons, by default, <tt>-C</tt> option finds copies only |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1316 | if the original file of the copy was modified in the same |
| 1317 | changeset. This flag makes the command |
| 1318 | inspect unmodified files as candidates for the source of |
| 1319 | copy. This is a very expensive operation for large |
Junio C Hamano | 16f9887 | 2007-06-12 16:09:14 | [diff] [blame] | 1320 | projects, so use it with caution. Giving more than one |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1321 | <tt>-C</tt> option has the same effect. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1322 | </p> |
| 1323 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1324 | <dt class="hdlist1"> |
Junio C Hamano | b02377c | 2011-04-28 22:26:02 | [diff] [blame] | 1325 | -D |
| 1326 | </dt> |
| 1327 | <dt class="hdlist1"> |
| 1328 | --irreversible-delete |
| 1329 | </dt> |
| 1330 | <dd> |
| 1331 | <p> |
| 1332 | Omit the preimage for deletes, i.e. print only the header but not |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1333 | the diff between the preimage and <tt>/dev/null</tt>. The resulting patch |
Junio C Hamano | d75148a | 2014-04-08 19:48:38 | [diff] [blame] | 1334 | is not meant to be applied with <tt>patch</tt> or <tt>git apply</tt>; this is |
Junio C Hamano | b02377c | 2011-04-28 22:26:02 | [diff] [blame] | 1335 | solely for people who want to just concentrate on reviewing the |
| 1336 | text after the change. In addition, the output obviously lack |
| 1337 | enough information to apply such a patch in reverse, even manually, |
| 1338 | hence the name of the option. |
| 1339 | </p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1340 | <div class="paragraph"><p>When used together with <tt>-B</tt>, omit also the preimage in the deletion part |
Junio C Hamano | b02377c | 2011-04-28 22:26:02 | [diff] [blame] | 1341 | of a delete/create pair.</p></div> |
| 1342 | </dd> |
| 1343 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1344 | -l<num> |
| 1345 | </dt> |
| 1346 | <dd> |
| 1347 | <p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1348 | 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] | 1349 | is the number of potential rename/copy targets. This |
| 1350 | option prevents rename/copy detection from running if |
| 1351 | the number of rename/copy targets exceeds the specified |
| 1352 | number. |
| 1353 | </p> |
| 1354 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1355 | <dt class="hdlist1"> |
Junio C Hamano | 982eb11 | 2010-11-18 00:53:09 | [diff] [blame] | 1356 | --diff-filter=[(A|C|D|M|R|T|U|X|B)…[*]] |
| 1357 | </dt> |
| 1358 | <dd> |
| 1359 | <p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1360 | Select only files that are Added (<tt>A</tt>), Copied (<tt>C</tt>), |
| 1361 | Deleted (<tt>D</tt>), Modified (<tt>M</tt>), Renamed (<tt>R</tt>), have their |
| 1362 | type (i.e. regular file, symlink, submodule, …) changed (<tt>T</tt>), |
| 1363 | are Unmerged (<tt>U</tt>), are |
| 1364 | Unknown (<tt>X</tt>), or have had their pairing Broken (<tt>B</tt>). |
Junio C Hamano | 982eb11 | 2010-11-18 00:53:09 | [diff] [blame] | 1365 | Any combination of the filter characters (including none) can be used. |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1366 | When <tt>*</tt> (All-or-none) is added to the combination, all |
Junio C Hamano | 982eb11 | 2010-11-18 00:53:09 | [diff] [blame] | 1367 | paths are selected if there is any file that matches |
| 1368 | other criteria in the comparison; if there is no file |
| 1369 | that matches other criteria, nothing is selected. |
| 1370 | </p> |
| 1371 | </dd> |
| 1372 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1373 | -S<string> |
| 1374 | </dt> |
| 1375 | <dd> |
| 1376 | <p> |
Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 1377 | Look for differences that change the number of occurrences of |
| 1378 | the specified string (i.e. addition/deletion) in a file. |
| 1379 | Intended for the scripter’s use. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1380 | </p> |
Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 1381 | <div class="paragraph"><p>It is useful when you’re looking for an exact block of code (like a |
| 1382 | struct), and want to know the history of that block since it first |
| 1383 | came into being: use the feature iteratively to feed the interesting |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1384 | block in the preimage back into <tt>-S</tt>, and keep going until you get the |
Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 1385 | very first version of the block.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1386 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1387 | <dt class="hdlist1"> |
Junio C Hamano | 3b4609d | 2010-09-30 00:04:34 | [diff] [blame] | 1388 | -G<regex> |
| 1389 | </dt> |
| 1390 | <dd> |
| 1391 | <p> |
Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 1392 | Look for differences whose patch text contains added/removed |
| 1393 | lines that match <regex>. |
Junio C Hamano | 3b4609d | 2010-09-30 00:04:34 | [diff] [blame] | 1394 | </p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1395 | <div class="paragraph"><p>To illustrate the difference between <tt>-S<regex> --pickaxe-regex</tt> and |
| 1396 | <tt>-G<regex></tt>, consider a commit with the following diff in the same |
Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 1397 | file:</p></div> |
| 1398 | <div class="listingblock"> |
| 1399 | <div class="content"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1400 | <pre><tt>+ return !regexec(regexp, two->ptr, 1, &regmatch, 0); |
Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 1401 | ... |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1402 | - hit = !regexec(regexp, mf2.ptr, 1, &regmatch, 0);</tt></pre> |
Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 1403 | </div></div> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1404 | <div class="paragraph"><p>While <tt>git log -G"regexec\(regexp"</tt> will show this commit, <tt>git log |
| 1405 | -S"regexec\(regexp" --pickaxe-regex</tt> will not (because the number of |
Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 1406 | occurrences of that string did not change).</p></div> |
| 1407 | <div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more |
| 1408 | information.</p></div> |
Junio C Hamano | 3b4609d | 2010-09-30 00:04:34 | [diff] [blame] | 1409 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1410 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1411 | --pickaxe-all |
| 1412 | </dt> |
| 1413 | <dd> |
| 1414 | <p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1415 | 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] | 1416 | changeset, not just the files that contain the change |
| 1417 | in <string>. |
| 1418 | </p> |
| 1419 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1420 | <dt class="hdlist1"> |
Junio C Hamano | bfe9e75 | 2006-04-05 21:43:28 | [diff] [blame] | 1421 | --pickaxe-regex |
| 1422 | </dt> |
| 1423 | <dd> |
| 1424 | <p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1425 | Treat the <string> given to <tt>-S</tt> as an extended POSIX regular |
Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 1426 | expression to match. |
Junio C Hamano | bfe9e75 | 2006-04-05 21:43:28 | [diff] [blame] | 1427 | </p> |
| 1428 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1429 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1430 | -O<orderfile> |
| 1431 | </dt> |
| 1432 | <dd> |
| 1433 | <p> |
| 1434 | Output the patch in the order specified in the |
| 1435 | <orderfile>, which has one shell glob pattern per line. |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1436 | This overrides the <tt>diff.orderfile</tt> configuration variable |
| 1437 | (see <a href="git-config.html">git-config(1)</a>). To cancel <tt>diff.orderfile</tt>, |
| 1438 | use <tt>-O/dev/null</tt>. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1439 | </p> |
| 1440 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1441 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1442 | -R |
| 1443 | </dt> |
| 1444 | <dd> |
| 1445 | <p> |
| 1446 | Swap two inputs; that is, show differences from index or |
| 1447 | on-disk file to tree contents. |
| 1448 | </p> |
| 1449 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1450 | <dt class="hdlist1"> |
Junio C Hamano | 24bc09a | 2008-02-28 00:27:44 | [diff] [blame] | 1451 | --relative[=<path>] |
| 1452 | </dt> |
| 1453 | <dd> |
| 1454 | <p> |
| 1455 | When run from a subdirectory of the project, it can be |
| 1456 | told to exclude changes outside the directory and show |
| 1457 | pathnames relative to it with this option. When you are |
| 1458 | not in a subdirectory (e.g. in a bare repository), you |
| 1459 | can name which subdirectory to make the output relative |
| 1460 | to by giving a <path> as an argument. |
| 1461 | </p> |
| 1462 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1463 | <dt class="hdlist1"> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 1464 | -a |
| 1465 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1466 | <dt class="hdlist1"> |
Junio C Hamano | c26f548 | 2006-07-09 09:38:14 | [diff] [blame] | 1467 | --text |
| 1468 | </dt> |
| 1469 | <dd> |
| 1470 | <p> |
| 1471 | Treat all files as text. |
| 1472 | </p> |
| 1473 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1474 | <dt class="hdlist1"> |
Junio C Hamano | fd46896 | 2007-02-14 23:45:04 | [diff] [blame] | 1475 | --ignore-space-at-eol |
| 1476 | </dt> |
| 1477 | <dd> |
| 1478 | <p> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 1479 | Ignore changes in whitespace at EOL. |
Junio C Hamano | fd46896 | 2007-02-14 23:45:04 | [diff] [blame] | 1480 | </p> |
| 1481 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1482 | <dt class="hdlist1"> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 1483 | -b |
| 1484 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1485 | <dt class="hdlist1"> |
Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 1486 | --ignore-space-change |
| 1487 | </dt> |
| 1488 | <dd> |
| 1489 | <p> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 1490 | Ignore changes in amount of whitespace. This ignores whitespace |
| 1491 | at line end, and considers all other sequences of one or |
| 1492 | more whitespace characters to be equivalent. |
Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 1493 | </p> |
| 1494 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1495 | <dt class="hdlist1"> |
Junio C Hamano | bbbb865 | 2008-12-29 10:34:22 | [diff] [blame] | 1496 | -w |
Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 1497 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1498 | <dt class="hdlist1"> |
Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 1499 | --ignore-all-space |
| 1500 | </dt> |
| 1501 | <dd> |
| 1502 | <p> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 1503 | Ignore whitespace when comparing lines. This ignores |
| 1504 | differences even if one line has whitespace where the other |
Junio C Hamano | d9c2d2f | 2006-12-06 08:59:07 | [diff] [blame] | 1505 | line has none. |
| 1506 | </p> |
| 1507 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1508 | <dt class="hdlist1"> |
Junio C Hamano | a195230 | 2013-07-01 21:31:18 | [diff] [blame] | 1509 | --ignore-blank-lines |
| 1510 | </dt> |
| 1511 | <dd> |
| 1512 | <p> |
| 1513 | Ignore changes whose lines are all blank. |
| 1514 | </p> |
| 1515 | </dd> |
| 1516 | <dt class="hdlist1"> |
Junio C Hamano | 1d40ee8 | 2009-01-07 10:14:16 | [diff] [blame] | 1517 | --inter-hunk-context=<lines> |
| 1518 | </dt> |
| 1519 | <dd> |
| 1520 | <p> |
| 1521 | Show the context between diff hunks, up to the specified number |
| 1522 | of lines, thereby fusing hunks that are close to each other. |
| 1523 | </p> |
| 1524 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1525 | <dt class="hdlist1"> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 1526 | -W |
| 1527 | </dt> |
| 1528 | <dt class="hdlist1"> |
| 1529 | --function-context |
| 1530 | </dt> |
| 1531 | <dd> |
| 1532 | <p> |
| 1533 | Show whole surrounding functions of changes. |
| 1534 | </p> |
| 1535 | </dd> |
| 1536 | <dt class="hdlist1"> |
Junio C Hamano | 48fd2f6 | 2007-03-19 02:02:30 | [diff] [blame] | 1537 | --exit-code |
| 1538 | </dt> |
| 1539 | <dd> |
| 1540 | <p> |
| 1541 | Make the program exit with codes similar to diff(1). |
| 1542 | That is, it exits with 1 if there were differences and |
| 1543 | 0 means no differences. |
| 1544 | </p> |
| 1545 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1546 | <dt class="hdlist1"> |
Junio C Hamano | 35e5755 | 2007-03-25 07:54:35 | [diff] [blame] | 1547 | --quiet |
| 1548 | </dt> |
| 1549 | <dd> |
| 1550 | <p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1551 | Disable all output of the program. Implies <tt>--exit-code</tt>. |
Junio C Hamano | 35e5755 | 2007-03-25 07:54:35 | [diff] [blame] | 1552 | </p> |
| 1553 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1554 | <dt class="hdlist1"> |
Junio C Hamano | bb0f404 | 2007-07-04 06:41:40 | [diff] [blame] | 1555 | --ext-diff |
| 1556 | </dt> |
| 1557 | <dd> |
| 1558 | <p> |
| 1559 | Allow an external diff helper to be executed. If you set an |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1560 | external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need |
| 1561 | 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] | 1562 | </p> |
| 1563 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1564 | <dt class="hdlist1"> |
Junio C Hamano | bb0f404 | 2007-07-04 06:41:40 | [diff] [blame] | 1565 | --no-ext-diff |
| 1566 | </dt> |
| 1567 | <dd> |
| 1568 | <p> |
| 1569 | Disallow external diff drivers. |
| 1570 | </p> |
| 1571 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1572 | <dt class="hdlist1"> |
Junio C Hamano | c652aed | 2011-07-07 01:14:31 | [diff] [blame] | 1573 | --textconv |
| 1574 | </dt> |
| 1575 | <dt class="hdlist1"> |
| 1576 | --no-textconv |
| 1577 | </dt> |
| 1578 | <dd> |
| 1579 | <p> |
| 1580 | Allow (or disallow) external text conversion filters to be run |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1581 | when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for |
Junio C Hamano | c652aed | 2011-07-07 01:14:31 | [diff] [blame] | 1582 | details. Because textconv filters are typically a one-way |
| 1583 | conversion, the resulting diff is suitable for human |
| 1584 | consumption, but cannot be applied. For this reason, textconv |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1585 | filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and |
| 1586 | <a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or |
Junio C Hamano | c652aed | 2011-07-07 01:14:31 | [diff] [blame] | 1587 | diff plumbing commands. |
| 1588 | </p> |
| 1589 | </dd> |
| 1590 | <dt class="hdlist1"> |
Junio C Hamano | 7d44952 | 2010-07-01 00:08:51 | [diff] [blame] | 1591 | --ignore-submodules[=<when>] |
Junio C Hamano | dfccbb0 | 2008-05-26 01:16:14 | [diff] [blame] | 1592 | </dt> |
| 1593 | <dd> |
| 1594 | <p> |
Junio C Hamano | 7d44952 | 2010-07-01 00:08:51 | [diff] [blame] | 1595 | Ignore changes to submodules in the diff generation. <when> can be |
Junio C Hamano | c710296 | 2013-05-29 23:57:17 | [diff] [blame] | 1596 | either "none", "untracked", "dirty" or "all", which is the default. |
Junio C Hamano | 619596a | 2010-08-18 22:15:35 | [diff] [blame] | 1597 | Using "none" will consider the submodule modified when it either contains |
| 1598 | untracked or modified files or its HEAD differs from the commit recorded |
| 1599 | in the superproject and can be used to override any settings of the |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1600 | <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] | 1601 | "untracked" is used submodules are not considered dirty when they only |
| 1602 | contain untracked content (but they are still scanned for modified |
| 1603 | content). Using "dirty" ignores all changes to the work tree of submodules, |
| 1604 | only changes to the commits stored in the superproject are shown (this was |
| 1605 | 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] | 1606 | </p> |
| 1607 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1608 | <dt class="hdlist1"> |
Junio C Hamano | e27cbd2 | 2007-12-21 17:57:33 | [diff] [blame] | 1609 | --src-prefix=<prefix> |
| 1610 | </dt> |
| 1611 | <dd> |
| 1612 | <p> |
| 1613 | Show the given source prefix instead of "a/". |
| 1614 | </p> |
| 1615 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1616 | <dt class="hdlist1"> |
Junio C Hamano | e27cbd2 | 2007-12-21 17:57:33 | [diff] [blame] | 1617 | --dst-prefix=<prefix> |
| 1618 | </dt> |
| 1619 | <dd> |
| 1620 | <p> |
| 1621 | Show the given destination prefix instead of "b/". |
| 1622 | </p> |
| 1623 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1624 | <dt class="hdlist1"> |
Junio C Hamano | e27cbd2 | 2007-12-21 17:57:33 | [diff] [blame] | 1625 | --no-prefix |
| 1626 | </dt> |
| 1627 | <dd> |
| 1628 | <p> |
| 1629 | Do not show any source or destination prefix. |
| 1630 | </p> |
| 1631 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1632 | </dl></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1633 | <div class="paragraph"><p>For more detailed explanation on these common options, see also |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1634 | <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1635 | <div class="dlist"><dl> |
| 1636 | <dt class="hdlist1"> |
Junio C Hamano | bd53dbf | 2009-01-18 18:26:37 | [diff] [blame] | 1637 | -1 --base |
| 1638 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1639 | <dt class="hdlist1"> |
Junio C Hamano | bd53dbf | 2009-01-18 18:26:37 | [diff] [blame] | 1640 | -2 --ours |
| 1641 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1642 | <dt class="hdlist1"> |
Junio C Hamano | bd53dbf | 2009-01-18 18:26:37 | [diff] [blame] | 1643 | -3 --theirs |
| 1644 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1645 | <dt class="hdlist1"> |
Junio C Hamano | bd53dbf | 2009-01-18 18:26:37 | [diff] [blame] | 1646 | -0 |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1647 | </dt> |
| 1648 | <dd> |
| 1649 | <p> |
| 1650 | Diff against the "base" version, "our branch" or "their |
| 1651 | branch" respectively. With these options, diffs for |
| 1652 | merged entries are not shown. |
| 1653 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1654 | <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] | 1655 | cleanly resolved paths. The option -0 can be given to |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1656 | omit diff output for unmerged entries and just show "Unmerged".</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1657 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1658 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1659 | -c |
| 1660 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1661 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1662 | --cc |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 1663 | </dt> |
| 1664 | <dd> |
| 1665 | <p> |
| 1666 | This compares stage 2 (our branch), stage 3 (their |
| 1667 | branch) and the working tree file and outputs a combined |
| 1668 | diff, similar to the way <em>diff-tree</em> shows a merge |
| 1669 | commit with these flags. |
| 1670 | </p> |
| 1671 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1672 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1673 | -q |
| 1674 | </dt> |
| 1675 | <dd> |
| 1676 | <p> |
Junio C Hamano | 51c2ab0 | 2006-07-09 20:38:54 | [diff] [blame] | 1677 | Remain silent even on nonexistent files |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1678 | </p> |
| 1679 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1680 | </dl></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1681 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1682 | </div> |
| 1683 | <div class="sect1"> |
Junio C Hamano | 543f8d6 | 2009-07-29 08:35:21 | [diff] [blame] | 1684 | <h2 id="_raw_output_format">Raw output format</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1685 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1686 | <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] | 1687 | "git-diff-files" and "git diff --raw" are very similar.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1688 | <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] | 1689 | compared differs:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1690 | <div class="dlist"><dl> |
| 1691 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1692 | git-diff-index <tree-ish> |
| 1693 | </dt> |
| 1694 | <dd> |
| 1695 | <p> |
| 1696 | compares the <tree-ish> and the files on the filesystem. |
| 1697 | </p> |
| 1698 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1699 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1700 | git-diff-index --cached <tree-ish> |
| 1701 | </dt> |
| 1702 | <dd> |
| 1703 | <p> |
| 1704 | compares the <tree-ish> and the index. |
| 1705 | </p> |
| 1706 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1707 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1708 | git-diff-tree [-r] <tree-ish-1> <tree-ish-2> [<pattern>…] |
| 1709 | </dt> |
| 1710 | <dd> |
| 1711 | <p> |
| 1712 | compares the trees named by the two arguments. |
| 1713 | </p> |
| 1714 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1715 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1716 | git-diff-files [<pattern>…] |
| 1717 | </dt> |
| 1718 | <dd> |
| 1719 | <p> |
| 1720 | compares the index and the files on the filesystem. |
| 1721 | </p> |
| 1722 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1723 | </dl></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1724 | <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] | 1725 | what is being compared. After that, all the commands print one output |
| 1726 | line per changed file.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1727 | <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] | 1728 | <div class="listingblock"> |
| 1729 | <div class="content"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1730 | <pre><tt>in-place edit :100644 100644 bcd1234... 0123456... M file0 |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1731 | copy-edit :100644 100644 abcd123... 1234567... C68 file1 file2 |
| 1732 | rename-edit :100644 100644 abcd123... 1234567... R86 file1 file3 |
| 1733 | create :000000 100644 0000000... 1234567... A file4 |
| 1734 | delete :100644 000000 1234567... 0000000... D file5 |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1735 | unmerged :000000 000000 0000000... 0000000... U file6</tt></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1736 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1737 | <div class="paragraph"><p>That is, from the left to the right:</p></div> |
| 1738 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1739 | <li> |
| 1740 | <p> |
| 1741 | a colon. |
| 1742 | </p> |
| 1743 | </li> |
| 1744 | <li> |
| 1745 | <p> |
| 1746 | mode for "src"; 000000 if creation or unmerged. |
| 1747 | </p> |
| 1748 | </li> |
| 1749 | <li> |
| 1750 | <p> |
| 1751 | a space. |
| 1752 | </p> |
| 1753 | </li> |
| 1754 | <li> |
| 1755 | <p> |
| 1756 | mode for "dst"; 000000 if deletion or unmerged. |
| 1757 | </p> |
| 1758 | </li> |
| 1759 | <li> |
| 1760 | <p> |
| 1761 | a space. |
| 1762 | </p> |
| 1763 | </li> |
| 1764 | <li> |
| 1765 | <p> |
| 1766 | sha1 for "src"; 0{40} if creation or unmerged. |
| 1767 | </p> |
| 1768 | </li> |
| 1769 | <li> |
| 1770 | <p> |
| 1771 | a space. |
| 1772 | </p> |
| 1773 | </li> |
| 1774 | <li> |
| 1775 | <p> |
| 1776 | sha1 for "dst"; 0{40} if creation, unmerged or "look at work tree". |
| 1777 | </p> |
| 1778 | </li> |
| 1779 | <li> |
| 1780 | <p> |
| 1781 | a space. |
| 1782 | </p> |
| 1783 | </li> |
| 1784 | <li> |
| 1785 | <p> |
| 1786 | status, followed by optional "score" number. |
| 1787 | </p> |
| 1788 | </li> |
| 1789 | <li> |
| 1790 | <p> |
| 1791 | a tab or a NUL when <em>-z</em> option is used. |
| 1792 | </p> |
| 1793 | </li> |
| 1794 | <li> |
| 1795 | <p> |
| 1796 | path for "src" |
| 1797 | </p> |
| 1798 | </li> |
| 1799 | <li> |
| 1800 | <p> |
| 1801 | a tab or a NUL when <em>-z</em> option is used; only exists for C or R. |
| 1802 | </p> |
| 1803 | </li> |
| 1804 | <li> |
| 1805 | <p> |
| 1806 | path for "dst"; only exists for C or R. |
| 1807 | </p> |
| 1808 | </li> |
| 1809 | <li> |
| 1810 | <p> |
| 1811 | an LF or a NUL when <em>-z</em> option is used, to terminate the record. |
| 1812 | </p> |
| 1813 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1814 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1815 | <div class="paragraph"><p>Possible status letters are:</p></div> |
| 1816 | <div class="ulist"><ul> |
Junio C Hamano | aa17c7c | 2008-11-03 04:36:58 | [diff] [blame] | 1817 | <li> |
| 1818 | <p> |
| 1819 | A: addition of a file |
| 1820 | </p> |
| 1821 | </li> |
| 1822 | <li> |
| 1823 | <p> |
| 1824 | C: copy of a file into a new one |
| 1825 | </p> |
| 1826 | </li> |
| 1827 | <li> |
| 1828 | <p> |
| 1829 | D: deletion of a file |
| 1830 | </p> |
| 1831 | </li> |
| 1832 | <li> |
| 1833 | <p> |
| 1834 | M: modification of the contents or mode of a file |
| 1835 | </p> |
| 1836 | </li> |
| 1837 | <li> |
| 1838 | <p> |
| 1839 | R: renaming of a file |
| 1840 | </p> |
| 1841 | </li> |
| 1842 | <li> |
| 1843 | <p> |
| 1844 | T: change in the type of the file |
| 1845 | </p> |
| 1846 | </li> |
| 1847 | <li> |
| 1848 | <p> |
| 1849 | U: file is unmerged (you must complete the merge before it can |
| 1850 | be committed) |
| 1851 | </p> |
| 1852 | </li> |
| 1853 | <li> |
| 1854 | <p> |
| 1855 | X: "unknown" change type (most probably a bug, please report it) |
| 1856 | </p> |
| 1857 | </li> |
| 1858 | </ul></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1859 | <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] | 1860 | percentage of similarity between the source and target of the move or |
| 1861 | copy), and are the only ones to be so.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1862 | <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] | 1863 | and it is out of sync with the index.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1864 | <div class="paragraph"><p>Example:</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1865 | <div class="listingblock"> |
| 1866 | <div class="content"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1867 | <pre><tt>:100644 100644 5be4a4...... 000000...... M file.c</tt></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1868 | </div></div> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1869 | <div class="paragraph"><p>When <tt>-z</tt> option is not used, TAB, LF, and backslash characters |
| 1870 | 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] | 1871 | respectively.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1872 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1873 | </div> |
| 1874 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1875 | <h2 id="_diff_format_for_merges">diff format for merges</h2> |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 1876 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1877 | <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] | 1878 | can take <em>-c</em> or <em>--cc</em> option |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 1879 | to generate diff output also for merge commits. The output differs |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1880 | from the format described above in the following way:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1881 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 1882 | <li> |
| 1883 | <p> |
| 1884 | there is a colon for each parent |
| 1885 | </p> |
| 1886 | </li> |
| 1887 | <li> |
| 1888 | <p> |
| 1889 | there are more "src" modes and "src" sha1 |
| 1890 | </p> |
| 1891 | </li> |
| 1892 | <li> |
| 1893 | <p> |
| 1894 | status is concatenated status characters for each parent |
| 1895 | </p> |
| 1896 | </li> |
| 1897 | <li> |
| 1898 | <p> |
| 1899 | no optional "score" number |
| 1900 | </p> |
| 1901 | </li> |
| 1902 | <li> |
| 1903 | <p> |
| 1904 | single path, only for "dst" |
| 1905 | </p> |
| 1906 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1907 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1908 | <div class="paragraph"><p>Example:</p></div> |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 1909 | <div class="listingblock"> |
| 1910 | <div class="content"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1911 | <pre><tt>::100644 100644 100644 fabadb8... cc95eb0... 4866510... MM describe.c</tt></pre> |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 1912 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1913 | <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] | 1914 | all parents.</p></div> |
Junio C Hamano | 67fad6d | 2007-05-06 08:53:12 | [diff] [blame] | 1915 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1916 | </div> |
| 1917 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1918 | <h2 id="_generating_patches_with_p">Generating patches with -p</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1919 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1920 | <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] | 1921 | with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or |
| 1922 | "git log" with the "-p" option, they |
Junio C Hamano | 7ae0ab2 | 2007-11-03 02:46:46 | [diff] [blame] | 1923 | do not produce the output described above; instead they produce a |
| 1924 | patch file. You can customize the creation of such patches via the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1925 | GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1926 | <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] | 1927 | diff format:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1928 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1929 | <li> |
| 1930 | <p> |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 1931 | It is preceded with a "git diff" header that looks like this: |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1932 | </p> |
| 1933 | <div class="literalblock"> |
| 1934 | <div class="content"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1935 | <pre><tt>diff --git a/file1 b/file2</tt></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1936 | </div></div> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1937 | <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] | 1938 | involved. Especially, even for a creation or a deletion, |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1939 | <tt>/dev/null</tt> is <em>not</em> used in place of the <tt>a/</tt> or <tt>b/</tt> filenames.</p></div> |
| 1940 | <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] | 1941 | 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] | 1942 | the file that rename/copy produces, respectively.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1943 | </li> |
| 1944 | <li> |
| 1945 | <p> |
| 1946 | It is followed by one or more extended header lines: |
| 1947 | </p> |
| 1948 | <div class="literalblock"> |
| 1949 | <div class="content"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1950 | <pre><tt>old mode <mode> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1951 | new mode <mode> |
| 1952 | deleted file mode <mode> |
| 1953 | new file mode <mode> |
| 1954 | copy from <path> |
| 1955 | copy to <path> |
| 1956 | rename from <path> |
| 1957 | rename to <path> |
| 1958 | similarity index <number> |
| 1959 | dissimilarity index <number> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1960 | index <hash>..<hash> <mode></tt></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1961 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1962 | <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] | 1963 | and file permission bits.</p></div> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1964 | <div class="paragraph"><p>Path names in extended headers do not include the <tt>a/</tt> and <tt>b/</tt> prefixes.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1965 | <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] | 1966 | the dissimilarity index is the percentage of changed lines. It |
| 1967 | is a rounded down integer, followed by a percent sign. The |
| 1968 | similarity index value of 100% is thus reserved for two equal |
| 1969 | files, while 100% dissimilarity means that no line from the old |
| 1970 | file made it into the new one.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1971 | <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] | 1972 | The <mode> is included if the file mode does not change; otherwise, |
| 1973 | separate lines indicate the old and the new mode.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1974 | </li> |
| 1975 | <li> |
| 1976 | <p> |
Junio C Hamano | a053d54 | 2006-10-27 09:29:13 | [diff] [blame] | 1977 | TAB, LF, double quote and backslash characters in pathnames |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1978 | are represented as <tt>\t</tt>, <tt>\n</tt>, <tt>\"</tt> and <tt>\\</tt>, respectively. |
Junio C Hamano | a053d54 | 2006-10-27 09:29:13 | [diff] [blame] | 1979 | If there is need for such substitution then the whole |
| 1980 | pathname is put in double quotes. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1981 | </p> |
| 1982 | </li> |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 1983 | <li> |
| 1984 | <p> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1985 | All the <tt>file1</tt> files in the output refer to files before the |
| 1986 | commit, and all the <tt>file2</tt> files refer to files after the commit. |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 1987 | It is incorrect to apply each change to each file sequentially. For |
| 1988 | example, this patch will swap a and b: |
| 1989 | </p> |
| 1990 | <div class="literalblock"> |
| 1991 | <div class="content"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1992 | <pre><tt>diff --git a/a b/b |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 1993 | rename from a |
| 1994 | rename to b |
| 1995 | diff --git a/b b/a |
| 1996 | rename from b |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 1997 | rename to a</tt></pre> |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 1998 | </div></div> |
| 1999 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2000 | </ol></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2001 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2002 | </div> |
| 2003 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2004 | <h2 id="_combined_diff_format">combined diff format</h2> |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 2005 | <div class="sectionbody"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2006 | <div class="paragraph"><p>Any diff-generating command can take the ‘-c` or <tt>--cc</tt> option to |
Junio C Hamano | c5be4cc | 2011-03-09 07:20:43 | [diff] [blame] | 2007 | produce a <em>combined diff</em> when showing a merge. This is the default |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 2008 | format when showing merges with <a href="git-diff.html">git-diff(1)</a> or |
| 2009 | <a href="git-show.html">git-show(1)</a>. Note also that you can give the `-m’ option to any |
Junio C Hamano | c5be4cc | 2011-03-09 07:20:43 | [diff] [blame] | 2010 | of these commands to force generation of diffs with individual parents |
| 2011 | of a merge.</p></div> |
| 2012 | <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] | 2013 | <div class="listingblock"> |
| 2014 | <div class="content"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2015 | <pre><tt>diff --combined describe.c |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2016 | index fabadb8,cc95eb0..4866510 |
| 2017 | --- a/describe.c |
| 2018 | +++ b/describe.c |
| 2019 | @@@ -98,20 -98,12 +98,20 @@@ |
| 2020 | return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1; |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 2021 | } |
| 2022 | |
| 2023 | - static void describe(char *arg) |
| 2024 | -static void describe(struct commit *cmit, int last_one) |
| 2025 | ++static void describe(char *arg, int last_one) |
| 2026 | { |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2027 | + unsigned char sha1[20]; |
| 2028 | + struct commit *cmit; |
| 2029 | struct commit_list *list; |
| 2030 | static int initialized = 0; |
| 2031 | struct commit_name *n; |
| 2032 | |
| 2033 | + if (get_sha1(arg, sha1) < 0) |
| 2034 | + usage(describe_usage); |
| 2035 | + cmit = lookup_commit_reference(sha1); |
| 2036 | + if (!cmit) |
| 2037 | + usage(describe_usage); |
| 2038 | + |
| 2039 | if (!initialized) { |
| 2040 | initialized = 1; |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2041 | for_each_ref(get_name);</tt></pre> |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 2042 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2043 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2044 | <li> |
| 2045 | <p> |
| 2046 | It is preceded with a "git diff" header, that looks like |
| 2047 | this (when <em>-c</em> option is used): |
| 2048 | </p> |
| 2049 | <div class="literalblock"> |
| 2050 | <div class="content"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2051 | <pre><tt>diff --combined file</tt></pre> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2052 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2053 | <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] | 2054 | <div class="literalblock"> |
| 2055 | <div class="content"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2056 | <pre><tt>diff --cc file</tt></pre> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2057 | </div></div> |
| 2058 | </li> |
| 2059 | <li> |
| 2060 | <p> |
| 2061 | It is followed by one or more extended header lines |
| 2062 | (this example shows a merge with two parents): |
| 2063 | </p> |
| 2064 | <div class="literalblock"> |
| 2065 | <div class="content"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2066 | <pre><tt>index <hash>,<hash>..<hash> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2067 | mode <mode>,<mode>..<mode> |
| 2068 | new file mode <mode> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2069 | deleted file mode <mode>,<mode></tt></pre> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2070 | </div></div> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2071 | <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] | 2072 | the <mode> is different from the rest. Extended headers with |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2073 | information about detected contents movement (renames and |
| 2074 | copying detection) are designed to work with diff of two |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2075 | <tree-ish> and are not used by combined diff format.</p></div> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2076 | </li> |
| 2077 | <li> |
| 2078 | <p> |
| 2079 | It is followed by two-line from-file/to-file header |
| 2080 | </p> |
| 2081 | <div class="literalblock"> |
| 2082 | <div class="content"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2083 | <pre><tt>--- a/file |
| 2084 | +++ b/file</tt></pre> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2085 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2086 | <div class="paragraph"><p>Similar to two-line header for traditional <em>unified</em> diff |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2087 | format, <tt>/dev/null</tt> is used to signal created or deleted |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2088 | files.</p></div> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2089 | </li> |
| 2090 | <li> |
| 2091 | <p> |
| 2092 | Chunk header format is modified to prevent people from |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2093 | accidentally feeding it to <tt>patch -p1</tt>. Combined diff format |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2094 | was created for review of merge commit changes, and was not |
| 2095 | meant for apply. The change is similar to the change in the |
| 2096 | extended <em>index</em> header: |
| 2097 | </p> |
| 2098 | <div class="literalblock"> |
| 2099 | <div class="content"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2100 | <pre><tt>@@@ <from-file-range> <from-file-range> <to-file-range> @@@</tt></pre> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2101 | </div></div> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2102 | <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] | 2103 | header for combined diff format.</p></div> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2104 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2105 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2106 | <div class="paragraph"><p>Unlike the traditional <em>unified</em> diff format, which shows two |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2107 | 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 |
| 2108 | added to B), or <tt>" "</tt> (space — unchanged) prefix, this format |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 2109 | compares two or more files file1, file2,… with one file X, and |
| 2110 | 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] | 2111 | 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] | 2112 | different from it.</p></div> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2113 | <div class="paragraph"><p>A <tt>-</tt> character in the column N means that the line appears in |
| 2114 | 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] | 2115 | in the column N means that the line appears in the result, |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 2116 | 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] | 2117 | added, from the point of view of that parent).</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2118 | <div class="paragraph"><p>In the above example output, the function signature was changed |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2119 | from both files (hence two <tt>-</tt> removals from both file1 and |
| 2120 | file2, plus <tt>++</tt> to mean one line that was added does not appear |
Junio C Hamano | d75148a | 2014-04-08 19:48:38 | [diff] [blame] | 2121 | in either file1 or file2). Also eight other lines are the same |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2122 | from file1 but do not appear in file2 (hence prefixed with <tt>+</tt>).</p></div> |
| 2123 | <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] | 2124 | merge commit with the merge result (i.e. file1..fileN are the |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2125 | parents). When shown by <tt>git diff-files -c</tt>, it compares the |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 2126 | two unresolved merge parents with the working tree file |
| 2127 | (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] | 2128 | "their version").</p></div> |
Junio C Hamano | fb56a96 | 2006-01-28 10:38:19 | [diff] [blame] | 2129 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2130 | </div> |
| 2131 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2132 | <h2 id="_other_diff_formats">other diff formats</h2> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2133 | <div class="sectionbody"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2134 | <div class="paragraph"><p>The <tt>--summary</tt> option describes newly added, deleted, renamed and |
| 2135 | copied files. The <tt>--stat</tt> option adds diffstat(1) graph to the |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2136 | output. These options can be combined with other options, such as |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2137 | <tt>-p</tt>, and are meant for human consumption.</p></div> |
| 2138 | <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] | 2139 | formats the pathnames compactly by combining common prefix and suffix of |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2140 | the pathnames. For example, a change that moves <tt>arch/i386/Makefile</tt> to |
| 2141 | <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] | 2142 | <div class="listingblock"> |
| 2143 | <div class="content"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2144 | <pre><tt>arch/{i386 => x86}/Makefile | 4 +--</tt></pre> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2145 | </div></div> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2146 | <div class="paragraph"><p>The <tt>--numstat</tt> option gives the diffstat(1) information but is designed |
| 2147 | for easier machine consumption. An entry in <tt>--numstat</tt> output looks |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2148 | like this:</p></div> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2149 | <div class="listingblock"> |
| 2150 | <div class="content"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2151 | <pre><tt>1 2 README |
| 2152 | 3 1 arch/{i386 => x86}/Makefile</tt></pre> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2153 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2154 | <div class="paragraph"><p>That is, from left to right:</p></div> |
| 2155 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2156 | <li> |
| 2157 | <p> |
| 2158 | the number of added lines; |
| 2159 | </p> |
| 2160 | </li> |
| 2161 | <li> |
| 2162 | <p> |
| 2163 | a tab; |
| 2164 | </p> |
| 2165 | </li> |
| 2166 | <li> |
| 2167 | <p> |
| 2168 | the number of deleted lines; |
| 2169 | </p> |
| 2170 | </li> |
| 2171 | <li> |
| 2172 | <p> |
| 2173 | a tab; |
| 2174 | </p> |
| 2175 | </li> |
| 2176 | <li> |
| 2177 | <p> |
| 2178 | pathname (possibly with rename/copy information); |
| 2179 | </p> |
| 2180 | </li> |
| 2181 | <li> |
| 2182 | <p> |
| 2183 | a newline. |
| 2184 | </p> |
| 2185 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2186 | </ol></div> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2187 | <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] | 2188 | <div class="listingblock"> |
| 2189 | <div class="content"> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2190 | <pre><tt>1 2 README NUL |
| 2191 | 3 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</tt></pre> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2192 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2193 | <div class="paragraph"><p>That is:</p></div> |
| 2194 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 3a70234 | 2007-12-12 21:34:02 | [diff] [blame] | 2195 | <li> |
| 2196 | <p> |
| 2197 | the number of added lines; |
| 2198 | </p> |
| 2199 | </li> |
| 2200 | <li> |
| 2201 | <p> |
| 2202 | a tab; |
| 2203 | </p> |
| 2204 | </li> |
| 2205 | <li> |
| 2206 | <p> |
| 2207 | the number of deleted lines; |
| 2208 | </p> |
| 2209 | </li> |
| 2210 | <li> |
| 2211 | <p> |
| 2212 | a tab; |
| 2213 | </p> |
| 2214 | </li> |
| 2215 | <li> |
| 2216 | <p> |
| 2217 | a NUL (only exists if renamed/copied); |
| 2218 | </p> |
| 2219 | </li> |
| 2220 | <li> |
| 2221 | <p> |
| 2222 | pathname in preimage; |
| 2223 | </p> |
| 2224 | </li> |
| 2225 | <li> |
| 2226 | <p> |
| 2227 | a NUL (only exists if renamed/copied); |
| 2228 | </p> |
| 2229 | </li> |
| 2230 | <li> |
| 2231 | <p> |
| 2232 | pathname in postimage (only exists if renamed/copied); |
| 2233 | </p> |
| 2234 | </li> |
| 2235 | <li> |
| 2236 | <p> |
| 2237 | a NUL. |
| 2238 | </p> |
| 2239 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2240 | </ol></div> |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2241 | <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] | 2242 | scripts that read the output to tell if the current record being read is |
| 2243 | a single-path record or a rename/copy record without reading ahead. |
Junio C Hamano | 61525f9 | 2014-01-17 22:46:49 | [diff] [blame] | 2244 | After reading added and deleted lines, reading up to <tt>NUL</tt> would yield |
| 2245 | 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] | 2246 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2247 | </div> |
| 2248 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2249 | <h2 id="_git">GIT</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2250 | <div class="sectionbody"> |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 2251 | <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] | 2252 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 2253 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2254 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 2255 | <div id="footnotes"><hr /></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2256 | <div id="footer"> |
| 2257 | <div id="footer-text"> |
Junio C Hamano | 683a861 | 2013-08-23 20:50:09 | [diff] [blame] | 2258 | Last updated 2013-08-20 08:40:27 PDT |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2259 | </div> |
| 2260 | </div> |
| 2261 | </body> |
| 2262 | </html> |