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-log(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-log(1) Manual Page |
| 738 | </h1> |
| 739 | <h2>NAME</h2> |
| 740 | <div class="sectionbody"> |
| 741 | <p>git-log - |
| 742 | Show commit logs |
| 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 | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 750 | <div class="verseblock"> |
Junio C Hamano | f26c77e | 2013-04-27 00:06:04 | [diff] [blame] | 751 | <pre class="content"><em>git log</em> [<options>] [<revision range>] [[--] <path>…]</pre> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 752 | <div class="attribution"> |
Junio C Hamano | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 753 | </div></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 754 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 755 | </div> |
| 756 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 757 | <h2 id="_description">DESCRIPTION</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 758 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 759 | <div class="paragraph"><p>Shows the commit logs.</p></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 760 | <div class="paragraph"><p>The command takes options applicable to the <code>git rev-list</code> |
Junio C Hamano | ba7c8d8 | 2006-04-15 06:17:42 | [diff] [blame] | 761 | command to control what is shown and how, and options applicable to |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 762 | the <code>git diff-*</code> commands to control how the changes |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 763 | each commit introduces are shown.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 764 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 765 | </div> |
| 766 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 767 | <h2 id="_options">OPTIONS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 768 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 769 | <div class="dlist"><dl> |
| 770 | <dt class="hdlist1"> |
Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 771 | --follow |
| 772 | </dt> |
| 773 | <dd> |
| 774 | <p> |
| 775 | Continue listing the history of a file beyond renames |
| 776 | (works only for a single file). |
| 777 | </p> |
| 778 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 779 | <dt class="hdlist1"> |
Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 780 | --no-decorate |
| 781 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 782 | <dt class="hdlist1"> |
Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 783 | --decorate[=short|full|no] |
| 784 | </dt> |
| 785 | <dd> |
| 786 | <p> |
| 787 | Print out the ref names of any commits that are shown. If <em>short</em> is |
| 788 | specified, the ref name prefixes <em>refs/heads/</em>, <em>refs/tags/</em> and |
| 789 | <em>refs/remotes/</em> will not be printed. If <em>full</em> is specified, the |
| 790 | full ref name (including prefix) will be printed. The default option |
| 791 | is <em>short</em>. |
| 792 | </p> |
| 793 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 794 | <dt class="hdlist1"> |
Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 795 | --source |
| 796 | </dt> |
| 797 | <dd> |
| 798 | <p> |
| 799 | Print out the ref name given on the command line by which each |
| 800 | commit was reached. |
| 801 | </p> |
| 802 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 803 | <dt class="hdlist1"> |
Junio C Hamano | ce836cc | 2013-01-21 02:01:53 | [diff] [blame] | 804 | --use-mailmap |
| 805 | </dt> |
| 806 | <dd> |
| 807 | <p> |
| 808 | Use mailmap file to map author and committer names and email |
Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 809 | addresses to canonical real names and email addresses. See |
Junio C Hamano | ce836cc | 2013-01-21 02:01:53 | [diff] [blame] | 810 | <a href="git-shortlog.html">git-shortlog(1)</a>. |
| 811 | </p> |
| 812 | </dd> |
| 813 | <dt class="hdlist1"> |
Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 814 | --full-diff |
| 815 | </dt> |
| 816 | <dd> |
| 817 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 818 | Without this flag, <code>git log -p <path>...</code> shows commits that |
Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 819 | touch the specified paths, and diffs about the same specified |
| 820 | paths. With this, the full diff is shown for commits that touch |
| 821 | the specified paths; this means that "<path>…" limits only |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 822 | commits, and doesn’t limit diff for those commits. |
Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 823 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 824 | <div class="paragraph"><p>Note that this affects all diff-based output types, e.g. those |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 825 | produced by <code>--stat</code>, etc.</p></div> |
Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 826 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 827 | <dt class="hdlist1"> |
Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 828 | --log-size |
| 829 | </dt> |
| 830 | <dd> |
| 831 | <p> |
Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 832 | Include a line “log size <number>” in the output for each commit, |
| 833 | where <number> is the length of that commit’s message in bytes. |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 834 | Intended to speed up tools that read log messages from <code>git log</code> |
Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 835 | output by allowing them to allocate space in advance. |
Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 836 | </p> |
| 837 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 838 | <dt class="hdlist1"> |
Junio C Hamano | 8eac268 | 2013-09-09 22:35:20 | [diff] [blame] | 839 | -L <start>,<end>:<file> |
| 840 | </dt> |
| 841 | <dt class="hdlist1"> |
Junio C Hamano | dd5004a | 2015-05-06 19:33:32 | [diff] [blame] | 842 | -L :<funcname>:<file> |
Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 843 | </dt> |
| 844 | <dd> |
| 845 | <p> |
| 846 | Trace the evolution of the line range given by "<start>,<end>" |
Junio C Hamano | dd5004a | 2015-05-06 19:33:32 | [diff] [blame] | 847 | (or the function name regex <funcname>) within the <file>. You may |
Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 848 | not give any pathspec limiters. This is currently limited to |
| 849 | a walk starting from a single revision, i.e., you may only |
| 850 | give zero or one positive revision arguments. |
| 851 | You can specify this option more than once. |
| 852 | </p> |
| 853 | <div class="paragraph"><p><start> and <end> can take one of these forms:</p></div> |
| 854 | <div class="ulist"><ul> |
| 855 | <li> |
| 856 | <p> |
| 857 | number |
| 858 | </p> |
| 859 | <div class="paragraph"><p>If <start> or <end> is a number, it specifies an |
| 860 | absolute line number (lines count from 1).</p></div> |
| 861 | </li> |
| 862 | <li> |
| 863 | <p> |
| 864 | /regex/ |
| 865 | </p> |
| 866 | <div class="paragraph"><p>This form will use the first line matching the given |
Junio C Hamano | 8eac268 | 2013-09-09 22:35:20 | [diff] [blame] | 867 | POSIX regex. If <start> is a regex, it will search from the end of |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 868 | the previous <code>-L</code> range, if any, otherwise from the start of file. |
Junio C Hamano | 8eac268 | 2013-09-09 22:35:20 | [diff] [blame] | 869 | If <start> is “^/regex/”, it will search from the start of file. |
| 870 | If <end> is a regex, it will search |
Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 871 | starting at the line given by <start>.</p></div> |
| 872 | </li> |
| 873 | <li> |
| 874 | <p> |
| 875 | +offset or -offset |
| 876 | </p> |
| 877 | <div class="paragraph"><p>This is only valid for <end> and will specify a number |
| 878 | of lines before or after the line given by <start>.</p></div> |
| 879 | </li> |
Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 880 | </ul></div> |
Junio C Hamano | dd5004a | 2015-05-06 19:33:32 | [diff] [blame] | 881 | <div class="paragraph"><p>If “:<funcname>” is given in place of <start> and <end>, it is a |
| 882 | regular expression that denotes the range from the first funcname line |
| 883 | that matches <funcname>, up to the next funcname line. “:<funcname>” |
| 884 | searches from the end of the previous <code>-L</code> range, if any, otherwise |
| 885 | from the start of file. “^:<funcname>” searches from the start of |
| 886 | file.</p></div> |
Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 887 | </dd> |
| 888 | <dt class="hdlist1"> |
Junio C Hamano | f26c77e | 2013-04-27 00:06:04 | [diff] [blame] | 889 | <revision range> |
| 890 | </dt> |
| 891 | <dd> |
| 892 | <p> |
| 893 | Show only commits in the specified revision range. When no |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 894 | <revision range> is specified, it defaults to <code>HEAD</code> (i.e. the |
| 895 | whole history leading to the current commit). <code>origin..HEAD</code> |
Junio C Hamano | f26c77e | 2013-04-27 00:06:04 | [diff] [blame] | 896 | specifies all the commits reachable from the current commit |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 897 | (i.e. <code>HEAD</code>), but not from <code>origin</code>. For a complete list of |
Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 898 | ways to spell <revision range>, see the <em>Specifying Ranges</em> |
Junio C Hamano | f26c77e | 2013-04-27 00:06:04 | [diff] [blame] | 899 | section of <a href="gitrevisions.html">gitrevisions(7)</a>. |
| 900 | </p> |
| 901 | </dd> |
| 902 | <dt class="hdlist1"> |
Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 903 | [--] <path>… |
| 904 | </dt> |
| 905 | <dd> |
| 906 | <p> |
Junio C Hamano | 5723afa | 2011-08-31 00:49:23 | [diff] [blame] | 907 | Show only commits that are enough to explain how the files |
Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 908 | that match the specified paths came to be. See <em>History |
| 909 | Simplification</em> below for details and other simplification |
Junio C Hamano | 5723afa | 2011-08-31 00:49:23 | [diff] [blame] | 910 | modes. |
Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 911 | </p> |
Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 912 | <div class="paragraph"><p>Paths may need to be prefixed with ‘`-- '’ to separate them from |
Junio C Hamano | f26c77e | 2013-04-27 00:06:04 | [diff] [blame] | 913 | options or the revision range, when confusion arises.</p></div> |
Junio C Hamano | 78e3a78 | 2010-07-15 22:24:45 | [diff] [blame] | 914 | </dd> |
| 915 | </dl></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 916 | <div class="sect2"> |
| 917 | <h3 id="_commit_limiting">Commit Limiting</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 918 | <div class="paragraph"><p>Besides specifying a range of commits that should be listed using the |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 919 | special notations explained in the description, additional commit |
Junio C Hamano | 8ce35d7 | 2012-09-18 22:30:42 | [diff] [blame] | 920 | limiting may be applied.</p></div> |
| 921 | <div class="paragraph"><p>Using more options generally further limits the output (e.g. |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 922 | <code>--since=<date1></code> limits to commits newer than <code><date1></code>, and using it |
| 923 | with <code>--grep=<pattern></code> further limits to commits whose log message |
| 924 | has a line that matches <code><pattern></code>), unless otherwise noted.</p></div> |
Junio C Hamano | 8ce35d7 | 2012-09-18 22:30:42 | [diff] [blame] | 925 | <div class="paragraph"><p>Note that these are applied before commit |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 926 | ordering and formatting options, such as <code>--reverse</code>.</p></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 927 | <div class="openblock"> |
| 928 | <div class="content"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 929 | <div class="dlist"><dl> |
| 930 | <dt class="hdlist1"> |
Junio C Hamano | 693e709 | 2012-09-12 22:56:53 | [diff] [blame] | 931 | -<number> |
| 932 | </dt> |
| 933 | <dt class="hdlist1"> |
| 934 | -n <number> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 935 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 936 | <dt class="hdlist1"> |
Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 937 | --max-count=<number> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 938 | </dt> |
| 939 | <dd> |
| 940 | <p> |
Junio C Hamano | c5be4cc | 2011-03-09 07:20:43 | [diff] [blame] | 941 | Limit the number of commits to output. |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 942 | </p> |
| 943 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 944 | <dt class="hdlist1"> |
Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 945 | --skip=<number> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 946 | </dt> |
| 947 | <dd> |
| 948 | <p> |
| 949 | Skip <em>number</em> commits before starting to show the commit output. |
| 950 | </p> |
| 951 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 952 | <dt class="hdlist1"> |
Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 953 | --since=<date> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 954 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 955 | <dt class="hdlist1"> |
Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 956 | --after=<date> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 957 | </dt> |
| 958 | <dd> |
| 959 | <p> |
| 960 | Show commits more recent than a specific date. |
| 961 | </p> |
| 962 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 963 | <dt class="hdlist1"> |
Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 964 | --until=<date> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 965 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 966 | <dt class="hdlist1"> |
Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 967 | --before=<date> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 968 | </dt> |
| 969 | <dd> |
| 970 | <p> |
| 971 | Show commits older than a specific date. |
| 972 | </p> |
| 973 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 974 | <dt class="hdlist1"> |
Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 975 | --author=<pattern> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 976 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 977 | <dt class="hdlist1"> |
Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 978 | --committer=<pattern> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 979 | </dt> |
| 980 | <dd> |
| 981 | <p> |
| 982 | Limit the commits output to ones with author/committer |
Junio C Hamano | 8ce35d7 | 2012-09-18 22:30:42 | [diff] [blame] | 983 | header lines that match the specified pattern (regular |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 984 | expression). With more than one <code>--author=<pattern></code>, |
Junio C Hamano | 8ce35d7 | 2012-09-18 22:30:42 | [diff] [blame] | 985 | commits whose author matches any of the given patterns are |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 986 | chosen (similarly for multiple <code>--committer=<pattern></code>). |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 987 | </p> |
| 988 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 989 | <dt class="hdlist1"> |
Junio C Hamano | 9954ed7 | 2012-10-03 04:54:00 | [diff] [blame] | 990 | --grep-reflog=<pattern> |
| 991 | </dt> |
| 992 | <dd> |
| 993 | <p> |
| 994 | Limit the commits output to ones with reflog entries that |
| 995 | match the specified pattern (regular expression). With |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 996 | more than one <code>--grep-reflog</code>, commits whose reflog message |
Junio C Hamano | 9954ed7 | 2012-10-03 04:54:00 | [diff] [blame] | 997 | matches any of the given patterns are chosen. It is an |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 998 | error to use this option unless <code>--walk-reflogs</code> is in use. |
Junio C Hamano | 9954ed7 | 2012-10-03 04:54:00 | [diff] [blame] | 999 | </p> |
| 1000 | </dd> |
| 1001 | <dt class="hdlist1"> |
Junio C Hamano | b4a9ede | 2009-04-08 07:36:32 | [diff] [blame] | 1002 | --grep=<pattern> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1003 | </dt> |
| 1004 | <dd> |
| 1005 | <p> |
| 1006 | Limit the commits output to ones with log message that |
Junio C Hamano | 8ce35d7 | 2012-09-18 22:30:42 | [diff] [blame] | 1007 | matches the specified pattern (regular expression). With |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1008 | more than one <code>--grep=<pattern></code>, commits whose message |
Junio C Hamano | 8ce35d7 | 2012-09-18 22:30:42 | [diff] [blame] | 1009 | matches any of the given patterns are chosen (but see |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1010 | <code>--all-match</code>). |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1011 | </p> |
Junio C Hamano | 8152abf | 2015-04-28 22:48:02 | [diff] [blame] | 1012 | <div class="paragraph"><p>When <code>--show-notes</code> is in effect, the message from the notes is |
| 1013 | matched as if it were part of the log message.</p></div> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1014 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1015 | <dt class="hdlist1"> |
Junio C Hamano | aa17c7c | 2008-11-03 04:36:58 | [diff] [blame] | 1016 | --all-match |
| 1017 | </dt> |
| 1018 | <dd> |
| 1019 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1020 | Limit the commits output to ones that match all given <code>--grep</code>, |
Junio C Hamano | 8ce35d7 | 2012-09-18 22:30:42 | [diff] [blame] | 1021 | instead of ones that match at least one. |
Junio C Hamano | aa17c7c | 2008-11-03 04:36:58 | [diff] [blame] | 1022 | </p> |
| 1023 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1024 | <dt class="hdlist1"> |
Junio C Hamano | 6bb32e6 | 2015-02-17 22:11:26 | [diff] [blame] | 1025 | --invert-grep |
| 1026 | </dt> |
| 1027 | <dd> |
| 1028 | <p> |
| 1029 | Limit the commits output to ones with log message that do not |
| 1030 | match the pattern specified with <code>--grep=<pattern></code>. |
| 1031 | </p> |
| 1032 | </dd> |
| 1033 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1034 | -i |
| 1035 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1036 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1037 | --regexp-ignore-case |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1038 | </dt> |
| 1039 | <dd> |
| 1040 | <p> |
Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 1041 | Match the regular expression limiting patterns without regard to letter |
| 1042 | case. |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1043 | </p> |
| 1044 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1045 | <dt class="hdlist1"> |
Junio C Hamano | a129545 | 2012-11-13 22:32:04 | [diff] [blame] | 1046 | --basic-regexp |
| 1047 | </dt> |
| 1048 | <dd> |
| 1049 | <p> |
| 1050 | Consider the limiting patterns to be basic regular expressions; |
| 1051 | this is the default. |
| 1052 | </p> |
| 1053 | </dd> |
| 1054 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1055 | -E |
| 1056 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1057 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1058 | --extended-regexp |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1059 | </dt> |
| 1060 | <dd> |
| 1061 | <p> |
| 1062 | Consider the limiting patterns to be extended regular expressions |
| 1063 | instead of the default basic regular expressions. |
| 1064 | </p> |
| 1065 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1066 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1067 | -F |
| 1068 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1069 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1070 | --fixed-strings |
Junio C Hamano | 24bc09a | 2008-02-28 00:27:44 | [diff] [blame] | 1071 | </dt> |
| 1072 | <dd> |
| 1073 | <p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1074 | Consider the limiting patterns to be fixed strings (don’t interpret |
Junio C Hamano | 24bc09a | 2008-02-28 00:27:44 | [diff] [blame] | 1075 | pattern as a regular expression). |
| 1076 | </p> |
| 1077 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1078 | <dt class="hdlist1"> |
Junio C Hamano | a129545 | 2012-11-13 22:32:04 | [diff] [blame] | 1079 | --perl-regexp |
| 1080 | </dt> |
| 1081 | <dd> |
| 1082 | <p> |
Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 1083 | Consider the limiting patterns to be Perl-compatible regular expressions. |
Junio C Hamano | a129545 | 2012-11-13 22:32:04 | [diff] [blame] | 1084 | Requires libpcre to be compiled in. |
| 1085 | </p> |
| 1086 | </dd> |
| 1087 | <dt class="hdlist1"> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1088 | --remove-empty |
| 1089 | </dt> |
| 1090 | <dd> |
| 1091 | <p> |
| 1092 | Stop when a given path disappears from the tree. |
| 1093 | </p> |
| 1094 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1095 | <dt class="hdlist1"> |
Junio C Hamano | 934e178 | 2009-07-16 06:59:15 | [diff] [blame] | 1096 | --merges |
| 1097 | </dt> |
| 1098 | <dd> |
| 1099 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1100 | Print only merge commits. This is exactly the same as <code>--min-parents=2</code>. |
Junio C Hamano | 934e178 | 2009-07-16 06:59:15 | [diff] [blame] | 1101 | </p> |
| 1102 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1103 | <dt class="hdlist1"> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1104 | --no-merges |
| 1105 | </dt> |
| 1106 | <dd> |
| 1107 | <p> |
Junio C Hamano | f32ce26 | 2011-03-27 07:35:11 | [diff] [blame] | 1108 | Do not print commits with more than one parent. This is |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1109 | exactly the same as <code>--max-parents=1</code>. |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1110 | </p> |
| 1111 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1112 | <dt class="hdlist1"> |
Junio C Hamano | f32ce26 | 2011-03-27 07:35:11 | [diff] [blame] | 1113 | --min-parents=<number> |
| 1114 | </dt> |
| 1115 | <dt class="hdlist1"> |
| 1116 | --max-parents=<number> |
| 1117 | </dt> |
| 1118 | <dt class="hdlist1"> |
| 1119 | --no-min-parents |
| 1120 | </dt> |
| 1121 | <dt class="hdlist1"> |
| 1122 | --no-max-parents |
| 1123 | </dt> |
| 1124 | <dd> |
| 1125 | <p> |
Junio C Hamano | c5bb3b3 | 2013-08-05 22:43:36 | [diff] [blame] | 1126 | Show only commits which have at least (or at most) that many parent |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1127 | commits. In particular, <code>--max-parents=1</code> is the same as <code>--no-merges</code>, |
| 1128 | <code>--min-parents=2</code> is the same as <code>--merges</code>. <code>--max-parents=0</code> |
| 1129 | gives all root commits and <code>--min-parents=3</code> all octopus merges. |
Junio C Hamano | f32ce26 | 2011-03-27 07:35:11 | [diff] [blame] | 1130 | </p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1131 | <div class="paragraph"><p><code>--no-min-parents</code> and <code>--no-max-parents</code> reset these limits (to no limit) |
| 1132 | again. Equivalent forms are <code>--min-parents=0</code> (any commit has 0 or more |
| 1133 | parents) and <code>--max-parents=-1</code> (negative numbers denote no upper limit).</p></div> |
Junio C Hamano | f32ce26 | 2011-03-27 07:35:11 | [diff] [blame] | 1134 | </dd> |
| 1135 | <dt class="hdlist1"> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1136 | --first-parent |
| 1137 | </dt> |
| 1138 | <dd> |
| 1139 | <p> |
| 1140 | Follow only the first parent commit upon seeing a merge |
| 1141 | commit. This option can give a better overview when |
| 1142 | viewing the evolution of a particular topic branch, |
| 1143 | because merges into a topic branch tend to be only about |
| 1144 | adjusting to updated upstream from time to time, and |
| 1145 | this option allows you to ignore the individual commits |
Junio C Hamano | ef57d1e | 2015-03-25 21:23:00 | [diff] [blame] | 1146 | brought in to your history by such a merge. Cannot be |
| 1147 | combined with --bisect. |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [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 | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1151 | --not |
| 1152 | </dt> |
| 1153 | <dd> |
| 1154 | <p> |
| 1155 | Reverses the meaning of the <em>^</em> prefix (or lack thereof) |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1156 | for all following revision specifiers, up to the next <code>--not</code>. |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1157 | </p> |
| 1158 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1159 | <dt class="hdlist1"> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1160 | --all |
| 1161 | </dt> |
| 1162 | <dd> |
| 1163 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1164 | Pretend as if all the refs in <code>refs/</code> are listed on the |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1165 | command line as <em><commit></em>. |
| 1166 | </p> |
| 1167 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1168 | <dt class="hdlist1"> |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1169 | --branches[=<pattern>] |
Junio C Hamano | 5081985 | 2008-11-19 02:07:56 | [diff] [blame] | 1170 | </dt> |
| 1171 | <dd> |
| 1172 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1173 | Pretend as if all the refs in <code>refs/heads</code> are listed |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1174 | on the command line as <em><commit></em>. If <em><pattern></em> is given, limit |
Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1175 | branches to ones matching given shell glob. If pattern lacks <em>?</em>, |
Junio C Hamano | 81d540a | 2012-03-02 19:52:47 | [diff] [blame] | 1176 | <em>*</em>, or <em>[</em>, <em>/*</em> at the end is implied. |
Junio C Hamano | 5081985 | 2008-11-19 02:07:56 | [diff] [blame] | 1177 | </p> |
| 1178 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1179 | <dt class="hdlist1"> |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1180 | --tags[=<pattern>] |
Junio C Hamano | 5081985 | 2008-11-19 02:07:56 | [diff] [blame] | 1181 | </dt> |
| 1182 | <dd> |
| 1183 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1184 | Pretend as if all the refs in <code>refs/tags</code> are listed |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1185 | on the command line as <em><commit></em>. If <em><pattern></em> is given, limit |
Junio C Hamano | 81d540a | 2012-03-02 19:52:47 | [diff] [blame] | 1186 | tags to ones matching given shell glob. If pattern lacks <em>?</em>, <em>*</em>, |
| 1187 | or <em>[</em>, <em>/*</em> at the end is implied. |
Junio C Hamano | 5081985 | 2008-11-19 02:07:56 | [diff] [blame] | 1188 | </p> |
| 1189 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1190 | <dt class="hdlist1"> |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1191 | --remotes[=<pattern>] |
Junio C Hamano | 5081985 | 2008-11-19 02:07:56 | [diff] [blame] | 1192 | </dt> |
| 1193 | <dd> |
| 1194 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1195 | Pretend as if all the refs in <code>refs/remotes</code> are listed |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1196 | on the command line as <em><commit></em>. If <em><pattern></em> is given, limit |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 1197 | remote-tracking branches to ones matching given shell glob. |
Junio C Hamano | 81d540a | 2012-03-02 19:52:47 | [diff] [blame] | 1198 | If pattern lacks <em>?</em>, <em>*</em>, or <em>[</em>, <em>/*</em> at the end is implied. |
Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1199 | </p> |
| 1200 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1201 | <dt class="hdlist1"> |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1202 | --glob=<glob-pattern> |
Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1203 | </dt> |
| 1204 | <dd> |
| 1205 | <p> |
Junio C Hamano | d2179ef | 2010-10-22 04:12:17 | [diff] [blame] | 1206 | Pretend as if all the refs matching shell glob <em><glob-pattern></em> |
Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1207 | are listed on the command line as <em><commit></em>. Leading <em>refs/</em>, |
Junio C Hamano | 81d540a | 2012-03-02 19:52:47 | [diff] [blame] | 1208 | is automatically prepended if missing. If pattern lacks <em>?</em>, <em>*</em>, |
| 1209 | or <em>[</em>, <em>/*</em> at the end is implied. |
Junio C Hamano | 5081985 | 2008-11-19 02:07:56 | [diff] [blame] | 1210 | </p> |
| 1211 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1212 | <dt class="hdlist1"> |
Junio C Hamano | f079f70 | 2013-12-06 23:43:18 | [diff] [blame] | 1213 | --exclude=<glob-pattern> |
| 1214 | </dt> |
| 1215 | <dd> |
| 1216 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1217 | Do not include refs matching <em><glob-pattern></em> that the next <code>--all</code>, |
| 1218 | <code>--branches</code>, <code>--tags</code>, <code>--remotes</code>, or <code>--glob</code> would otherwise |
Junio C Hamano | f079f70 | 2013-12-06 23:43:18 | [diff] [blame] | 1219 | consider. Repetitions of this option accumulate exclusion patterns |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1220 | up to the next <code>--all</code>, <code>--branches</code>, <code>--tags</code>, <code>--remotes</code>, or |
| 1221 | <code>--glob</code> option (other options or arguments do not clear |
Junio C Hamano | fb5ffde | 2014-11-04 22:38:56 | [diff] [blame] | 1222 | accumulated patterns). |
Junio C Hamano | f079f70 | 2013-12-06 23:43:18 | [diff] [blame] | 1223 | </p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1224 | <div class="paragraph"><p>The patterns given should not begin with <code>refs/heads</code>, <code>refs/tags</code>, or |
| 1225 | <code>refs/remotes</code> when applied to <code>--branches</code>, <code>--tags</code>, or <code>--remotes</code>, |
| 1226 | respectively, and they must begin with <code>refs/</code> when applied to <code>--glob</code> |
| 1227 | or <code>--all</code>. If a trailing <em>/*</em> is intended, it must be given |
Junio C Hamano | f079f70 | 2013-12-06 23:43:18 | [diff] [blame] | 1228 | explicitly.</p></div> |
| 1229 | </dd> |
| 1230 | <dt class="hdlist1"> |
Junio C Hamano | 2a4bcbc | 2014-10-29 20:07:39 | [diff] [blame] | 1231 | --reflog |
| 1232 | </dt> |
| 1233 | <dd> |
| 1234 | <p> |
| 1235 | Pretend as if all objects mentioned by reflogs are listed on the |
| 1236 | command line as <code><commit></code>. |
| 1237 | </p> |
| 1238 | </dd> |
| 1239 | <dt class="hdlist1"> |
Junio C Hamano | 084228c | 2011-05-30 08:13:52 | [diff] [blame] | 1240 | --ignore-missing |
| 1241 | </dt> |
| 1242 | <dd> |
| 1243 | <p> |
| 1244 | Upon seeing an invalid object name in the input, pretend as if |
| 1245 | the bad input was not given. |
| 1246 | </p> |
| 1247 | </dd> |
| 1248 | <dt class="hdlist1"> |
Junio C Hamano | 5706e0b | 2009-11-24 10:54:16 | [diff] [blame] | 1249 | --bisect |
| 1250 | </dt> |
| 1251 | <dd> |
| 1252 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1253 | Pretend as if the bad bisection ref <code>refs/bisect/bad</code> |
| 1254 | was listed and as if it was followed by <code>--not</code> and the good |
| 1255 | bisection refs <code>refs/bisect/good-*</code> on the command |
Junio C Hamano | ef57d1e | 2015-03-25 21:23:00 | [diff] [blame] | 1256 | line. Cannot be combined with --first-parent. |
Junio C Hamano | 5706e0b | 2009-11-24 10:54:16 | [diff] [blame] | 1257 | </p> |
| 1258 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1259 | <dt class="hdlist1"> |
Junio C Hamano | 5706e0b | 2009-11-24 10:54:16 | [diff] [blame] | 1260 | --stdin |
| 1261 | </dt> |
| 1262 | <dd> |
| 1263 | <p> |
| 1264 | In addition to the <em><commit></em> listed on the command |
| 1265 | line, read them from the standard input. If a <em>--</em> separator is |
| 1266 | seen, stop reading commits and start reading paths to limit the |
| 1267 | result. |
| 1268 | </p> |
| 1269 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1270 | <dt class="hdlist1"> |
Junio C Hamano | 9a2fb2d | 2011-03-23 05:40:15 | [diff] [blame] | 1271 | --cherry-mark |
| 1272 | </dt> |
| 1273 | <dd> |
| 1274 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1275 | Like <code>--cherry-pick</code> (see below) but mark equivalent commits |
| 1276 | with <code>=</code> rather than omitting them, and inequivalent ones with <code>+</code>. |
Junio C Hamano | 9a2fb2d | 2011-03-23 05:40:15 | [diff] [blame] | 1277 | </p> |
| 1278 | </dd> |
| 1279 | <dt class="hdlist1"> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1280 | --cherry-pick |
| 1281 | </dt> |
| 1282 | <dd> |
| 1283 | <p> |
| 1284 | Omit any commit that introduces the same change as |
Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 1285 | another commit on the “other side” when the set of |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1286 | commits are limited with symmetric difference. |
| 1287 | </p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1288 | <div class="paragraph"><p>For example, if you have two branches, <code>A</code> and <code>B</code>, a usual way |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1289 | to list all commits on only one side of them is with |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1290 | <code>--left-right</code> (see the example below in the description of |
| 1291 | the <code>--left-right</code> option). However, it shows the commits that were |
Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 1292 | cherry-picked from the other branch (for example, “3rd on b” may be |
| 1293 | cherry-picked from branch A). With this option, such pairs of commits are |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1294 | excluded from the output.</p></div> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1295 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1296 | <dt class="hdlist1"> |
Junio C Hamano | 9a2fb2d | 2011-03-23 05:40:15 | [diff] [blame] | 1297 | --left-only |
| 1298 | </dt> |
| 1299 | <dt class="hdlist1"> |
| 1300 | --right-only |
| 1301 | </dt> |
| 1302 | <dd> |
| 1303 | <p> |
| 1304 | List only commits on the respective side of a symmetric range, |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1305 | i.e. only those which would be marked <code><</code> resp. <code>></code> by |
| 1306 | <code>--left-right</code>. |
Junio C Hamano | 9a2fb2d | 2011-03-23 05:40:15 | [diff] [blame] | 1307 | </p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1308 | <div class="paragraph"><p>For example, <code>--cherry-pick --right-only A...B</code> omits those |
| 1309 | commits from <code>B</code> which are in <code>A</code> or are patch-equivalent to a commit in |
| 1310 | <code>A</code>. In other words, this lists the <code>+</code> commits from <code>git cherry A B</code>. |
| 1311 | More precisely, <code>--cherry-pick --right-only --no-merges</code> gives the exact |
Junio C Hamano | 9a2fb2d | 2011-03-23 05:40:15 | [diff] [blame] | 1312 | list.</p></div> |
| 1313 | </dd> |
| 1314 | <dt class="hdlist1"> |
| 1315 | --cherry |
| 1316 | </dt> |
| 1317 | <dd> |
| 1318 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1319 | A synonym for <code>--right-only --cherry-mark --no-merges</code>; useful to |
Junio C Hamano | 9a2fb2d | 2011-03-23 05:40:15 | [diff] [blame] | 1320 | limit the output to the commits on our side and mark those that |
| 1321 | have been applied to the other side of a forked history with |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1322 | <code>git log --cherry upstream...mybranch</code>, similar to |
| 1323 | <code>git cherry upstream mybranch</code>. |
Junio C Hamano | 9a2fb2d | 2011-03-23 05:40:15 | [diff] [blame] | 1324 | </p> |
| 1325 | </dd> |
| 1326 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1327 | -g |
| 1328 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1329 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1330 | --walk-reflogs |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1331 | </dt> |
| 1332 | <dd> |
| 1333 | <p> |
| 1334 | Instead of walking the commit ancestry chain, walk |
| 1335 | reflog entries from the most recent one to older ones. |
| 1336 | When this option is used you cannot specify commits to |
| 1337 | exclude (that is, <em>^commit</em>, <em>commit1..commit2</em>, |
Junio C Hamano | d75148a | 2014-04-08 19:48:38 | [diff] [blame] | 1338 | and <em>commit1...commit2</em> notations cannot be used). |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1339 | </p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1340 | <div class="paragraph"><p>With <code>--pretty</code> format other than <code>oneline</code> (for obvious reasons), |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1341 | this causes the output to have two extra lines of information |
| 1342 | taken from the reflog. By default, <em>commit@{Nth}</em> notation is |
| 1343 | used in the output. When the starting commit is specified as |
Junio C Hamano | 1d36888 | 2008-08-11 22:03:10 | [diff] [blame] | 1344 | <em>commit@{now}</em>, output also uses <em>commit@{timestamp}</em> notation |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1345 | instead. Under <code>--pretty=oneline</code>, the commit message is |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1346 | prefixed with this information on the same line. |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1347 | This option cannot be combined with <code>--reverse</code>. |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1348 | See also <a href="git-reflog.html">git-reflog(1)</a>.</p></div> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1349 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1350 | <dt class="hdlist1"> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1351 | --merge |
| 1352 | </dt> |
| 1353 | <dd> |
| 1354 | <p> |
| 1355 | After a failed merge, show refs that touch files having a |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1356 | conflict and don’t exist on all heads to merge. |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1357 | </p> |
| 1358 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1359 | <dt class="hdlist1"> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1360 | --boundary |
| 1361 | </dt> |
| 1362 | <dd> |
| 1363 | <p> |
Junio C Hamano | 27159f8 | 2013-06-14 17:19:22 | [diff] [blame] | 1364 | Output excluded boundary commits. Boundary commits are |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1365 | prefixed with <code>-</code>. |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1366 | </p> |
| 1367 | </dd> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1368 | </dl></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1369 | </div></div> |
| 1370 | </div> |
| 1371 | <div class="sect2"> |
| 1372 | <h3 id="_history_simplification">History Simplification</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1373 | <div class="paragraph"><p>Sometimes you are only interested in parts of the history, for example the |
Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1374 | commits modifying a particular <path>. But there are two parts of |
| 1375 | <em>History Simplification</em>, one part is selecting the commits and the other |
| 1376 | is how to do it, as there are various strategies to simplify the history.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1377 | <div class="paragraph"><p>The following options select the commits to be shown:</p></div> |
| 1378 | <div class="dlist"><dl> |
| 1379 | <dt class="hdlist1"> |
Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1380 | <paths> |
| 1381 | </dt> |
| 1382 | <dd> |
| 1383 | <p> |
| 1384 | Commits modifying the given <paths> are selected. |
| 1385 | </p> |
| 1386 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1387 | <dt class="hdlist1"> |
Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1388 | --simplify-by-decoration |
| 1389 | </dt> |
| 1390 | <dd> |
| 1391 | <p> |
| 1392 | Commits that are referred by some branch or tag are selected. |
| 1393 | </p> |
| 1394 | </dd> |
| 1395 | </dl></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1396 | <div class="paragraph"><p>Note that extra commits can be shown to give a meaningful history.</p></div> |
| 1397 | <div class="paragraph"><p>The following options affect the way the simplification is performed:</p></div> |
| 1398 | <div class="dlist"><dl> |
| 1399 | <dt class="hdlist1"> |
Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1400 | Default mode |
| 1401 | </dt> |
| 1402 | <dd> |
| 1403 | <p> |
| 1404 | Simplifies the history to the simplest history explaining the |
| 1405 | final state of the tree. Simplest because it prunes some side |
| 1406 | branches if the end result is the same (i.e. merging branches |
| 1407 | with the same content) |
| 1408 | </p> |
| 1409 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1410 | <dt class="hdlist1"> |
Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1411 | --full-history |
| 1412 | </dt> |
| 1413 | <dd> |
| 1414 | <p> |
Junio C Hamano | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 1415 | Same as the default mode, but does not prune some history. |
Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1416 | </p> |
| 1417 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1418 | <dt class="hdlist1"> |
Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1419 | --dense |
| 1420 | </dt> |
| 1421 | <dd> |
| 1422 | <p> |
| 1423 | Only the selected commits are shown, plus some to have a |
| 1424 | meaningful history. |
| 1425 | </p> |
| 1426 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1427 | <dt class="hdlist1"> |
Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1428 | --sparse |
| 1429 | </dt> |
| 1430 | <dd> |
| 1431 | <p> |
| 1432 | All commits in the simplified history are shown. |
| 1433 | </p> |
| 1434 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1435 | <dt class="hdlist1"> |
Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1436 | --simplify-merges |
| 1437 | </dt> |
| 1438 | <dd> |
| 1439 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1440 | Additional option to <code>--full-history</code> to remove some needless |
Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1441 | merges from the resulting history, as there are no selected |
| 1442 | commits contributing to this merge. |
| 1443 | </p> |
| 1444 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1445 | <dt class="hdlist1"> |
Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1446 | --ancestry-path |
| 1447 | </dt> |
| 1448 | <dd> |
| 1449 | <p> |
| 1450 | When given a range of commits to display (e.g. <em>commit1..commit2</em> |
| 1451 | or <em>commit2 ^commit1</em>), only display commits that exist |
| 1452 | directly on the ancestry chain between the <em>commit1</em> and |
| 1453 | <em>commit2</em>, i.e. commits that are both descendants of <em>commit1</em>, |
| 1454 | and ancestors of <em>commit2</em>. |
| 1455 | </p> |
| 1456 | </dd> |
Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1457 | </dl></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1458 | <div class="paragraph"><p>A more detailed explanation follows.</p></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1459 | <div class="paragraph"><p>Suppose you specified <code>foo</code> as the <paths>. We shall call commits |
| 1460 | that modify <code>foo</code> !TREESAME, and the rest TREESAME. (In a diff |
| 1461 | filtered for <code>foo</code>, they look different and equal, respectively.)</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1462 | <div class="paragraph"><p>In the following, we will always refer to the same example history to |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1463 | illustrate the differences between simplification settings. We assume |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1464 | that you are filtering for a file <code>foo</code> in this commit graph:</p></div> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1465 | <div class="listingblock"> |
| 1466 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1467 | <pre><code> .-A---M---N---O---P---Q |
Junio C Hamano | 27159f8 | 2013-06-14 17:19:22 | [diff] [blame] | 1468 | / / / / / / |
| 1469 | I B C D E Y |
| 1470 | \ / / / / / |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1471 | `-------------' X</code></pre> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1472 | </div></div> |
Junio C Hamano | 27159f8 | 2013-06-14 17:19:22 | [diff] [blame] | 1473 | <div class="paragraph"><p>The horizontal line of history A---Q is taken to be the first parent of |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1474 | each merge. The commits are:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1475 | <div class="ulist"><ul> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1476 | <li> |
| 1477 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1478 | <code>I</code> is the initial commit, in which <code>foo</code> exists with contents |
| 1479 | “asdf”, and a file <code>quux</code> exists with contents “quux”. Initial |
| 1480 | commits are compared to an empty tree, so <code>I</code> is !TREESAME. |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1481 | </p> |
| 1482 | </li> |
| 1483 | <li> |
| 1484 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1485 | In <code>A</code>, <code>foo</code> contains just “foo”. |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1486 | </p> |
| 1487 | </li> |
| 1488 | <li> |
| 1489 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1490 | <code>B</code> contains the same change as <code>A</code>. Its merge <code>M</code> is trivial and |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1491 | hence TREESAME to all parents. |
| 1492 | </p> |
| 1493 | </li> |
| 1494 | <li> |
| 1495 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1496 | <code>C</code> does not change <code>foo</code>, but its merge <code>N</code> changes it to “foobar”, |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1497 | so it is not TREESAME to any parent. |
| 1498 | </p> |
| 1499 | </li> |
| 1500 | <li> |
| 1501 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1502 | <code>D</code> sets <code>foo</code> to “baz”. Its merge <code>O</code> combines the strings from |
| 1503 | <code>N</code> and <code>D</code> to “foobarbaz”; i.e., it is not TREESAME to any parent. |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1504 | </p> |
| 1505 | </li> |
| 1506 | <li> |
| 1507 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1508 | <code>E</code> changes <code>quux</code> to “xyzzy”, and its merge <code>P</code> combines the |
| 1509 | strings to “quux xyzzy”. <code>P</code> is TREESAME to <code>O</code>, but not to <code>E</code>. |
Junio C Hamano | 27159f8 | 2013-06-14 17:19:22 | [diff] [blame] | 1510 | </p> |
| 1511 | </li> |
| 1512 | <li> |
| 1513 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1514 | <code>X</code> is an independent root commit that added a new file <code>side</code>, and <code>Y</code> |
| 1515 | modified it. <code>Y</code> is TREESAME to <code>X</code>. Its merge <code>Q</code> added <code>side</code> to <code>P</code>, and |
| 1516 | <code>Q</code> is TREESAME to <code>P</code>, but not to <code>Y</code>. |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1517 | </p> |
| 1518 | </li> |
| 1519 | </ul></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1520 | <div class="paragraph"><p><code>rev-list</code> walks backwards through history, including or excluding |
| 1521 | commits based on whether <code>--full-history</code> and/or parent rewriting |
| 1522 | (via <code>--parents</code> or <code>--children</code>) are used. The following settings |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1523 | are available.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1524 | <div class="dlist"><dl> |
| 1525 | <dt class="hdlist1"> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1526 | Default mode |
| 1527 | </dt> |
| 1528 | <dd> |
| 1529 | <p> |
| 1530 | Commits are included if they are not TREESAME to any parent |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1531 | (though this can be changed, see <code>--sparse</code> below). If the |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1532 | commit was a merge, and it was TREESAME to one parent, follow |
| 1533 | only that parent. (Even if there are several TREESAME |
| 1534 | parents, follow only one of them.) Otherwise, follow all |
| 1535 | parents. |
| 1536 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1537 | <div class="paragraph"><p>This results in:</p></div> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1538 | <div class="listingblock"> |
| 1539 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1540 | <pre><code> .-A---N---O |
Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1541 | / / / |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1542 | I---------D</code></pre> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1543 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1544 | <div class="paragraph"><p>Note how the rule to only follow the TREESAME parent, if one is |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1545 | available, removed <code>B</code> from consideration entirely. <code>C</code> was |
| 1546 | considered via <code>N</code>, but is TREESAME. Root commits are compared to an |
| 1547 | empty tree, so <code>I</code> is !TREESAME.</p></div> |
| 1548 | <div class="paragraph"><p>Parent/child relations are only visible with <code>--parents</code>, but that does |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1549 | not affect the commits selected in default mode, so we have shown the |
| 1550 | parent lines.</p></div> |
| 1551 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1552 | <dt class="hdlist1"> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1553 | --full-history without parent rewriting |
| 1554 | </dt> |
| 1555 | <dd> |
| 1556 | <p> |
| 1557 | This mode differs from the default in one point: always follow |
| 1558 | all parents of a merge, even if it is TREESAME to one of them. |
| 1559 | Even if more than one side of the merge has commits that are |
| 1560 | included, this does not imply that the merge itself is! In |
| 1561 | the example, we get |
| 1562 | </p> |
| 1563 | <div class="listingblock"> |
| 1564 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1565 | <pre><code> I A B N D O P Q</code></pre> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1566 | </div></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1567 | <div class="paragraph"><p><code>M</code> was excluded because it is TREESAME to both parents. <code>E</code>, |
| 1568 | <code>C</code> and <code>B</code> were all walked, but only <code>B</code> was !TREESAME, so the others |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1569 | do not appear.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1570 | <div class="paragraph"><p>Note that without parent rewriting, it is not really possible to talk |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1571 | about the parent/child relationships between the commits, so we show |
| 1572 | them disconnected.</p></div> |
| 1573 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1574 | <dt class="hdlist1"> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1575 | --full-history with parent rewriting |
| 1576 | </dt> |
| 1577 | <dd> |
| 1578 | <p> |
| 1579 | Ordinary commits are only included if they are !TREESAME |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1580 | (though this can be changed, see <code>--sparse</code> below). |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1581 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1582 | <div class="paragraph"><p>Merges are always included. However, their parent list is rewritten: |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1583 | Along each parent, prune away commits that are not included |
| 1584 | themselves. This results in</p></div> |
| 1585 | <div class="listingblock"> |
| 1586 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1587 | <pre><code> .-A---M---N---O---P---Q |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1588 | / / / / / |
| 1589 | I B / D / |
| 1590 | \ / / / / |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1591 | `-------------'</code></pre> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1592 | </div></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1593 | <div class="paragraph"><p>Compare to <code>--full-history</code> without rewriting above. Note that <code>E</code> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1594 | was pruned away because it is TREESAME, but the parent list of P was |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1595 | rewritten to contain <code>E</code>'s parent <code>I</code>. The same happened for <code>C</code> and |
| 1596 | <code>N</code>, and <code>X</code>, <code>Y</code> and <code>Q</code>.</p></div> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1597 | </dd> |
| 1598 | </dl></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1599 | <div class="paragraph"><p>In addition to the above settings, you can change whether TREESAME |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1600 | affects inclusion:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1601 | <div class="dlist"><dl> |
| 1602 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1603 | --dense |
| 1604 | </dt> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1605 | <dd> |
| 1606 | <p> |
| 1607 | Commits that are walked are included if they are not TREESAME |
| 1608 | to any parent. |
| 1609 | </p> |
| 1610 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1611 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1612 | --sparse |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1613 | </dt> |
| 1614 | <dd> |
| 1615 | <p> |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1616 | All commits that are walked are included. |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1617 | </p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1618 | <div class="paragraph"><p>Note that without <code>--full-history</code>, this still simplifies merges: if |
Junio C Hamano | a76cb0d | 2008-08-13 20:04:10 | [diff] [blame] | 1619 | one of the parents is TREESAME, we follow only that one, so the other |
| 1620 | sides of the merge are never walked.</p></div> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1621 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1622 | <dt class="hdlist1"> |
Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1623 | --simplify-merges |
| 1624 | </dt> |
| 1625 | <dd> |
| 1626 | <p> |
| 1627 | First, build a history graph in the same way that |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1628 | <code>--full-history</code> with parent rewriting does (see above). |
Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1629 | </p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1630 | <div class="paragraph"><p>Then simplify each commit <code>C</code> to its replacement <code>C'</code> in the final |
Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1631 | history according to the following rules:</p></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1632 | <div class="openblock"> |
| 1633 | <div class="content"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1634 | <div class="ulist"><ul> |
Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1635 | <li> |
| 1636 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1637 | Set <code>C'</code> to <code>C</code>. |
Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1638 | </p> |
| 1639 | </li> |
| 1640 | <li> |
| 1641 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1642 | Replace each parent <code>P</code> of <code>C'</code> with its simplification <code>P'</code>. In |
Junio C Hamano | 27159f8 | 2013-06-14 17:19:22 | [diff] [blame] | 1643 | the process, drop parents that are ancestors of other parents or that are |
| 1644 | root commits TREESAME to an empty tree, and remove duplicates, but take care |
| 1645 | to never drop all parents that we are TREESAME to. |
Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1646 | </p> |
| 1647 | </li> |
| 1648 | <li> |
| 1649 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1650 | If after this parent rewriting, <code>C'</code> is a root or merge commit (has |
Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1651 | zero or >1 parents), a boundary commit, or !TREESAME, it remains. |
| 1652 | Otherwise, it is replaced with its only parent. |
| 1653 | </p> |
| 1654 | </li> |
| 1655 | </ul></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1656 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1657 | <div class="paragraph"><p>The effect of this is best shown by way of comparing to |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1658 | <code>--full-history</code> with parent rewriting. The example turns into:</p></div> |
Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1659 | <div class="listingblock"> |
| 1660 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1661 | <pre><code> .-A---M---N---O |
Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1662 | / / / |
| 1663 | I B D |
| 1664 | \ / / |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1665 | `---------'</code></pre> |
Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1666 | </div></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1667 | <div class="paragraph"><p>Note the major differences in <code>N</code>, <code>P</code>, and <code>Q</code> over <code>--full-history</code>:</p></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1668 | <div class="openblock"> |
| 1669 | <div class="content"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1670 | <div class="ulist"><ul> |
Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1671 | <li> |
| 1672 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1673 | <code>N</code>'s parent list had <code>I</code> removed, because it is an ancestor of the |
| 1674 | other parent <code>M</code>. Still, <code>N</code> remained because it is !TREESAME. |
Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1675 | </p> |
| 1676 | </li> |
| 1677 | <li> |
| 1678 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1679 | <code>P</code>'s parent list similarly had <code>I</code> removed. <code>P</code> was then |
Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1680 | removed completely, because it had one parent and is TREESAME. |
| 1681 | </p> |
| 1682 | </li> |
Junio C Hamano | 27159f8 | 2013-06-14 17:19:22 | [diff] [blame] | 1683 | <li> |
| 1684 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1685 | <code>Q</code>'s parent list had <code>Y</code> simplified to <code>X</code>. <code>X</code> was then removed, because it |
| 1686 | was a TREESAME root. <code>Q</code> was then removed completely, because it had one |
Junio C Hamano | 27159f8 | 2013-06-14 17:19:22 | [diff] [blame] | 1687 | parent and is TREESAME. |
| 1688 | </p> |
| 1689 | </li> |
Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1690 | </ul></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1691 | </div></div> |
Junio C Hamano | a2f4662 | 2008-09-03 05:20:31 | [diff] [blame] | 1692 | </dd> |
| 1693 | </dl></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1694 | <div class="paragraph"><p>Finally, there is a fifth simplification mode available:</p></div> |
| 1695 | <div class="dlist"><dl> |
| 1696 | <dt class="hdlist1"> |
Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1697 | --ancestry-path |
| 1698 | </dt> |
| 1699 | <dd> |
| 1700 | <p> |
| 1701 | Limit the displayed commits to those directly on the ancestry |
Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 1702 | chain between the “from” and “to” commits in the given commit |
| 1703 | range. I.e. only display commits that are ancestor of the “to” |
| 1704 | commit and descendants of the “from” commit. |
Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1705 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1706 | <div class="paragraph"><p>As an example use case, consider the following commit history:</p></div> |
Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1707 | <div class="listingblock"> |
| 1708 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1709 | <pre><code> D---E-------F |
Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1710 | / \ \ |
| 1711 | B---C---G---H---I---J |
| 1712 | / \ |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1713 | A-------K---------------L--M</code></pre> |
Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1714 | </div></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1715 | <div class="paragraph"><p>A regular <em>D..M</em> computes the set of commits that are ancestors of <code>M</code>, |
| 1716 | but excludes the ones that are ancestors of <code>D</code>. This is useful to see |
| 1717 | what happened to the history leading to <code>M</code> since <code>D</code>, in the sense |
| 1718 | that “what does <code>M</code> have that did not exist in <code>D</code>”. The result in this |
| 1719 | example would be all the commits, except <code>A</code> and <code>B</code> (and <code>D</code> itself, |
Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1720 | of course).</p></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1721 | <div class="paragraph"><p>When we want to find out what commits in <code>M</code> are contaminated with the |
| 1722 | bug introduced by <code>D</code> and need fixing, however, we might want to view |
| 1723 | only the subset of <em>D..M</em> that are actually descendants of <code>D</code>, i.e. |
| 1724 | excluding <code>C</code> and <code>K</code>. This is exactly what the <code>--ancestry-path</code> |
Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1725 | option does. Applied to the <em>D..M</em> range, it results in:</p></div> |
| 1726 | <div class="listingblock"> |
| 1727 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1728 | <pre><code> E-------F |
Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1729 | \ \ |
| 1730 | G---H---I---J |
| 1731 | \ |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1732 | L--M</code></pre> |
Junio C Hamano | 89a5734 | 2010-06-22 23:22:55 | [diff] [blame] | 1733 | </div></div> |
| 1734 | </dd> |
| 1735 | </dl></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1736 | <div class="paragraph"><p>The <code>--simplify-by-decoration</code> option allows you to view only the |
Junio C Hamano | 2836349 | 2008-11-14 08:26:31 | [diff] [blame] | 1737 | big picture of the topology of the history, by omitting commits |
| 1738 | that are not referenced by tags. Commits are marked as !TREESAME |
| 1739 | (in other words, kept after history simplification rules described |
| 1740 | above) if (1) they are referenced by tags, or (2) they change the |
| 1741 | contents of the paths given on the command line. All other |
| 1742 | commits are marked as TREESAME (subject to be simplified away).</p></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1743 | </div> |
| 1744 | <div class="sect2"> |
| 1745 | <h3 id="_commit_ordering">Commit Ordering</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1746 | <div class="paragraph"><p>By default, the commits are shown in reverse chronological order.</p></div> |
| 1747 | <div class="dlist"><dl> |
| 1748 | <dt class="hdlist1"> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1749 | --date-order |
| 1750 | </dt> |
| 1751 | <dd> |
| 1752 | <p> |
Junio C Hamano | d031611 | 2012-08-22 19:55:29 | [diff] [blame] | 1753 | Show no parents before all of its children are shown, but |
| 1754 | otherwise show commits in the commit timestamp order. |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1755 | </p> |
| 1756 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1757 | <dt class="hdlist1"> |
Junio C Hamano | a195230 | 2013-07-01 21:31:18 | [diff] [blame] | 1758 | --author-date-order |
| 1759 | </dt> |
| 1760 | <dd> |
| 1761 | <p> |
| 1762 | Show no parents before all of its children are shown, but |
| 1763 | otherwise show commits in the author timestamp order. |
| 1764 | </p> |
| 1765 | </dd> |
| 1766 | <dt class="hdlist1"> |
Junio C Hamano | d031611 | 2012-08-22 19:55:29 | [diff] [blame] | 1767 | --topo-order |
| 1768 | </dt> |
| 1769 | <dd> |
| 1770 | <p> |
| 1771 | Show no parents before all of its children are shown, and |
| 1772 | avoid showing commits on multiple lines of history |
| 1773 | intermixed. |
| 1774 | </p> |
| 1775 | <div class="paragraph"><p>For example, in a commit history like this:</p></div> |
| 1776 | <div class="listingblock"> |
| 1777 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1778 | <pre><code> ---1----2----4----7 |
Junio C Hamano | d031611 | 2012-08-22 19:55:29 | [diff] [blame] | 1779 | \ \ |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1780 | 3----5----6----8---</code></pre> |
Junio C Hamano | d031611 | 2012-08-22 19:55:29 | [diff] [blame] | 1781 | </div></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1782 | <div class="paragraph"><p>where the numbers denote the order of commit timestamps, <code>git |
| 1783 | rev-list</code> and friends with <code>--date-order</code> show the commits in the |
Junio C Hamano | d031611 | 2012-08-22 19:55:29 | [diff] [blame] | 1784 | timestamp order: 8 7 6 5 4 3 2 1.</p></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1785 | <div class="paragraph"><p>With <code>--topo-order</code>, they would show 8 6 5 3 7 4 2 1 (or 8 7 4 2 6 5 |
Junio C Hamano | d031611 | 2012-08-22 19:55:29 | [diff] [blame] | 1786 | 3 1); some older commits are shown before newer ones in order to |
| 1787 | avoid showing the commits from two parallel development track mixed |
| 1788 | together.</p></div> |
| 1789 | </dd> |
| 1790 | <dt class="hdlist1"> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1791 | --reverse |
| 1792 | </dt> |
| 1793 | <dd> |
| 1794 | <p> |
| 1795 | Output the commits in reverse order. |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1796 | Cannot be combined with <code>--walk-reflogs</code>. |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1797 | </p> |
| 1798 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1799 | </dl></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1800 | </div> |
| 1801 | <div class="sect2"> |
| 1802 | <h3 id="_object_traversal">Object Traversal</h3> |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 1803 | <div class="paragraph"><p>These options are mostly targeted for packing of Git repositories.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1804 | <div class="dlist"><dl> |
| 1805 | <dt class="hdlist1"> |
Junio C Hamano | eccdd4a | 2012-09-10 23:28:17 | [diff] [blame] | 1806 | --no-walk[=(sorted|unsorted)] |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1807 | </dt> |
| 1808 | <dd> |
| 1809 | <p> |
Junio C Hamano | eccdd4a | 2012-09-10 23:28:17 | [diff] [blame] | 1810 | Only show the given commits, but do not traverse their ancestors. |
| 1811 | This has no effect if a range is specified. If the argument |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1812 | <code>unsorted</code> is given, the commits are shown in the order they were |
| 1813 | given on the command line. Otherwise (if <code>sorted</code> or no argument |
Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 1814 | was given), the commits are shown in reverse chronological order |
Junio C Hamano | eccdd4a | 2012-09-10 23:28:17 | [diff] [blame] | 1815 | by commit time. |
Junio C Hamano | ef57d1e | 2015-03-25 21:23:00 | [diff] [blame] | 1816 | Cannot be combined with <code>--graph</code>. |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1817 | </p> |
| 1818 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1819 | <dt class="hdlist1"> |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1820 | --do-walk |
| 1821 | </dt> |
| 1822 | <dd> |
| 1823 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1824 | Overrides a previous <code>--no-walk</code>. |
Junio C Hamano | b0e0295 | 2008-01-19 08:02:00 | [diff] [blame] | 1825 | </p> |
| 1826 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1827 | </dl></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 1828 | </div> |
| 1829 | <div class="sect2"> |
| 1830 | <h3 id="_commit_formatting">Commit Formatting</h3> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 1831 | <div class="dlist"><dl> |
| 1832 | <dt class="hdlist1"> |
| 1833 | --pretty[=<format>] |
| 1834 | </dt> |
| 1835 | <dt class="hdlist1"> |
| 1836 | --format=<format> |
| 1837 | </dt> |
| 1838 | <dd> |
| 1839 | <p> |
| 1840 | Pretty-print the contents of the commit logs in a given format, |
| 1841 | 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] | 1842 | <em>full</em>, <em>fuller</em>, <em>email</em>, <em>raw</em>, <em>format:<string></em> |
| 1843 | and <em>tformat:<string></em>. When <em><format></em> is none of the above, |
| 1844 | and has <em>%placeholder</em> in it, it acts as if |
| 1845 | <em>--pretty=tformat:<format></em> were given. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 1846 | </p> |
Junio C Hamano | 6bb32e6 | 2015-02-17 22:11:26 | [diff] [blame] | 1847 | <div class="paragraph"><p>See the "PRETTY FORMATS" section for some additional details for each |
| 1848 | format. When <em>=<format></em> part is omitted, it defaults to <em>medium</em>.</p></div> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 1849 | <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] | 1850 | configuration (see <a href="git-config.html">git-config(1)</a>).</p></div> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 1851 | </dd> |
| 1852 | <dt class="hdlist1"> |
| 1853 | --abbrev-commit |
| 1854 | </dt> |
| 1855 | <dd> |
| 1856 | <p> |
| 1857 | Instead of showing the full 40-byte hexadecimal commit object |
| 1858 | name, show only a partial prefix. Non default number of |
| 1859 | digits can be specified with "--abbrev=<n>" (which also modifies |
| 1860 | diff output, if it is displayed). |
| 1861 | </p> |
| 1862 | <div class="paragraph"><p>This should make "--pretty=oneline" a whole lot more readable for |
| 1863 | people using 80-column terminals.</p></div> |
| 1864 | </dd> |
| 1865 | <dt class="hdlist1"> |
Junio C Hamano | f93530e | 2011-05-25 23:59:59 | [diff] [blame] | 1866 | --no-abbrev-commit |
| 1867 | </dt> |
| 1868 | <dd> |
| 1869 | <p> |
| 1870 | Show the full 40-byte hexadecimal commit object name. This negates |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1871 | <code>--abbrev-commit</code> and those options which imply it such as |
Junio C Hamano | f93530e | 2011-05-25 23:59:59 | [diff] [blame] | 1872 | "--oneline". It also overrides the <em>log.abbrevCommit</em> variable. |
| 1873 | </p> |
| 1874 | </dd> |
| 1875 | <dt class="hdlist1"> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 1876 | --oneline |
| 1877 | </dt> |
| 1878 | <dd> |
| 1879 | <p> |
| 1880 | This is a shorthand for "--pretty=oneline --abbrev-commit" |
| 1881 | used together. |
| 1882 | </p> |
| 1883 | </dd> |
| 1884 | <dt class="hdlist1"> |
Junio C Hamano | c5bb3b3 | 2013-08-05 22:43:36 | [diff] [blame] | 1885 | --encoding=<encoding> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 1886 | </dt> |
| 1887 | <dd> |
| 1888 | <p> |
| 1889 | The commit objects record the encoding used for the log message |
| 1890 | in their encoding header; this option can be used to tell the |
| 1891 | command to re-code the commit log message in the encoding |
| 1892 | preferred by the user. For non plumbing commands this |
Junio C Hamano | 823eebb | 2015-07-10 22:29:34 | [diff] [blame] | 1893 | defaults to UTF-8. Note that if an object claims to be encoded |
| 1894 | in <code>X</code> and we are outputting in <code>X</code>, we will output the object |
| 1895 | verbatim; this means that invalid sequences in the original |
| 1896 | commit may be copied to the output. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 1897 | </p> |
| 1898 | </dd> |
| 1899 | <dt class="hdlist1"> |
Junio C Hamano | 4e6ba27 | 2016-01-20 23:23:19 | [diff] [blame] | 1900 | --notes[=<treeish>] |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 1901 | </dt> |
| 1902 | <dd> |
| 1903 | <p> |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1904 | Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 1905 | commit, when showing the commit log message. This is the default |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1906 | for <code>git log</code>, <code>git show</code> and <code>git whatchanged</code> commands when |
| 1907 | 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] | 1908 | on the command line. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 1909 | </p> |
Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 1910 | <div class="paragraph"><p>By default, the notes shown are from the notes refs listed in the |
| 1911 | <em>core.notesRef</em> and <em>notes.displayRef</em> variables (or corresponding |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1912 | environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p></div> |
Junio C Hamano | 4e6ba27 | 2016-01-20 23:23:19 | [diff] [blame] | 1913 | <div class="paragraph"><p>With an optional <em><treeish></em> argument, use the treeish to find the notes |
| 1914 | to display. The treeish can specify the full refname when it begins |
Junio C Hamano | 1f7c4a5 | 2015-10-14 22:15:51 | [diff] [blame] | 1915 | with <code>refs/notes/</code>; when it begins with <code>notes/</code>, <code>refs/</code> and otherwise |
| 1916 | <code>refs/notes/</code> is prefixed to form a full name of the ref.</p></div> |
Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 1917 | <div class="paragraph"><p>Multiple --notes options can be combined to control which notes are |
| 1918 | being displayed. Examples: "--notes=foo" will show only notes from |
| 1919 | "refs/notes/foo"; "--notes=foo --notes" will show both notes from |
| 1920 | "refs/notes/foo" and from the default notes ref(s).</p></div> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 1921 | </dd> |
| 1922 | <dt class="hdlist1"> |
Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 1923 | --no-notes |
| 1924 | </dt> |
| 1925 | <dd> |
| 1926 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1927 | 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] | 1928 | resetting the list of notes refs from which notes are shown. |
| 1929 | Options are parsed in the order given on the command line, so e.g. |
| 1930 | "--notes --notes=foo --no-notes --notes=bar" will only show notes |
| 1931 | from "refs/notes/bar". |
| 1932 | </p> |
| 1933 | </dd> |
| 1934 | <dt class="hdlist1"> |
Junio C Hamano | 4e6ba27 | 2016-01-20 23:23:19 | [diff] [blame] | 1935 | --show-notes[=<treeish>] |
Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 1936 | </dt> |
| 1937 | <dt class="hdlist1"> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 1938 | --[no-]standard-notes |
| 1939 | </dt> |
| 1940 | <dd> |
| 1941 | <p> |
Junio C Hamano | 6003346 | 2011-05-03 00:48:43 | [diff] [blame] | 1942 | These options are deprecated. Use the above --notes/--no-notes |
| 1943 | options instead. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 1944 | </p> |
| 1945 | </dd> |
| 1946 | <dt class="hdlist1"> |
Junio C Hamano | 0acb1ae | 2012-09-24 21:28:13 | [diff] [blame] | 1947 | --show-signature |
| 1948 | </dt> |
| 1949 | <dd> |
| 1950 | <p> |
| 1951 | Check the validity of a signed commit object by passing the signature |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1952 | to <code>gpg --verify</code> and show the output. |
Junio C Hamano | 0acb1ae | 2012-09-24 21:28:13 | [diff] [blame] | 1953 | </p> |
| 1954 | </dd> |
| 1955 | <dt class="hdlist1"> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 1956 | --relative-date |
| 1957 | </dt> |
| 1958 | <dd> |
| 1959 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1960 | Synonym for <code>--date=relative</code>. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 1961 | </p> |
| 1962 | </dd> |
| 1963 | <dt class="hdlist1"> |
Junio C Hamano | 1eb5609 | 2015-10-05 20:39:53 | [diff] [blame] | 1964 | --date=<format> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 1965 | </dt> |
| 1966 | <dd> |
| 1967 | <p> |
| 1968 | Only takes effect for dates shown in human-readable format, such |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1969 | as when using <code>--pretty</code>. <code>log.date</code> config variable sets a default |
Junio C Hamano | 1eb5609 | 2015-10-05 20:39:53 | [diff] [blame] | 1970 | value for the log command’s <code>--date</code> option. By default, dates |
| 1971 | are shown in the original time zone (either committer’s or |
| 1972 | author’s). If <code>-local</code> is appended to the format (e.g., |
| 1973 | <code>iso-local</code>), the user’s local time zone is used instead. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 1974 | </p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1975 | <div class="paragraph"><p><code>--date=relative</code> shows dates relative to the current time, |
Junio C Hamano | 1eb5609 | 2015-10-05 20:39:53 | [diff] [blame] | 1976 | e.g. “2 hours ago”. The <code>-local</code> option cannot be used with |
| 1977 | <code>--raw</code> or <code>--relative</code>.</p></div> |
| 1978 | <div class="paragraph"><p><code>--date=local</code> is an alias for <code>--date=default-local</code>.</p></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 1979 | <div class="paragraph"><p><code>--date=iso</code> (or <code>--date=iso8601</code>) shows timestamps in a ISO 8601-like format. |
| 1980 | The differences to the strict ISO 8601 format are:</p></div> |
| 1981 | <div class="ulist"><ul> |
| 1982 | <li> |
| 1983 | <p> |
| 1984 | a space instead of the <code>T</code> date/time delimiter |
| 1985 | </p> |
| 1986 | </li> |
| 1987 | <li> |
| 1988 | <p> |
| 1989 | a space between time and time zone |
| 1990 | </p> |
| 1991 | </li> |
| 1992 | <li> |
| 1993 | <p> |
| 1994 | no colon between hours and minutes of the time zone |
| 1995 | </p> |
| 1996 | </li> |
| 1997 | </ul></div> |
| 1998 | <div class="paragraph"><p><code>--date=iso-strict</code> (or <code>--date=iso8601-strict</code>) shows timestamps in strict |
| 1999 | ISO 8601 format.</p></div> |
| 2000 | <div class="paragraph"><p><code>--date=rfc</code> (or <code>--date=rfc2822</code>) shows timestamps in RFC 2822 |
Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 2001 | format, often found in email messages.</p></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2002 | <div class="paragraph"><p><code>--date=short</code> shows only the date, but not the time, in <code>YYYY-MM-DD</code> format.</p></div> |
| 2003 | <div class="paragraph"><p><code>--date=raw</code> shows the date in the internal raw Git format <code>%s %z</code> format.</p></div> |
Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 2004 | <div class="paragraph"><p><code>--date=format:...</code> feeds the format <code>...</code> to your system <code>strftime</code>. |
| 2005 | Use <code>--date=format:%c</code> to show the date in your system locale’s |
| 2006 | preferred format. See the <code>strftime</code> manual for a complete list of |
Junio C Hamano | 1eb5609 | 2015-10-05 20:39:53 | [diff] [blame] | 2007 | format placeholders. When using <code>-local</code>, the correct syntax is |
| 2008 | <code>--date=format-local:...</code>.</p></div> |
| 2009 | <div class="paragraph"><p><code>--date=default</code> is the default format, and is similar to |
| 2010 | <code>--date=rfc2822</code>, with a few exceptions:</p></div> |
| 2011 | <div class="ulist"><ul> |
| 2012 | <li> |
| 2013 | <p> |
| 2014 | there is no comma after the day-of-week |
| 2015 | </p> |
| 2016 | </li> |
| 2017 | <li> |
| 2018 | <p> |
| 2019 | the time zone is omitted when the local time zone is used |
| 2020 | </p> |
| 2021 | </li> |
| 2022 | </ul></div> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2023 | </dd> |
| 2024 | <dt class="hdlist1"> |
| 2025 | --parents |
| 2026 | </dt> |
| 2027 | <dd> |
| 2028 | <p> |
| 2029 | Print also the parents of the commit (in the form "commit parent…"). |
| 2030 | Also enables parent rewriting, see <em>History Simplification</em> below. |
| 2031 | </p> |
| 2032 | </dd> |
| 2033 | <dt class="hdlist1"> |
| 2034 | --children |
| 2035 | </dt> |
| 2036 | <dd> |
| 2037 | <p> |
| 2038 | Print also the children of the commit (in the form "commit child…"). |
| 2039 | Also enables parent rewriting, see <em>History Simplification</em> below. |
| 2040 | </p> |
| 2041 | </dd> |
| 2042 | <dt class="hdlist1"> |
| 2043 | --left-right |
| 2044 | </dt> |
| 2045 | <dd> |
| 2046 | <p> |
| 2047 | Mark which side of a symmetric diff a commit is reachable from. |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2048 | Commits from the left side are prefixed with <code><</code> and those from |
| 2049 | the right with <code>></code>. If combined with <code>--boundary</code>, those |
| 2050 | commits are prefixed with <code>-</code>. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2051 | </p> |
| 2052 | <div class="paragraph"><p>For example, if you have this topology:</p></div> |
| 2053 | <div class="listingblock"> |
| 2054 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2055 | <pre><code> y---b---b branch B |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2056 | / \ / |
| 2057 | / . |
| 2058 | / / \ |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2059 | o---x---a---a branch A</code></pre> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2060 | </div></div> |
| 2061 | <div class="paragraph"><p>you would get an output like this:</p></div> |
| 2062 | <div class="listingblock"> |
| 2063 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2064 | <pre><code> $ git rev-list --left-right --boundary --pretty=oneline A...B |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2065 | |
| 2066 | >bbbbbbb... 3rd on b |
| 2067 | >bbbbbbb... 2nd on b |
| 2068 | <aaaaaaa... 3rd on a |
| 2069 | <aaaaaaa... 2nd on a |
| 2070 | -yyyyyyy... 1st on b |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2071 | -xxxxxxx... 1st on a</code></pre> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2072 | </div></div> |
| 2073 | </dd> |
| 2074 | <dt class="hdlist1"> |
| 2075 | --graph |
| 2076 | </dt> |
| 2077 | <dd> |
| 2078 | <p> |
| 2079 | Draw a text-based graphical representation of the commit history |
| 2080 | on the left hand side of the output. This may cause extra lines |
| 2081 | to be printed in between commits, in order for the graph history |
| 2082 | to be drawn properly. |
Junio C Hamano | ef57d1e | 2015-03-25 21:23:00 | [diff] [blame] | 2083 | Cannot be combined with <code>--no-walk</code>. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2084 | </p> |
| 2085 | <div class="paragraph"><p>This enables parent rewriting, see <em>History Simplification</em> below.</p></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2086 | <div class="paragraph"><p>This implies the <code>--topo-order</code> option by default, but the |
| 2087 | <code>--date-order</code> option may also be specified.</p></div> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2088 | </dd> |
Junio C Hamano | 624dd4c | 2014-04-03 21:56:30 | [diff] [blame] | 2089 | <dt class="hdlist1"> |
| 2090 | --show-linear-break[=<barrier>] |
| 2091 | </dt> |
| 2092 | <dd> |
| 2093 | <p> |
| 2094 | When --graph is not used, all history branches are flattened |
| 2095 | which can make it hard to see that the two consecutive commits |
| 2096 | do not belong to a linear branch. This option puts a barrier |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2097 | in between them in that case. If <code><barrier></code> is specified, it |
Junio C Hamano | 624dd4c | 2014-04-03 21:56:30 | [diff] [blame] | 2098 | is the string that will be shown instead of the default one. |
| 2099 | </p> |
| 2100 | </dd> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2101 | </dl></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2102 | </div> |
| 2103 | <div class="sect2"> |
| 2104 | <h3 id="_diff_formatting">Diff Formatting</h3> |
Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 2105 | <div class="paragraph"><p>Listed below are options that control the formatting of diff output. |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 2106 | Some of them are specific to <a href="git-rev-list.html">git-rev-list(1)</a>, however other diff |
| 2107 | options may be given. See <a href="git-diff-files.html">git-diff-files(1)</a> for more options.</p></div> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2108 | <div class="dlist"><dl> |
| 2109 | <dt class="hdlist1"> |
| 2110 | -c |
| 2111 | </dt> |
| 2112 | <dd> |
| 2113 | <p> |
| 2114 | With this option, diff output for a merge commit |
| 2115 | shows the differences from each of the parents to the merge result |
| 2116 | simultaneously instead of showing pairwise diff between a parent |
| 2117 | and the result one at a time. Furthermore, it lists only files |
| 2118 | which were modified from all parents. |
| 2119 | </p> |
| 2120 | </dd> |
| 2121 | <dt class="hdlist1"> |
| 2122 | --cc |
| 2123 | </dt> |
| 2124 | <dd> |
| 2125 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2126 | This flag implies the <code>-c</code> option and further compresses the |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2127 | patch output by omitting uninteresting hunks whose contents in |
| 2128 | the parents have only two variants and the merge result picks |
| 2129 | one of them without modification. |
| 2130 | </p> |
| 2131 | </dd> |
| 2132 | <dt class="hdlist1"> |
| 2133 | -m |
| 2134 | </dt> |
| 2135 | <dd> |
| 2136 | <p> |
| 2137 | This flag makes the merge commits show the full diff like |
| 2138 | regular commits; for each merge parent, a separate log entry |
| 2139 | and diff is generated. An exception is that only diff against |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2140 | the first parent is shown when <code>--first-parent</code> option is given; |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2141 | in that case, the output represents the changes the merge |
| 2142 | brought <em>into</em> the then-current branch. |
| 2143 | </p> |
| 2144 | </dd> |
| 2145 | <dt class="hdlist1"> |
| 2146 | -r |
| 2147 | </dt> |
| 2148 | <dd> |
| 2149 | <p> |
| 2150 | Show recursive diffs. |
| 2151 | </p> |
| 2152 | </dd> |
| 2153 | <dt class="hdlist1"> |
| 2154 | -t |
| 2155 | </dt> |
| 2156 | <dd> |
| 2157 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2158 | Show the tree objects in the diff output. This implies <code>-r</code>. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2159 | </p> |
| 2160 | </dd> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2161 | </dl></div> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2162 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2163 | </div> |
| 2164 | </div> |
| 2165 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2166 | <h2 id="_pretty_formats">PRETTY FORMATS</h2> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2167 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2168 | <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] | 2169 | is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is |
| 2170 | inserted before the <em>Author:</em> line. This line begins with |
| 2171 | "Merge: " and the sha1s of ancestral commits are printed, |
| 2172 | separated by spaces. Note that the listed commits may not |
| 2173 | necessarily be the list of the <strong>direct</strong> parent commits if you |
| 2174 | have limited your view of history: for example, if you are |
| 2175 | only interested in changes related to a certain directory or |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2176 | file.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2177 | <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] | 2178 | additional formats by setting a pretty.<name> |
| 2179 | config option to either another format name, or a |
| 2180 | <em>format:</em> string, as described below (see |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 2181 | <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] | 2182 | built-in formats:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2183 | <div class="ulist"><ul> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2184 | <li> |
| 2185 | <p> |
| 2186 | <em>oneline</em> |
| 2187 | </p> |
| 2188 | <div class="literalblock"> |
| 2189 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2190 | <pre><code><sha1> <title line></code></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2191 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2192 | <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] | 2193 | </li> |
| 2194 | <li> |
| 2195 | <p> |
| 2196 | <em>short</em> |
| 2197 | </p> |
| 2198 | <div class="literalblock"> |
| 2199 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2200 | <pre><code>commit <sha1> |
| 2201 | Author: <author></code></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2202 | </div></div> |
| 2203 | <div class="literalblock"> |
| 2204 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2205 | <pre><code><title line></code></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2206 | </div></div> |
| 2207 | </li> |
| 2208 | <li> |
| 2209 | <p> |
| 2210 | <em>medium</em> |
| 2211 | </p> |
| 2212 | <div class="literalblock"> |
| 2213 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2214 | <pre><code>commit <sha1> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2215 | Author: <author> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2216 | Date: <author date></code></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2217 | </div></div> |
| 2218 | <div class="literalblock"> |
| 2219 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2220 | <pre><code><title line></code></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2221 | </div></div> |
| 2222 | <div class="literalblock"> |
| 2223 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2224 | <pre><code><full commit message></code></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2225 | </div></div> |
| 2226 | </li> |
| 2227 | <li> |
| 2228 | <p> |
| 2229 | <em>full</em> |
| 2230 | </p> |
| 2231 | <div class="literalblock"> |
| 2232 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2233 | <pre><code>commit <sha1> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2234 | Author: <author> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2235 | Commit: <committer></code></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2236 | </div></div> |
| 2237 | <div class="literalblock"> |
| 2238 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2239 | <pre><code><title line></code></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2240 | </div></div> |
| 2241 | <div class="literalblock"> |
| 2242 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2243 | <pre><code><full commit message></code></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2244 | </div></div> |
| 2245 | </li> |
| 2246 | <li> |
| 2247 | <p> |
| 2248 | <em>fuller</em> |
| 2249 | </p> |
| 2250 | <div class="literalblock"> |
| 2251 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2252 | <pre><code>commit <sha1> |
Junio C Hamano | 6a3c827 | 2008-12-19 21:38:18 | [diff] [blame] | 2253 | Author: <author> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2254 | AuthorDate: <author date> |
Junio C Hamano | 6a3c827 | 2008-12-19 21:38:18 | [diff] [blame] | 2255 | Commit: <committer> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2256 | CommitDate: <committer date></code></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2257 | </div></div> |
| 2258 | <div class="literalblock"> |
| 2259 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2260 | <pre><code><title line></code></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2261 | </div></div> |
| 2262 | <div class="literalblock"> |
| 2263 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2264 | <pre><code><full commit message></code></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2265 | </div></div> |
| 2266 | </li> |
| 2267 | <li> |
| 2268 | <p> |
| 2269 | <em>email</em> |
| 2270 | </p> |
| 2271 | <div class="literalblock"> |
| 2272 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2273 | <pre><code>From <sha1> <date> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2274 | From: <author> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2275 | Date: <author date> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2276 | Subject: [PATCH] <title line></code></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2277 | </div></div> |
| 2278 | <div class="literalblock"> |
| 2279 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2280 | <pre><code><full commit message></code></pre> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2281 | </div></div> |
| 2282 | </li> |
| 2283 | <li> |
| 2284 | <p> |
| 2285 | <em>raw</em> |
| 2286 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2287 | <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] | 2288 | stored in the commit object. Notably, the SHA-1s are |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2289 | displayed in full, regardless of whether --abbrev or |
| 2290 | --no-abbrev are used, and <em>parents</em> information show the |
Junio C Hamano | d75148a | 2014-04-08 19:48:38 | [diff] [blame] | 2291 | true parent commits, without taking grafts or history |
Junio C Hamano | 85f1fde | 2015-06-01 20:37:32 | [diff] [blame] | 2292 | simplification into account. Note that this format affects the way |
| 2293 | commits are displayed, but not the way the diff is shown e.g. with |
| 2294 | <code>git log --raw</code>. To get full object names in a raw diff format, |
| 2295 | use <code>--no-abbrev</code>.</p></div> |
Junio C Hamano | a340aaa | 2006-11-23 02:47:33 | [diff] [blame] | 2296 | </li> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2297 | <li> |
| 2298 | <p> |
Junio C Hamano | e32ec8b | 2010-06-02 23:32:31 | [diff] [blame] | 2299 | <em>format:<string></em> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2300 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2301 | <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] | 2302 | you want to show. It works a little bit like printf format, |
| 2303 | 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] | 2304 | instead of <em>\n</em>.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2305 | <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] | 2306 | would show something like this:</p></div> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2307 | <div class="listingblock"> |
| 2308 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2309 | <pre><code>The author of fe6e0ee was Junio C Hamano, 23 hours ago |
| 2310 | 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] | 2311 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2312 | <div class="paragraph"><p>The placeholders are:</p></div> |
| 2313 | <div class="ulist"><ul> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2314 | <li> |
| 2315 | <p> |
| 2316 | <em>%H</em>: commit hash |
| 2317 | </p> |
| 2318 | </li> |
| 2319 | <li> |
| 2320 | <p> |
| 2321 | <em>%h</em>: abbreviated commit hash |
| 2322 | </p> |
| 2323 | </li> |
| 2324 | <li> |
| 2325 | <p> |
| 2326 | <em>%T</em>: tree hash |
| 2327 | </p> |
| 2328 | </li> |
| 2329 | <li> |
| 2330 | <p> |
| 2331 | <em>%t</em>: abbreviated tree hash |
| 2332 | </p> |
| 2333 | </li> |
| 2334 | <li> |
| 2335 | <p> |
| 2336 | <em>%P</em>: parent hashes |
| 2337 | </p> |
| 2338 | </li> |
| 2339 | <li> |
| 2340 | <p> |
| 2341 | <em>%p</em>: abbreviated parent hashes |
| 2342 | </p> |
| 2343 | </li> |
| 2344 | <li> |
| 2345 | <p> |
| 2346 | <em>%an</em>: author name |
| 2347 | </p> |
| 2348 | </li> |
| 2349 | <li> |
| 2350 | <p> |
Junio C Hamano | 04e768d | 2013-04-23 19:19:26 | [diff] [blame] | 2351 | <em>%aN</em>: author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a> |
| 2352 | or <a href="git-blame.html">git-blame(1)</a>) |
Junio C Hamano | f5a9362 | 2008-07-16 03:23:57 | [diff] [blame] | 2353 | </p> |
| 2354 | </li> |
| 2355 | <li> |
| 2356 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2357 | <em>%ae</em>: author email |
| 2358 | </p> |
| 2359 | </li> |
| 2360 | <li> |
| 2361 | <p> |
Junio C Hamano | 04e768d | 2013-04-23 19:19:26 | [diff] [blame] | 2362 | <em>%aE</em>: author email (respecting .mailmap, see |
| 2363 | <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] | 2364 | </p> |
| 2365 | </li> |
| 2366 | <li> |
| 2367 | <p> |
Junio C Hamano | a387df3 | 2008-08-29 08:56:58 | [diff] [blame] | 2368 | <em>%ad</em>: author date (format respects --date= option) |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2369 | </p> |
| 2370 | </li> |
| 2371 | <li> |
| 2372 | <p> |
| 2373 | <em>%aD</em>: author date, RFC2822 style |
| 2374 | </p> |
| 2375 | </li> |
| 2376 | <li> |
| 2377 | <p> |
| 2378 | <em>%ar</em>: author date, relative |
| 2379 | </p> |
| 2380 | </li> |
| 2381 | <li> |
| 2382 | <p> |
| 2383 | <em>%at</em>: author date, UNIX timestamp |
| 2384 | </p> |
| 2385 | </li> |
| 2386 | <li> |
| 2387 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2388 | <em>%ai</em>: author date, ISO 8601-like format |
| 2389 | </p> |
| 2390 | </li> |
| 2391 | <li> |
| 2392 | <p> |
| 2393 | <em>%aI</em>: author date, strict ISO 8601 format |
Junio C Hamano | 02f130b | 2007-07-14 08:26:56 | [diff] [blame] | 2394 | </p> |
| 2395 | </li> |
| 2396 | <li> |
| 2397 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2398 | <em>%cn</em>: committer name |
| 2399 | </p> |
| 2400 | </li> |
| 2401 | <li> |
| 2402 | <p> |
Junio C Hamano | 04e768d | 2013-04-23 19:19:26 | [diff] [blame] | 2403 | <em>%cN</em>: committer name (respecting .mailmap, see |
| 2404 | <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] | 2405 | </p> |
| 2406 | </li> |
| 2407 | <li> |
| 2408 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2409 | <em>%ce</em>: committer email |
| 2410 | </p> |
| 2411 | </li> |
| 2412 | <li> |
| 2413 | <p> |
Junio C Hamano | 04e768d | 2013-04-23 19:19:26 | [diff] [blame] | 2414 | <em>%cE</em>: committer email (respecting .mailmap, see |
| 2415 | <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] | 2416 | </p> |
| 2417 | </li> |
| 2418 | <li> |
| 2419 | <p> |
Junio C Hamano | 53fe031 | 2014-09-09 21:16:17 | [diff] [blame] | 2420 | <em>%cd</em>: committer date (format respects --date= option) |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2421 | </p> |
| 2422 | </li> |
| 2423 | <li> |
| 2424 | <p> |
| 2425 | <em>%cD</em>: committer date, RFC2822 style |
| 2426 | </p> |
| 2427 | </li> |
| 2428 | <li> |
| 2429 | <p> |
| 2430 | <em>%cr</em>: committer date, relative |
| 2431 | </p> |
| 2432 | </li> |
| 2433 | <li> |
| 2434 | <p> |
| 2435 | <em>%ct</em>: committer date, UNIX timestamp |
| 2436 | </p> |
| 2437 | </li> |
| 2438 | <li> |
| 2439 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2440 | <em>%ci</em>: committer date, ISO 8601-like format |
| 2441 | </p> |
| 2442 | </li> |
| 2443 | <li> |
| 2444 | <p> |
| 2445 | <em>%cI</em>: committer date, strict ISO 8601 format |
Junio C Hamano | 02f130b | 2007-07-14 08:26:56 | [diff] [blame] | 2446 | </p> |
| 2447 | </li> |
| 2448 | <li> |
| 2449 | <p> |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 2450 | <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] | 2451 | </p> |
| 2452 | </li> |
| 2453 | <li> |
| 2454 | <p> |
Junio C Hamano | 00b9f1a | 2014-09-29 23:11:28 | [diff] [blame] | 2455 | <em>%D</em>: ref names without the " (", ")" wrapping. |
| 2456 | </p> |
| 2457 | </li> |
| 2458 | <li> |
| 2459 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2460 | <em>%e</em>: encoding |
| 2461 | </p> |
| 2462 | </li> |
| 2463 | <li> |
| 2464 | <p> |
| 2465 | <em>%s</em>: subject |
| 2466 | </p> |
| 2467 | </li> |
| 2468 | <li> |
| 2469 | <p> |
Junio C Hamano | 5f9a6f0 | 2009-04-06 08:26:56 | [diff] [blame] | 2470 | <em>%f</em>: sanitized subject line, suitable for a filename |
| 2471 | </p> |
| 2472 | </li> |
| 2473 | <li> |
| 2474 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2475 | <em>%b</em>: body |
| 2476 | </p> |
| 2477 | </li> |
| 2478 | <li> |
| 2479 | <p> |
Junio C Hamano | cb39aea | 2010-05-09 07:24:48 | [diff] [blame] | 2480 | <em>%B</em>: raw body (unwrapped subject and body) |
| 2481 | </p> |
| 2482 | </li> |
| 2483 | <li> |
| 2484 | <p> |
Junio C Hamano | 3b70d3c | 2009-11-21 17:37:37 | [diff] [blame] | 2485 | <em>%N</em>: commit notes |
| 2486 | </p> |
| 2487 | </li> |
| 2488 | <li> |
| 2489 | <p> |
Junio C Hamano | 0acb1ae | 2012-09-24 21:28:13 | [diff] [blame] | 2490 | <em>%GG</em>: raw verification message from GPG for a signed commit |
| 2491 | </p> |
| 2492 | </li> |
| 2493 | <li> |
| 2494 | <p> |
Junio C Hamano | edf80bd | 2013-04-05 22:14:36 | [diff] [blame] | 2495 | <em>%G?</em>: show "G" for a Good signature, "B" for a Bad signature, "U" for a good, |
| 2496 | untrusted signature and "N" for no signature |
Junio C Hamano | 0acb1ae | 2012-09-24 21:28:13 | [diff] [blame] | 2497 | </p> |
| 2498 | </li> |
| 2499 | <li> |
| 2500 | <p> |
| 2501 | <em>%GS</em>: show the name of the signer for a signed commit |
| 2502 | </p> |
| 2503 | </li> |
| 2504 | <li> |
| 2505 | <p> |
Junio C Hamano | 5e7f131 | 2013-03-21 22:49:01 | [diff] [blame] | 2506 | <em>%GK</em>: show the key used to sign a signed commit |
| 2507 | </p> |
| 2508 | </li> |
| 2509 | <li> |
| 2510 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2511 | <em>%gD</em>: reflog selector, e.g., <code>refs/stash@{1}</code> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 2512 | </p> |
| 2513 | </li> |
| 2514 | <li> |
| 2515 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2516 | <em>%gd</em>: shortened reflog selector, e.g., <code>stash@{1}</code> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 2517 | </p> |
| 2518 | </li> |
| 2519 | <li> |
| 2520 | <p> |
Junio C Hamano | 962f3a3 | 2011-12-22 20:21:44 | [diff] [blame] | 2521 | <em>%gn</em>: reflog identity name |
| 2522 | </p> |
| 2523 | </li> |
| 2524 | <li> |
| 2525 | <p> |
Junio C Hamano | 04e768d | 2013-04-23 19:19:26 | [diff] [blame] | 2526 | <em>%gN</em>: reflog identity name (respecting .mailmap, see |
| 2527 | <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] | 2528 | </p> |
| 2529 | </li> |
| 2530 | <li> |
| 2531 | <p> |
| 2532 | <em>%ge</em>: reflog identity email |
| 2533 | </p> |
| 2534 | </li> |
| 2535 | <li> |
| 2536 | <p> |
Junio C Hamano | 04e768d | 2013-04-23 19:19:26 | [diff] [blame] | 2537 | <em>%gE</em>: reflog identity email (respecting .mailmap, see |
| 2538 | <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] | 2539 | </p> |
| 2540 | </li> |
| 2541 | <li> |
| 2542 | <p> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 2543 | <em>%gs</em>: reflog subject |
| 2544 | </p> |
| 2545 | </li> |
| 2546 | <li> |
| 2547 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2548 | <em>%Cred</em>: switch color to red |
| 2549 | </p> |
| 2550 | </li> |
| 2551 | <li> |
| 2552 | <p> |
| 2553 | <em>%Cgreen</em>: switch color to green |
| 2554 | </p> |
| 2555 | </li> |
| 2556 | <li> |
| 2557 | <p> |
| 2558 | <em>%Cblue</em>: switch color to blue |
| 2559 | </p> |
| 2560 | </li> |
| 2561 | <li> |
| 2562 | <p> |
| 2563 | <em>%Creset</em>: reset color |
| 2564 | </p> |
| 2565 | </li> |
| 2566 | <li> |
| 2567 | <p> |
Junio C Hamano | abad6da | 2013-01-06 09:06:32 | [diff] [blame] | 2568 | <em>%C(…)</em>: color specification, as described in color.branch.* config option; |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2569 | adding <code>auto,</code> at the beginning will emit color only when colors are |
| 2570 | enabled for log output (by <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and |
| 2571 | respecting the <code>auto</code> settings of the former if we are going to a |
| 2572 | 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] | 2573 | on the next placeholders until the color is switched again. |
Junio C Hamano | cc0cb31 | 2009-01-22 03:38:50 | [diff] [blame] | 2574 | </p> |
| 2575 | </li> |
| 2576 | <li> |
| 2577 | <p> |
Junio C Hamano | d9e0e5d | 2007-04-14 16:22:04 | [diff] [blame] | 2578 | <em>%m</em>: left, right or boundary mark |
| 2579 | </p> |
| 2580 | </li> |
| 2581 | <li> |
| 2582 | <p> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2583 | <em>%n</em>: newline |
| 2584 | </p> |
Junio C Hamano | 0430e3a | 2007-05-15 03:13:17 | [diff] [blame] | 2585 | </li> |
Junio C Hamano | b78d259 | 2008-04-09 09:39:08 | [diff] [blame] | 2586 | <li> |
| 2587 | <p> |
Junio C Hamano | a9701f0 | 2010-01-21 00:42:16 | [diff] [blame] | 2588 | <em>%%</em>: a raw <em>%</em> |
| 2589 | </p> |
| 2590 | </li> |
| 2591 | <li> |
| 2592 | <p> |
Junio C Hamano | b78d259 | 2008-04-09 09:39:08 | [diff] [blame] | 2593 | <em>%x00</em>: print a byte from a hex code |
| 2594 | </p> |
| 2595 | </li> |
Junio C Hamano | bf984de | 2009-11-23 06:11:19 | [diff] [blame] | 2596 | <li> |
| 2597 | <p> |
| 2598 | <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] | 2599 | <a href="git-shortlog.html">git-shortlog(1)</a>. |
Junio C Hamano | bf984de | 2009-11-23 06:11:19 | [diff] [blame] | 2600 | </p> |
| 2601 | </li> |
Junio C Hamano | 04e768d | 2013-04-23 19:19:26 | [diff] [blame] | 2602 | <li> |
| 2603 | <p> |
| 2604 | <em>%<(<N>[,trunc|ltrunc|mtrunc])</em>: make the next placeholder take at |
| 2605 | least N columns, padding spaces on the right if necessary. |
| 2606 | Optionally truncate at the beginning (ltrunc), the middle (mtrunc) |
| 2607 | or the end (trunc) if the output is longer than N columns. |
| 2608 | Note that truncating only works correctly with N >= 2. |
| 2609 | </p> |
| 2610 | </li> |
| 2611 | <li> |
| 2612 | <p> |
| 2613 | <em>%<|(<N>)</em>: make the next placeholder take at least until Nth |
| 2614 | columns, padding spaces on the right if necessary |
| 2615 | </p> |
| 2616 | </li> |
| 2617 | <li> |
| 2618 | <p> |
| 2619 | <em>%>(<N>)</em>, <em>%>|(<N>)</em>: similar to <em>%<(<N>)</em>, <em>%<|(<N>)</em> |
| 2620 | respectively, but padding spaces on the left |
| 2621 | </p> |
| 2622 | </li> |
| 2623 | <li> |
| 2624 | <p> |
| 2625 | <em>%>>(<N>)</em>, <em>%>>|(<N>)</em>: similar to <em>%>(<N>)</em>, <em>%>|(<N>)</em> |
| 2626 | respectively, except that if the next placeholder takes more spaces |
| 2627 | than given and there are spaces on its left, use those spaces |
| 2628 | </p> |
| 2629 | </li> |
| 2630 | <li> |
| 2631 | <p> |
| 2632 | <em>%><(<N>)</em>, <em>%><|(<N>)</em>: similar to <em>% <(<N>)</em>, <em>%<|(<N>)</em> |
| 2633 | respectively, but padding both sides (i.e. the text is centered) |
| 2634 | </p> |
| 2635 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2636 | </ul></div> |
Junio C Hamano | a3fd83c | 2007-03-02 10:34:36 | [diff] [blame] | 2637 | </li> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 2638 | </ul></div> |
| 2639 | <div class="admonitionblock"> |
| 2640 | <table><tr> |
| 2641 | <td class="icon"> |
| 2642 | <div class="title">Note</div> |
| 2643 | </td> |
| 2644 | <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] | 2645 | revision traversal engine. For example, the <code>%g*</code> reflog options will |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 2646 | 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] | 2647 | <code>git log -g</code>). The <code>%d</code> and <code>%D</code> placeholders will use the "short" |
| 2648 | decoration format if <code>--decorate</code> was not already provided on the command |
| 2649 | line.</td> |
Junio C Hamano | c21ab05 | 2009-10-31 04:03:55 | [diff] [blame] | 2650 | </tr></table> |
| 2651 | </div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2652 | <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] | 2653 | is inserted immediately before the expansion if and only if the |
| 2654 | placeholder expands to a non-empty string.</p></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2655 | <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] | 2656 | immediately precede the expansion are deleted if and only if the |
| 2657 | placeholder expands to an empty string.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2658 | <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] | 2659 | is inserted immediately before the expansion if and only if the |
| 2660 | placeholder expands to a non-empty string.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2661 | <div class="ulist"><ul> |
Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 2662 | <li> |
| 2663 | <p> |
| 2664 | <em>tformat:</em> |
| 2665 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 2666 | <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] | 2667 | provides "terminator" semantics instead of "separator" semantics. In |
| 2668 | other words, each commit has the message terminator character (usually a |
| 2669 | newline) appended, rather than a separator placed between entries. |
| 2670 | This means that the final entry of a single-line format will be properly |
| 2671 | terminated with a new line, just as the "oneline" format does. |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2672 | For example:</p></div> |
Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 2673 | <div class="listingblock"> |
| 2674 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2675 | <pre><code>$ git log -2 --pretty=format:%h 4da45bef \ |
Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 2676 | | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/' |
| 2677 | 4da45be |
| 2678 | 7134973 -- NO NEWLINE |
| 2679 | |
| 2680 | $ git log -2 --pretty=tformat:%h 4da45bef \ |
| 2681 | | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/' |
| 2682 | 4da45be |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2683 | 7134973</code></pre> |
Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 2684 | </div></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2685 | <div class="paragraph"><p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted |
| 2686 | 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] | 2687 | equivalent:</p></div> |
| 2688 | <div class="listingblock"> |
| 2689 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2690 | <pre><code>$ git log -2 --pretty=tformat:%h 4da45bef |
| 2691 | $ git log -2 --pretty=%h 4da45bef</code></pre> |
Junio C Hamano | 0a23522 | 2009-03-06 08:21:09 | [diff] [blame] | 2692 | </div></div> |
Junio C Hamano | 6fb124c | 2008-06-13 10:04:01 | [diff] [blame] | 2693 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 2694 | </ul></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 2695 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2696 | </div> |
| 2697 | <div class="sect1"> |
Junio C Hamano | 58f587a | 2013-07-22 19:20:59 | [diff] [blame] | 2698 | <h2 id="_common_diff_options">COMMON DIFF OPTIONS</h2> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2699 | <div class="sectionbody"> |
| 2700 | <div class="dlist"><dl> |
| 2701 | <dt class="hdlist1"> |
| 2702 | -p |
| 2703 | </dt> |
| 2704 | <dt class="hdlist1"> |
| 2705 | -u |
| 2706 | </dt> |
| 2707 | <dt class="hdlist1"> |
| 2708 | --patch |
| 2709 | </dt> |
| 2710 | <dd> |
| 2711 | <p> |
| 2712 | Generate patch (see section on generating patches). |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2713 | </p> |
| 2714 | </dd> |
| 2715 | <dt class="hdlist1"> |
Junio C Hamano | 58f587a | 2013-07-22 19:20:59 | [diff] [blame] | 2716 | -s |
| 2717 | </dt> |
| 2718 | <dt class="hdlist1"> |
| 2719 | --no-patch |
| 2720 | </dt> |
| 2721 | <dd> |
| 2722 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2723 | Suppress diff output. Useful for commands like <code>git show</code> that |
| 2724 | 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] | 2725 | </p> |
| 2726 | </dd> |
| 2727 | <dt class="hdlist1"> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2728 | -U<n> |
| 2729 | </dt> |
| 2730 | <dt class="hdlist1"> |
| 2731 | --unified=<n> |
| 2732 | </dt> |
| 2733 | <dd> |
| 2734 | <p> |
| 2735 | Generate diffs with <n> lines of context instead of |
| 2736 | the usual three. |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2737 | Implies <code>-p</code>. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2738 | </p> |
| 2739 | </dd> |
| 2740 | <dt class="hdlist1"> |
| 2741 | --raw |
| 2742 | </dt> |
| 2743 | <dd> |
| 2744 | <p> |
Junio C Hamano | 85f1fde | 2015-06-01 20:37:32 | [diff] [blame] | 2745 | For each commit, show a summary of changes using the raw diff |
| 2746 | format. See the "RAW OUTPUT FORMAT" section of |
| 2747 | <a href="git-diff.html">git-diff(1)</a>. This is different from showing the log |
| 2748 | itself in raw format, which you can achieve with |
| 2749 | <code>--format=raw</code>. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2750 | </p> |
| 2751 | </dd> |
| 2752 | <dt class="hdlist1"> |
| 2753 | --patch-with-raw |
| 2754 | </dt> |
| 2755 | <dd> |
| 2756 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2757 | Synonym for <code>-p --raw</code>. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2758 | </p> |
| 2759 | </dd> |
| 2760 | <dt class="hdlist1"> |
Junio C Hamano | 5a73f30 | 2011-10-14 05:58:34 | [diff] [blame] | 2761 | --minimal |
| 2762 | </dt> |
| 2763 | <dd> |
| 2764 | <p> |
| 2765 | Spend extra time to make sure the smallest possible |
| 2766 | diff is produced. |
| 2767 | </p> |
| 2768 | </dd> |
| 2769 | <dt class="hdlist1"> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2770 | --patience |
| 2771 | </dt> |
| 2772 | <dd> |
| 2773 | <p> |
| 2774 | Generate a diff using the "patience diff" algorithm. |
| 2775 | </p> |
| 2776 | </dd> |
| 2777 | <dt class="hdlist1"> |
Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 2778 | --histogram |
| 2779 | </dt> |
| 2780 | <dd> |
| 2781 | <p> |
| 2782 | Generate a diff using the "histogram diff" algorithm. |
| 2783 | </p> |
| 2784 | </dd> |
| 2785 | <dt class="hdlist1"> |
Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 2786 | --diff-algorithm={patience|minimal|histogram|myers} |
| 2787 | </dt> |
| 2788 | <dd> |
| 2789 | <p> |
| 2790 | Choose a diff algorithm. The variants are as follows: |
| 2791 | </p> |
| 2792 | <div class="openblock"> |
| 2793 | <div class="content"> |
| 2794 | <div class="dlist"><dl> |
| 2795 | <dt class="hdlist1"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2796 | <code>default</code>, <code>myers</code> |
Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 2797 | </dt> |
| 2798 | <dd> |
| 2799 | <p> |
| 2800 | The basic greedy diff algorithm. Currently, this is the default. |
| 2801 | </p> |
| 2802 | </dd> |
| 2803 | <dt class="hdlist1"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2804 | <code>minimal</code> |
Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 2805 | </dt> |
| 2806 | <dd> |
| 2807 | <p> |
| 2808 | Spend extra time to make sure the smallest possible diff is |
| 2809 | produced. |
| 2810 | </p> |
| 2811 | </dd> |
| 2812 | <dt class="hdlist1"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2813 | <code>patience</code> |
Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 2814 | </dt> |
| 2815 | <dd> |
| 2816 | <p> |
| 2817 | Use "patience diff" algorithm when generating patches. |
| 2818 | </p> |
| 2819 | </dd> |
| 2820 | <dt class="hdlist1"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2821 | <code>histogram</code> |
Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 2822 | </dt> |
| 2823 | <dd> |
| 2824 | <p> |
| 2825 | This algorithm extends the patience algorithm to "support |
| 2826 | low-occurrence common elements". |
| 2827 | </p> |
| 2828 | </dd> |
| 2829 | </dl></div> |
| 2830 | </div></div> |
| 2831 | <div class="paragraph"><p>For instance, if you configured diff.algorithm variable to a |
| 2832 | non-default value and want to use the default one, then you |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2833 | have to use <code>--diff-algorithm=default</code> option.</p></div> |
Junio C Hamano | 80ad00d | 2013-02-18 00:19:03 | [diff] [blame] | 2834 | </dd> |
| 2835 | <dt class="hdlist1"> |
Junio C Hamano | 4c4b012 | 2011-06-30 01:19:32 | [diff] [blame] | 2836 | --stat[=<width>[,<name-width>[,<count>]]] |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2837 | </dt> |
| 2838 | <dd> |
| 2839 | <p> |
Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 2840 | Generate a diffstat. By default, as much space as necessary |
| 2841 | will be used for the filename part, and the rest for the graph |
| 2842 | part. Maximum width defaults to terminal width, or 80 columns |
Junio C Hamano | 7f2b3cb | 2012-06-22 22:42:39 | [diff] [blame] | 2843 | if not connected to a terminal, and can be overridden by |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2844 | <code><width></code>. The width of the filename part can be limited by |
| 2845 | giving another width <code><name-width></code> after a comma. The width |
Junio C Hamano | aea9e6b | 2012-03-07 00:17:11 | [diff] [blame] | 2846 | of the graph part can be limited by using |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2847 | <code>--stat-graph-width=<width></code> (affects all commands generating |
| 2848 | a stat graph) or by setting <code>diff.statGraphWidth=<width></code> |
| 2849 | (does not affect <code>git format-patch</code>). |
| 2850 | By giving a third parameter <code><count></code>, you can limit the |
| 2851 | 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] | 2852 | there are more. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2853 | </p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2854 | <div class="paragraph"><p>These parameters can also be set individually with <code>--stat-width=<width></code>, |
| 2855 | <code>--stat-name-width=<name-width></code> and <code>--stat-count=<count></code>.</p></div> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2856 | </dd> |
| 2857 | <dt class="hdlist1"> |
| 2858 | --numstat |
| 2859 | </dt> |
| 2860 | <dd> |
| 2861 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2862 | Similar to <code>--stat</code>, but shows number of added and |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2863 | deleted lines in decimal notation and pathname without |
| 2864 | abbreviation, to make it more machine friendly. For |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2865 | binary files, outputs two <code>-</code> instead of saying |
| 2866 | <code>0 0</code>. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2867 | </p> |
| 2868 | </dd> |
| 2869 | <dt class="hdlist1"> |
| 2870 | --shortstat |
| 2871 | </dt> |
| 2872 | <dd> |
| 2873 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2874 | Output only the last line of the <code>--stat</code> format containing total |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2875 | number of modified files, as well as number of added and deleted |
| 2876 | lines. |
| 2877 | </p> |
| 2878 | </dd> |
| 2879 | <dt class="hdlist1"> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 2880 | --dirstat[=<param1,param2,…>] |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2881 | </dt> |
| 2882 | <dd> |
| 2883 | <p> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 2884 | Output the distribution of relative amount of changes for each |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2885 | sub-directory. The behavior of <code>--dirstat</code> can be customized by |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 2886 | passing it a comma separated list of parameters. |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2887 | The defaults are controlled by the <code>diff.dirstat</code> configuration |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 2888 | variable (see <a href="git-config.html">git-config(1)</a>). |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 2889 | The following parameters are available: |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2890 | </p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2891 | <div class="openblock"> |
| 2892 | <div class="content"> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 2893 | <div class="dlist"><dl> |
| 2894 | <dt class="hdlist1"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2895 | <code>changes</code> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 2896 | </dt> |
| 2897 | <dd> |
| 2898 | <p> |
| 2899 | Compute the dirstat numbers by counting the lines that have been |
| 2900 | removed from the source, or added to the destination. This ignores |
| 2901 | the amount of pure code movements within a file. In other words, |
| 2902 | rearranging lines in a file is not counted as much as other changes. |
| 2903 | This is the default behavior when no parameter is given. |
| 2904 | </p> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2905 | </dd> |
| 2906 | <dt class="hdlist1"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2907 | <code>lines</code> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2908 | </dt> |
| 2909 | <dd> |
| 2910 | <p> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 2911 | Compute the dirstat numbers by doing the regular line-based diff |
| 2912 | analysis, and summing the removed/added line counts. (For binary |
| 2913 | files, count 64-byte chunks instead, since binary files have no |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2914 | natural concept of lines). This is a more expensive <code>--dirstat</code> |
| 2915 | behavior than the <code>changes</code> behavior, but it does count rearranged |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 2916 | lines within a file as much as other changes. The resulting output |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2917 | is consistent with what you get from the other <code>--*stat</code> options. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2918 | </p> |
| 2919 | </dd> |
| 2920 | <dt class="hdlist1"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2921 | <code>files</code> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 2922 | </dt> |
| 2923 | <dd> |
| 2924 | <p> |
| 2925 | Compute the dirstat numbers by counting the number of files changed. |
| 2926 | Each changed file counts equally in the dirstat analysis. This is |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2927 | the computationally cheapest <code>--dirstat</code> behavior, since it does |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 2928 | not have to look at the file contents at all. |
| 2929 | </p> |
| 2930 | </dd> |
| 2931 | <dt class="hdlist1"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2932 | <code>cumulative</code> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 2933 | </dt> |
| 2934 | <dd> |
| 2935 | <p> |
| 2936 | Count changes in a child directory for the parent directory as well. |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2937 | Note that when using <code>cumulative</code>, the sum of the percentages |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 2938 | reported may exceed 100%. The default (non-cumulative) behavior can |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2939 | be specified with the <code>noncumulative</code> parameter. |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 2940 | </p> |
| 2941 | </dd> |
| 2942 | <dt class="hdlist1"> |
| 2943 | <limit> |
| 2944 | </dt> |
| 2945 | <dd> |
| 2946 | <p> |
| 2947 | An integer parameter specifies a cut-off percent (3% by default). |
| 2948 | Directories contributing less than this percentage of the changes |
| 2949 | are not shown in the output. |
| 2950 | </p> |
| 2951 | </dd> |
| 2952 | </dl></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 2953 | </div></div> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 2954 | <div class="paragraph"><p>Example: The following will count changed files, while ignoring |
| 2955 | directories with less than 10% of the total amount of changed files, |
| 2956 | and accumulating child directory counts in the parent directories: |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2957 | <code>--dirstat=files,10,cumulative</code>.</p></div> |
Junio C Hamano | 1c222c5 | 2011-05-13 19:55:32 | [diff] [blame] | 2958 | </dd> |
| 2959 | <dt class="hdlist1"> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2960 | --summary |
| 2961 | </dt> |
| 2962 | <dd> |
| 2963 | <p> |
| 2964 | Output a condensed summary of extended header information |
| 2965 | such as creations, renames and mode changes. |
| 2966 | </p> |
| 2967 | </dd> |
| 2968 | <dt class="hdlist1"> |
| 2969 | --patch-with-stat |
| 2970 | </dt> |
| 2971 | <dd> |
| 2972 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2973 | Synonym for <code>-p --stat</code>. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2974 | </p> |
| 2975 | </dd> |
| 2976 | <dt class="hdlist1"> |
| 2977 | -z |
| 2978 | </dt> |
| 2979 | <dd> |
| 2980 | <p> |
| 2981 | Separate the commits with NULs instead of with new newlines. |
| 2982 | </p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 2983 | <div class="paragraph"><p>Also, when <code>--raw</code> or <code>--numstat</code> has been given, do not munge |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2984 | pathnames and use NULs as output field terminators.</p></div> |
| 2985 | <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] | 2986 | and backslash characters replaced with <code>\t</code>, <code>\n</code>, <code>\"</code>, and <code>\\</code>, |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 2987 | respectively, and the pathname will be enclosed in double quotes if |
| 2988 | any of those replacements occurred.</p></div> |
| 2989 | </dd> |
| 2990 | <dt class="hdlist1"> |
| 2991 | --name-only |
| 2992 | </dt> |
| 2993 | <dd> |
| 2994 | <p> |
| 2995 | Show only names of changed files. |
| 2996 | </p> |
| 2997 | </dd> |
| 2998 | <dt class="hdlist1"> |
| 2999 | --name-status |
| 3000 | </dt> |
| 3001 | <dd> |
| 3002 | <p> |
| 3003 | Show only names and status of changed files. See the description |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3004 | of the <code>--diff-filter</code> option on what the status letters mean. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3005 | </p> |
| 3006 | </dd> |
| 3007 | <dt class="hdlist1"> |
| 3008 | --submodule[=<format>] |
| 3009 | </dt> |
| 3010 | <dd> |
| 3011 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3012 | Specify how differences in submodules are shown. When <code>--submodule</code> |
| 3013 | or <code>--submodule=log</code> is given, the <em>log</em> format is used. This format lists |
| 3014 | the commits in the range like <a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does. |
| 3015 | Omitting the <code>--submodule</code> option or specifying <code>--submodule=short</code>, |
Junio C Hamano | e768cc1 | 2012-03-16 05:43:05 | [diff] [blame] | 3016 | 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] | 3017 | 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] | 3018 | <code>diff.submodule</code> configuration variable. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3019 | </p> |
| 3020 | </dd> |
| 3021 | <dt class="hdlist1"> |
| 3022 | --color[=<when>] |
| 3023 | </dt> |
| 3024 | <dd> |
| 3025 | <p> |
| 3026 | Show colored diff. |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3027 | <code>--color</code> (i.e. without <em>=<when></em>) is the same as <code>--color=always</code>. |
| 3028 | <em><when></em> can be one of <code>always</code>, <code>never</code>, or <code>auto</code>. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3029 | </p> |
| 3030 | </dd> |
| 3031 | <dt class="hdlist1"> |
| 3032 | --no-color |
| 3033 | </dt> |
| 3034 | <dd> |
| 3035 | <p> |
Junio C Hamano | 5f2627d | 2011-05-06 20:23:48 | [diff] [blame] | 3036 | Turn off colored diff. |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3037 | It is the same as <code>--color=never</code>. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3038 | </p> |
| 3039 | </dd> |
| 3040 | <dt class="hdlist1"> |
| 3041 | --word-diff[=<mode>] |
| 3042 | </dt> |
| 3043 | <dd> |
| 3044 | <p> |
| 3045 | Show a word diff, using the <mode> to delimit changed words. |
| 3046 | By default, words are delimited by whitespace; see |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3047 | <code>--word-diff-regex</code> below. The <mode> defaults to <em>plain</em>, and |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3048 | must be one of: |
| 3049 | </p> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 3050 | <div class="openblock"> |
| 3051 | <div class="content"> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3052 | <div class="dlist"><dl> |
| 3053 | <dt class="hdlist1"> |
| 3054 | color |
| 3055 | </dt> |
| 3056 | <dd> |
| 3057 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3058 | Highlight changed words using only colors. Implies <code>--color</code>. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3059 | </p> |
| 3060 | </dd> |
| 3061 | <dt class="hdlist1"> |
| 3062 | plain |
| 3063 | </dt> |
| 3064 | <dd> |
| 3065 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3066 | Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3067 | attempts to escape the delimiters if they appear in the input, |
| 3068 | so the output may be ambiguous. |
| 3069 | </p> |
| 3070 | </dd> |
| 3071 | <dt class="hdlist1"> |
| 3072 | porcelain |
| 3073 | </dt> |
| 3074 | <dd> |
| 3075 | <p> |
| 3076 | Use a special line-based format intended for script |
| 3077 | consumption. Added/removed/unchanged runs are printed in the |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3078 | usual unified diff format, starting with a <code>+</code>/<code>-</code>/` ` |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3079 | character at the beginning of the line and extending to the |
| 3080 | end of the line. Newlines in the input are represented by a |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3081 | tilde <code>~</code> on a line of its own. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3082 | </p> |
| 3083 | </dd> |
| 3084 | <dt class="hdlist1"> |
| 3085 | none |
| 3086 | </dt> |
| 3087 | <dd> |
| 3088 | <p> |
| 3089 | Disable word diff again. |
| 3090 | </p> |
| 3091 | </dd> |
| 3092 | </dl></div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 3093 | </div></div> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3094 | <div class="paragraph"><p>Note that despite the name of the first mode, color is used to |
| 3095 | highlight the changed parts in all modes if enabled.</p></div> |
| 3096 | </dd> |
| 3097 | <dt class="hdlist1"> |
| 3098 | --word-diff-regex=<regex> |
| 3099 | </dt> |
| 3100 | <dd> |
| 3101 | <p> |
| 3102 | Use <regex> to decide what a word is, instead of considering |
| 3103 | runs of non-whitespace to be a word. Also implies |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3104 | <code>--word-diff</code> unless it was already enabled. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3105 | </p> |
| 3106 | <div class="paragraph"><p>Every non-overlapping match of the |
| 3107 | <regex> is considered a word. Anything between these matches is |
| 3108 | considered whitespace and ignored(!) for the purposes of finding |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3109 | differences. You may want to append <code>|[^[:space:]]</code> to your regular |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3110 | expression to make sure that it matches all non-whitespace characters. |
| 3111 | A match that contains a newline is silently truncated(!) at the |
| 3112 | newline.</p></div> |
Junio C Hamano | 713eded | 2015-12-03 00:24:02 | [diff] [blame] | 3113 | <div class="paragraph"><p>For example, <code>--word-diff-regex=.</code> will treat each character as a word |
| 3114 | and, correspondingly, show differences character by character.</p></div> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3115 | <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] | 3116 | <a href="gitattributes.html">gitattributes(1)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3117 | overrides any diff driver or configuration setting. Diff drivers |
| 3118 | override configuration settings.</p></div> |
| 3119 | </dd> |
| 3120 | <dt class="hdlist1"> |
| 3121 | --color-words[=<regex>] |
| 3122 | </dt> |
| 3123 | <dd> |
| 3124 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3125 | Equivalent to <code>--word-diff=color</code> plus (if a regex was |
| 3126 | specified) <code>--word-diff-regex=<regex></code>. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3127 | </p> |
| 3128 | </dd> |
| 3129 | <dt class="hdlist1"> |
| 3130 | --no-renames |
| 3131 | </dt> |
| 3132 | <dd> |
| 3133 | <p> |
| 3134 | Turn off rename detection, even when the configuration |
| 3135 | file gives the default to do so. |
| 3136 | </p> |
| 3137 | </dd> |
| 3138 | <dt class="hdlist1"> |
| 3139 | --check |
| 3140 | </dt> |
| 3141 | <dd> |
| 3142 | <p> |
Junio C Hamano | 6005bfa | 2011-06-23 00:51:22 | [diff] [blame] | 3143 | Warn if changes introduce whitespace errors. What are |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3144 | considered whitespace errors is controlled by <code>core.whitespace</code> |
Junio C Hamano | 6005bfa | 2011-06-23 00:51:22 | [diff] [blame] | 3145 | configuration. By default, trailing whitespaces (including |
| 3146 | lines that solely consist of whitespaces) and a space character |
| 3147 | that is immediately followed by a tab character inside the |
| 3148 | initial indent of the line are considered whitespace errors. |
| 3149 | Exits with non-zero status if problems are found. Not compatible |
| 3150 | with --exit-code. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3151 | </p> |
| 3152 | </dd> |
| 3153 | <dt class="hdlist1"> |
Junio C Hamano | 8c5d594 | 2015-06-11 19:37:48 | [diff] [blame] | 3154 | --ws-error-highlight=<kind> |
| 3155 | </dt> |
| 3156 | <dd> |
| 3157 | <p> |
| 3158 | Highlight whitespace errors on lines specified by <kind> |
| 3159 | in the color specified by <code>color.diff.whitespace</code>. <kind> |
| 3160 | is a comma separated list of <code>old</code>, <code>new</code>, <code>context</code>. When |
| 3161 | this option is not given, only whitespace errors in <code>new</code> |
| 3162 | lines are highlighted. E.g. <code>--ws-error-highlight=new,old</code> |
| 3163 | highlights whitespace errors on both deleted and added lines. |
| 3164 | <code>all</code> can be used as a short-hand for <code>old,new,context</code>. |
| 3165 | </p> |
| 3166 | </dd> |
| 3167 | <dt class="hdlist1"> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3168 | --full-index |
| 3169 | </dt> |
| 3170 | <dd> |
| 3171 | <p> |
| 3172 | Instead of the first handful of characters, show the full |
| 3173 | pre- and post-image blob object names on the "index" |
| 3174 | line when generating patch format output. |
| 3175 | </p> |
| 3176 | </dd> |
| 3177 | <dt class="hdlist1"> |
| 3178 | --binary |
| 3179 | </dt> |
| 3180 | <dd> |
| 3181 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3182 | In addition to <code>--full-index</code>, output a binary diff that |
| 3183 | can be applied with <code>git-apply</code>. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3184 | </p> |
| 3185 | </dd> |
| 3186 | <dt class="hdlist1"> |
| 3187 | --abbrev[=<n>] |
| 3188 | </dt> |
| 3189 | <dd> |
| 3190 | <p> |
| 3191 | Instead of showing the full 40-byte hexadecimal object |
| 3192 | name in diff-raw format output and diff-tree header |
| 3193 | lines, show only a partial prefix. This is |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3194 | independent of the <code>--full-index</code> option above, which controls |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3195 | the diff-patch output format. Non default number of |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3196 | digits can be specified with <code>--abbrev=<n></code>. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3197 | </p> |
| 3198 | </dd> |
| 3199 | <dt class="hdlist1"> |
| 3200 | -B[<n>][/<m>] |
| 3201 | </dt> |
| 3202 | <dt class="hdlist1"> |
| 3203 | --break-rewrites[=[<n>][/<m>]] |
| 3204 | </dt> |
| 3205 | <dd> |
| 3206 | <p> |
| 3207 | Break complete rewrite changes into pairs of delete and |
| 3208 | create. This serves two purposes: |
| 3209 | </p> |
| 3210 | <div class="paragraph"><p>It affects the way a change that amounts to a total rewrite of a file |
| 3211 | not as a series of deletion and insertion mixed together with a very |
| 3212 | few lines that happen to match textually as the context, but as a |
| 3213 | single deletion of everything old followed by a single insertion of |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3214 | everything new, and the number <code>m</code> controls this aspect of the -B |
| 3215 | 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] | 3216 | original should remain in the result for Git to consider it a total |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3217 | rewrite (i.e. otherwise the resulting patch will be a series of |
| 3218 | deletion and insertion mixed together with context lines).</p></div> |
| 3219 | <div class="paragraph"><p>When used with -M, a totally-rewritten file is also considered as the |
| 3220 | source of a rename (usually -M only considers a file that disappeared |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3221 | as the source of a rename), and the number <code>n</code> controls this aspect of |
| 3222 | the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3223 | addition and deletion compared to 20% or more of the file’s size are |
| 3224 | eligible for being picked up as a possible source of a rename to |
| 3225 | another file.</p></div> |
| 3226 | </dd> |
| 3227 | <dt class="hdlist1"> |
| 3228 | -M[<n>] |
| 3229 | </dt> |
| 3230 | <dt class="hdlist1"> |
| 3231 | --find-renames[=<n>] |
| 3232 | </dt> |
| 3233 | <dd> |
| 3234 | <p> |
| 3235 | If generating diffs, detect and report renames for each commit. |
| 3236 | For following files across renames while traversing history, see |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3237 | <code>--follow</code>. |
| 3238 | If <code>n</code> is specified, it is a threshold on the similarity |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3239 | index (i.e. amount of addition/deletions compared to the |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3240 | file’s size). For example, <code>-M90%</code> means Git should consider a |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3241 | 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] | 3242 | hasn’t changed. Without a <code>%</code> sign, the number is to be read as |
| 3243 | a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes |
| 3244 | 0.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is |
| 3245 | the same as <code>-M5%</code>. To limit detection to exact renames, use |
| 3246 | <code>-M100%</code>. The default similarity index is 50%. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3247 | </p> |
| 3248 | </dd> |
| 3249 | <dt class="hdlist1"> |
| 3250 | -C[<n>] |
| 3251 | </dt> |
| 3252 | <dt class="hdlist1"> |
| 3253 | --find-copies[=<n>] |
| 3254 | </dt> |
| 3255 | <dd> |
| 3256 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3257 | Detect copies as well as renames. See also <code>--find-copies-harder</code>. |
| 3258 | If <code>n</code> is specified, it has the same meaning as for <code>-M<n></code>. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3259 | </p> |
| 3260 | </dd> |
| 3261 | <dt class="hdlist1"> |
| 3262 | --find-copies-harder |
| 3263 | </dt> |
| 3264 | <dd> |
| 3265 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3266 | For performance reasons, by default, <code>-C</code> option finds copies only |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3267 | if the original file of the copy was modified in the same |
| 3268 | changeset. This flag makes the command |
| 3269 | inspect unmodified files as candidates for the source of |
| 3270 | copy. This is a very expensive operation for large |
| 3271 | projects, so use it with caution. Giving more than one |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3272 | <code>-C</code> option has the same effect. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3273 | </p> |
| 3274 | </dd> |
| 3275 | <dt class="hdlist1"> |
Junio C Hamano | b02377c | 2011-04-28 22:26:02 | [diff] [blame] | 3276 | -D |
| 3277 | </dt> |
| 3278 | <dt class="hdlist1"> |
| 3279 | --irreversible-delete |
| 3280 | </dt> |
| 3281 | <dd> |
| 3282 | <p> |
| 3283 | 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] | 3284 | the diff between the preimage and <code>/dev/null</code>. The resulting patch |
| 3285 | 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] | 3286 | solely for people who want to just concentrate on reviewing the |
| 3287 | text after the change. In addition, the output obviously lack |
| 3288 | enough information to apply such a patch in reverse, even manually, |
| 3289 | hence the name of the option. |
| 3290 | </p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3291 | <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] | 3292 | of a delete/create pair.</p></div> |
| 3293 | </dd> |
| 3294 | <dt class="hdlist1"> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3295 | -l<num> |
| 3296 | </dt> |
| 3297 | <dd> |
| 3298 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3299 | The <code>-M</code> and <code>-C</code> options require O(n^2) processing time where n |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3300 | is the number of potential rename/copy targets. This |
| 3301 | option prevents rename/copy detection from running if |
| 3302 | the number of rename/copy targets exceeds the specified |
| 3303 | number. |
| 3304 | </p> |
| 3305 | </dd> |
| 3306 | <dt class="hdlist1"> |
| 3307 | --diff-filter=[(A|C|D|M|R|T|U|X|B)…[*]] |
| 3308 | </dt> |
| 3309 | <dd> |
| 3310 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3311 | Select only files that are Added (<code>A</code>), Copied (<code>C</code>), |
| 3312 | Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their |
| 3313 | type (i.e. regular file, symlink, submodule, …) changed (<code>T</code>), |
| 3314 | are Unmerged (<code>U</code>), are |
| 3315 | Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>). |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3316 | Any combination of the filter characters (including none) can be used. |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3317 | When <code>*</code> (All-or-none) is added to the combination, all |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3318 | paths are selected if there is any file that matches |
| 3319 | other criteria in the comparison; if there is no file |
| 3320 | that matches other criteria, nothing is selected. |
| 3321 | </p> |
| 3322 | </dd> |
| 3323 | <dt class="hdlist1"> |
| 3324 | -S<string> |
| 3325 | </dt> |
| 3326 | <dd> |
| 3327 | <p> |
Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 3328 | Look for differences that change the number of occurrences of |
| 3329 | the specified string (i.e. addition/deletion) in a file. |
| 3330 | Intended for the scripter’s use. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3331 | </p> |
Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 3332 | <div class="paragraph"><p>It is useful when you’re looking for an exact block of code (like a |
| 3333 | struct), and want to know the history of that block since it first |
| 3334 | came into being: use the feature iteratively to feed the interesting |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3335 | 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] | 3336 | very first version of the block.</p></div> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3337 | </dd> |
| 3338 | <dt class="hdlist1"> |
| 3339 | -G<regex> |
| 3340 | </dt> |
| 3341 | <dd> |
| 3342 | <p> |
Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 3343 | Look for differences whose patch text contains added/removed |
| 3344 | lines that match <regex>. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3345 | </p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3346 | <div class="paragraph"><p>To illustrate the difference between <code>-S<regex> --pickaxe-regex</code> and |
| 3347 | <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] | 3348 | file:</p></div> |
| 3349 | <div class="listingblock"> |
| 3350 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3351 | <pre><code>+ return !regexec(regexp, two->ptr, 1, &regmatch, 0); |
Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 3352 | ... |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3353 | - hit = !regexec(regexp, mf2.ptr, 1, &regmatch, 0);</code></pre> |
Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 3354 | </div></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3355 | <div class="paragraph"><p>While <code>git log -G"regexec\(regexp"</code> will show this commit, <code>git log |
| 3356 | -S"regexec\(regexp" --pickaxe-regex</code> will not (because the number of |
Junio C Hamano | f1f5a7b | 2013-06-11 22:23:52 | [diff] [blame] | 3357 | occurrences of that string did not change).</p></div> |
| 3358 | <div class="paragraph"><p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more |
| 3359 | information.</p></div> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3360 | </dd> |
| 3361 | <dt class="hdlist1"> |
| 3362 | --pickaxe-all |
| 3363 | </dt> |
| 3364 | <dd> |
| 3365 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3366 | When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3367 | changeset, not just the files that contain the change |
| 3368 | in <string>. |
| 3369 | </p> |
| 3370 | </dd> |
| 3371 | <dt class="hdlist1"> |
| 3372 | --pickaxe-regex |
| 3373 | </dt> |
| 3374 | <dd> |
| 3375 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3376 | 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] | 3377 | expression to match. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3378 | </p> |
| 3379 | </dd> |
| 3380 | <dt class="hdlist1"> |
| 3381 | -O<orderfile> |
| 3382 | </dt> |
| 3383 | <dd> |
| 3384 | <p> |
| 3385 | Output the patch in the order specified in the |
| 3386 | <orderfile>, which has one shell glob pattern per line. |
Junio C Hamano | 322c624 | 2015-03-23 21:32:46 | [diff] [blame] | 3387 | This overrides the <code>diff.orderFile</code> configuration variable |
| 3388 | (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] | 3389 | use <code>-O/dev/null</code>. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3390 | </p> |
| 3391 | </dd> |
| 3392 | <dt class="hdlist1"> |
| 3393 | -R |
| 3394 | </dt> |
| 3395 | <dd> |
| 3396 | <p> |
| 3397 | Swap two inputs; that is, show differences from index or |
| 3398 | on-disk file to tree contents. |
| 3399 | </p> |
| 3400 | </dd> |
| 3401 | <dt class="hdlist1"> |
| 3402 | --relative[=<path>] |
| 3403 | </dt> |
| 3404 | <dd> |
| 3405 | <p> |
| 3406 | When run from a subdirectory of the project, it can be |
| 3407 | told to exclude changes outside the directory and show |
| 3408 | pathnames relative to it with this option. When you are |
| 3409 | not in a subdirectory (e.g. in a bare repository), you |
| 3410 | can name which subdirectory to make the output relative |
| 3411 | to by giving a <path> as an argument. |
| 3412 | </p> |
| 3413 | </dd> |
| 3414 | <dt class="hdlist1"> |
| 3415 | -a |
| 3416 | </dt> |
| 3417 | <dt class="hdlist1"> |
| 3418 | --text |
| 3419 | </dt> |
| 3420 | <dd> |
| 3421 | <p> |
| 3422 | Treat all files as text. |
| 3423 | </p> |
| 3424 | </dd> |
| 3425 | <dt class="hdlist1"> |
| 3426 | --ignore-space-at-eol |
| 3427 | </dt> |
| 3428 | <dd> |
| 3429 | <p> |
| 3430 | Ignore changes in whitespace at EOL. |
| 3431 | </p> |
| 3432 | </dd> |
| 3433 | <dt class="hdlist1"> |
| 3434 | -b |
| 3435 | </dt> |
| 3436 | <dt class="hdlist1"> |
| 3437 | --ignore-space-change |
| 3438 | </dt> |
| 3439 | <dd> |
| 3440 | <p> |
| 3441 | Ignore changes in amount of whitespace. This ignores whitespace |
| 3442 | at line end, and considers all other sequences of one or |
| 3443 | more whitespace characters to be equivalent. |
| 3444 | </p> |
| 3445 | </dd> |
| 3446 | <dt class="hdlist1"> |
| 3447 | -w |
| 3448 | </dt> |
| 3449 | <dt class="hdlist1"> |
| 3450 | --ignore-all-space |
| 3451 | </dt> |
| 3452 | <dd> |
| 3453 | <p> |
| 3454 | Ignore whitespace when comparing lines. This ignores |
| 3455 | differences even if one line has whitespace where the other |
| 3456 | line has none. |
| 3457 | </p> |
| 3458 | </dd> |
| 3459 | <dt class="hdlist1"> |
Junio C Hamano | a195230 | 2013-07-01 21:31:18 | [diff] [blame] | 3460 | --ignore-blank-lines |
| 3461 | </dt> |
| 3462 | <dd> |
| 3463 | <p> |
| 3464 | Ignore changes whose lines are all blank. |
| 3465 | </p> |
| 3466 | </dd> |
| 3467 | <dt class="hdlist1"> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3468 | --inter-hunk-context=<lines> |
| 3469 | </dt> |
| 3470 | <dd> |
| 3471 | <p> |
| 3472 | Show the context between diff hunks, up to the specified number |
| 3473 | of lines, thereby fusing hunks that are close to each other. |
| 3474 | </p> |
| 3475 | </dd> |
| 3476 | <dt class="hdlist1"> |
Junio C Hamano | 11821ed | 2011-10-19 18:42:09 | [diff] [blame] | 3477 | -W |
| 3478 | </dt> |
| 3479 | <dt class="hdlist1"> |
| 3480 | --function-context |
| 3481 | </dt> |
| 3482 | <dd> |
| 3483 | <p> |
| 3484 | Show whole surrounding functions of changes. |
| 3485 | </p> |
| 3486 | </dd> |
| 3487 | <dt class="hdlist1"> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3488 | --ext-diff |
| 3489 | </dt> |
| 3490 | <dd> |
| 3491 | <p> |
| 3492 | Allow an external diff helper to be executed. If you set an |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 3493 | external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need |
| 3494 | to use this option with <a href="git-log.html">git-log(1)</a> and friends. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3495 | </p> |
| 3496 | </dd> |
| 3497 | <dt class="hdlist1"> |
| 3498 | --no-ext-diff |
| 3499 | </dt> |
| 3500 | <dd> |
| 3501 | <p> |
| 3502 | Disallow external diff drivers. |
| 3503 | </p> |
| 3504 | </dd> |
| 3505 | <dt class="hdlist1"> |
Junio C Hamano | c652aed | 2011-07-07 01:14:31 | [diff] [blame] | 3506 | --textconv |
| 3507 | </dt> |
| 3508 | <dt class="hdlist1"> |
| 3509 | --no-textconv |
| 3510 | </dt> |
| 3511 | <dd> |
| 3512 | <p> |
| 3513 | Allow (or disallow) external text conversion filters to be run |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 3514 | 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] | 3515 | details. Because textconv filters are typically a one-way |
| 3516 | conversion, the resulting diff is suitable for human |
| 3517 | consumption, but cannot be applied. For this reason, textconv |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 3518 | filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and |
| 3519 | <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] | 3520 | diff plumbing commands. |
| 3521 | </p> |
| 3522 | </dd> |
| 3523 | <dt class="hdlist1"> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3524 | --ignore-submodules[=<when>] |
| 3525 | </dt> |
| 3526 | <dd> |
| 3527 | <p> |
| 3528 | Ignore changes to submodules in the diff generation. <when> can be |
Junio C Hamano | c710296 | 2013-05-29 23:57:17 | [diff] [blame] | 3529 | either "none", "untracked", "dirty" or "all", which is the default. |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3530 | Using "none" will consider the submodule modified when it either contains |
| 3531 | untracked or modified files or its HEAD differs from the commit recorded |
| 3532 | 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] | 3533 | <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 | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3534 | "untracked" is used submodules are not considered dirty when they only |
| 3535 | contain untracked content (but they are still scanned for modified |
| 3536 | content). Using "dirty" ignores all changes to the work tree of submodules, |
| 3537 | only changes to the commits stored in the superproject are shown (this was |
| 3538 | the behavior until 1.7.0). Using "all" hides all changes to submodules. |
| 3539 | </p> |
| 3540 | </dd> |
| 3541 | <dt class="hdlist1"> |
| 3542 | --src-prefix=<prefix> |
| 3543 | </dt> |
| 3544 | <dd> |
| 3545 | <p> |
| 3546 | Show the given source prefix instead of "a/". |
| 3547 | </p> |
| 3548 | </dd> |
| 3549 | <dt class="hdlist1"> |
| 3550 | --dst-prefix=<prefix> |
| 3551 | </dt> |
| 3552 | <dd> |
| 3553 | <p> |
| 3554 | Show the given destination prefix instead of "b/". |
| 3555 | </p> |
| 3556 | </dd> |
| 3557 | <dt class="hdlist1"> |
| 3558 | --no-prefix |
| 3559 | </dt> |
| 3560 | <dd> |
| 3561 | <p> |
| 3562 | Do not show any source or destination prefix. |
| 3563 | </p> |
| 3564 | </dd> |
| 3565 | </dl></div> |
| 3566 | <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] | 3567 | <a href="gitdiffcore.html">gitdiffcore(7)</a>.</p></div> |
Junio C Hamano | d2c978f | 2011-03-20 19:42:22 | [diff] [blame] | 3568 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 3569 | </div> |
| 3570 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3571 | <h2 id="_generating_patches_with_p">Generating patches with -p</h2> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3572 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3573 | <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] | 3574 | with a <em>-p</em> option, "git diff" without the <em>--raw</em> option, or |
| 3575 | "git log" with the "-p" option, they |
| 3576 | do not produce the output described above; instead they produce a |
| 3577 | patch file. You can customize the creation of such patches via the |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3578 | GIT_EXTERNAL_DIFF and the GIT_DIFF_OPTS environment variables.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3579 | <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] | 3580 | diff format:</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3581 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3582 | <li> |
| 3583 | <p> |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 3584 | It is preceded with a "git diff" header that looks like this: |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3585 | </p> |
| 3586 | <div class="literalblock"> |
| 3587 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3588 | <pre><code>diff --git a/file1 b/file2</code></pre> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3589 | </div></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3590 | <div class="paragraph"><p>The <code>a/</code> and <code>b/</code> filenames are the same unless rename/copy is |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3591 | involved. Especially, even for a creation or a deletion, |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3592 | <code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p></div> |
| 3593 | <div class="paragraph"><p>When rename/copy is involved, <code>file1</code> and <code>file2</code> show the |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3594 | 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] | 3595 | the file that rename/copy produces, respectively.</p></div> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3596 | </li> |
| 3597 | <li> |
| 3598 | <p> |
| 3599 | It is followed by one or more extended header lines: |
| 3600 | </p> |
| 3601 | <div class="literalblock"> |
| 3602 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3603 | <pre><code>old mode <mode> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3604 | new mode <mode> |
| 3605 | deleted file mode <mode> |
| 3606 | new file mode <mode> |
| 3607 | copy from <path> |
| 3608 | copy to <path> |
| 3609 | rename from <path> |
| 3610 | rename to <path> |
| 3611 | similarity index <number> |
| 3612 | dissimilarity index <number> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3613 | index <hash>..<hash> <mode></code></pre> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3614 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3615 | <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] | 3616 | and file permission bits.</p></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3617 | <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] | 3618 | <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] | 3619 | the dissimilarity index is the percentage of changed lines. It |
| 3620 | is a rounded down integer, followed by a percent sign. The |
| 3621 | similarity index value of 100% is thus reserved for two equal |
| 3622 | files, while 100% dissimilarity means that no line from the old |
| 3623 | file made it into the new one.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3624 | <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] | 3625 | The <mode> is included if the file mode does not change; otherwise, |
| 3626 | separate lines indicate the old and the new mode.</p></div> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3627 | </li> |
| 3628 | <li> |
| 3629 | <p> |
| 3630 | TAB, LF, double quote and backslash characters in pathnames |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3631 | are represented as <code>\t</code>, <code>\n</code>, <code>\"</code> and <code>\\</code>, respectively. |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3632 | If there is need for such substitution then the whole |
| 3633 | pathname is put in double quotes. |
| 3634 | </p> |
| 3635 | </li> |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 3636 | <li> |
| 3637 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3638 | All the <code>file1</code> files in the output refer to files before the |
| 3639 | 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] | 3640 | It is incorrect to apply each change to each file sequentially. For |
| 3641 | example, this patch will swap a and b: |
| 3642 | </p> |
| 3643 | <div class="literalblock"> |
| 3644 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3645 | <pre><code>diff --git a/a b/b |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 3646 | rename from a |
| 3647 | rename to b |
| 3648 | diff --git a/b b/a |
| 3649 | rename from b |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3650 | rename to a</code></pre> |
Junio C Hamano | 7f9fa86 | 2010-10-19 23:51:14 | [diff] [blame] | 3651 | </div></div> |
| 3652 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3653 | </ol></div> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3654 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 3655 | </div> |
| 3656 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3657 | <h2 id="_combined_diff_format">combined diff format</h2> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3658 | <div class="sectionbody"> |
Junio C Hamano | 1dbca52 | 2015-05-22 20:48:55 | [diff] [blame] | 3659 | <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] | 3660 | 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] | 3661 | 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] | 3662 | <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] | 3663 | of these commands to force generation of diffs with individual parents |
| 3664 | of a merge.</p></div> |
| 3665 | <div class="paragraph"><p>A <em>combined diff</em> format looks like this:</p></div> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3666 | <div class="listingblock"> |
| 3667 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3668 | <pre><code>diff --combined describe.c |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3669 | index fabadb8,cc95eb0..4866510 |
| 3670 | --- a/describe.c |
| 3671 | +++ b/describe.c |
| 3672 | @@@ -98,20 -98,12 +98,20 @@@ |
| 3673 | return (a_date > b_date) ? -1 : (a_date == b_date) ? 0 : 1; |
| 3674 | } |
| 3675 | |
| 3676 | - static void describe(char *arg) |
| 3677 | -static void describe(struct commit *cmit, int last_one) |
| 3678 | ++static void describe(char *arg, int last_one) |
| 3679 | { |
| 3680 | + unsigned char sha1[20]; |
| 3681 | + struct commit *cmit; |
| 3682 | struct commit_list *list; |
| 3683 | static int initialized = 0; |
| 3684 | struct commit_name *n; |
| 3685 | |
| 3686 | + if (get_sha1(arg, sha1) < 0) |
| 3687 | + usage(describe_usage); |
| 3688 | + cmit = lookup_commit_reference(sha1); |
| 3689 | + if (!cmit) |
| 3690 | + usage(describe_usage); |
| 3691 | + |
| 3692 | if (!initialized) { |
| 3693 | initialized = 1; |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3694 | for_each_ref(get_name);</code></pre> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3695 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3696 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3697 | <li> |
| 3698 | <p> |
| 3699 | It is preceded with a "git diff" header, that looks like |
| 3700 | this (when <em>-c</em> option is used): |
| 3701 | </p> |
| 3702 | <div class="literalblock"> |
| 3703 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3704 | <pre><code>diff --combined file</code></pre> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3705 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3706 | <div class="paragraph"><p>or like this (when <em>--cc</em> option is used):</p></div> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3707 | <div class="literalblock"> |
| 3708 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3709 | <pre><code>diff --cc file</code></pre> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3710 | </div></div> |
| 3711 | </li> |
| 3712 | <li> |
| 3713 | <p> |
| 3714 | It is followed by one or more extended header lines |
| 3715 | (this example shows a merge with two parents): |
| 3716 | </p> |
| 3717 | <div class="literalblock"> |
| 3718 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3719 | <pre><code>index <hash>,<hash>..<hash> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3720 | mode <mode>,<mode>..<mode> |
| 3721 | new file mode <mode> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3722 | deleted file mode <mode>,<mode></code></pre> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3723 | </div></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3724 | <div class="paragraph"><p>The <code>mode <mode>,<mode>..<mode></code> line appears only if at least one of |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3725 | the <mode> is different from the rest. Extended headers with |
| 3726 | information about detected contents movement (renames and |
| 3727 | copying detection) are designed to work with diff of two |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3728 | <tree-ish> and are not used by combined diff format.</p></div> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3729 | </li> |
| 3730 | <li> |
| 3731 | <p> |
| 3732 | It is followed by two-line from-file/to-file header |
| 3733 | </p> |
| 3734 | <div class="literalblock"> |
| 3735 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3736 | <pre><code>--- a/file |
| 3737 | +++ b/file</code></pre> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3738 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3739 | <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] | 3740 | format, <code>/dev/null</code> is used to signal created or deleted |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3741 | files.</p></div> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3742 | </li> |
| 3743 | <li> |
| 3744 | <p> |
| 3745 | Chunk header format is modified to prevent people from |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3746 | accidentally feeding it to <code>patch -p1</code>. Combined diff format |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3747 | was created for review of merge commit changes, and was not |
| 3748 | meant for apply. The change is similar to the change in the |
| 3749 | extended <em>index</em> header: |
| 3750 | </p> |
| 3751 | <div class="literalblock"> |
| 3752 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3753 | <pre><code>@@@ <from-file-range> <from-file-range> <to-file-range> @@@</code></pre> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3754 | </div></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3755 | <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] | 3756 | header for combined diff format.</p></div> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3757 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3758 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3759 | <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] | 3760 | 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 |
| 3761 | added to B), or <code>" "</code> (space — unchanged) prefix, this format |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3762 | compares two or more files file1, file2,… with one file X, and |
| 3763 | 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] | 3764 | 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] | 3765 | different from it.</p></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3766 | <div class="paragraph"><p>A <code>-</code> character in the column N means that the line appears in |
| 3767 | 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] | 3768 | in the column N means that the line appears in the result, |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3769 | 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] | 3770 | added, from the point of view of that parent).</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3771 | <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] | 3772 | from both files (hence two <code>-</code> removals from both file1 and |
| 3773 | 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] | 3774 | in either file1 or file2). Also eight other lines are the same |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3775 | from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p></div> |
| 3776 | <div class="paragraph"><p>When shown by <code>git diff-tree -c</code>, it compares the parents of a |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3777 | merge commit with the merge result (i.e. file1..fileN are the |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3778 | parents). When shown by <code>git diff-files -c</code>, it compares the |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3779 | two unresolved merge parents with the working tree file |
| 3780 | (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] | 3781 | "their version").</p></div> |
Junio C Hamano | 00b8b63 | 2007-12-07 09:50:49 | [diff] [blame] | 3782 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 3783 | </div> |
| 3784 | <div class="sect1"> |
Junio C Hamano | 58f587a | 2013-07-22 19:20:59 | [diff] [blame] | 3785 | <h2 id="_examples">EXAMPLES</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3786 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3787 | <div class="dlist"><dl> |
| 3788 | <dt class="hdlist1"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3789 | <code>git log --no-merges</code> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3790 | </dt> |
| 3791 | <dd> |
| 3792 | <p> |
| 3793 | Show the whole commit history, but skip any merges |
| 3794 | </p> |
| 3795 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3796 | <dt class="hdlist1"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3797 | <code>git log v2.6.12.. include/scsi drivers/scsi</code> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3798 | </dt> |
| 3799 | <dd> |
| 3800 | <p> |
| 3801 | Show all commits since version <em>v2.6.12</em> that changed any file |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3802 | in the <code>include/scsi</code> or <code>drivers/scsi</code> subdirectories |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3803 | </p> |
| 3804 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3805 | <dt class="hdlist1"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3806 | <code>git log --since="2 weeks ago" -- gitk</code> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3807 | </dt> |
| 3808 | <dd> |
| 3809 | <p> |
| 3810 | Show the changes during the last two weeks to the file <em>gitk</em>. |
Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 3811 | The “--” is necessary to avoid confusion with the <strong>branch</strong> named |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3812 | <em>gitk</em> |
| 3813 | </p> |
| 3814 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3815 | <dt class="hdlist1"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3816 | <code>git log --name-status release..test</code> |
Junio C Hamano | ba7c8d8 | 2006-04-15 06:17:42 | [diff] [blame] | 3817 | </dt> |
| 3818 | <dd> |
| 3819 | <p> |
| 3820 | Show the commits that are in the "test" branch but not yet |
| 3821 | in the "release" branch, along with the list of paths |
| 3822 | each commit modifies. |
| 3823 | </p> |
| 3824 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3825 | <dt class="hdlist1"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3826 | <code>git log --follow builtin/rev-list.c</code> |
Junio C Hamano | 235d53f | 2007-07-13 00:25:15 | [diff] [blame] | 3827 | </dt> |
| 3828 | <dd> |
| 3829 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3830 | Shows the commits that changed <code>builtin/rev-list.c</code>, including |
Junio C Hamano | 235d53f | 2007-07-13 00:25:15 | [diff] [blame] | 3831 | those commits that occurred before the file was given its |
| 3832 | present name. |
| 3833 | </p> |
| 3834 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3835 | <dt class="hdlist1"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3836 | <code>git log --branches --not --remotes=origin</code> |
Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 3837 | </dt> |
| 3838 | <dd> |
| 3839 | <p> |
| 3840 | Shows all commits that are in any of local branches but not in |
Junio C Hamano | 97bcb48 | 2010-11-25 03:16:07 | [diff] [blame] | 3841 | any of remote-tracking branches for <em>origin</em> (what you have that |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3842 | origin doesn’t). |
Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 3843 | </p> |
| 3844 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3845 | <dt class="hdlist1"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3846 | <code>git log master --not --remotes=*/master</code> |
Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 3847 | </dt> |
| 3848 | <dd> |
| 3849 | <p> |
| 3850 | Shows all commits that are in local master but not in any remote |
| 3851 | repository master branches. |
| 3852 | </p> |
| 3853 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3854 | <dt class="hdlist1"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3855 | <code>git log -p -m --first-parent</code> |
Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 3856 | </dt> |
| 3857 | <dd> |
| 3858 | <p> |
| 3859 | Shows the history including change diffs, but only from the |
Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 3860 | “main branch” perspective, skipping commits that come from merged |
Junio C Hamano | 3166736 | 2010-03-25 00:38:53 | [diff] [blame] | 3861 | branches, and showing full diffs of changes introduced by the merges. |
| 3862 | This makes sense only when following a strict policy of merging all |
| 3863 | topic branches when staying on a single integration branch. |
| 3864 | </p> |
| 3865 | </dd> |
Junio C Hamano | 693e709 | 2012-09-12 22:56:53 | [diff] [blame] | 3866 | <dt class="hdlist1"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3867 | <code>git log -L '/int main/',/^}/:main.c</code> |
Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 3868 | </dt> |
| 3869 | <dd> |
| 3870 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3871 | Shows how the function <code>main()</code> in the file <code>main.c</code> evolved |
Junio C Hamano | 7e590a1 | 2013-06-02 23:46:52 | [diff] [blame] | 3872 | over time. |
| 3873 | </p> |
| 3874 | </dd> |
| 3875 | <dt class="hdlist1"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3876 | <code>git log -3</code> |
Junio C Hamano | 693e709 | 2012-09-12 22:56:53 | [diff] [blame] | 3877 | </dt> |
| 3878 | <dd> |
| 3879 | <p> |
| 3880 | Limits the number of commits to show to 3. |
| 3881 | </p> |
| 3882 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3883 | </dl></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 3884 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 3885 | </div> |
| 3886 | <div class="sect1"> |
Junio C Hamano | 58f587a | 2013-07-22 19:20:59 | [diff] [blame] | 3887 | <h2 id="_discussion">DISCUSSION</h2> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 3888 | <div class="sectionbody"> |
Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 3889 | <div class="paragraph"><p>Git is to some extent character encoding agnostic.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3890 | <div class="ulist"><ul> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 3891 | <li> |
| 3892 | <p> |
Junio C Hamano | 54bf1e2 | 2008-12-20 06:30:11 | [diff] [blame] | 3893 | The contents of the blob objects are uninterpreted sequences |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 3894 | of bytes. There is no encoding translation at the core |
| 3895 | level. |
| 3896 | </p> |
| 3897 | </li> |
| 3898 | <li> |
| 3899 | <p> |
Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 3900 | Path names are encoded in UTF-8 normalization form C. This |
| 3901 | applies to tree objects, the index file, ref names, as well as |
| 3902 | path names in command line arguments, environment variables |
| 3903 | and config files (<code>.git/config</code> (see <a href="git-config.html">git-config(1)</a>), |
| 3904 | <a href="gitignore.html">gitignore(5)</a>, <a href="gitattributes.html">gitattributes(5)</a> and |
| 3905 | <a href="gitmodules.html">gitmodules(5)</a>). |
| 3906 | </p> |
| 3907 | <div class="paragraph"><p>Note that Git at the core level treats path names simply as |
| 3908 | sequences of non-NUL bytes, there are no path name encoding |
| 3909 | conversions (except on Mac and Windows). Therefore, using |
| 3910 | non-ASCII path names will mostly work even on platforms and file |
| 3911 | systems that use legacy extended ASCII encodings. However, |
| 3912 | repositories created on such systems will not work properly on |
| 3913 | UTF-8-based systems (e.g. Linux, Mac, Windows) and vice versa. |
| 3914 | Additionally, many Git-based tools simply assume path names to |
| 3915 | be UTF-8 and will fail to display other encodings correctly.</p></div> |
| 3916 | </li> |
| 3917 | <li> |
| 3918 | <p> |
| 3919 | Commit log messages are typically encoded in UTF-8, but other |
| 3920 | extended ASCII encodings are also supported. This includes |
| 3921 | ISO-8859-x, CP125x and many others, but <em>not</em> UTF-16/32, |
| 3922 | EBCDIC and CJK multi-byte encodings (GBK, Shift-JIS, Big5, |
| 3923 | EUC-x, CP9xx etc.). |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 3924 | </p> |
| 3925 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3926 | </ul></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3927 | <div class="paragraph"><p>Although we encourage that the commit log messages are encoded |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 3928 | in UTF-8, both the core and Git Porcelain are designed not to |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 3929 | force UTF-8 on projects. If all participants of a particular |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 3930 | project find it more convenient to use legacy encodings, Git |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 3931 | does not forbid it. However, there are a few things to keep in |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3932 | mind.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3933 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 3934 | <li> |
| 3935 | <p> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 3936 | <em>git commit</em> and <em>git commit-tree</em> issues |
Junio C Hamano | 14b7648 | 2008-01-05 10:32:26 | [diff] [blame] | 3937 | a warning if the commit log message given to it does not look |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 3938 | like a valid UTF-8 string, unless you explicitly say your |
| 3939 | project uses a legacy encoding. The way to say this is to |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3940 | have i18n.commitencoding in <code>.git/config</code> file, like this: |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 3941 | </p> |
| 3942 | <div class="listingblock"> |
| 3943 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3944 | <pre><code>[i18n] |
| 3945 | commitencoding = ISO-8859-1</code></pre> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 3946 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3947 | <div class="paragraph"><p>Commit objects created with the above setting record the value |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3948 | of <code>i18n.commitencoding</code> in its <code>encoding</code> header. This is to |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 3949 | help other people who look at them later. Lack of this header |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3950 | implies that the commit log message is encoded in UTF-8.</p></div> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 3951 | </li> |
| 3952 | <li> |
| 3953 | <p> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 3954 | <em>git log</em>, <em>git show</em>, <em>git blame</em> and friends look at the |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3955 | <code>encoding</code> header of a commit object, and try to re-code the |
Junio C Hamano | aa17c7c | 2008-11-03 04:36:58 | [diff] [blame] | 3956 | log message into UTF-8 unless otherwise specified. You can |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 3957 | specify the desired output encoding with |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3958 | <code>i18n.logoutputencoding</code> in <code>.git/config</code> file, like this: |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 3959 | </p> |
| 3960 | <div class="listingblock"> |
| 3961 | <div class="content"> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3962 | <pre><code>[i18n] |
| 3963 | logoutputencoding = ISO-8859-1</code></pre> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 3964 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3965 | <div class="paragraph"><p>If you do not have this configuration variable, the value of |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3966 | <code>i18n.commitencoding</code> is used instead.</p></div> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 3967 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3968 | </ol></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3969 | <div class="paragraph"><p>Note that we deliberately chose not to re-code the commit log |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 3970 | message when a commit is made to force UTF-8 at the commit |
| 3971 | object level, because re-coding to UTF-8 is not necessarily a |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 3972 | reversible operation.</p></div> |
Junio C Hamano | 775a0f4 | 2006-12-31 01:19:14 | [diff] [blame] | 3973 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 3974 | </div> |
| 3975 | <div class="sect1"> |
Junio C Hamano | 58f587a | 2013-07-22 19:20:59 | [diff] [blame] | 3976 | <h2 id="_configuration">CONFIGURATION</h2> |
Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 3977 | <div class="sectionbody"> |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 3978 | <div class="paragraph"><p>See <a href="git-config.html">git-config(1)</a> for core variables and <a href="git-diff.html">git-diff(1)</a> |
Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 3979 | for settings related to diff generation.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3980 | <div class="dlist"><dl> |
| 3981 | <dt class="hdlist1"> |
Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 3982 | format.pretty |
| 3983 | </dt> |
| 3984 | <dd> |
| 3985 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3986 | Default for the <code>--format</code> option. (See <em>Pretty Formats</em> above.) |
| 3987 | Defaults to <code>medium</code>. |
Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 3988 | </p> |
| 3989 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 3990 | <dt class="hdlist1"> |
Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 3991 | i18n.logOutputEncoding |
| 3992 | </dt> |
| 3993 | <dd> |
| 3994 | <p> |
Junio C Hamano | b73af6c | 2013-12-03 22:07:11 | [diff] [blame] | 3995 | Encoding to use when displaying logs. (See <em>Discussion</em> above.) |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 3996 | Defaults to the value of <code>i18n.commitEncoding</code> if set, and UTF-8 |
Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 3997 | otherwise. |
| 3998 | </p> |
| 3999 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4000 | <dt class="hdlist1"> |
Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 4001 | log.date |
| 4002 | </dt> |
| 4003 | <dd> |
| 4004 | <p> |
| 4005 | Default format for human-readable dates. (Compare the |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4006 | <code>--date</code> option.) Defaults to "default", which means to write |
| 4007 | dates like <code>Sat May 8 19:35:34 2010 -0500</code>. |
Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 4008 | </p> |
| 4009 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4010 | <dt class="hdlist1"> |
Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 4011 | log.follow |
| 4012 | </dt> |
| 4013 | <dd> |
| 4014 | <p> |
Junio C Hamano | b0a1e83 | 2015-10-15 23:08:31 | [diff] [blame] | 4015 | If <code>true</code>, <code>git log</code> will act as if the <code>--follow</code> option was used when |
| 4016 | a single <path> is given. This has the same limitations as <code>--follow</code>, |
| 4017 | i.e. it cannot be used to follow multiple files and does not work well |
| 4018 | on non-linear history. |
Junio C Hamano | d7ed404 | 2015-08-03 19:43:00 | [diff] [blame] | 4019 | </p> |
| 4020 | </dd> |
| 4021 | <dt class="hdlist1"> |
Junio C Hamano | 322c624 | 2015-03-23 21:32:46 | [diff] [blame] | 4022 | log.showRoot |
Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 4023 | </dt> |
| 4024 | <dd> |
| 4025 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4026 | If <code>false</code>, <code>git log</code> and related commands will not treat the |
Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 4027 | initial commit as a big creation event. Any root commits in |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4028 | <code>git log -p</code> output would be shown without a diff attached. |
| 4029 | The default is <code>true</code>. |
Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 4030 | </p> |
| 4031 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4032 | <dt class="hdlist1"> |
Junio C Hamano | abad6da | 2013-01-06 09:06:32 | [diff] [blame] | 4033 | mailmap.* |
Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 4034 | </dt> |
| 4035 | <dd> |
| 4036 | <p> |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 4037 | See <a href="git-shortlog.html">git-shortlog(1)</a>. |
Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 4038 | </p> |
| 4039 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4040 | <dt class="hdlist1"> |
Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 4041 | notes.displayRef |
| 4042 | </dt> |
| 4043 | <dd> |
| 4044 | <p> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4045 | Which refs, in addition to the default set by <code>core.notesRef</code> |
Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 4046 | or <em>GIT_NOTES_REF</em>, to read notes from when showing commit |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4047 | messages with the <code>log</code> family of commands. See |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 4048 | <a href="git-notes.html">git-notes(1)</a>. |
Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 4049 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 4050 | <div class="paragraph"><p>May be an unabbreviated ref name or a glob and may be specified |
Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 4051 | multiple times. A warning will be issued for refs that do not exist, |
| 4052 | but a glob that does not match any refs is silently ignored.</p></div> |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4053 | <div class="paragraph"><p>This setting can be disabled by the <code>--no-notes</code> option, |
Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 4054 | overridden by the <em>GIT_NOTES_DISPLAY_REF</em> environment variable, |
Junio C Hamano | ac12f0e | 2014-09-19 22:32:51 | [diff] [blame] | 4055 | and overridden by the <code>--notes=<ref></code> option.</p></div> |
Junio C Hamano | a574a09 | 2010-06-13 19:57:10 | [diff] [blame] | 4056 | </dd> |
| 4057 | </dl></div> |
| 4058 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 4059 | </div> |
| 4060 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 4061 | <h2 id="_git">GIT</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 4062 | <div class="sectionbody"> |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 4063 | <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] | 4064 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 4065 | </div> |
Junio C Hamano | 9629d4f | 2012-12-19 00:28:27 | [diff] [blame] | 4066 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 4067 | <div id="footnotes"><hr /></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 4068 | <div id="footer"> |
| 4069 | <div id="footer-text"> |
Junio C Hamano | b0a1e83 | 2015-10-15 23:08:31 | [diff] [blame] | 4070 | Last updated 2015-10-15 16:07:45 PDT |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 4071 | </div> |
| 4072 | </div> |
| 4073 | </body> |
| 4074 | </html> |