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 | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 5 | <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" /> |
| 6 | <meta name="generator" content="AsciiDoc 8.6.8" /> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 7 | <title>git-rev-parse(1)</title> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 8 | <style type="text/css"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [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 | 9d97115 | 2012-12-19 00:43:11 | [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 | 9d97115 | 2012-12-19 00:43:11 | [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 | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 90 | .monospaced, code, pre { |
| 91 | font-family: "Courier New", Courier, monospace; |
| 92 | font-size: inherit; |
| 93 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 94 | padding: 0; |
| 95 | margin: 0; |
| 96 | } |
| 97 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 98 | |
| 99 | #author { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 100 | color: #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 101 | font-weight: bold; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 102 | font-size: 1.1em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 103 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 104 | #email { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 105 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 106 | #revnumber, #revdate, #revremark { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 107 | } |
| 108 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 109 | #footer { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 110 | font-size: small; |
| 111 | border-top: 2px solid silver; |
| 112 | padding-top: 0.5em; |
| 113 | margin-top: 4.0em; |
| 114 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 115 | #footer-text { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 116 | float: left; |
| 117 | padding-bottom: 0.5em; |
| 118 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 119 | #footer-badges { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 120 | float: right; |
| 121 | padding-bottom: 0.5em; |
| 122 | } |
| 123 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 124 | #preamble { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 125 | margin-top: 1.5em; |
| 126 | margin-bottom: 1.5em; |
| 127 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 128 | div.imageblock, div.exampleblock, div.verseblock, |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 129 | div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, |
| 130 | div.admonitionblock { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 131 | margin-top: 1.0em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 132 | margin-bottom: 1.5em; |
| 133 | } |
| 134 | div.admonitionblock { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 135 | margin-top: 2.0em; |
| 136 | margin-bottom: 2.0em; |
| 137 | margin-right: 10%; |
| 138 | color: #606060; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 139 | } |
| 140 | |
| 141 | div.content { /* Block element content. */ |
| 142 | padding: 0; |
| 143 | } |
| 144 | |
| 145 | /* Block element titles. */ |
| 146 | div.title, caption.title { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 147 | color: #527bbd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 148 | font-weight: bold; |
| 149 | text-align: left; |
| 150 | margin-top: 1.0em; |
| 151 | margin-bottom: 0.5em; |
| 152 | } |
| 153 | div.title + * { |
| 154 | margin-top: 0; |
| 155 | } |
| 156 | |
| 157 | td div.title:first-child { |
| 158 | margin-top: 0.0em; |
| 159 | } |
| 160 | div.content div.title:first-child { |
| 161 | margin-top: 0.0em; |
| 162 | } |
| 163 | div.content + div.title { |
| 164 | margin-top: 0.0em; |
| 165 | } |
| 166 | |
| 167 | div.sidebarblock > div.content { |
| 168 | background: #ffffee; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 169 | border: 1px solid #dddddd; |
| 170 | border-left: 4px solid #f0f0f0; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 171 | padding: 0.5em; |
| 172 | } |
| 173 | |
| 174 | div.listingblock > div.content { |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 175 | border: 1px solid #dddddd; |
| 176 | border-left: 5px solid #f0f0f0; |
| 177 | background: #f8f8f8; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 178 | padding: 0.5em; |
| 179 | } |
| 180 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 181 | div.quoteblock, div.verseblock { |
| 182 | padding-left: 1.0em; |
| 183 | margin-left: 1.0em; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 184 | margin-right: 10%; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 185 | border-left: 5px solid #f0f0f0; |
| 186 | color: #888; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 187 | } |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 188 | |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 189 | div.quoteblock > div.attribution { |
| 190 | padding-top: 0.5em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 191 | text-align: right; |
| 192 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 193 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 194 | div.verseblock > pre.content { |
| 195 | font-family: inherit; |
| 196 | font-size: inherit; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 197 | } |
| 198 | div.verseblock > div.attribution { |
| 199 | padding-top: 0.75em; |
| 200 | text-align: left; |
| 201 | } |
| 202 | /* DEPRECATED: Pre version 8.2.7 verse style literal block. */ |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 203 | div.verseblock + div.attribution { |
| 204 | text-align: left; |
| 205 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 206 | |
| 207 | div.admonitionblock .icon { |
| 208 | vertical-align: top; |
| 209 | font-size: 1.1em; |
| 210 | font-weight: bold; |
| 211 | text-decoration: underline; |
| 212 | color: #527bbd; |
| 213 | padding-right: 0.5em; |
| 214 | } |
| 215 | div.admonitionblock td.content { |
| 216 | padding-left: 0.5em; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 217 | border-left: 3px solid #dddddd; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 218 | } |
| 219 | |
| 220 | div.exampleblock > div.content { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 221 | border-left: 3px solid #dddddd; |
| 222 | padding-left: 0.5em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 223 | } |
| 224 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 225 | div.imageblock div.content { padding-left: 0; } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 226 | span.image img { border-style: none; } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 227 | a.image:visited { color: white; } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 228 | |
| 229 | dl { |
| 230 | margin-top: 0.8em; |
| 231 | margin-bottom: 0.8em; |
| 232 | } |
| 233 | dt { |
| 234 | margin-top: 0.5em; |
| 235 | margin-bottom: 0; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 236 | font-style: normal; |
| 237 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 238 | } |
| 239 | dd > *:first-child { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 240 | margin-top: 0.1em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 241 | } |
| 242 | |
| 243 | ul, ol { |
| 244 | list-style-position: outside; |
| 245 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 246 | ol.arabic { |
| 247 | list-style-type: decimal; |
| 248 | } |
| 249 | ol.loweralpha { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 250 | list-style-type: lower-alpha; |
| 251 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 252 | ol.upperalpha { |
| 253 | list-style-type: upper-alpha; |
| 254 | } |
| 255 | ol.lowerroman { |
| 256 | list-style-type: lower-roman; |
| 257 | } |
| 258 | ol.upperroman { |
| 259 | list-style-type: upper-roman; |
| 260 | } |
| 261 | |
| 262 | div.compact ul, div.compact ol, |
| 263 | div.compact p, div.compact p, |
| 264 | div.compact div, div.compact div { |
| 265 | margin-top: 0.1em; |
| 266 | margin-bottom: 0.1em; |
| 267 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 268 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 269 | tfoot { |
| 270 | font-weight: bold; |
| 271 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 272 | td > div.verse { |
| 273 | white-space: pre; |
| 274 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 275 | |
| 276 | div.hdlist { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 277 | margin-top: 0.8em; |
| 278 | margin-bottom: 0.8em; |
| 279 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 280 | div.hdlist tr { |
| 281 | padding-bottom: 15px; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 282 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 283 | dt.hdlist1.strong, td.hdlist1.strong { |
| 284 | font-weight: bold; |
| 285 | } |
| 286 | td.hdlist1 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 287 | vertical-align: top; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 288 | font-style: normal; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 289 | padding-right: 0.8em; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 290 | color: navy; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 291 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 292 | td.hdlist2 { |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 293 | vertical-align: top; |
| 294 | } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 295 | div.hdlist.compact tr { |
| 296 | margin: 0; |
| 297 | padding-bottom: 0; |
| 298 | } |
| 299 | |
| 300 | .comment { |
| 301 | background: yellow; |
| 302 | } |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 303 | |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 304 | .footnote, .footnoteref { |
| 305 | font-size: 0.8em; |
| 306 | } |
| 307 | |
| 308 | span.footnote, span.footnoteref { |
| 309 | vertical-align: super; |
| 310 | } |
| 311 | |
| 312 | #footnotes { |
| 313 | margin: 20px 0 20px 0; |
| 314 | padding: 7px 0 0 0; |
| 315 | } |
| 316 | |
| 317 | #footnotes div.footnote { |
| 318 | margin: 0 0 5px 0; |
| 319 | } |
| 320 | |
| 321 | #footnotes hr { |
| 322 | border: none; |
| 323 | border-top: 1px solid silver; |
| 324 | height: 1px; |
| 325 | text-align: left; |
| 326 | margin-left: 0; |
| 327 | width: 20%; |
| 328 | min-width: 100px; |
| 329 | } |
| 330 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 331 | div.colist td { |
| 332 | padding-right: 0.5em; |
| 333 | padding-bottom: 0.3em; |
| 334 | vertical-align: top; |
| 335 | } |
| 336 | div.colist td img { |
| 337 | margin-top: 0.3em; |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 338 | } |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 339 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 340 | @media print { |
| 341 | #footer-badges { display: none; } |
| 342 | } |
| 343 | |
| 344 | #toc { |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 345 | margin-bottom: 2.5em; |
| 346 | } |
| 347 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 348 | #toctitle { |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 349 | color: #527bbd; |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 350 | font-size: 1.1em; |
| 351 | font-weight: bold; |
| 352 | margin-top: 1.0em; |
| 353 | margin-bottom: 0.1em; |
| 354 | } |
| 355 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 356 | div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 357 | margin-top: 0; |
| 358 | margin-bottom: 0; |
| 359 | } |
| 360 | div.toclevel2 { |
| 361 | margin-left: 2em; |
| 362 | font-size: 0.9em; |
| 363 | } |
| 364 | div.toclevel3 { |
| 365 | margin-left: 4em; |
| 366 | font-size: 0.9em; |
| 367 | } |
| 368 | div.toclevel4 { |
| 369 | margin-left: 6em; |
| 370 | font-size: 0.9em; |
| 371 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 372 | |
| 373 | span.aqua { color: aqua; } |
| 374 | span.black { color: black; } |
| 375 | span.blue { color: blue; } |
| 376 | span.fuchsia { color: fuchsia; } |
| 377 | span.gray { color: gray; } |
| 378 | span.green { color: green; } |
| 379 | span.lime { color: lime; } |
| 380 | span.maroon { color: maroon; } |
| 381 | span.navy { color: navy; } |
| 382 | span.olive { color: olive; } |
| 383 | span.purple { color: purple; } |
| 384 | span.red { color: red; } |
| 385 | span.silver { color: silver; } |
| 386 | span.teal { color: teal; } |
| 387 | span.white { color: white; } |
| 388 | span.yellow { color: yellow; } |
| 389 | |
| 390 | span.aqua-background { background: aqua; } |
| 391 | span.black-background { background: black; } |
| 392 | span.blue-background { background: blue; } |
| 393 | span.fuchsia-background { background: fuchsia; } |
| 394 | span.gray-background { background: gray; } |
| 395 | span.green-background { background: green; } |
| 396 | span.lime-background { background: lime; } |
| 397 | span.maroon-background { background: maroon; } |
| 398 | span.navy-background { background: navy; } |
| 399 | span.olive-background { background: olive; } |
| 400 | span.purple-background { background: purple; } |
| 401 | span.red-background { background: red; } |
| 402 | span.silver-background { background: silver; } |
| 403 | span.teal-background { background: teal; } |
| 404 | span.white-background { background: white; } |
| 405 | span.yellow-background { background: yellow; } |
| 406 | |
| 407 | span.big { font-size: 2em; } |
| 408 | span.small { font-size: 0.6em; } |
| 409 | |
| 410 | span.underline { text-decoration: underline; } |
| 411 | span.overline { text-decoration: overline; } |
| 412 | span.line-through { text-decoration: line-through; } |
| 413 | |
| 414 | div.unbreakable { page-break-inside: avoid; } |
| 415 | |
| 416 | |
| 417 | /* |
| 418 | * xhtml11 specific |
| 419 | * |
| 420 | * */ |
| 421 | |
| 422 | div.tableblock { |
| 423 | margin-top: 1.0em; |
| 424 | margin-bottom: 1.5em; |
| 425 | } |
| 426 | div.tableblock > table { |
| 427 | border: 3px solid #527bbd; |
| 428 | } |
| 429 | thead, p.table.header { |
| 430 | font-weight: bold; |
| 431 | color: #527bbd; |
| 432 | } |
| 433 | p.table { |
| 434 | margin-top: 0; |
| 435 | } |
| 436 | /* Because the table frame attribute is overriden by CSS in most browsers. */ |
| 437 | div.tableblock > table[frame="void"] { |
| 438 | border-style: none; |
| 439 | } |
| 440 | div.tableblock > table[frame="hsides"] { |
| 441 | border-left-style: none; |
| 442 | border-right-style: none; |
| 443 | } |
| 444 | div.tableblock > table[frame="vsides"] { |
| 445 | border-top-style: none; |
| 446 | border-bottom-style: none; |
| 447 | } |
| 448 | |
| 449 | |
| 450 | /* |
| 451 | * html5 specific |
| 452 | * |
| 453 | * */ |
| 454 | |
| 455 | table.tableblock { |
| 456 | margin-top: 1.0em; |
| 457 | margin-bottom: 1.5em; |
| 458 | } |
| 459 | thead, p.tableblock.header { |
| 460 | font-weight: bold; |
| 461 | color: #527bbd; |
| 462 | } |
| 463 | p.tableblock { |
| 464 | margin-top: 0; |
| 465 | } |
| 466 | table.tableblock { |
| 467 | border-width: 3px; |
| 468 | border-spacing: 0px; |
| 469 | border-style: solid; |
| 470 | border-color: #527bbd; |
| 471 | border-collapse: collapse; |
| 472 | } |
| 473 | th.tableblock, td.tableblock { |
| 474 | border-width: 1px; |
| 475 | padding: 4px; |
| 476 | border-style: solid; |
| 477 | border-color: #527bbd; |
| 478 | } |
| 479 | |
| 480 | table.tableblock.frame-topbot { |
| 481 | border-left-style: hidden; |
| 482 | border-right-style: hidden; |
| 483 | } |
| 484 | table.tableblock.frame-sides { |
| 485 | border-top-style: hidden; |
| 486 | border-bottom-style: hidden; |
| 487 | } |
| 488 | table.tableblock.frame-none { |
| 489 | border-style: hidden; |
| 490 | } |
| 491 | |
| 492 | th.tableblock.halign-left, td.tableblock.halign-left { |
| 493 | text-align: left; |
| 494 | } |
| 495 | th.tableblock.halign-center, td.tableblock.halign-center { |
| 496 | text-align: center; |
| 497 | } |
| 498 | th.tableblock.halign-right, td.tableblock.halign-right { |
| 499 | text-align: right; |
| 500 | } |
| 501 | |
| 502 | th.tableblock.valign-top, td.tableblock.valign-top { |
| 503 | vertical-align: top; |
| 504 | } |
| 505 | th.tableblock.valign-middle, td.tableblock.valign-middle { |
| 506 | vertical-align: middle; |
| 507 | } |
| 508 | th.tableblock.valign-bottom, td.tableblock.valign-bottom { |
| 509 | vertical-align: bottom; |
| 510 | } |
| 511 | |
| 512 | |
| 513 | /* |
| 514 | * manpage specific |
| 515 | * |
| 516 | * */ |
| 517 | |
| 518 | body.manpage h1 { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 519 | padding-top: 0.5em; |
| 520 | padding-bottom: 0.5em; |
| 521 | border-top: 2px solid silver; |
| 522 | border-bottom: 2px solid silver; |
| 523 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 524 | body.manpage h2 { |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 525 | border-style: none; |
| 526 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 527 | body.manpage div.sectionbody { |
| 528 | margin-left: 3em; |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 529 | } |
| 530 | |
| 531 | @media print { |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 532 | body.manpage div#toc { display: none; } |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 533 | } |
| 534 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 535 | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 536 | </style> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 537 | <script type="text/javascript"> |
| 538 | /*<![CDATA[*/ |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 539 | var asciidoc = { // Namespace. |
| 540 | |
| 541 | ///////////////////////////////////////////////////////////////////// |
| 542 | // Table Of Contents generator |
| 543 | ///////////////////////////////////////////////////////////////////// |
| 544 | |
| 545 | /* Author: Mihai Bazon, September 2002 |
| 546 | * http://students.infoiasi.ro/~mishoo |
| 547 | * |
| 548 | * Table Of Content generator |
| 549 | * Version: 0.4 |
| 550 | * |
| 551 | * Feel free to use this script under the terms of the GNU General Public |
| 552 | * License, as long as you do not remove or alter this notice. |
| 553 | */ |
| 554 | |
| 555 | /* modified by Troy D. Hanson, September 2006. License: GPL */ |
| 556 | /* modified by Stuart Rackham, 2006, 2009. License: GPL */ |
| 557 | |
| 558 | // toclevels = 1..4. |
| 559 | toc: function (toclevels) { |
| 560 | |
| 561 | function getText(el) { |
| 562 | var text = ""; |
| 563 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 564 | if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants. |
| 565 | text += i.data; |
| 566 | else if (i.firstChild != null) |
| 567 | text += getText(i); |
| 568 | } |
| 569 | return text; |
| 570 | } |
| 571 | |
| 572 | function TocEntry(el, text, toclevel) { |
| 573 | this.element = el; |
| 574 | this.text = text; |
| 575 | this.toclevel = toclevel; |
| 576 | } |
| 577 | |
| 578 | function tocEntries(el, toclevels) { |
| 579 | var result = new Array; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 580 | var re = new RegExp('[hH]([1-'+(toclevels+1)+'])'); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 581 | // Function that scans the DOM tree for header elements (the DOM2 |
| 582 | // nodeIterator API would be a better technique but not supported by all |
| 583 | // browsers). |
| 584 | var iterate = function (el) { |
| 585 | for (var i = el.firstChild; i != null; i = i.nextSibling) { |
| 586 | if (i.nodeType == 1 /* Node.ELEMENT_NODE */) { |
| 587 | var mo = re.exec(i.tagName); |
| 588 | if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") { |
| 589 | result[result.length] = new TocEntry(i, getText(i), mo[1]-1); |
| 590 | } |
| 591 | iterate(i); |
| 592 | } |
| 593 | } |
| 594 | } |
| 595 | iterate(el); |
| 596 | return result; |
| 597 | } |
| 598 | |
| 599 | var toc = document.getElementById("toc"); |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 600 | if (!toc) { |
| 601 | return; |
| 602 | } |
| 603 | |
| 604 | // Delete existing TOC entries in case we're reloading the TOC. |
| 605 | var tocEntriesToRemove = []; |
| 606 | var i; |
| 607 | for (i = 0; i < toc.childNodes.length; i++) { |
| 608 | var entry = toc.childNodes[i]; |
| 609 | if (entry.nodeName.toLowerCase() == 'div' |
| 610 | && entry.getAttribute("class") |
| 611 | && entry.getAttribute("class").match(/^toclevel/)) |
| 612 | tocEntriesToRemove.push(entry); |
| 613 | } |
| 614 | for (i = 0; i < tocEntriesToRemove.length; i++) { |
| 615 | toc.removeChild(tocEntriesToRemove[i]); |
| 616 | } |
| 617 | |
| 618 | // Rebuild TOC entries. |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 619 | var entries = tocEntries(document.getElementById("content"), toclevels); |
| 620 | for (var i = 0; i < entries.length; ++i) { |
| 621 | var entry = entries[i]; |
| 622 | if (entry.element.id == "") |
| 623 | entry.element.id = "_toc_" + i; |
| 624 | var a = document.createElement("a"); |
| 625 | a.href = "#" + entry.element.id; |
| 626 | a.appendChild(document.createTextNode(entry.text)); |
| 627 | var div = document.createElement("div"); |
| 628 | div.appendChild(a); |
| 629 | div.className = "toclevel" + entry.toclevel; |
| 630 | toc.appendChild(div); |
| 631 | } |
| 632 | if (entries.length == 0) |
| 633 | toc.parentNode.removeChild(toc); |
| 634 | }, |
| 635 | |
| 636 | |
| 637 | ///////////////////////////////////////////////////////////////////// |
| 638 | // Footnotes generator |
| 639 | ///////////////////////////////////////////////////////////////////// |
| 640 | |
| 641 | /* Based on footnote generation code from: |
| 642 | * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html |
| 643 | */ |
| 644 | |
| 645 | footnotes: function () { |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 646 | // Delete existing footnote entries in case we're reloading the footnodes. |
| 647 | var i; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 648 | var noteholder = document.getElementById("footnotes"); |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 649 | if (!noteholder) { |
| 650 | return; |
| 651 | } |
| 652 | var entriesToRemove = []; |
| 653 | for (i = 0; i < noteholder.childNodes.length; i++) { |
| 654 | var entry = noteholder.childNodes[i]; |
| 655 | if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote") |
| 656 | entriesToRemove.push(entry); |
| 657 | } |
| 658 | for (i = 0; i < entriesToRemove.length; i++) { |
| 659 | noteholder.removeChild(entriesToRemove[i]); |
| 660 | } |
| 661 | |
| 662 | // Rebuild footnote entries. |
| 663 | var cont = document.getElementById("content"); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 664 | var spans = cont.getElementsByTagName("span"); |
| 665 | var refs = {}; |
| 666 | var n = 0; |
| 667 | for (i=0; i<spans.length; i++) { |
| 668 | if (spans[i].className == "footnote") { |
| 669 | n++; |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 670 | var note = spans[i].getAttribute("data-note"); |
| 671 | if (!note) { |
| 672 | // Use [\s\S] in place of . so multi-line matches work. |
| 673 | // Because JavaScript has no s (dotall) regex flag. |
| 674 | note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1]; |
| 675 | spans[i].innerHTML = |
| 676 | "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n + |
| 677 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 678 | spans[i].setAttribute("data-note", note); |
| 679 | } |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 680 | noteholder.innerHTML += |
| 681 | "<div class='footnote' id='_footnote_" + n + "'>" + |
| 682 | "<a href='#_footnoteref_" + n + "' title='Return to text'>" + |
| 683 | n + "</a>. " + note + "</div>"; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 684 | var id =spans[i].getAttribute("id"); |
| 685 | if (id != null) refs["#"+id] = n; |
| 686 | } |
| 687 | } |
| 688 | if (n == 0) |
| 689 | noteholder.parentNode.removeChild(noteholder); |
| 690 | else { |
| 691 | // Process footnoterefs. |
| 692 | for (i=0; i<spans.length; i++) { |
| 693 | if (spans[i].className == "footnoteref") { |
| 694 | var href = spans[i].getElementsByTagName("a")[0].getAttribute("href"); |
| 695 | href = href.match(/#.*/)[0]; // Because IE return full URL. |
| 696 | n = refs[href]; |
| 697 | spans[i].innerHTML = |
| 698 | "[<a href='#_footnote_" + n + |
| 699 | "' title='View footnote' class='footnote'>" + n + "</a>]"; |
| 700 | } |
| 701 | } |
| 702 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 703 | }, |
| 704 | |
| 705 | install: function(toclevels) { |
| 706 | var timerId; |
| 707 | |
| 708 | function reinstall() { |
| 709 | asciidoc.footnotes(); |
| 710 | if (toclevels) { |
| 711 | asciidoc.toc(toclevels); |
| 712 | } |
| 713 | } |
| 714 | |
| 715 | function reinstallAndRemoveTimer() { |
| 716 | clearInterval(timerId); |
| 717 | reinstall(); |
| 718 | } |
| 719 | |
| 720 | timerId = setInterval(reinstall, 500); |
| 721 | if (document.addEventListener) |
| 722 | document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false); |
| 723 | else |
| 724 | window.onload = reinstallAndRemoveTimer; |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 725 | } |
| 726 | |
| 727 | } |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 728 | asciidoc.install(); |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 729 | /*]]>*/ |
| 730 | </script> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 731 | </head> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 732 | <body class="manpage"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 733 | <div id="header"> |
| 734 | <h1> |
| 735 | git-rev-parse(1) Manual Page |
| 736 | </h1> |
| 737 | <h2>NAME</h2> |
| 738 | <div class="sectionbody"> |
| 739 | <p>git-rev-parse - |
Junio C Hamano | 0107892 | 2006-03-10 00:31:47 | [diff] [blame] | 740 | Pick out and massage parameters |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 741 | </p> |
| 742 | </div> |
| 743 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 744 | <div id="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 745 | <div class="sect1"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 746 | <h2 id="_synopsis">SYNOPSIS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 747 | <div class="sectionbody"> |
Junio C Hamano | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 748 | <div class="verseblock"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 749 | <pre class="content"><em>git rev-parse</em> [ --option ] <args>…</pre> |
| 750 | <div class="attribution"> |
Junio C Hamano | 15567bc | 2011-07-23 00:51:59 | [diff] [blame] | 751 | </div></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 752 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 753 | </div> |
| 754 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 755 | <h2 id="_description">DESCRIPTION</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 756 | <div class="sectionbody"> |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 757 | <div class="paragraph"><p>Many Git porcelainish commands take mixture of flags |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 758 | (i.e. parameters that begin with a dash <em>-</em>) and parameters |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 759 | meant for the underlying <em>git rev-list</em> command they use internally |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 760 | and flags and parameters for the other commands they use |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 761 | downstream of <em>git rev-list</em>. This command is used to |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 762 | distinguish between them.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 763 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 764 | </div> |
| 765 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 766 | <h2 id="_options">OPTIONS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 767 | <div class="sectionbody"> |
Junio C Hamano | 0241d05 | 2013-08-30 23:52:17 | [diff] [blame] | 768 | <div class="sect2"> |
| 769 | <h3 id="_operation_modes">Operation Modes</h3> |
| 770 | <div class="paragraph"><p>Each of these options must appear first on the command line.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 771 | <div class="dlist"><dl> |
| 772 | <dt class="hdlist1"> |
Junio C Hamano | e125866 | 2007-11-19 05:03:19 | [diff] [blame] | 773 | --parseopt |
| 774 | </dt> |
| 775 | <dd> |
| 776 | <p> |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 777 | Use <em>git rev-parse</em> in option parsing mode (see PARSEOPT section below). |
Junio C Hamano | e125866 | 2007-11-19 05:03:19 | [diff] [blame] | 778 | </p> |
| 779 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 780 | <dt class="hdlist1"> |
Junio C Hamano | 0241d05 | 2013-08-30 23:52:17 | [diff] [blame] | 781 | --sq-quote |
| 782 | </dt> |
| 783 | <dd> |
| 784 | <p> |
| 785 | Use <em>git rev-parse</em> in shell quoting mode (see SQ-QUOTE |
| 786 | section below). In contrast to the <code>--sq</code> option below, this |
| 787 | mode does only quoting. Nothing else is done to command input. |
| 788 | </p> |
| 789 | </dd> |
| 790 | </dl></div> |
| 791 | </div> |
| 792 | <div class="sect2"> |
| 793 | <h3 id="_options_for_parseopt">Options for --parseopt</h3> |
| 794 | <div class="dlist"><dl> |
| 795 | <dt class="hdlist1"> |
Junio C Hamano | a9499de | 2009-04-30 03:38:48 | [diff] [blame] | 796 | --keep-dashdash |
Junio C Hamano | e125866 | 2007-11-19 05:03:19 | [diff] [blame] | 797 | </dt> |
| 798 | <dd> |
| 799 | <p> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 800 | Only meaningful in <code>--parseopt</code> mode. Tells the option parser to echo |
| 801 | out the first <code>--</code> met instead of skipping it. |
Junio C Hamano | e125866 | 2007-11-19 05:03:19 | [diff] [blame] | 802 | </p> |
| 803 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 804 | <dt class="hdlist1"> |
Junio C Hamano | ccc4d37 | 2009-07-06 18:05:38 | [diff] [blame] | 805 | --stop-at-non-option |
| 806 | </dt> |
| 807 | <dd> |
| 808 | <p> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 809 | Only meaningful in <code>--parseopt</code> mode. Lets the option parser stop at |
Junio C Hamano | ccc4d37 | 2009-07-06 18:05:38 | [diff] [blame] | 810 | the first non-option argument. This can be used to parse sub-commands |
Junio C Hamano | 167b138 | 2010-01-31 23:04:31 | [diff] [blame] | 811 | that take options themselves. |
Junio C Hamano | ccc4d37 | 2009-07-06 18:05:38 | [diff] [blame] | 812 | </p> |
| 813 | </dd> |
Junio C Hamano | 0241d05 | 2013-08-30 23:52:17 | [diff] [blame] | 814 | </dl></div> |
| 815 | </div> |
| 816 | <div class="sect2"> |
| 817 | <h3 id="_options_for_filtering">Options for Filtering</h3> |
| 818 | <div class="dlist"><dl> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 819 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 820 | --revs-only |
| 821 | </dt> |
| 822 | <dd> |
| 823 | <p> |
| 824 | Do not output flags and parameters not meant for |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 825 | <em>git rev-list</em> command. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 826 | </p> |
| 827 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 828 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 829 | --no-revs |
| 830 | </dt> |
| 831 | <dd> |
| 832 | <p> |
| 833 | Do not output flags and parameters meant for |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 834 | <em>git rev-list</em> command. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 835 | </p> |
| 836 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 837 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 838 | --flags |
| 839 | </dt> |
| 840 | <dd> |
| 841 | <p> |
| 842 | Do not output non-flag parameters. |
| 843 | </p> |
| 844 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 845 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 846 | --no-flags |
| 847 | </dt> |
| 848 | <dd> |
| 849 | <p> |
| 850 | Do not output flag parameters. |
| 851 | </p> |
| 852 | </dd> |
Junio C Hamano | 0241d05 | 2013-08-30 23:52:17 | [diff] [blame] | 853 | </dl></div> |
| 854 | </div> |
| 855 | <div class="sect2"> |
| 856 | <h3 id="_options_for_output">Options for Output</h3> |
| 857 | <div class="dlist"><dl> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 858 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 859 | --default <arg> |
| 860 | </dt> |
| 861 | <dd> |
| 862 | <p> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 863 | If there is no parameter given by the user, use <code><arg></code> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 864 | instead. |
| 865 | </p> |
| 866 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 867 | <dt class="hdlist1"> |
Junio C Hamano | a195230 | 2013-07-01 21:31:18 | [diff] [blame] | 868 | --prefix <arg> |
| 869 | </dt> |
| 870 | <dd> |
| 871 | <p> |
| 872 | Behave as if <em>git rev-parse</em> was invoked from the <code><arg></code> |
| 873 | subdirectory of the working tree. Any relative filenames are |
| 874 | resolved as if they are prefixed by <code><arg></code> and will be printed |
| 875 | in that form. |
| 876 | </p> |
| 877 | <div class="paragraph"><p>This can be used to convert arguments to a command run in a subdirectory |
| 878 | so that they can still be used after moving to the top-level of the |
| 879 | repository. For example:</p></div> |
| 880 | <div class="listingblock"> |
| 881 | <div class="content"> |
| 882 | <pre><code>prefix=$(git rev-parse --show-prefix) |
| 883 | cd "$(git rev-parse --show-toplevel)" |
| 884 | eval "set -- $(git rev-parse --sq --prefix "$prefix" "$@")"</code></pre> |
| 885 | </div></div> |
| 886 | </dd> |
| 887 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 888 | --verify |
| 889 | </dt> |
| 890 | <dd> |
| 891 | <p> |
Junio C Hamano | edf80bd | 2013-04-05 22:14:36 | [diff] [blame] | 892 | Verify that exactly one parameter is provided, and that it |
| 893 | can be turned into a raw 20-byte SHA-1 that can be used to |
| 894 | access the object database. If so, emit it to the standard |
| 895 | output; otherwise, error out. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 896 | </p> |
Junio C Hamano | edf80bd | 2013-04-05 22:14:36 | [diff] [blame] | 897 | <div class="paragraph"><p>If you want to make sure that the output actually names an object in |
| 898 | your object database and/or can be used as a specific type of object |
| 899 | For example, <code>git rev-parse "$VAR^{commit}"</code> will make sure <code>$VAR</code> |
| 900 | names an existing object that is a commit-ish (i.e. a commit, or an |
| 901 | annotated tag that points at a commit). To make sure that <code>$VAR</code> |
| 902 | names an existing object of any type, <code>git rev-parse "$VAR^{object}"</code> |
| 903 | can be used.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 904 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 905 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 906 | -q |
| 907 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 908 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 909 | --quiet |
Junio C Hamano | 9ab8767 | 2008-04-28 08:40:29 | [diff] [blame] | 910 | </dt> |
| 911 | <dd> |
| 912 | <p> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 913 | Only meaningful in <code>--verify</code> mode. Do not output an error |
Junio C Hamano | 9ab8767 | 2008-04-28 08:40:29 | [diff] [blame] | 914 | message if the first argument is not a valid object name; |
| 915 | instead exit with non-zero status silently. |
| 916 | </p> |
| 917 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 918 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 919 | --sq |
| 920 | </dt> |
| 921 | <dd> |
| 922 | <p> |
| 923 | Usually the output is made one line per flag and |
| 924 | parameter. This option makes output a single line, |
| 925 | properly quoted for consumption by shell. Useful when |
| 926 | you expect your parameter to contain whitespaces and |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 927 | newlines (e.g. when using pickaxe <code>-S</code> with |
| 928 | <em>git diff-*</em>). In contrast to the <code>--sq-quote</code> option, |
Junio C Hamano | 7ae1825 | 2009-05-23 09:53:32 | [diff] [blame] | 929 | the command input is still interpreted as usual. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 930 | </p> |
| 931 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 932 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 933 | --not |
| 934 | </dt> |
| 935 | <dd> |
| 936 | <p> |
Junio C Hamano | 6926bef | 2007-06-16 09:54:05 | [diff] [blame] | 937 | When showing object names, prefix them with <em>^</em> and |
| 938 | strip <em>^</em> prefix from the object names that already have |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 939 | one. |
| 940 | </p> |
| 941 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 942 | <dt class="hdlist1"> |
Junio C Hamano | 0241d05 | 2013-08-30 23:52:17 | [diff] [blame] | 943 | --abbrev-ref[=(strict|loose)] |
| 944 | </dt> |
| 945 | <dd> |
| 946 | <p> |
| 947 | A non-ambiguous short name of the objects name. |
| 948 | The option core.warnAmbiguousRefs is used to select the strict |
| 949 | abbreviation mode. |
| 950 | </p> |
| 951 | </dd> |
| 952 | <dt class="hdlist1"> |
| 953 | --short |
| 954 | </dt> |
| 955 | <dt class="hdlist1"> |
| 956 | --short=number |
| 957 | </dt> |
| 958 | <dd> |
| 959 | <p> |
| 960 | Instead of outputting the full SHA-1 values of object names try to |
| 961 | abbreviate them to a shorter unique name. When no length is specified |
| 962 | 7 is used. The minimum length is 4. |
| 963 | </p> |
| 964 | </dd> |
| 965 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 966 | --symbolic |
| 967 | </dt> |
| 968 | <dd> |
| 969 | <p> |
Junio C Hamano | e3f080d | 2013-04-22 02:27:13 | [diff] [blame] | 970 | Usually the object names are output in SHA-1 form (with |
Junio C Hamano | 6926bef | 2007-06-16 09:54:05 | [diff] [blame] | 971 | possible <em>^</em> prefix); this option makes them output in a |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 972 | form as close to the original input as possible. |
| 973 | </p> |
| 974 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 975 | <dt class="hdlist1"> |
Junio C Hamano | 35738e8 | 2008-01-07 07:55:46 | [diff] [blame] | 976 | --symbolic-full-name |
| 977 | </dt> |
| 978 | <dd> |
| 979 | <p> |
| 980 | This is similar to --symbolic, but it omits input that |
| 981 | are not refs (i.e. branch or tag names; or more |
| 982 | explicitly disambiguating "heads/master" form, when you |
| 983 | want to name the "master" branch when there is an |
| 984 | unfortunately named tag "master"), and show them as full |
| 985 | refnames (e.g. "refs/heads/master"). |
| 986 | </p> |
| 987 | </dd> |
Junio C Hamano | 0241d05 | 2013-08-30 23:52:17 | [diff] [blame] | 988 | </dl></div> |
| 989 | </div> |
| 990 | <div class="sect2"> |
| 991 | <h3 id="_options_for_objects">Options for Objects</h3> |
| 992 | <div class="dlist"><dl> |
Junio C Hamano | bb30064 | 2012-07-22 21:09:14 | [diff] [blame] | 993 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 994 | --all |
| 995 | </dt> |
| 996 | <dd> |
| 997 | <p> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 998 | Show all refs found in <code>refs/</code>. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 999 | </p> |
| 1000 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1001 | <dt class="hdlist1"> |
Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1002 | --branches[=pattern] |
| 1003 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1004 | <dt class="hdlist1"> |
Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1005 | --tags[=pattern] |
| 1006 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1007 | <dt class="hdlist1"> |
Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1008 | --remotes[=pattern] |
Junio C Hamano | 6959c6c | 2006-05-17 10:34:11 | [diff] [blame] | 1009 | </dt> |
| 1010 | <dd> |
| 1011 | <p> |
Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1012 | Show all branches, tags, or remote-tracking branches, |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1013 | respectively (i.e., refs found in <code>refs/heads</code>, |
| 1014 | <code>refs/tags</code>, or <code>refs/remotes</code>, respectively). |
Junio C Hamano | 6959c6c | 2006-05-17 10:34:11 | [diff] [blame] | 1015 | </p> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1016 | <div class="paragraph"><p>If a <code>pattern</code> is given, only refs matching the given shell glob are |
| 1017 | shown. If the pattern does not contain a globbing character (<code>?</code>, |
| 1018 | <code>*</code>, or <code>[</code>), it is turned into a prefix match by appending <code>/*</code>.</p></div> |
Junio C Hamano | 6959c6c | 2006-05-17 10:34:11 | [diff] [blame] | 1019 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1020 | <dt class="hdlist1"> |
Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1021 | --glob=pattern |
Junio C Hamano | 6959c6c | 2006-05-17 10:34:11 | [diff] [blame] | 1022 | </dt> |
| 1023 | <dd> |
| 1024 | <p> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1025 | Show all refs matching the shell glob pattern <code>pattern</code>. If |
| 1026 | the pattern does not start with <code>refs/</code>, this is automatically |
Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1027 | prepended. If the pattern does not contain a globbing |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1028 | character (<code>?</code>, <code>*</code>, or <code>[</code>), it is turned into a prefix |
| 1029 | match by appending <code>/*</code>. |
Junio C Hamano | 6959c6c | 2006-05-17 10:34:11 | [diff] [blame] | 1030 | </p> |
| 1031 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1032 | <dt class="hdlist1"> |
Junio C Hamano | 0241d05 | 2013-08-30 23:52:17 | [diff] [blame] | 1033 | --disambiguate=<prefix> |
Junio C Hamano | a9701f0 | 2010-01-21 00:42:16 | [diff] [blame] | 1034 | </dt> |
| 1035 | <dd> |
| 1036 | <p> |
Junio C Hamano | 0241d05 | 2013-08-30 23:52:17 | [diff] [blame] | 1037 | Show every object whose name begins with the given prefix. |
| 1038 | The <prefix> must be at least 4 hexadecimal digits long to |
| 1039 | avoid listing each and every object in the repository by |
| 1040 | mistake. |
Junio C Hamano | a9701f0 | 2010-01-21 00:42:16 | [diff] [blame] | 1041 | </p> |
| 1042 | </dd> |
Junio C Hamano | 0241d05 | 2013-08-30 23:52:17 | [diff] [blame] | 1043 | </dl></div> |
| 1044 | </div> |
| 1045 | <div class="sect2"> |
| 1046 | <h3 id="_options_for_files">Options for Files</h3> |
| 1047 | <div class="dlist"><dl> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1048 | <dt class="hdlist1"> |
Junio C Hamano | 0241d05 | 2013-08-30 23:52:17 | [diff] [blame] | 1049 | --local-env-vars |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1050 | </dt> |
| 1051 | <dd> |
| 1052 | <p> |
Junio C Hamano | 0241d05 | 2013-08-30 23:52:17 | [diff] [blame] | 1053 | List the GIT_* environment variables that are local to the |
| 1054 | repository (e.g. GIT_DIR or GIT_WORK_TREE, but not GIT_EDITOR). |
| 1055 | Only the names of the variables are listed, not their value, |
| 1056 | even if they are set. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1057 | </p> |
| 1058 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1059 | <dt class="hdlist1"> |
Junio C Hamano | e246e3b | 2006-02-19 08:45:18 | [diff] [blame] | 1060 | --git-dir |
| 1061 | </dt> |
| 1062 | <dd> |
| 1063 | <p> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1064 | Show <code>$GIT_DIR</code> if defined. Otherwise show the path to |
Junio C Hamano | 35cd2a8 | 2012-05-23 22:01:13 | [diff] [blame] | 1065 | the .git directory. The path shown, when relative, is |
| 1066 | relative to the current working directory. |
Junio C Hamano | e246e3b | 2006-02-19 08:45:18 | [diff] [blame] | 1067 | </p> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1068 | <div class="paragraph"><p>If <code>$GIT_DIR</code> is not defined and the current directory |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 1069 | is not detected to lie in a Git repository or work tree |
Junio C Hamano | 3609b33 | 2010-12-29 01:34:52 | [diff] [blame] | 1070 | print a message to stderr and exit with nonzero status.</p></div> |
Junio C Hamano | e246e3b | 2006-02-19 08:45:18 | [diff] [blame] | 1071 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1072 | <dt class="hdlist1"> |
Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 1073 | --is-inside-git-dir |
| 1074 | </dt> |
| 1075 | <dd> |
| 1076 | <p> |
Junio C Hamano | d526ba9 | 2007-07-02 00:17:42 | [diff] [blame] | 1077 | When the current working directory is below the repository |
| 1078 | directory print "true", otherwise "false". |
| 1079 | </p> |
| 1080 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1081 | <dt class="hdlist1"> |
Junio C Hamano | d526ba9 | 2007-07-02 00:17:42 | [diff] [blame] | 1082 | --is-inside-work-tree |
| 1083 | </dt> |
| 1084 | <dd> |
| 1085 | <p> |
| 1086 | When the current working directory is inside the work tree of the |
| 1087 | repository print "true", otherwise "false". |
| 1088 | </p> |
| 1089 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1090 | <dt class="hdlist1"> |
Junio C Hamano | d526ba9 | 2007-07-02 00:17:42 | [diff] [blame] | 1091 | --is-bare-repository |
| 1092 | </dt> |
| 1093 | <dd> |
| 1094 | <p> |
| 1095 | When the repository is bare print "true", otherwise "false". |
Junio C Hamano | ee695f2 | 2007-06-21 00:35:36 | [diff] [blame] | 1096 | </p> |
| 1097 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1098 | <dt class="hdlist1"> |
Junio C Hamano | 0241d05 | 2013-08-30 23:52:17 | [diff] [blame] | 1099 | --resolve-git-dir <path> |
Junio C Hamano | 636c8b2 | 2010-03-07 22:25:17 | [diff] [blame] | 1100 | </dt> |
| 1101 | <dd> |
| 1102 | <p> |
Junio C Hamano | 0241d05 | 2013-08-30 23:52:17 | [diff] [blame] | 1103 | Check if <path> is a valid repository or a gitfile that |
| 1104 | points at a valid repository, and print the location of the |
| 1105 | repository. If <path> is a gitfile then the resolved path |
| 1106 | to the real repository is printed. |
Junio C Hamano | 636c8b2 | 2010-03-07 22:25:17 | [diff] [blame] | 1107 | </p> |
| 1108 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1109 | <dt class="hdlist1"> |
Junio C Hamano | 0241d05 | 2013-08-30 23:52:17 | [diff] [blame] | 1110 | --show-cdup |
Junio C Hamano | e246e3b | 2006-02-19 08:45:18 | [diff] [blame] | 1111 | </dt> |
| 1112 | <dd> |
| 1113 | <p> |
Junio C Hamano | 0241d05 | 2013-08-30 23:52:17 | [diff] [blame] | 1114 | When the command is invoked from a subdirectory, show the |
| 1115 | path of the top-level directory relative to the current |
| 1116 | directory (typically a sequence of "../", or an empty string). |
Junio C Hamano | e246e3b | 2006-02-19 08:45:18 | [diff] [blame] | 1117 | </p> |
| 1118 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1119 | <dt class="hdlist1"> |
Junio C Hamano | 0241d05 | 2013-08-30 23:52:17 | [diff] [blame] | 1120 | --show-prefix |
| 1121 | </dt> |
| 1122 | <dd> |
| 1123 | <p> |
| 1124 | When the command is invoked from a subdirectory, show the |
| 1125 | path of the current directory relative to the top-level |
| 1126 | directory. |
| 1127 | </p> |
| 1128 | </dd> |
| 1129 | <dt class="hdlist1"> |
| 1130 | --show-toplevel |
| 1131 | </dt> |
| 1132 | <dd> |
| 1133 | <p> |
| 1134 | Show the absolute path of the top-level directory. |
| 1135 | </p> |
| 1136 | </dd> |
| 1137 | </dl></div> |
| 1138 | </div> |
| 1139 | <div class="sect2"> |
| 1140 | <h3 id="_other_options">Other Options</h3> |
| 1141 | <div class="dlist"><dl> |
| 1142 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1143 | --since=datestring |
| 1144 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1145 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1146 | --after=datestring |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1147 | </dt> |
| 1148 | <dd> |
| 1149 | <p> |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 1150 | Parse the date string, and output the corresponding |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1151 | --max-age= parameter for <em>git rev-list</em>. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1152 | </p> |
| 1153 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1154 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1155 | --until=datestring |
| 1156 | </dt> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1157 | <dt class="hdlist1"> |
Junio C Hamano | eb41599 | 2008-06-08 22:49:47 | [diff] [blame] | 1158 | --before=datestring |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1159 | </dt> |
| 1160 | <dd> |
| 1161 | <p> |
Junio C Hamano | fce7c7e | 2008-07-02 03:06:38 | [diff] [blame] | 1162 | Parse the date string, and output the corresponding |
Junio C Hamano | 1aa40d2 | 2010-01-21 17:46:43 | [diff] [blame] | 1163 | --min-age= parameter for <em>git rev-list</em>. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1164 | </p> |
| 1165 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1166 | <dt class="hdlist1"> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1167 | <args>… |
| 1168 | </dt> |
| 1169 | <dd> |
| 1170 | <p> |
| 1171 | Flags and parameters to be parsed. |
| 1172 | </p> |
| 1173 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1174 | </dl></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1175 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1176 | </div> |
Junio C Hamano | 0241d05 | 2013-08-30 23:52:17 | [diff] [blame] | 1177 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1178 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1179 | <h2 id="_specifying_revisions">SPECIFYING REVISIONS</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1180 | <div class="sectionbody"> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1181 | <div class="paragraph"><p>A revision parameter <em><rev></em> typically, but not necessarily, names a |
Junio C Hamano | e3f080d | 2013-04-22 02:27:13 | [diff] [blame] | 1182 | commit object. It uses what is called an <em>extended SHA-1</em> |
Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 1183 | syntax. Here are various ways to spell object names. The |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1184 | ones listed near the end of this list name trees and |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1185 | blobs contained in a commit.</p></div> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1186 | <div class="dlist"><dl> |
| 1187 | <dt class="hdlist1"> |
| 1188 | <em><sha1></em>, e.g. <em>dae86e1950b1277e545cee180551750029cfe735</em>, <em>dae86e</em> |
| 1189 | </dt> |
| 1190 | <dd> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1191 | <p> |
Junio C Hamano | e3f080d | 2013-04-22 02:27:13 | [diff] [blame] | 1192 | The full SHA-1 object name (40-byte hexadecimal string), or |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1193 | a leading substring that is unique within the repository. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1194 | E.g. dae86e1950b1277e545cee180551750029cfe735 and dae86e both |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1195 | name the same commit object if there is no other object in |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1196 | your repository whose object name starts with dae86e. |
| 1197 | </p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1198 | </dd> |
| 1199 | <dt class="hdlist1"> |
| 1200 | <em><describeOutput></em>, e.g. <em>v1.7.4.2-679-g3bee7fb</em> |
| 1201 | </dt> |
| 1202 | <dd> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1203 | <p> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1204 | Output from <code>git describe</code>; i.e. a closest tag, optionally |
Junio C Hamano | 7f80ae8 | 2008-07-30 18:31:35 | [diff] [blame] | 1205 | followed by a dash and a number of commits, followed by a dash, a |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1206 | <em>g</em>, and an abbreviated object name. |
Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 1207 | </p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1208 | </dd> |
| 1209 | <dt class="hdlist1"> |
| 1210 | <em><refname></em>, e.g. <em>master</em>, <em>heads/master</em>, <em>refs/heads/master</em> |
| 1211 | </dt> |
| 1212 | <dd> |
Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 1213 | <p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1214 | A symbolic ref name. E.g. <em>master</em> typically means the commit |
| 1215 | object referenced by <em>refs/heads/master</em>. If you |
| 1216 | happen to have both <em>heads/master</em> and <em>tags/master</em>, you can |
Junio C Hamano | 076ffcc | 2013-02-06 05:13:21 | [diff] [blame] | 1217 | explicitly say <em>heads/master</em> to tell Git which one you mean. |
Junio C Hamano | f593372 | 2012-07-25 23:25:21 | [diff] [blame] | 1218 | When ambiguous, a <em><refname></em> is disambiguated by taking the |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 1219 | first match in the following rules: |
| 1220 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1221 | <div class="olist arabic"><ol class="arabic"> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 1222 | <li> |
| 1223 | <p> |
Junio C Hamano | f593372 | 2012-07-25 23:25:21 | [diff] [blame] | 1224 | If <em>$GIT_DIR/<refname></em> exists, that is what you mean (this is usually |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1225 | useful only for <em>HEAD</em>, <em>FETCH_HEAD</em>, <em>ORIG_HEAD</em>, <em>MERGE_HEAD</em> |
| 1226 | and <em>CHERRY_PICK_HEAD</em>); |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1227 | </p> |
| 1228 | </li> |
| 1229 | <li> |
| 1230 | <p> |
Junio C Hamano | f593372 | 2012-07-25 23:25:21 | [diff] [blame] | 1231 | otherwise, <em>refs/<refname></em> if it exists; |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 1232 | </p> |
| 1233 | </li> |
| 1234 | <li> |
| 1235 | <p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1236 | otherwise, <em>refs/tags/<refname></em> if it exists; |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 1237 | </p> |
| 1238 | </li> |
| 1239 | <li> |
| 1240 | <p> |
Junio C Hamano | f593372 | 2012-07-25 23:25:21 | [diff] [blame] | 1241 | otherwise, <em>refs/heads/<refname></em> if it exists; |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 1242 | </p> |
| 1243 | </li> |
| 1244 | <li> |
| 1245 | <p> |
Junio C Hamano | f593372 | 2012-07-25 23:25:21 | [diff] [blame] | 1246 | otherwise, <em>refs/remotes/<refname></em> if it exists; |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 1247 | </p> |
| 1248 | </li> |
| 1249 | <li> |
| 1250 | <p> |
Junio C Hamano | f593372 | 2012-07-25 23:25:21 | [diff] [blame] | 1251 | otherwise, <em>refs/remotes/<refname>/HEAD</em> if it exists. |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 1252 | </p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1253 | <div class="paragraph"><p><em>HEAD</em> names the commit on which you based the changes in the working tree. |
| 1254 | <em>FETCH_HEAD</em> records the branch which you fetched from a remote repository |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1255 | with your last <code>git fetch</code> invocation. |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1256 | <em>ORIG_HEAD</em> is created by commands that move your <em>HEAD</em> in a drastic |
| 1257 | way, to record the position of the <em>HEAD</em> before their operation, so that |
| 1258 | you can easily change the tip of the branch back to the state before you ran |
| 1259 | them. |
| 1260 | <em>MERGE_HEAD</em> records the commit(s) which you are merging into your branch |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1261 | when you run <code>git merge</code>. |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1262 | <em>CHERRY_PICK_HEAD</em> records the commit which you are cherry-picking |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1263 | when you run <code>git cherry-pick</code>.</p></div> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1264 | <div class="paragraph"><p>Note that any of the <em>refs/*</em> cases above may come either from |
Junio C Hamano | eccdd4a | 2012-09-10 23:28:17 | [diff] [blame] | 1265 | the <em>$GIT_DIR/refs</em> directory or from the <em>$GIT_DIR/packed-refs</em> file. |
Junio C Hamano | a080bc3 | 2013-04-12 21:33:01 | [diff] [blame] | 1266 | While the ref name encoding is unspecified, UTF-8 is preferred as |
Junio C Hamano | eccdd4a | 2012-09-10 23:28:17 | [diff] [blame] | 1267 | some output processing may assume ref names in UTF-8.</p></div> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 1268 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1269 | </ol></div> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1270 | </dd> |
| 1271 | <dt class="hdlist1"> |
Junio C Hamano | 79f4c7c | 2013-09-20 21:03:37 | [diff] [blame] | 1272 | <em>@</em> |
| 1273 | </dt> |
| 1274 | <dd> |
| 1275 | <p> |
| 1276 | <em>@</em> alone is a shortcut for <em>HEAD</em>. |
| 1277 | </p> |
| 1278 | </dd> |
| 1279 | <dt class="hdlist1"> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1280 | <em><refname>@{<date>}</em>, e.g. <em>master@{yesterday}</em>, <em>HEAD@{5 minutes ago}</em> |
| 1281 | </dt> |
| 1282 | <dd> |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 1283 | <p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1284 | A ref followed by the suffix <em>@</em> with a date specification |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 1285 | enclosed in a brace |
Junio C Hamano | 341071d | 2006-06-04 07:24:48 | [diff] [blame] | 1286 | pair (e.g. <em>{yesterday}</em>, <em>{1 month 2 weeks 3 days 1 hour 1 |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1287 | second ago}</em> or <em>{1979-02-26 18:30:00}</em>) specifies the value |
Junio C Hamano | 341071d | 2006-06-04 07:24:48 | [diff] [blame] | 1288 | of the ref at a prior point in time. This suffix may only be |
| 1289 | used immediately following a ref name and the ref must have an |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1290 | existing log (<em>$GIT_DIR/logs/<ref></em>). Note that this looks up the state |
Junio C Hamano | bb8e996 | 2008-06-30 09:05:08 | [diff] [blame] | 1291 | of your <strong>local</strong> ref at a given time; e.g., what was in your local |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1292 | <em>master</em> branch last week. If you want to look at commits made during |
| 1293 | certain times, see <em>--since</em> and <em>--until</em>. |
Junio C Hamano | 341071d | 2006-06-04 07:24:48 | [diff] [blame] | 1294 | </p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1295 | </dd> |
| 1296 | <dt class="hdlist1"> |
| 1297 | <em><refname>@{<n>}</em>, e.g. <em>master@{1}</em> |
| 1298 | </dt> |
| 1299 | <dd> |
Junio C Hamano | 341071d | 2006-06-04 07:24:48 | [diff] [blame] | 1300 | <p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1301 | A ref followed by the suffix <em>@</em> with an ordinal specification |
| 1302 | enclosed in a brace pair (e.g. <em>{1}</em>, <em>{15}</em>) specifies |
Junio C Hamano | 2d47c62 | 2007-01-18 06:24:10 | [diff] [blame] | 1303 | the n-th prior value of that ref. For example <em>master@{1}</em> |
| 1304 | is the immediate prior value of <em>master</em> while <em>master@{5}</em> |
| 1305 | is the 5th prior value of <em>master</em>. This suffix may only be used |
| 1306 | immediately following a ref name and the ref must have an existing |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1307 | log (<em>$GIT_DIR/logs/<refname></em>). |
Junio C Hamano | 2d47c62 | 2007-01-18 06:24:10 | [diff] [blame] | 1308 | </p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1309 | </dd> |
| 1310 | <dt class="hdlist1"> |
| 1311 | <em>@{<n>}</em>, e.g. <em>@{1}</em> |
| 1312 | </dt> |
| 1313 | <dd> |
Junio C Hamano | 2d47c62 | 2007-01-18 06:24:10 | [diff] [blame] | 1314 | <p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1315 | You can use the <em>@</em> construct with an empty ref part to get at a |
| 1316 | reflog entry of the current branch. For example, if you are on |
| 1317 | branch <em>blabla</em> then <em>@{1}</em> means the same as <em>blabla@{1}</em>. |
Junio C Hamano | 39381a7 | 2007-02-02 07:35:15 | [diff] [blame] | 1318 | </p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1319 | </dd> |
| 1320 | <dt class="hdlist1"> |
| 1321 | <em>@{-<n>}</em>, e.g. <em>@{-1}</em> |
| 1322 | </dt> |
| 1323 | <dd> |
Junio C Hamano | 39381a7 | 2007-02-02 07:35:15 | [diff] [blame] | 1324 | <p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1325 | The construct <em>@{-<n>}</em> means the <n>th branch checked out |
Junio C Hamano | 440791e | 2009-01-29 01:54:02 | [diff] [blame] | 1326 | before the current one. |
| 1327 | </p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1328 | </dd> |
| 1329 | <dt class="hdlist1"> |
Junio C Hamano | fa156ea | 2013-03-17 23:39:09 | [diff] [blame] | 1330 | <em><branchname>@{upstream}</em>, e.g. <em>master@{upstream}</em>, <em>@{u}</em> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1331 | </dt> |
| 1332 | <dd> |
Junio C Hamano | 440791e | 2009-01-29 01:54:02 | [diff] [blame] | 1333 | <p> |
Junio C Hamano | fa156ea | 2013-03-17 23:39:09 | [diff] [blame] | 1334 | The suffix <em>@{upstream}</em> to a branchname (short form <em><branchname>@{u}</em>) |
| 1335 | refers to the branch that the branch specified by branchname is set to build on |
| 1336 | top of. A missing branchname defaults to the current one. |
Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1337 | </p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1338 | </dd> |
| 1339 | <dt class="hdlist1"> |
| 1340 | <em><rev>^</em>, e.g. <em>HEAD^, v1.5.1^0</em> |
| 1341 | </dt> |
| 1342 | <dd> |
Junio C Hamano | 57827fb | 2010-01-23 03:02:50 | [diff] [blame] | 1343 | <p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1344 | A suffix <em>^</em> to a revision parameter means the first parent of |
Junio C Hamano | 6926bef | 2007-06-16 09:54:05 | [diff] [blame] | 1345 | that commit object. <em>^<n></em> means the <n>th parent (i.e. |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1346 | <em><rev>^</em> |
| 1347 | is equivalent to <em><rev>^1</em>). As a special rule, |
| 1348 | <em><rev>^0</em> means the commit itself and is used when <em><rev></em> is the |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1349 | object name of a tag object that refers to a commit object. |
| 1350 | </p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1351 | </dd> |
| 1352 | <dt class="hdlist1"> |
| 1353 | <em><rev>~<n></em>, e.g. <em>master~3</em> |
| 1354 | </dt> |
| 1355 | <dd> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1356 | <p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1357 | A suffix <em>~<n></em> to a revision parameter means the commit |
Junio C Hamano | 81d540a | 2012-03-02 19:52:47 | [diff] [blame] | 1358 | object that is the <n>th generation ancestor of the named |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1359 | commit object, following only the first parents. I.e. <em><rev>~3</em> is |
| 1360 | equivalent to <em><rev>^^^</em> which is equivalent to |
| 1361 | <em><rev>^1^1^1</em>. See below for an illustration of |
Junio C Hamano | 29f1431 | 2006-10-26 08:47:29 | [diff] [blame] | 1362 | the usage of this form. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1363 | </p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1364 | </dd> |
| 1365 | <dt class="hdlist1"> |
| 1366 | <em><rev>^{<type>}</em>, e.g. <em>v0.99.8^{commit}</em> |
| 1367 | </dt> |
| 1368 | <dd> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1369 | <p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1370 | A suffix <em>^</em> followed by an object type name enclosed in |
Junio C Hamano | e6f28d0 | 2013-09-17 21:34:00 | [diff] [blame] | 1371 | brace pair means dereference the object at <em><rev></em> recursively until |
| 1372 | an object of type <em><type></em> is found or the object cannot be |
| 1373 | dereferenced anymore (in which case, barf). |
| 1374 | For example, if <em><rev></em> is a commit-ish, <em><rev>^{commit}</em> |
| 1375 | describes the corresponding commit object. |
| 1376 | Similarly, if <em><rev></em> is a tree-ish, <em><rev>^{tree}</em> |
| 1377 | describes the corresponding tree object. |
| 1378 | <em><rev>^0</em> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1379 | is a short-hand for <em><rev>^{commit}</em>. |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1380 | </p> |
Junio C Hamano | a6c69e1 | 2013-04-03 20:31:10 | [diff] [blame] | 1381 | <div class="paragraph"><p><em>rev^{object}</em> can be used to make sure <em>rev</em> names an |
| 1382 | object that exists, without requiring <em>rev</em> to be a tag, and |
| 1383 | without dereferencing <em>rev</em>; because a tag is already an object, |
| 1384 | it does not have to be dereferenced even once to get to an object.</p></div> |
Junio C Hamano | 79f4c7c | 2013-09-20 21:03:37 | [diff] [blame] | 1385 | <div class="paragraph"><p><em>rev^{tag}</em> can be used to ensure that <em>rev</em> identifies an |
| 1386 | existing tag object.</p></div> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1387 | </dd> |
| 1388 | <dt class="hdlist1"> |
| 1389 | <em><rev>^{}</em>, e.g. <em>v0.99.8^{}</em> |
| 1390 | </dt> |
| 1391 | <dd> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1392 | <p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1393 | A suffix <em>^</em> followed by an empty brace pair |
| 1394 | means the object could be a tag, |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1395 | and dereference the tag recursively until a non-tag object is |
| 1396 | found. |
| 1397 | </p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1398 | </dd> |
| 1399 | <dt class="hdlist1"> |
| 1400 | <em><rev>^{/<text>}</em>, e.g. <em>HEAD^{/fix nasty bug}</em> |
| 1401 | </dt> |
| 1402 | <dd> |
Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 1403 | <p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1404 | A suffix <em>^</em> to a revision parameter, followed by a brace |
| 1405 | pair that contains a text led by a slash, |
| 1406 | is the same as the <em>:/fix nasty bug</em> syntax below except that |
Junio C Hamano | 18b5ad5 | 2010-12-22 01:57:50 | [diff] [blame] | 1407 | it returns the youngest matching commit which is reachable from |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1408 | the <em><rev></em> before <em>^</em>. |
Junio C Hamano | 18b5ad5 | 2010-12-22 01:57:50 | [diff] [blame] | 1409 | </p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1410 | </dd> |
| 1411 | <dt class="hdlist1"> |
| 1412 | <em>:/<text></em>, e.g. <em>:/fix nasty bug</em> |
| 1413 | </dt> |
| 1414 | <dd> |
Junio C Hamano | 18b5ad5 | 2010-12-22 01:57:50 | [diff] [blame] | 1415 | <p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1416 | A colon, followed by a slash, followed by a text, names |
Junio C Hamano | 442206c | 2010-09-28 05:51:23 | [diff] [blame] | 1417 | a commit whose commit message matches the specified regular expression. |
Junio C Hamano | 6ac2f14 | 2007-03-01 01:24:56 | [diff] [blame] | 1418 | This name returns the youngest matching commit which is |
| 1419 | reachable from any ref. If the commit message starts with a |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1420 | <em>!</em> you have to repeat that; the special sequence <em>:/!</em>, |
| 1421 | followed by something else than <em>!</em>, is reserved for now. |
Junio C Hamano | 442206c | 2010-09-28 05:51:23 | [diff] [blame] | 1422 | The regular expression can match any part of the commit message. To |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1423 | match messages starting with a string, one can use e.g. <em>:/^foo</em>. |
Junio C Hamano | 6ac2f14 | 2007-03-01 01:24:56 | [diff] [blame] | 1424 | </p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1425 | </dd> |
| 1426 | <dt class="hdlist1"> |
| 1427 | <em><rev>:<path></em>, e.g. <em>HEAD:README</em>, <em>:README</em>, <em>master:./README</em> |
| 1428 | </dt> |
| 1429 | <dd> |
Junio C Hamano | 6ac2f14 | 2007-03-01 01:24:56 | [diff] [blame] | 1430 | <p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1431 | A suffix <em>:</em> followed by a path names the blob or tree |
Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 1432 | at the given path in the tree-ish object named by the part |
| 1433 | before the colon. |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1434 | <em>:path</em> (with an empty part before the colon) |
Junio C Hamano | 7d44952 | 2010-07-01 00:08:51 | [diff] [blame] | 1435 | is a special case of the syntax described next: content |
| 1436 | recorded in the index at the given path. |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1437 | A path starting with <em>./</em> or <em>../</em> is relative to the current working directory. |
| 1438 | The given path will be converted to be relative to the working tree’s root directory. |
Junio C Hamano | 0d75e87 | 2010-12-17 06:57:26 | [diff] [blame] | 1439 | This is most useful to address a blob or tree from a commit or tree that has |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1440 | the same tree structure as the working tree. |
Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 1441 | </p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1442 | </dd> |
| 1443 | <dt class="hdlist1"> |
| 1444 | <em>:<n>:<path></em>, e.g. <em>:0:README</em>, <em>:README</em> |
| 1445 | </dt> |
| 1446 | <dd> |
Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 1447 | <p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1448 | A colon, optionally followed by a stage number (0 to 3) and a |
| 1449 | colon, followed by a path, names a blob object in the |
| 1450 | index at the given path. A missing stage number (and the colon |
| 1451 | that follows it) names a stage 0 entry. During a merge, stage |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1452 | 1 is the common ancestor, stage 2 is the target branch’s version |
Junio C Hamano | cae8627 | 2007-08-21 02:20:49 | [diff] [blame] | 1453 | (typically the current branch), and stage 3 is the version from |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1454 | the branch which is being merged. |
Junio C Hamano | fbe0052 | 2006-10-19 05:58:48 | [diff] [blame] | 1455 | </p> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1456 | </dd> |
| 1457 | </dl></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1458 | <div class="paragraph"><p>Here is an illustration, by Jon Loeliger. Both commit nodes B |
Junio C Hamano | 1c95e9d | 2008-02-01 10:52:44 | [diff] [blame] | 1459 | and C are parents of commit node A. Parent commits are ordered |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1460 | left-to-right.</p></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1461 | <div class="literalblock"> |
| 1462 | <div class="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1463 | <pre><code>G H I J |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1464 | \ / \ / |
| 1465 | D E F |
Junio C Hamano | 137273f | 2008-05-27 07:44:33 | [diff] [blame] | 1466 | \ | / \ |
| 1467 | \ | / | |
Junio C Hamano | 872c568 | 2006-07-07 06:05:40 | [diff] [blame] | 1468 | \|/ | |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1469 | B C |
| 1470 | \ / |
| 1471 | \ / |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1472 | A</code></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1473 | </div></div> |
| 1474 | <div class="literalblock"> |
| 1475 | <div class="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1476 | <pre><code>A = = A^0 |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1477 | B = A^ = A^1 = A~1 |
| 1478 | C = A^2 = A^2 |
| 1479 | D = A^^ = A^1^1 = A~2 |
| 1480 | E = B^2 = A^^2 |
| 1481 | F = B^3 = A^^3 |
| 1482 | G = A^^^ = A^1^1^1 = A~3 |
| 1483 | H = D^2 = B^^2 = A^^^2 = A~2^2 |
| 1484 | I = F^ = B^3^ = A^^3^ |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1485 | J = F^2 = B^3^2 = A^^3^2</code></pre> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1486 | </div></div> |
| 1487 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1488 | </div> |
| 1489 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1490 | <h2 id="_specifying_ranges">SPECIFYING RANGES</h2> |
Junio C Hamano | 872c568 | 2006-07-07 06:05:40 | [diff] [blame] | 1491 | <div class="sectionbody"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1492 | <div class="paragraph"><p>History traversing commands such as <code>git log</code> operate on a set |
Junio C Hamano | 872c568 | 2006-07-07 06:05:40 | [diff] [blame] | 1493 | of commits, not just a single commit. To these commands, |
| 1494 | specifying a single revision with the notation described in the |
| 1495 | previous section means the set of commits reachable from that |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1496 | commit, following the commit ancestry chain.</p></div> |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1497 | <div class="paragraph"><p>To exclude commits reachable from a commit, a prefix <em>^</em> |
| 1498 | notation is used. E.g. <em>^r1 r2</em> means commits reachable |
| 1499 | from <em>r2</em> but exclude the ones reachable from <em>r1</em>.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1500 | <div class="paragraph"><p>This set operation appears so often that there is a shorthand |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1501 | for it. When you have two commits <em>r1</em> and <em>r2</em> (named according |
Junio C Hamano | d32738e | 2008-07-09 19:53:42 | [diff] [blame] | 1502 | to the syntax explained in SPECIFYING REVISIONS above), you can ask |
| 1503 | for commits that are reachable from r2 excluding those that are reachable |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1504 | from r1 by <em>^r1 r2</em> and it can be written as <em>r1..r2</em>.</p></div> |
| 1505 | <div class="paragraph"><p>A similar notation <em>r1...r2</em> is called symmetric difference |
| 1506 | of <em>r1</em> and <em>r2</em> and is defined as |
| 1507 | <em>r1 r2 --not $(git merge-base --all r1 r2)</em>. |
Junio C Hamano | ea5dae6 | 2007-05-10 23:25:08 | [diff] [blame] | 1508 | It is the set of commits that are reachable from either one of |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1509 | <em>r1</em> or <em>r2</em> but not from both.</p></div> |
Junio C Hamano | eccdd4a | 2012-09-10 23:28:17 | [diff] [blame] | 1510 | <div class="paragraph"><p>In these two shorthands, you can omit one end and let it default to HEAD. |
| 1511 | For example, <em>origin..</em> is a shorthand for <em>origin..HEAD</em> and asks "What |
| 1512 | did I do since I forked from the origin branch?" Similarly, <em>..origin</em> |
| 1513 | is a shorthand for <em>HEAD..origin</em> and asks "What did the origin do since |
| 1514 | I forked from them?" Note that <em>..</em> would mean <em>HEAD..HEAD</em> which is an |
| 1515 | empty range that is both reachable and unreachable from HEAD.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1516 | <div class="paragraph"><p>Two other shorthands for naming a set that is formed by a commit |
Junio C Hamano | ee3adc3 | 2011-04-06 19:53:38 | [diff] [blame] | 1517 | and its parent commits exist. The <em>r1^@</em> notation means all |
| 1518 | parents of <em>r1</em>. <em>r1^!</em> includes commit <em>r1</em> but excludes |
Junio C Hamano | 1504827 | 2008-07-07 22:10:48 | [diff] [blame] | 1519 | all of its parents.</p></div> |
Junio C Hamano | f593372 | 2012-07-25 23:25:21 | [diff] [blame] | 1520 | <div class="paragraph"><p>To summarize:</p></div> |
| 1521 | <div class="dlist"><dl> |
| 1522 | <dt class="hdlist1"> |
| 1523 | <em><rev></em> |
| 1524 | </dt> |
| 1525 | <dd> |
| 1526 | <p> |
| 1527 | Include commits that are reachable from (i.e. ancestors of) |
| 1528 | <rev>. |
| 1529 | </p> |
| 1530 | </dd> |
| 1531 | <dt class="hdlist1"> |
| 1532 | <em>^<rev></em> |
| 1533 | </dt> |
| 1534 | <dd> |
| 1535 | <p> |
| 1536 | Exclude commits that are reachable from (i.e. ancestors of) |
| 1537 | <rev>. |
| 1538 | </p> |
| 1539 | </dd> |
| 1540 | <dt class="hdlist1"> |
| 1541 | <em><rev1>..<rev2></em> |
| 1542 | </dt> |
| 1543 | <dd> |
| 1544 | <p> |
| 1545 | Include commits that are reachable from <rev2> but exclude |
Junio C Hamano | f26c77e | 2013-04-27 00:06:04 | [diff] [blame] | 1546 | those that are reachable from <rev1>. When either <rev1> or |
| 1547 | <rev2> is omitted, it defaults to <em>HEAD</em>. |
Junio C Hamano | f593372 | 2012-07-25 23:25:21 | [diff] [blame] | 1548 | </p> |
| 1549 | </dd> |
| 1550 | <dt class="hdlist1"> |
| 1551 | <em><rev1>...<rev2></em> |
| 1552 | </dt> |
| 1553 | <dd> |
| 1554 | <p> |
| 1555 | Include commits that are reachable from either <rev1> or |
Junio C Hamano | f26c77e | 2013-04-27 00:06:04 | [diff] [blame] | 1556 | <rev2> but exclude those that are reachable from both. When |
| 1557 | either <rev1> or <rev2> is omitted, it defaults to <em>HEAD</em>. |
Junio C Hamano | f593372 | 2012-07-25 23:25:21 | [diff] [blame] | 1558 | </p> |
| 1559 | </dd> |
| 1560 | <dt class="hdlist1"> |
| 1561 | <em><rev>^@</em>, e.g. <em>HEAD^@</em> |
| 1562 | </dt> |
| 1563 | <dd> |
| 1564 | <p> |
| 1565 | A suffix <em>^</em> followed by an at sign is the same as listing |
| 1566 | all parents of <em><rev></em> (meaning, include anything reachable from |
| 1567 | its parents, but not the commit itself). |
| 1568 | </p> |
| 1569 | </dd> |
| 1570 | <dt class="hdlist1"> |
| 1571 | <em><rev>^!</em>, e.g. <em>HEAD^!</em> |
| 1572 | </dt> |
| 1573 | <dd> |
| 1574 | <p> |
| 1575 | A suffix <em>^</em> followed by an exclamation mark is the same |
| 1576 | as giving commit <em><rev></em> and then all its parents prefixed with |
| 1577 | <em>^</em> to exclude them (and their ancestors). |
| 1578 | </p> |
| 1579 | </dd> |
| 1580 | </dl></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1581 | <div class="paragraph"><p>Here are a handful of examples:</p></div> |
Junio C Hamano | 872c568 | 2006-07-07 06:05:40 | [diff] [blame] | 1582 | <div class="literalblock"> |
| 1583 | <div class="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1584 | <pre><code>D G H D |
Junio C Hamano | 3aa8182 | 2007-03-30 08:52:26 | [diff] [blame] | 1585 | D F G H I J D F |
| 1586 | ^G D H D |
| 1587 | ^D B E I J F B |
Junio C Hamano | f593372 | 2012-07-25 23:25:21 | [diff] [blame] | 1588 | B..C C |
Junio C Hamano | 3aa8182 | 2007-03-30 08:52:26 | [diff] [blame] | 1589 | B...C G H D E B C |
| 1590 | ^D B C E I J F B C |
Junio C Hamano | f593372 | 2012-07-25 23:25:21 | [diff] [blame] | 1591 | C I J F C |
Junio C Hamano | 3aa8182 | 2007-03-30 08:52:26 | [diff] [blame] | 1592 | C^@ I J F |
Junio C Hamano | f593372 | 2012-07-25 23:25:21 | [diff] [blame] | 1593 | C^! C |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1594 | F^! D G H D F</code></pre> |
Junio C Hamano | 872c568 | 2006-07-07 06:05:40 | [diff] [blame] | 1595 | </div></div> |
| 1596 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1597 | </div> |
| 1598 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1599 | <h2 id="_parseopt">PARSEOPT</h2> |
Junio C Hamano | e125866 | 2007-11-19 05:03:19 | [diff] [blame] | 1600 | <div class="sectionbody"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1601 | <div class="paragraph"><p>In <code>--parseopt</code> mode, <em>git rev-parse</em> helps massaging options to bring to shell |
Junio C Hamano | e125866 | 2007-11-19 05:03:19 | [diff] [blame] | 1602 | scripts the same facilities C builtins have. It works as an option normalizer |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1603 | (e.g. splits single switches aggregate values), a bit like <code>getopt(1)</code> does.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1604 | <div class="paragraph"><p>It takes on the standard input the specification of the options to parse and |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1605 | understand, and echoes on the standard output a string suitable for <code>sh(1)</code> <code>eval</code> |
Junio C Hamano | e125866 | 2007-11-19 05:03:19 | [diff] [blame] | 1606 | to replace the arguments with normalized ones. In case of error, it outputs |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1607 | usage on the standard error stream, and exits with code 129.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1608 | <div class="paragraph"><p>Note: Make sure you quote the result when passing it to <code>eval</code>. See |
Junio C Hamano | a978876 | 2010-08-03 15:15:54 | [diff] [blame] | 1609 | below for an example.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1610 | <div class="sect2"> |
| 1611 | <h3 id="_input_format">Input Format</h3> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1612 | <div class="paragraph"><p><em>git rev-parse --parseopt</em> input format is fully text based. It has two parts, |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1613 | separated by a line that contains only <code>--</code>. The lines before the separator |
Junio C Hamano | e125866 | 2007-11-19 05:03:19 | [diff] [blame] | 1614 | (should be more than one) are used for the usage. |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1615 | The lines after the separator describe the options.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1616 | <div class="paragraph"><p>Each line of options has this format:</p></div> |
Junio C Hamano | e125866 | 2007-11-19 05:03:19 | [diff] [blame] | 1617 | <div class="listingblock"> |
| 1618 | <div class="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1619 | <pre><code><opt_spec><flags>* SP+ help LF</code></pre> |
Junio C Hamano | e125866 | 2007-11-19 05:03:19 | [diff] [blame] | 1620 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1621 | <div class="dlist"><dl> |
| 1622 | <dt class="hdlist1"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1623 | <code><opt_spec></code> |
Junio C Hamano | e125866 | 2007-11-19 05:03:19 | [diff] [blame] | 1624 | </dt> |
| 1625 | <dd> |
| 1626 | <p> |
| 1627 | its format is the short option character, then the long option name |
| 1628 | separated by a comma. Both parts are not required, though at least one |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1629 | is necessary. <code>h,help</code>, <code>dry-run</code> and <code>f</code> are all three correct |
| 1630 | <code><opt_spec></code>. |
Junio C Hamano | e125866 | 2007-11-19 05:03:19 | [diff] [blame] | 1631 | </p> |
| 1632 | </dd> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1633 | <dt class="hdlist1"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1634 | <code><flags></code> |
Junio C Hamano | e125866 | 2007-11-19 05:03:19 | [diff] [blame] | 1635 | </dt> |
| 1636 | <dd> |
| 1637 | <p> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1638 | <code><flags></code> are of <code>*</code>, <code>=</code>, <code>?</code> or <code>!</code>. |
Junio C Hamano | e125866 | 2007-11-19 05:03:19 | [diff] [blame] | 1639 | </p> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1640 | <div class="ulist"><ul> |
Junio C Hamano | bb34317 | 2008-03-09 10:39:09 | [diff] [blame] | 1641 | <li> |
| 1642 | <p> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1643 | Use <code>=</code> if the option takes an argument. |
Junio C Hamano | bb34317 | 2008-03-09 10:39:09 | [diff] [blame] | 1644 | </p> |
| 1645 | </li> |
| 1646 | <li> |
| 1647 | <p> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1648 | Use <code>?</code> to mean that the option is optional (though its use is discouraged). |
Junio C Hamano | bb34317 | 2008-03-09 10:39:09 | [diff] [blame] | 1649 | </p> |
| 1650 | </li> |
| 1651 | <li> |
| 1652 | <p> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1653 | Use <code>*</code> to mean that this option should not be listed in the usage |
| 1654 | generated for the <code>-h</code> argument. It’s shown for <code>--help-all</code> as |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1655 | documented in <a href="gitcli.html">gitcli(7)</a>. |
Junio C Hamano | bb34317 | 2008-03-09 10:39:09 | [diff] [blame] | 1656 | </p> |
| 1657 | </li> |
| 1658 | <li> |
| 1659 | <p> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1660 | Use <code>!</code> to not make the corresponding negated long option available. |
Junio C Hamano | bb34317 | 2008-03-09 10:39:09 | [diff] [blame] | 1661 | </p> |
| 1662 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1663 | </ul></div> |
Junio C Hamano | e125866 | 2007-11-19 05:03:19 | [diff] [blame] | 1664 | </dd> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1665 | </dl></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1666 | <div class="paragraph"><p>The remainder of the line, after stripping the spaces, is used |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1667 | as the help associated to the option.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1668 | <div class="paragraph"><p>Blank lines are ignored, and lines that don’t match this specification are used |
Junio C Hamano | e125866 | 2007-11-19 05:03:19 | [diff] [blame] | 1669 | as option group headers (start the line with a space to create such |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1670 | lines on purpose).</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1671 | </div> |
| 1672 | <div class="sect2"> |
| 1673 | <h3 id="_example">Example</h3> |
Junio C Hamano | e125866 | 2007-11-19 05:03:19 | [diff] [blame] | 1674 | <div class="listingblock"> |
| 1675 | <div class="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1676 | <pre><code>OPTS_SPEC="\ |
Junio C Hamano | e125866 | 2007-11-19 05:03:19 | [diff] [blame] | 1677 | some-command [options] <args>... |
| 1678 | |
| 1679 | some-command does foo and bar! |
| 1680 | -- |
| 1681 | h,help show the help |
| 1682 | |
| 1683 | foo some nifty option --foo |
| 1684 | bar= some cool option --bar with an argument |
| 1685 | |
| 1686 | An option group Header |
| 1687 | C? option C with an optional argument" |
| 1688 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1689 | eval "$(echo "$OPTS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)"</code></pre> |
Junio C Hamano | e125866 | 2007-11-19 05:03:19 | [diff] [blame] | 1690 | </div></div> |
| 1691 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1692 | </div> |
| 1693 | </div> |
| 1694 | <div class="sect1"> |
Junio C Hamano | 7ae1825 | 2009-05-23 09:53:32 | [diff] [blame] | 1695 | <h2 id="_sq_quote">SQ-QUOTE</h2> |
| 1696 | <div class="sectionbody"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1697 | <div class="paragraph"><p>In <code>--sq-quote</code> mode, <em>git rev-parse</em> echoes on the standard output a |
| 1698 | single line suitable for <code>sh(1)</code> <code>eval</code>. This line is made by |
| 1699 | normalizing the arguments following <code>--sq-quote</code>. Nothing other than |
Junio C Hamano | 7ae1825 | 2009-05-23 09:53:32 | [diff] [blame] | 1700 | quoting the arguments is done.</p></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1701 | <div class="paragraph"><p>If you want command input to still be interpreted as usual by |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1702 | <em>git rev-parse</em> before the output is shell quoted, see the <code>--sq</code> |
Junio C Hamano | 7ae1825 | 2009-05-23 09:53:32 | [diff] [blame] | 1703 | option.</p></div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1704 | <div class="sect2"> |
| 1705 | <h3 id="_example_2">Example</h3> |
Junio C Hamano | 7ae1825 | 2009-05-23 09:53:32 | [diff] [blame] | 1706 | <div class="listingblock"> |
| 1707 | <div class="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1708 | <pre><code>$ cat >your-git-script.sh <<\EOF |
Junio C Hamano | 7ae1825 | 2009-05-23 09:53:32 | [diff] [blame] | 1709 | #!/bin/sh |
| 1710 | args=$(git rev-parse --sq-quote "$@") # quote user-supplied arguments |
| 1711 | command="git frotz -n24 $args" # and use it inside a handcrafted |
| 1712 | # command line |
| 1713 | eval "$command" |
| 1714 | EOF |
| 1715 | |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1716 | $ sh your-git-script.sh "a b'c"</code></pre> |
Junio C Hamano | 7ae1825 | 2009-05-23 09:53:32 | [diff] [blame] | 1717 | </div></div> |
| 1718 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1719 | </div> |
| 1720 | </div> |
| 1721 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1722 | <h2 id="_examples">EXAMPLES</h2> |
Junio C Hamano | feeb1be | 2008-05-22 00:53:35 | [diff] [blame] | 1723 | <div class="sectionbody"> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1724 | <div class="ulist"><ul> |
Junio C Hamano | feeb1be | 2008-05-22 00:53:35 | [diff] [blame] | 1725 | <li> |
| 1726 | <p> |
| 1727 | Print the object name of the current commit: |
| 1728 | </p> |
| 1729 | <div class="listingblock"> |
| 1730 | <div class="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1731 | <pre><code>$ git rev-parse --verify HEAD</code></pre> |
Junio C Hamano | feeb1be | 2008-05-22 00:53:35 | [diff] [blame] | 1732 | </div></div> |
| 1733 | </li> |
| 1734 | <li> |
| 1735 | <p> |
| 1736 | Print the commit object name from the revision in the $REV shell variable: |
| 1737 | </p> |
| 1738 | <div class="listingblock"> |
| 1739 | <div class="content"> |
Junio C Hamano | edf80bd | 2013-04-05 22:14:36 | [diff] [blame] | 1740 | <pre><code>$ git rev-parse --verify $REV^{commit}</code></pre> |
Junio C Hamano | feeb1be | 2008-05-22 00:53:35 | [diff] [blame] | 1741 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1742 | <div class="paragraph"><p>This will error out if $REV is empty or not a valid revision.</p></div> |
Junio C Hamano | feeb1be | 2008-05-22 00:53:35 | [diff] [blame] | 1743 | </li> |
| 1744 | <li> |
| 1745 | <p> |
Junio C Hamano | edf80bd | 2013-04-05 22:14:36 | [diff] [blame] | 1746 | Similar to above: |
Junio C Hamano | feeb1be | 2008-05-22 00:53:35 | [diff] [blame] | 1747 | </p> |
| 1748 | <div class="listingblock"> |
| 1749 | <div class="content"> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1750 | <pre><code>$ git rev-parse --default master --verify $REV</code></pre> |
Junio C Hamano | feeb1be | 2008-05-22 00:53:35 | [diff] [blame] | 1751 | </div></div> |
Junio C Hamano | 68cf15a | 2010-11-06 01:01:59 | [diff] [blame] | 1752 | <div class="paragraph"><p>but if $REV is empty, the commit object name from master will be printed.</p></div> |
Junio C Hamano | feeb1be | 2008-05-22 00:53:35 | [diff] [blame] | 1753 | </li> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1754 | </ul></div> |
Junio C Hamano | feeb1be | 2008-05-22 00:53:35 | [diff] [blame] | 1755 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1756 | </div> |
| 1757 | <div class="sect1"> |
Junio C Hamano | ba4b928 | 2008-07-06 05:20:31 | [diff] [blame] | 1758 | <h2 id="_git">GIT</h2> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1759 | <div class="sectionbody"> |
Junio C Hamano | a28a920 | 2012-06-21 07:08:23 | [diff] [blame] | 1760 | <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] | 1761 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 1762 | </div> |
Junio C Hamano | 9d97115 | 2012-12-19 00:43:11 | [diff] [blame] | 1763 | </div> |
Junio C Hamano | 7bd050f | 2011-09-22 06:32:22 | [diff] [blame] | 1764 | <div id="footnotes"><hr /></div> |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1765 | <div id="footer"> |
| 1766 | <div id="footer-text"> |
Junio C Hamano | 0241d05 | 2013-08-30 23:52:17 | [diff] [blame] | 1767 | Last updated 2013-08-30 16:51:59 PDT |
Junio C Hamano | 1a4e841 | 2005-12-27 08:17:23 | [diff] [blame] | 1768 | </div> |
| 1769 | </div> |
| 1770 | </body> |
| 1771 | </html> |