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