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