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