blob: 8541777e1b85df95abae3a28c4495609cc6498f5 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231<!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 Hamano9d971152012-12-19 00:43:115<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
6<meta name="generator" content="AsciiDoc 8.6.8" />
Junio C Hamano68cf15a2010-11-06 01:01:597<title>git-rev-parse(1)</title>
Junio C Hamano1a4e8412005-12-27 08:17:238<style type="text/css">
Junio C Hamano9d971152012-12-19 00:43:119/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
10
11/* Default font. */
12body {
13 font-family: Georgia,serif;
14}
15
16/* Title font. */
17h1, h2, h3, h4, h5, h6,
18div.title, caption.title,
19thead, p.table.header,
20#toctitle,
21#author, #revnumber, #revdate, #revremark,
22#footer {
23 font-family: Arial,Helvetica,sans-serif;
Junio C Hamano1a4e8412005-12-27 08:17:2324}
25
26body {
27 margin: 1em 5% 1em 5%;
28}
29
Junio C Hamanoba4b9282008-07-06 05:20:3130a {
31 color: blue;
32 text-decoration: underline;
33}
34a:visited {
35 color: fuchsia;
36}
Junio C Hamano1a4e8412005-12-27 08:17:2337
38em {
39 font-style: italic;
Junio C Hamano68cf15a2010-11-06 01:01:5940 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2341}
42
43strong {
44 font-weight: bold;
Junio C Hamano68cf15a2010-11-06 01:01:5945 color: #083194;
Junio C Hamano1a4e8412005-12-27 08:17:2346}
47
Junio C Hamano1a4e8412005-12-27 08:17:2348h1, h2, h3, h4, h5, h6 {
49 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:2350 margin-top: 1.2em;
51 margin-bottom: 0.5em;
52 line-height: 1.3;
53}
54
Junio C Hamanoba4b9282008-07-06 05:20:3155h1, h2, h3 {
Junio C Hamano1a4e8412005-12-27 08:17:2356 border-bottom: 2px solid silver;
57}
58h2 {
Junio C Hamano1a4e8412005-12-27 08:17:2359 padding-top: 0.5em;
60}
Junio C Hamanoba4b9282008-07-06 05:20:3161h3 {
62 float: left;
63}
64h3 + * {
65 clear: left;
66}
Junio C Hamano9d971152012-12-19 00:43:1167h5 {
68 font-size: 1.0em;
69}
Junio C Hamano1a4e8412005-12-27 08:17:2370
71div.sectionbody {
Junio C Hamano1a4e8412005-12-27 08:17:2372 margin-left: 0;
73}
74
75hr {
76 border: 1px solid silver;
77}
78
79p {
80 margin-top: 0.5em;
81 margin-bottom: 0.5em;
82}
83
Junio C Hamano68cf15a2010-11-06 01:01:5984ul, ol, li > p {
85 margin-top: 0;
86}
Junio C Hamano9d971152012-12-19 00:43:1187ul > li { color: #aaa; }
88ul > li > * { color: black; }
Junio C Hamano68cf15a2010-11-06 01:01:5989
Junio C Hamano9d971152012-12-19 00:43:1190.monospaced, code, pre {
91 font-family: "Courier New", Courier, monospace;
92 font-size: inherit;
93 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:2394 padding: 0;
95 margin: 0;
96}
97
Junio C Hamano9d971152012-12-19 00:43:1198
99#author {
Junio C Hamano1a4e8412005-12-27 08:17:23100 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23101 font-weight: bold;
Junio C Hamanoba4b9282008-07-06 05:20:31102 font-size: 1.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23103}
Junio C Hamano9d971152012-12-19 00:43:11104#email {
Junio C Hamano1a4e8412005-12-27 08:17:23105}
Junio C Hamano9d971152012-12-19 00:43:11106#revnumber, #revdate, #revremark {
Junio C Hamano1a4e8412005-12-27 08:17:23107}
108
Junio C Hamano9d971152012-12-19 00:43:11109#footer {
Junio C Hamano1a4e8412005-12-27 08:17:23110 font-size: small;
111 border-top: 2px solid silver;
112 padding-top: 0.5em;
113 margin-top: 4.0em;
114}
Junio C Hamano9d971152012-12-19 00:43:11115#footer-text {
Junio C Hamano1a4e8412005-12-27 08:17:23116 float: left;
117 padding-bottom: 0.5em;
118}
Junio C Hamano9d971152012-12-19 00:43:11119#footer-badges {
Junio C Hamano1a4e8412005-12-27 08:17:23120 float: right;
121 padding-bottom: 0.5em;
122}
123
Junio C Hamano9d971152012-12-19 00:43:11124#preamble {
Junio C Hamano68cf15a2010-11-06 01:01:59125 margin-top: 1.5em;
126 margin-bottom: 1.5em;
127}
Junio C Hamano9d971152012-12-19 00:43:11128div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamano1a4e8412005-12-27 08:17:23129div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
130div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22131 margin-top: 1.0em;
Junio C Hamano1a4e8412005-12-27 08:17:23132 margin-bottom: 1.5em;
133}
134div.admonitionblock {
Junio C Hamano7bd050f2011-09-22 06:32:22135 margin-top: 2.0em;
136 margin-bottom: 2.0em;
137 margin-right: 10%;
138 color: #606060;
Junio C Hamano1a4e8412005-12-27 08:17:23139}
140
141div.content { /* Block element content. */
142 padding: 0;
143}
144
145/* Block element titles. */
146div.title, caption.title {
Junio C Hamano68cf15a2010-11-06 01:01:59147 color: #527bbd;
Junio C Hamano1a4e8412005-12-27 08:17:23148 font-weight: bold;
149 text-align: left;
150 margin-top: 1.0em;
151 margin-bottom: 0.5em;
152}
153div.title + * {
154 margin-top: 0;
155}
156
157td div.title:first-child {
158 margin-top: 0.0em;
159}
160div.content div.title:first-child {
161 margin-top: 0.0em;
162}
163div.content + div.title {
164 margin-top: 0.0em;
165}
166
167div.sidebarblock > div.content {
168 background: #ffffee;
Junio C Hamano9d971152012-12-19 00:43:11169 border: 1px solid #dddddd;
170 border-left: 4px solid #f0f0f0;
Junio C Hamano1a4e8412005-12-27 08:17:23171 padding: 0.5em;
172}
173
174div.listingblock > div.content {
Junio C Hamano9d971152012-12-19 00:43:11175 border: 1px solid #dddddd;
176 border-left: 5px solid #f0f0f0;
177 background: #f8f8f8;
Junio C Hamano1a4e8412005-12-27 08:17:23178 padding: 0.5em;
179}
180
Junio C Hamano7bd050f2011-09-22 06:32:22181div.quoteblock, div.verseblock {
182 padding-left: 1.0em;
183 margin-left: 1.0em;
Junio C Hamano68cf15a2010-11-06 01:01:59184 margin-right: 10%;
Junio C Hamano9d971152012-12-19 00:43:11185 border-left: 5px solid #f0f0f0;
186 color: #888;
Junio C Hamano1a4e8412005-12-27 08:17:23187}
Junio C Hamano7bd050f2011-09-22 06:32:22188
Junio C Hamano68cf15a2010-11-06 01:01:59189div.quoteblock > div.attribution {
190 padding-top: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23191 text-align: right;
192}
Junio C Hamano68cf15a2010-11-06 01:01:59193
Junio C Hamano9d971152012-12-19 00:43:11194div.verseblock > pre.content {
195 font-family: inherit;
196 font-size: inherit;
Junio C Hamano68cf15a2010-11-06 01:01:59197}
198div.verseblock > div.attribution {
199 padding-top: 0.75em;
200 text-align: left;
201}
202/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
Junio C Hamanoba4b9282008-07-06 05:20:31203div.verseblock + div.attribution {
204 text-align: left;
205}
Junio C Hamano1a4e8412005-12-27 08:17:23206
207div.admonitionblock .icon {
208 vertical-align: top;
209 font-size: 1.1em;
210 font-weight: bold;
211 text-decoration: underline;
212 color: #527bbd;
213 padding-right: 0.5em;
214}
215div.admonitionblock td.content {
216 padding-left: 0.5em;
Junio C Hamano7bd050f2011-09-22 06:32:22217 border-left: 3px solid #dddddd;
Junio C Hamano1a4e8412005-12-27 08:17:23218}
219
220div.exampleblock > div.content {
Junio C Hamano7bd050f2011-09-22 06:32:22221 border-left: 3px solid #dddddd;
222 padding-left: 0.5em;
Junio C Hamano1a4e8412005-12-27 08:17:23223}
224
Junio C Hamano1a4e8412005-12-27 08:17:23225div.imageblock div.content { padding-left: 0; }
Junio C Hamano1a4e8412005-12-27 08:17:23226span.image img { border-style: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59227a.image:visited { color: white; }
Junio C Hamano1a4e8412005-12-27 08:17:23228
229dl {
230 margin-top: 0.8em;
231 margin-bottom: 0.8em;
232}
233dt {
234 margin-top: 0.5em;
235 margin-bottom: 0;
Junio C Hamano68cf15a2010-11-06 01:01:59236 font-style: normal;
237 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23238}
239dd > *:first-child {
Junio C Hamano68cf15a2010-11-06 01:01:59240 margin-top: 0.1em;
Junio C Hamano1a4e8412005-12-27 08:17:23241}
242
243ul, ol {
244 list-style-position: outside;
245}
Junio C Hamano68cf15a2010-11-06 01:01:59246ol.arabic {
247 list-style-type: decimal;
248}
249ol.loweralpha {
Junio C Hamano1a4e8412005-12-27 08:17:23250 list-style-type: lower-alpha;
251}
Junio C Hamano68cf15a2010-11-06 01:01:59252ol.upperalpha {
253 list-style-type: upper-alpha;
254}
255ol.lowerroman {
256 list-style-type: lower-roman;
257}
258ol.upperroman {
259 list-style-type: upper-roman;
260}
261
262div.compact ul, div.compact ol,
263div.compact p, div.compact p,
264div.compact div, div.compact div {
265 margin-top: 0.1em;
266 margin-bottom: 0.1em;
267}
Junio C Hamano1a4e8412005-12-27 08:17:23268
Junio C Hamano1a4e8412005-12-27 08:17:23269tfoot {
270 font-weight: bold;
271}
Junio C Hamano68cf15a2010-11-06 01:01:59272td > div.verse {
273 white-space: pre;
274}
Junio C Hamano68cf15a2010-11-06 01:01:59275
276div.hdlist {
Junio C Hamano1a4e8412005-12-27 08:17:23277 margin-top: 0.8em;
278 margin-bottom: 0.8em;
279}
Junio C Hamano68cf15a2010-11-06 01:01:59280div.hdlist tr {
281 padding-bottom: 15px;
Junio C Hamanoba4b9282008-07-06 05:20:31282}
Junio C Hamano68cf15a2010-11-06 01:01:59283dt.hdlist1.strong, td.hdlist1.strong {
284 font-weight: bold;
285}
286td.hdlist1 {
Junio C Hamano1a4e8412005-12-27 08:17:23287 vertical-align: top;
Junio C Hamano68cf15a2010-11-06 01:01:59288 font-style: normal;
Junio C Hamano1a4e8412005-12-27 08:17:23289 padding-right: 0.8em;
Junio C Hamano68cf15a2010-11-06 01:01:59290 color: navy;
Junio C Hamano1a4e8412005-12-27 08:17:23291}
Junio C Hamano68cf15a2010-11-06 01:01:59292td.hdlist2 {
Junio C Hamano1a4e8412005-12-27 08:17:23293 vertical-align: top;
294}
Junio C Hamano68cf15a2010-11-06 01:01:59295div.hdlist.compact tr {
296 margin: 0;
297 padding-bottom: 0;
298}
299
300.comment {
301 background: yellow;
302}
Junio C Hamano1a4e8412005-12-27 08:17:23303
Junio C Hamano7bd050f2011-09-22 06:32:22304.footnote, .footnoteref {
305 font-size: 0.8em;
306}
307
308span.footnote, span.footnoteref {
309 vertical-align: super;
310}
311
312#footnotes {
313 margin: 20px 0 20px 0;
314 padding: 7px 0 0 0;
315}
316
317#footnotes div.footnote {
318 margin: 0 0 5px 0;
319}
320
321#footnotes hr {
322 border: none;
323 border-top: 1px solid silver;
324 height: 1px;
325 text-align: left;
326 margin-left: 0;
327 width: 20%;
328 min-width: 100px;
329}
330
Junio C Hamano9d971152012-12-19 00:43:11331div.colist td {
332 padding-right: 0.5em;
333 padding-bottom: 0.3em;
334 vertical-align: top;
335}
336div.colist td img {
337 margin-top: 0.3em;
Junio C Hamano1a4e8412005-12-27 08:17:23338}
Junio C Hamanoba4b9282008-07-06 05:20:31339
Junio C Hamano9d971152012-12-19 00:43:11340@media print {
341 #footer-badges { display: none; }
342}
343
344#toc {
Junio C Hamano7bd050f2011-09-22 06:32:22345 margin-bottom: 2.5em;
346}
347
Junio C Hamano9d971152012-12-19 00:43:11348#toctitle {
Junio C Hamanoba4b9282008-07-06 05:20:31349 color: #527bbd;
Junio C Hamanoba4b9282008-07-06 05:20:31350 font-size: 1.1em;
351 font-weight: bold;
352 margin-top: 1.0em;
353 margin-bottom: 0.1em;
354}
355
Junio C Hamano9d971152012-12-19 00:43:11356div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanoba4b9282008-07-06 05:20:31357 margin-top: 0;
358 margin-bottom: 0;
359}
360div.toclevel2 {
361 margin-left: 2em;
362 font-size: 0.9em;
363}
364div.toclevel3 {
365 margin-left: 4em;
366 font-size: 0.9em;
367}
368div.toclevel4 {
369 margin-left: 6em;
370 font-size: 0.9em;
371}
Junio C Hamano9d971152012-12-19 00:43:11372
373span.aqua { color: aqua; }
374span.black { color: black; }
375span.blue { color: blue; }
376span.fuchsia { color: fuchsia; }
377span.gray { color: gray; }
378span.green { color: green; }
379span.lime { color: lime; }
380span.maroon { color: maroon; }
381span.navy { color: navy; }
382span.olive { color: olive; }
383span.purple { color: purple; }
384span.red { color: red; }
385span.silver { color: silver; }
386span.teal { color: teal; }
387span.white { color: white; }
388span.yellow { color: yellow; }
389
390span.aqua-background { background: aqua; }
391span.black-background { background: black; }
392span.blue-background { background: blue; }
393span.fuchsia-background { background: fuchsia; }
394span.gray-background { background: gray; }
395span.green-background { background: green; }
396span.lime-background { background: lime; }
397span.maroon-background { background: maroon; }
398span.navy-background { background: navy; }
399span.olive-background { background: olive; }
400span.purple-background { background: purple; }
401span.red-background { background: red; }
402span.silver-background { background: silver; }
403span.teal-background { background: teal; }
404span.white-background { background: white; }
405span.yellow-background { background: yellow; }
406
407span.big { font-size: 2em; }
408span.small { font-size: 0.6em; }
409
410span.underline { text-decoration: underline; }
411span.overline { text-decoration: overline; }
412span.line-through { text-decoration: line-through; }
413
414div.unbreakable { page-break-inside: avoid; }
415
416
417/*
418 * xhtml11 specific
419 *
420 * */
421
422div.tableblock {
423 margin-top: 1.0em;
424 margin-bottom: 1.5em;
425}
426div.tableblock > table {
427 border: 3px solid #527bbd;
428}
429thead, p.table.header {
430 font-weight: bold;
431 color: #527bbd;
432}
433p.table {
434 margin-top: 0;
435}
436/* Because the table frame attribute is overriden by CSS in most browsers. */
437div.tableblock > table[frame="void"] {
438 border-style: none;
439}
440div.tableblock > table[frame="hsides"] {
441 border-left-style: none;
442 border-right-style: none;
443}
444div.tableblock > table[frame="vsides"] {
445 border-top-style: none;
446 border-bottom-style: none;
447}
448
449
450/*
451 * html5 specific
452 *
453 * */
454
455table.tableblock {
456 margin-top: 1.0em;
457 margin-bottom: 1.5em;
458}
459thead, p.tableblock.header {
460 font-weight: bold;
461 color: #527bbd;
462}
463p.tableblock {
464 margin-top: 0;
465}
466table.tableblock {
467 border-width: 3px;
468 border-spacing: 0px;
469 border-style: solid;
470 border-color: #527bbd;
471 border-collapse: collapse;
472}
473th.tableblock, td.tableblock {
474 border-width: 1px;
475 padding: 4px;
476 border-style: solid;
477 border-color: #527bbd;
478}
479
480table.tableblock.frame-topbot {
481 border-left-style: hidden;
482 border-right-style: hidden;
483}
484table.tableblock.frame-sides {
485 border-top-style: hidden;
486 border-bottom-style: hidden;
487}
488table.tableblock.frame-none {
489 border-style: hidden;
490}
491
492th.tableblock.halign-left, td.tableblock.halign-left {
493 text-align: left;
494}
495th.tableblock.halign-center, td.tableblock.halign-center {
496 text-align: center;
497}
498th.tableblock.halign-right, td.tableblock.halign-right {
499 text-align: right;
500}
501
502th.tableblock.valign-top, td.tableblock.valign-top {
503 vertical-align: top;
504}
505th.tableblock.valign-middle, td.tableblock.valign-middle {
506 vertical-align: middle;
507}
508th.tableblock.valign-bottom, td.tableblock.valign-bottom {
509 vertical-align: bottom;
510}
511
512
513/*
514 * manpage specific
515 *
516 * */
517
518body.manpage h1 {
Junio C Hamano68cf15a2010-11-06 01:01:59519 padding-top: 0.5em;
520 padding-bottom: 0.5em;
521 border-top: 2px solid silver;
522 border-bottom: 2px solid silver;
523}
Junio C Hamano9d971152012-12-19 00:43:11524body.manpage h2 {
Junio C Hamano68cf15a2010-11-06 01:01:59525 border-style: none;
526}
Junio C Hamano9d971152012-12-19 00:43:11527body.manpage div.sectionbody {
528 margin-left: 3em;
Junio C Hamano68cf15a2010-11-06 01:01:59529}
530
531@media print {
Junio C Hamano9d971152012-12-19 00:43:11532 body.manpage div#toc { display: none; }
Junio C Hamano68cf15a2010-11-06 01:01:59533}
534
Junio C Hamano1a4e8412005-12-27 08:17:23535
Junio C Hamano1a4e8412005-12-27 08:17:23536</style>
Junio C Hamano7bd050f2011-09-22 06:32:22537<script type="text/javascript">
538/*<![CDATA[*/
Junio C Hamano7bd050f2011-09-22 06:32:22539var asciidoc = { // Namespace.
540
541/////////////////////////////////////////////////////////////////////
542// Table Of Contents generator
543/////////////////////////////////////////////////////////////////////
544
545/* Author: Mihai Bazon, September 2002
546 * http://students.infoiasi.ro/~mishoo
547 *
548 * Table Of Content generator
549 * Version: 0.4
550 *
551 * Feel free to use this script under the terms of the GNU General Public
552 * License, as long as you do not remove or alter this notice.
553 */
554
555 /* modified by Troy D. Hanson, September 2006. License: GPL */
556 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
557
558// toclevels = 1..4.
559toc: function (toclevels) {
560
561 function getText(el) {
562 var text = "";
563 for (var i = el.firstChild; i != null; i = i.nextSibling) {
564 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
565 text += i.data;
566 else if (i.firstChild != null)
567 text += getText(i);
568 }
569 return text;
570 }
571
572 function TocEntry(el, text, toclevel) {
573 this.element = el;
574 this.text = text;
575 this.toclevel = toclevel;
576 }
577
578 function tocEntries(el, toclevels) {
579 var result = new Array;
Junio C Hamano9d971152012-12-19 00:43:11580 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
Junio C Hamano7bd050f2011-09-22 06:32:22581 // Function that scans the DOM tree for header elements (the DOM2
582 // nodeIterator API would be a better technique but not supported by all
583 // browsers).
584 var iterate = function (el) {
585 for (var i = el.firstChild; i != null; i = i.nextSibling) {
586 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
587 var mo = re.exec(i.tagName);
588 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
589 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
590 }
591 iterate(i);
592 }
593 }
594 }
595 iterate(el);
596 return result;
597 }
598
599 var toc = document.getElementById("toc");
Junio C Hamano9d971152012-12-19 00:43:11600 if (!toc) {
601 return;
602 }
603
604 // Delete existing TOC entries in case we're reloading the TOC.
605 var tocEntriesToRemove = [];
606 var i;
607 for (i = 0; i < toc.childNodes.length; i++) {
608 var entry = toc.childNodes[i];
609 if (entry.nodeName.toLowerCase() == 'div'
610 && entry.getAttribute("class")
611 && entry.getAttribute("class").match(/^toclevel/))
612 tocEntriesToRemove.push(entry);
613 }
614 for (i = 0; i < tocEntriesToRemove.length; i++) {
615 toc.removeChild(tocEntriesToRemove[i]);
616 }
617
618 // Rebuild TOC entries.
Junio C Hamano7bd050f2011-09-22 06:32:22619 var entries = tocEntries(document.getElementById("content"), toclevels);
620 for (var i = 0; i < entries.length; ++i) {
621 var entry = entries[i];
622 if (entry.element.id == "")
623 entry.element.id = "_toc_" + i;
624 var a = document.createElement("a");
625 a.href = "#" + entry.element.id;
626 a.appendChild(document.createTextNode(entry.text));
627 var div = document.createElement("div");
628 div.appendChild(a);
629 div.className = "toclevel" + entry.toclevel;
630 toc.appendChild(div);
631 }
632 if (entries.length == 0)
633 toc.parentNode.removeChild(toc);
634},
635
636
637/////////////////////////////////////////////////////////////////////
638// Footnotes generator
639/////////////////////////////////////////////////////////////////////
640
641/* Based on footnote generation code from:
642 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
643 */
644
645footnotes: function () {
Junio C Hamano9d971152012-12-19 00:43:11646 // Delete existing footnote entries in case we're reloading the footnodes.
647 var i;
Junio C Hamano7bd050f2011-09-22 06:32:22648 var noteholder = document.getElementById("footnotes");
Junio C Hamano9d971152012-12-19 00:43:11649 if (!noteholder) {
650 return;
651 }
652 var entriesToRemove = [];
653 for (i = 0; i < noteholder.childNodes.length; i++) {
654 var entry = noteholder.childNodes[i];
655 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
656 entriesToRemove.push(entry);
657 }
658 for (i = 0; i < entriesToRemove.length; i++) {
659 noteholder.removeChild(entriesToRemove[i]);
660 }
661
662 // Rebuild footnote entries.
663 var cont = document.getElementById("content");
Junio C Hamano7bd050f2011-09-22 06:32:22664 var spans = cont.getElementsByTagName("span");
665 var refs = {};
666 var n = 0;
667 for (i=0; i<spans.length; i++) {
668 if (spans[i].className == "footnote") {
669 n++;
Junio C Hamano9d971152012-12-19 00:43:11670 var note = spans[i].getAttribute("data-note");
671 if (!note) {
672 // Use [\s\S] in place of . so multi-line matches work.
673 // Because JavaScript has no s (dotall) regex flag.
674 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
675 spans[i].innerHTML =
676 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
677 "' title='View footnote' class='footnote'>" + n + "</a>]";
678 spans[i].setAttribute("data-note", note);
679 }
Junio C Hamano7bd050f2011-09-22 06:32:22680 noteholder.innerHTML +=
681 "<div class='footnote' id='_footnote_" + n + "'>" +
682 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
683 n + "</a>. " + note + "</div>";
Junio C Hamano7bd050f2011-09-22 06:32:22684 var id =spans[i].getAttribute("id");
685 if (id != null) refs["#"+id] = n;
686 }
687 }
688 if (n == 0)
689 noteholder.parentNode.removeChild(noteholder);
690 else {
691 // Process footnoterefs.
692 for (i=0; i<spans.length; i++) {
693 if (spans[i].className == "footnoteref") {
694 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
695 href = href.match(/#.*/)[0]; // Because IE return full URL.
696 n = refs[href];
697 spans[i].innerHTML =
698 "[<a href='#_footnote_" + n +
699 "' title='View footnote' class='footnote'>" + n + "</a>]";
700 }
701 }
702 }
Junio C Hamano9d971152012-12-19 00:43:11703},
704
705install: function(toclevels) {
706 var timerId;
707
708 function reinstall() {
709 asciidoc.footnotes();
710 if (toclevels) {
711 asciidoc.toc(toclevels);
712 }
713 }
714
715 function reinstallAndRemoveTimer() {
716 clearInterval(timerId);
717 reinstall();
718 }
719
720 timerId = setInterval(reinstall, 500);
721 if (document.addEventListener)
722 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
723 else
724 window.onload = reinstallAndRemoveTimer;
Junio C Hamano7bd050f2011-09-22 06:32:22725}
726
727}
Junio C Hamano9d971152012-12-19 00:43:11728asciidoc.install();
Junio C Hamano7bd050f2011-09-22 06:32:22729/*]]>*/
730</script>
Junio C Hamano1a4e8412005-12-27 08:17:23731</head>
Junio C Hamano9d971152012-12-19 00:43:11732<body class="manpage">
Junio C Hamano1a4e8412005-12-27 08:17:23733<div id="header">
734<h1>
735git-rev-parse(1) Manual Page
736</h1>
737<h2>NAME</h2>
738<div class="sectionbody">
739<p>git-rev-parse -
Junio C Hamano01078922006-03-10 00:31:47740 Pick out and massage parameters
Junio C Hamano1a4e8412005-12-27 08:17:23741</p>
742</div>
743</div>
Junio C Hamano7bd050f2011-09-22 06:32:22744<div id="content">
Junio C Hamano9d971152012-12-19 00:43:11745<div class="sect1">
Junio C Hamano68cf15a2010-11-06 01:01:59746<h2 id="_synopsis">SYNOPSIS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23747<div class="sectionbody">
Junio C Hamano15567bc2011-07-23 00:51:59748<div class="verseblock">
Junio C Hamano9d971152012-12-19 00:43:11749<pre class="content"><em>git rev-parse</em> [ --option ] &lt;args&gt;&#8230;</pre>
750<div class="attribution">
Junio C Hamano15567bc2011-07-23 00:51:59751</div></div>
Junio C Hamano1a4e8412005-12-27 08:17:23752</div>
Junio C Hamano9d971152012-12-19 00:43:11753</div>
754<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31755<h2 id="_description">DESCRIPTION</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23756<div class="sectionbody">
Junio C Hamano076ffcc2013-02-06 05:13:21757<div class="paragraph"><p>Many Git porcelainish commands take mixture of flags
Junio C Hamano1a4e8412005-12-27 08:17:23758(i.e. parameters that begin with a dash <em>-</em>) and parameters
Junio C Hamano1aa40d22010-01-21 17:46:43759meant for the underlying <em>git rev-list</em> command they use internally
Junio C Hamanofce7c7e2008-07-02 03:06:38760and flags and parameters for the other commands they use
Junio C Hamano1aa40d22010-01-21 17:46:43761downstream of <em>git rev-list</em>. This command is used to
Junio C Hamanoba4b9282008-07-06 05:20:31762distinguish between them.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23763</div>
Junio C Hamano9d971152012-12-19 00:43:11764</div>
765<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:31766<h2 id="_options">OPTIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:23767<div class="sectionbody">
Junio C Hamano0241d052013-08-30 23:52:17768<div class="sect2">
769<h3 id="_operation_modes">Operation Modes</h3>
770<div class="paragraph"><p>Each of these options must appear first on the command line.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:59771<div class="dlist"><dl>
772<dt class="hdlist1">
Junio C Hamanoe1258662007-11-19 05:03:19773--parseopt
774</dt>
775<dd>
776<p>
Junio C Hamano1aa40d22010-01-21 17:46:43777 Use <em>git rev-parse</em> in option parsing mode (see PARSEOPT section below).
Junio C Hamanoe1258662007-11-19 05:03:19778</p>
779</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59780<dt class="hdlist1">
Junio C Hamano0241d052013-08-30 23:52:17781--sq-quote
782</dt>
783<dd>
784<p>
785 Use <em>git rev-parse</em> in shell quoting mode (see SQ-QUOTE
786 section below). In contrast to the <code>--sq</code> option below, this
787 mode does only quoting. Nothing else is done to command input.
788</p>
789</dd>
790</dl></div>
791</div>
792<div class="sect2">
793<h3 id="_options_for_parseopt">Options for --parseopt</h3>
794<div class="dlist"><dl>
795<dt class="hdlist1">
Junio C Hamanoa9499de2009-04-30 03:38:48796--keep-dashdash
Junio C Hamanoe1258662007-11-19 05:03:19797</dt>
798<dd>
799<p>
Junio C Hamano9d971152012-12-19 00:43:11800 Only meaningful in <code>--parseopt</code> mode. Tells the option parser to echo
801 out the first <code>--</code> met instead of skipping it.
Junio C Hamanoe1258662007-11-19 05:03:19802</p>
803</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59804<dt class="hdlist1">
Junio C Hamanoccc4d372009-07-06 18:05:38805--stop-at-non-option
806</dt>
807<dd>
808<p>
Junio C Hamano9d971152012-12-19 00:43:11809 Only meaningful in <code>--parseopt</code> mode. Lets the option parser stop at
Junio C Hamanoccc4d372009-07-06 18:05:38810 the first non-option argument. This can be used to parse sub-commands
Junio C Hamano167b1382010-01-31 23:04:31811 that take options themselves.
Junio C Hamanoccc4d372009-07-06 18:05:38812</p>
813</dd>
Junio C Hamano0241d052013-08-30 23:52:17814</dl></div>
815</div>
816<div class="sect2">
817<h3 id="_options_for_filtering">Options for Filtering</h3>
818<div class="dlist"><dl>
Junio C Hamano68cf15a2010-11-06 01:01:59819<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23820--revs-only
821</dt>
822<dd>
823<p>
824 Do not output flags and parameters not meant for
Junio C Hamano1aa40d22010-01-21 17:46:43825 <em>git rev-list</em> command.
Junio C Hamano1a4e8412005-12-27 08:17:23826</p>
827</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59828<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23829--no-revs
830</dt>
831<dd>
832<p>
833 Do not output flags and parameters meant for
Junio C Hamano1aa40d22010-01-21 17:46:43834 <em>git rev-list</em> command.
Junio C Hamano1a4e8412005-12-27 08:17:23835</p>
836</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59837<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23838--flags
839</dt>
840<dd>
841<p>
842 Do not output non-flag parameters.
843</p>
844</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59845<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23846--no-flags
847</dt>
848<dd>
849<p>
850 Do not output flag parameters.
851</p>
852</dd>
Junio C Hamano0241d052013-08-30 23:52:17853</dl></div>
854</div>
855<div class="sect2">
856<h3 id="_options_for_output">Options for Output</h3>
857<div class="dlist"><dl>
Junio C Hamano68cf15a2010-11-06 01:01:59858<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23859--default &lt;arg&gt;
860</dt>
861<dd>
862<p>
Junio C Hamano9d971152012-12-19 00:43:11863 If there is no parameter given by the user, use <code>&lt;arg&gt;</code>
Junio C Hamano1a4e8412005-12-27 08:17:23864 instead.
865</p>
866</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59867<dt class="hdlist1">
Junio C Hamanoa1952302013-07-01 21:31:18868--prefix &lt;arg&gt;
869</dt>
870<dd>
871<p>
872 Behave as if <em>git rev-parse</em> was invoked from the <code>&lt;arg&gt;</code>
873 subdirectory of the working tree. Any relative filenames are
874 resolved as if they are prefixed by <code>&lt;arg&gt;</code> and will be printed
875 in that form.
876</p>
877<div class="paragraph"><p>This can be used to convert arguments to a command run in a subdirectory
878so that they can still be used after moving to the top-level of the
879repository. For example:</p></div>
880<div class="listingblock">
881<div class="content">
882<pre><code>prefix=$(git rev-parse --show-prefix)
883cd "$(git rev-parse --show-toplevel)"
884eval "set -- $(git rev-parse --sq --prefix "$prefix" "$@")"</code></pre>
885</div></div>
886</dd>
887<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23888--verify
889</dt>
890<dd>
891<p>
Junio C Hamanoedf80bd2013-04-05 22:14:36892 Verify that exactly one parameter is provided, and that it
893 can be turned into a raw 20-byte SHA-1 that can be used to
894 access the object database. If so, emit it to the standard
895 output; otherwise, error out.
Junio C Hamano1a4e8412005-12-27 08:17:23896</p>
Junio C Hamanoedf80bd2013-04-05 22:14:36897<div class="paragraph"><p>If you want to make sure that the output actually names an object in
898your object database and/or can be used as a specific type of object
899For example, <code>git rev-parse "$VAR^{commit}"</code> will make sure <code>$VAR</code>
900names an existing object that is a commit-ish (i.e. a commit, or an
901annotated tag that points at a commit). To make sure that <code>$VAR</code>
902names an existing object of any type, <code>git rev-parse "$VAR^{object}"</code>
903can be used.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:23904</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59905<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47906-q
907</dt>
Junio C Hamano68cf15a2010-11-06 01:01:59908<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:47909--quiet
Junio C Hamano9ab87672008-04-28 08:40:29910</dt>
911<dd>
912<p>
Junio C Hamano9d971152012-12-19 00:43:11913 Only meaningful in <code>--verify</code> mode. Do not output an error
Junio C Hamano9ab87672008-04-28 08:40:29914 message if the first argument is not a valid object name;
915 instead exit with non-zero status silently.
916</p>
917</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59918<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23919--sq
920</dt>
921<dd>
922<p>
923 Usually the output is made one line per flag and
924 parameter. This option makes output a single line,
925 properly quoted for consumption by shell. Useful when
926 you expect your parameter to contain whitespaces and
Junio C Hamano9d971152012-12-19 00:43:11927 newlines (e.g. when using pickaxe <code>-S</code> with
928 <em>git diff-&#42;</em>). In contrast to the <code>--sq-quote</code> option,
Junio C Hamano7ae18252009-05-23 09:53:32929 the command input is still interpreted as usual.
Junio C Hamano1a4e8412005-12-27 08:17:23930</p>
931</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59932<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23933--not
934</dt>
935<dd>
936<p>
Junio C Hamano6926bef2007-06-16 09:54:05937 When showing object names, prefix them with <em>&#94;</em> and
938 strip <em>&#94;</em> prefix from the object names that already have
Junio C Hamano1a4e8412005-12-27 08:17:23939 one.
940</p>
941</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59942<dt class="hdlist1">
Junio C Hamano0241d052013-08-30 23:52:17943--abbrev-ref[=(strict|loose)]
944</dt>
945<dd>
946<p>
947 A non-ambiguous short name of the objects name.
948 The option core.warnAmbiguousRefs is used to select the strict
949 abbreviation mode.
950</p>
951</dd>
952<dt class="hdlist1">
953--short
954</dt>
955<dt class="hdlist1">
956--short=number
957</dt>
958<dd>
959<p>
960 Instead of outputting the full SHA-1 values of object names try to
961 abbreviate them to a shorter unique name. When no length is specified
962 7 is used. The minimum length is 4.
963</p>
964</dd>
965<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23966--symbolic
967</dt>
968<dd>
969<p>
Junio C Hamanoe3f080d2013-04-22 02:27:13970 Usually the object names are output in SHA-1 form (with
Junio C Hamano6926bef2007-06-16 09:54:05971 possible <em>&#94;</em> prefix); this option makes them output in a
Junio C Hamano1a4e8412005-12-27 08:17:23972 form as close to the original input as possible.
973</p>
974</dd>
Junio C Hamano68cf15a2010-11-06 01:01:59975<dt class="hdlist1">
Junio C Hamano35738e82008-01-07 07:55:46976--symbolic-full-name
977</dt>
978<dd>
979<p>
980 This is similar to --symbolic, but it omits input that
981 are not refs (i.e. branch or tag names; or more
982 explicitly disambiguating "heads/master" form, when you
983 want to name the "master" branch when there is an
984 unfortunately named tag "master"), and show them as full
985 refnames (e.g. "refs/heads/master").
986</p>
987</dd>
Junio C Hamano0241d052013-08-30 23:52:17988</dl></div>
989</div>
990<div class="sect2">
991<h3 id="_options_for_objects">Options for Objects</h3>
992<div class="dlist"><dl>
Junio C Hamanobb300642012-07-22 21:09:14993<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:23994--all
995</dt>
996<dd>
997<p>
Junio C Hamano9d971152012-12-19 00:43:11998 Show all refs found in <code>refs/</code>.
Junio C Hamano1a4e8412005-12-27 08:17:23999</p>
1000</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591001<dt class="hdlist1">
Junio C Hamano57827fb2010-01-23 03:02:501002--branches[=pattern]
1003</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591004<dt class="hdlist1">
Junio C Hamano57827fb2010-01-23 03:02:501005--tags[=pattern]
1006</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591007<dt class="hdlist1">
Junio C Hamano57827fb2010-01-23 03:02:501008--remotes[=pattern]
Junio C Hamano6959c6c2006-05-17 10:34:111009</dt>
1010<dd>
1011<p>
Junio C Hamano57827fb2010-01-23 03:02:501012 Show all branches, tags, or remote-tracking branches,
Junio C Hamano9d971152012-12-19 00:43:111013 respectively (i.e., refs found in <code>refs/heads</code>,
1014 <code>refs/tags</code>, or <code>refs/remotes</code>, respectively).
Junio C Hamano6959c6c2006-05-17 10:34:111015</p>
Junio C Hamano9d971152012-12-19 00:43:111016<div class="paragraph"><p>If a <code>pattern</code> is given, only refs matching the given shell glob are
1017shown. If the pattern does not contain a globbing character (<code>?</code>,
1018<code>*</code>, or <code>[</code>), it is turned into a prefix match by appending <code>/*</code>.</p></div>
Junio C Hamano6959c6c2006-05-17 10:34:111019</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591020<dt class="hdlist1">
Junio C Hamano57827fb2010-01-23 03:02:501021--glob=pattern
Junio C Hamano6959c6c2006-05-17 10:34:111022</dt>
1023<dd>
1024<p>
Junio C Hamano9d971152012-12-19 00:43:111025 Show all refs matching the shell glob pattern <code>pattern</code>. If
1026 the pattern does not start with <code>refs/</code>, this is automatically
Junio C Hamano57827fb2010-01-23 03:02:501027 prepended. If the pattern does not contain a globbing
Junio C Hamano9d971152012-12-19 00:43:111028 character (<code>?</code>, <code>*</code>, or <code>[</code>), it is turned into a prefix
1029 match by appending <code>/*</code>.
Junio C Hamano6959c6c2006-05-17 10:34:111030</p>
1031</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591032<dt class="hdlist1">
Junio C Hamano0241d052013-08-30 23:52:171033--disambiguate=&lt;prefix&gt;
Junio C Hamanoa9701f02010-01-21 00:42:161034</dt>
1035<dd>
1036<p>
Junio C Hamano0241d052013-08-30 23:52:171037 Show every object whose name begins with the given prefix.
1038 The &lt;prefix&gt; must be at least 4 hexadecimal digits long to
1039 avoid listing each and every object in the repository by
1040 mistake.
Junio C Hamanoa9701f02010-01-21 00:42:161041</p>
1042</dd>
Junio C Hamano0241d052013-08-30 23:52:171043</dl></div>
1044</div>
1045<div class="sect2">
1046<h3 id="_options_for_files">Options for Files</h3>
1047<div class="dlist"><dl>
Junio C Hamano68cf15a2010-11-06 01:01:591048<dt class="hdlist1">
Junio C Hamano0241d052013-08-30 23:52:171049--local-env-vars
Junio C Hamano1a4e8412005-12-27 08:17:231050</dt>
1051<dd>
1052<p>
Junio C Hamano0241d052013-08-30 23:52:171053 List the GIT_* environment variables that are local to the
1054 repository (e.g. GIT_DIR or GIT_WORK_TREE, but not GIT_EDITOR).
1055 Only the names of the variables are listed, not their value,
1056 even if they are set.
Junio C Hamano1a4e8412005-12-27 08:17:231057</p>
1058</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591059<dt class="hdlist1">
Junio C Hamanoe246e3b2006-02-19 08:45:181060--git-dir
1061</dt>
1062<dd>
1063<p>
Junio C Hamano9d971152012-12-19 00:43:111064 Show <code>$GIT_DIR</code> if defined. Otherwise show the path to
Junio C Hamano35cd2a82012-05-23 22:01:131065 the .git directory. The path shown, when relative, is
1066 relative to the current working directory.
Junio C Hamanoe246e3b2006-02-19 08:45:181067</p>
Junio C Hamano9d971152012-12-19 00:43:111068<div class="paragraph"><p>If <code>$GIT_DIR</code> is not defined and the current directory
Junio C Hamano076ffcc2013-02-06 05:13:211069is not detected to lie in a Git repository or work tree
Junio C Hamano3609b332010-12-29 01:34:521070print a message to stderr and exit with nonzero status.</p></div>
Junio C Hamanoe246e3b2006-02-19 08:45:181071</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591072<dt class="hdlist1">
Junio C Hamanoee695f22007-06-21 00:35:361073--is-inside-git-dir
1074</dt>
1075<dd>
1076<p>
Junio C Hamanod526ba92007-07-02 00:17:421077 When the current working directory is below the repository
1078 directory print "true", otherwise "false".
1079</p>
1080</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591081<dt class="hdlist1">
Junio C Hamanod526ba92007-07-02 00:17:421082--is-inside-work-tree
1083</dt>
1084<dd>
1085<p>
1086 When the current working directory is inside the work tree of the
1087 repository print "true", otherwise "false".
1088</p>
1089</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591090<dt class="hdlist1">
Junio C Hamanod526ba92007-07-02 00:17:421091--is-bare-repository
1092</dt>
1093<dd>
1094<p>
1095 When the repository is bare print "true", otherwise "false".
Junio C Hamanoee695f22007-06-21 00:35:361096</p>
1097</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591098<dt class="hdlist1">
Junio C Hamano0241d052013-08-30 23:52:171099--resolve-git-dir &lt;path&gt;
Junio C Hamano636c8b22010-03-07 22:25:171100</dt>
1101<dd>
1102<p>
Junio C Hamano0241d052013-08-30 23:52:171103 Check if &lt;path&gt; is a valid repository or a gitfile that
1104 points at a valid repository, and print the location of the
1105 repository. If &lt;path&gt; is a gitfile then the resolved path
1106 to the real repository is printed.
Junio C Hamano636c8b22010-03-07 22:25:171107</p>
1108</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591109<dt class="hdlist1">
Junio C Hamano0241d052013-08-30 23:52:171110--show-cdup
Junio C Hamanoe246e3b2006-02-19 08:45:181111</dt>
1112<dd>
1113<p>
Junio C Hamano0241d052013-08-30 23:52:171114 When the command is invoked from a subdirectory, show the
1115 path of the top-level directory relative to the current
1116 directory (typically a sequence of "../", or an empty string).
Junio C Hamanoe246e3b2006-02-19 08:45:181117</p>
1118</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591119<dt class="hdlist1">
Junio C Hamano0241d052013-08-30 23:52:171120--show-prefix
1121</dt>
1122<dd>
1123<p>
1124 When the command is invoked from a subdirectory, show the
1125 path of the current directory relative to the top-level
1126 directory.
1127</p>
1128</dd>
1129<dt class="hdlist1">
1130--show-toplevel
1131</dt>
1132<dd>
1133<p>
1134 Show the absolute path of the top-level directory.
1135</p>
1136</dd>
1137</dl></div>
1138</div>
1139<div class="sect2">
1140<h3 id="_other_options">Other Options</h3>
1141<div class="dlist"><dl>
1142<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471143--since=datestring
1144</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591145<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471146--after=datestring
Junio C Hamano1a4e8412005-12-27 08:17:231147</dt>
1148<dd>
1149<p>
Junio C Hamanofce7c7e2008-07-02 03:06:381150 Parse the date string, and output the corresponding
Junio C Hamano1aa40d22010-01-21 17:46:431151 --max-age= parameter for <em>git rev-list</em>.
Junio C Hamano1a4e8412005-12-27 08:17:231152</p>
1153</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591154<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471155--until=datestring
1156</dt>
Junio C Hamano68cf15a2010-11-06 01:01:591157<dt class="hdlist1">
Junio C Hamanoeb415992008-06-08 22:49:471158--before=datestring
Junio C Hamano1a4e8412005-12-27 08:17:231159</dt>
1160<dd>
1161<p>
Junio C Hamanofce7c7e2008-07-02 03:06:381162 Parse the date string, and output the corresponding
Junio C Hamano1aa40d22010-01-21 17:46:431163 --min-age= parameter for <em>git rev-list</em>.
Junio C Hamano1a4e8412005-12-27 08:17:231164</p>
1165</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591166<dt class="hdlist1">
Junio C Hamano1a4e8412005-12-27 08:17:231167&lt;args&gt;&#8230;
1168</dt>
1169<dd>
1170<p>
1171 Flags and parameters to be parsed.
1172</p>
1173</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311174</dl></div>
Junio C Hamano1a4e8412005-12-27 08:17:231175</div>
Junio C Hamano9d971152012-12-19 00:43:111176</div>
Junio C Hamano0241d052013-08-30 23:52:171177</div>
Junio C Hamano9d971152012-12-19 00:43:111178<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311179<h2 id="_specifying_revisions">SPECIFYING REVISIONS</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231180<div class="sectionbody">
Junio C Hamanoee3adc32011-04-06 19:53:381181<div class="paragraph"><p>A revision parameter <em>&lt;rev&gt;</em> typically, but not necessarily, names a
Junio C Hamanoe3f080d2013-04-22 02:27:131182commit object. It uses what is called an <em>extended SHA-1</em>
Junio C Hamanofbe00522006-10-19 05:58:481183syntax. Here are various ways to spell object names. The
Junio C Hamanoee3adc32011-04-06 19:53:381184ones listed near the end of this list name trees and
Junio C Hamanoba4b9282008-07-06 05:20:311185blobs contained in a commit.</p></div>
Junio C Hamanoee3adc32011-04-06 19:53:381186<div class="dlist"><dl>
1187<dt class="hdlist1">
1188<em>&lt;sha1&gt;</em>, e.g. <em>dae86e1950b1277e545cee180551750029cfe735</em>, <em>dae86e</em>
1189</dt>
1190<dd>
Junio C Hamano1a4e8412005-12-27 08:17:231191<p>
Junio C Hamanoe3f080d2013-04-22 02:27:131192 The full SHA-1 object name (40-byte hexadecimal string), or
Junio C Hamanoee3adc32011-04-06 19:53:381193 a leading substring that is unique within the repository.
Junio C Hamano1a4e8412005-12-27 08:17:231194 E.g. dae86e1950b1277e545cee180551750029cfe735 and dae86e both
Junio C Hamanoee3adc32011-04-06 19:53:381195 name the same commit object if there is no other object in
Junio C Hamano1a4e8412005-12-27 08:17:231196 your repository whose object name starts with dae86e.
1197</p>
Junio C Hamanoee3adc32011-04-06 19:53:381198</dd>
1199<dt class="hdlist1">
1200<em>&lt;describeOutput&gt;</em>, e.g. <em>v1.7.4.2-679-g3bee7fb</em>
1201</dt>
1202<dd>
Junio C Hamano1a4e8412005-12-27 08:17:231203<p>
Junio C Hamano9d971152012-12-19 00:43:111204 Output from <code>git describe</code>; i.e. a closest tag, optionally
Junio C Hamano7f80ae82008-07-30 18:31:351205 followed by a dash and a number of commits, followed by a dash, a
Junio C Hamanoee3adc32011-04-06 19:53:381206 <em>g</em>, and an abbreviated object name.
Junio C Hamanofbe00522006-10-19 05:58:481207</p>
Junio C Hamanoee3adc32011-04-06 19:53:381208</dd>
1209<dt class="hdlist1">
1210<em>&lt;refname&gt;</em>, e.g. <em>master</em>, <em>heads/master</em>, <em>refs/heads/master</em>
1211</dt>
1212<dd>
Junio C Hamanofbe00522006-10-19 05:58:481213<p>
Junio C Hamanoee3adc32011-04-06 19:53:381214 A symbolic ref name. E.g. <em>master</em> typically means the commit
1215 object referenced by <em>refs/heads/master</em>. If you
1216 happen to have both <em>heads/master</em> and <em>tags/master</em>, you can
Junio C Hamano076ffcc2013-02-06 05:13:211217 explicitly say <em>heads/master</em> to tell Git which one you mean.
Junio C Hamanof5933722012-07-25 23:25:211218 When ambiguous, a <em>&lt;refname&gt;</em> is disambiguated by taking the
Junio C Hamano29f14312006-10-26 08:47:291219 first match in the following rules:
1220</p>
Junio C Hamano68cf15a2010-11-06 01:01:591221<div class="olist arabic"><ol class="arabic">
Junio C Hamano29f14312006-10-26 08:47:291222<li>
1223<p>
Junio C Hamanof5933722012-07-25 23:25:211224If <em>$GIT_DIR/&lt;refname&gt;</em> exists, that is what you mean (this is usually
Junio C Hamanoee3adc32011-04-06 19:53:381225 useful only for <em>HEAD</em>, <em>FETCH_HEAD</em>, <em>ORIG_HEAD</em>, <em>MERGE_HEAD</em>
1226 and <em>CHERRY_PICK_HEAD</em>);
Junio C Hamano1a4e8412005-12-27 08:17:231227</p>
1228</li>
1229<li>
1230<p>
Junio C Hamanof5933722012-07-25 23:25:211231otherwise, <em>refs/&lt;refname&gt;</em> if it exists;
Junio C Hamano29f14312006-10-26 08:47:291232</p>
1233</li>
1234<li>
1235<p>
Junio C Hamanoee3adc32011-04-06 19:53:381236otherwise, <em>refs/tags/&lt;refname&gt;</em> if it exists;
Junio C Hamano29f14312006-10-26 08:47:291237</p>
1238</li>
1239<li>
1240<p>
Junio C Hamanof5933722012-07-25 23:25:211241otherwise, <em>refs/heads/&lt;refname&gt;</em> if it exists;
Junio C Hamano29f14312006-10-26 08:47:291242</p>
1243</li>
1244<li>
1245<p>
Junio C Hamanof5933722012-07-25 23:25:211246otherwise, <em>refs/remotes/&lt;refname&gt;</em> if it exists;
Junio C Hamano29f14312006-10-26 08:47:291247</p>
1248</li>
1249<li>
1250<p>
Junio C Hamanof5933722012-07-25 23:25:211251otherwise, <em>refs/remotes/&lt;refname&gt;/HEAD</em> if it exists.
Junio C Hamano29f14312006-10-26 08:47:291252</p>
Junio C Hamanoee3adc32011-04-06 19:53:381253<div class="paragraph"><p><em>HEAD</em> names the commit on which you based the changes in the working tree.
1254<em>FETCH_HEAD</em> records the branch which you fetched from a remote repository
Junio C Hamano9d971152012-12-19 00:43:111255with your last <code>git fetch</code> invocation.
Junio C Hamanoee3adc32011-04-06 19:53:381256<em>ORIG_HEAD</em> is created by commands that move your <em>HEAD</em> in a drastic
1257way, to record the position of the <em>HEAD</em> before their operation, so that
1258you can easily change the tip of the branch back to the state before you ran
1259them.
1260<em>MERGE_HEAD</em> records the commit(s) which you are merging into your branch
Junio C Hamano9d971152012-12-19 00:43:111261when you run <code>git merge</code>.
Junio C Hamanoee3adc32011-04-06 19:53:381262<em>CHERRY_PICK_HEAD</em> records the commit which you are cherry-picking
Junio C Hamano9d971152012-12-19 00:43:111263when you run <code>git cherry-pick</code>.</p></div>
Junio C Hamanoee3adc32011-04-06 19:53:381264<div class="paragraph"><p>Note that any of the <em>refs/*</em> cases above may come either from
Junio C Hamanoeccdd4a2012-09-10 23:28:171265the <em>$GIT_DIR/refs</em> directory or from the <em>$GIT_DIR/packed-refs</em> file.
Junio C Hamanoa080bc32013-04-12 21:33:011266While the ref name encoding is unspecified, UTF-8 is preferred as
Junio C Hamanoeccdd4a2012-09-10 23:28:171267some output processing may assume ref names in UTF-8.</p></div>
Junio C Hamano29f14312006-10-26 08:47:291268</li>
Junio C Hamanoba4b9282008-07-06 05:20:311269</ol></div>
Junio C Hamanoee3adc32011-04-06 19:53:381270</dd>
1271<dt class="hdlist1">
Junio C Hamano79f4c7c2013-09-20 21:03:371272<em>@</em>
1273</dt>
1274<dd>
1275<p>
1276 <em>@</em> alone is a shortcut for <em>HEAD</em>.
1277</p>
1278</dd>
1279<dt class="hdlist1">
Junio C Hamanoee3adc32011-04-06 19:53:381280<em>&lt;refname&gt;@{&lt;date&gt;}</em>, e.g. <em>master@{yesterday}</em>, <em>HEAD@{5 minutes ago}</em>
1281</dt>
1282<dd>
Junio C Hamano29f14312006-10-26 08:47:291283<p>
Junio C Hamanoee3adc32011-04-06 19:53:381284 A ref followed by the suffix <em>@</em> with a date specification
Junio C Hamano29f14312006-10-26 08:47:291285 enclosed in a brace
Junio C Hamano341071d2006-06-04 07:24:481286 pair (e.g. <em>{yesterday}</em>, <em>{1 month 2 weeks 3 days 1 hour 1
Junio C Hamanoee3adc32011-04-06 19:53:381287 second ago}</em> or <em>{1979-02-26 18:30:00}</em>) specifies the value
Junio C Hamano341071d2006-06-04 07:24:481288 of the ref at a prior point in time. This suffix may only be
1289 used immediately following a ref name and the ref must have an
Junio C Hamanoee3adc32011-04-06 19:53:381290 existing log (<em>$GIT_DIR/logs/&lt;ref&gt;</em>). Note that this looks up the state
Junio C Hamanobb8e9962008-06-30 09:05:081291 of your <strong>local</strong> ref at a given time; e.g., what was in your local
Junio C Hamanoee3adc32011-04-06 19:53:381292 <em>master</em> branch last week. If you want to look at commits made during
1293 certain times, see <em>--since</em> and <em>--until</em>.
Junio C Hamano341071d2006-06-04 07:24:481294</p>
Junio C Hamanoee3adc32011-04-06 19:53:381295</dd>
1296<dt class="hdlist1">
1297<em>&lt;refname&gt;@{&lt;n&gt;}</em>, e.g. <em>master@{1}</em>
1298</dt>
1299<dd>
Junio C Hamano341071d2006-06-04 07:24:481300<p>
Junio C Hamanoee3adc32011-04-06 19:53:381301 A ref followed by the suffix <em>@</em> with an ordinal specification
1302 enclosed in a brace pair (e.g. <em>{1}</em>, <em>{15}</em>) specifies
Junio C Hamano2d47c622007-01-18 06:24:101303 the n-th prior value of that ref. For example <em>master@{1}</em>
1304 is the immediate prior value of <em>master</em> while <em>master@{5}</em>
1305 is the 5th prior value of <em>master</em>. This suffix may only be used
1306 immediately following a ref name and the ref must have an existing
Junio C Hamanoee3adc32011-04-06 19:53:381307 log (<em>$GIT_DIR/logs/&lt;refname&gt;</em>).
Junio C Hamano2d47c622007-01-18 06:24:101308</p>
Junio C Hamanoee3adc32011-04-06 19:53:381309</dd>
1310<dt class="hdlist1">
1311<em>@{&lt;n&gt;}</em>, e.g. <em>@{1}</em>
1312</dt>
1313<dd>
Junio C Hamano2d47c622007-01-18 06:24:101314<p>
Junio C Hamanoee3adc32011-04-06 19:53:381315 You can use the <em>@</em> construct with an empty ref part to get at a
1316 reflog entry of the current branch. For example, if you are on
1317 branch <em>blabla</em> then <em>@{1}</em> means the same as <em>blabla@{1}</em>.
Junio C Hamano39381a72007-02-02 07:35:151318</p>
Junio C Hamanoee3adc32011-04-06 19:53:381319</dd>
1320<dt class="hdlist1">
1321<em>@{-&lt;n&gt;}</em>, e.g. <em>@{-1}</em>
1322</dt>
1323<dd>
Junio C Hamano39381a72007-02-02 07:35:151324<p>
Junio C Hamanoee3adc32011-04-06 19:53:381325 The construct <em>@{-&lt;n&gt;}</em> means the &lt;n&gt;th branch checked out
Junio C Hamano440791e2009-01-29 01:54:021326 before the current one.
1327</p>
Junio C Hamanoee3adc32011-04-06 19:53:381328</dd>
1329<dt class="hdlist1">
Junio C Hamanofa156ea2013-03-17 23:39:091330<em>&lt;branchname&gt;@{upstream}</em>, e.g. <em>master@{upstream}</em>, <em>@{u}</em>
Junio C Hamanoee3adc32011-04-06 19:53:381331</dt>
1332<dd>
Junio C Hamano440791e2009-01-29 01:54:021333<p>
Junio C Hamanofa156ea2013-03-17 23:39:091334 The suffix <em>@{upstream}</em> to a branchname (short form <em>&lt;branchname&gt;@{u}</em>)
1335 refers to the branch that the branch specified by branchname is set to build on
1336 top of. A missing branchname defaults to the current one.
Junio C Hamano57827fb2010-01-23 03:02:501337</p>
Junio C Hamanoee3adc32011-04-06 19:53:381338</dd>
1339<dt class="hdlist1">
1340<em>&lt;rev&gt;&#94;</em>, e.g. <em>HEAD&#94;, v1.5.1&#94;0</em>
1341</dt>
1342<dd>
Junio C Hamano57827fb2010-01-23 03:02:501343<p>
Junio C Hamanoee3adc32011-04-06 19:53:381344 A suffix <em>&#94;</em> to a revision parameter means the first parent of
Junio C Hamano6926bef2007-06-16 09:54:051345 that commit object. <em>&#94;&lt;n&gt;</em> means the &lt;n&gt;th parent (i.e.
Junio C Hamanoee3adc32011-04-06 19:53:381346 <em>&lt;rev&gt;&#94;</em>
1347 is equivalent to <em>&lt;rev&gt;&#94;1</em>). As a special rule,
1348 <em>&lt;rev&gt;&#94;0</em> means the commit itself and is used when <em>&lt;rev&gt;</em> is the
Junio C Hamano1a4e8412005-12-27 08:17:231349 object name of a tag object that refers to a commit object.
1350</p>
Junio C Hamanoee3adc32011-04-06 19:53:381351</dd>
1352<dt class="hdlist1">
1353<em>&lt;rev&gt;&#126;&lt;n&gt;</em>, e.g. <em>master&#126;3</em>
1354</dt>
1355<dd>
Junio C Hamano1a4e8412005-12-27 08:17:231356<p>
Junio C Hamanoee3adc32011-04-06 19:53:381357 A suffix <em>&#126;&lt;n&gt;</em> to a revision parameter means the commit
Junio C Hamano81d540a2012-03-02 19:52:471358 object that is the &lt;n&gt;th generation ancestor of the named
Junio C Hamanoee3adc32011-04-06 19:53:381359 commit object, following only the first parents. I.e. <em>&lt;rev&gt;&#126;3</em> is
1360 equivalent to <em>&lt;rev&gt;&#94;&#94;&#94;</em> which is equivalent to
1361 <em>&lt;rev&gt;&#94;1&#94;1&#94;1</em>. See below for an illustration of
Junio C Hamano29f14312006-10-26 08:47:291362 the usage of this form.
Junio C Hamano1a4e8412005-12-27 08:17:231363</p>
Junio C Hamanoee3adc32011-04-06 19:53:381364</dd>
1365<dt class="hdlist1">
1366<em>&lt;rev&gt;&#94;{&lt;type&gt;}</em>, e.g. <em>v0.99.8&#94;{commit}</em>
1367</dt>
1368<dd>
Junio C Hamano1a4e8412005-12-27 08:17:231369<p>
Junio C Hamanoee3adc32011-04-06 19:53:381370 A suffix <em>&#94;</em> followed by an object type name enclosed in
Junio C Hamanoe6f28d02013-09-17 21:34:001371 brace pair means dereference the object at <em>&lt;rev&gt;</em> recursively until
1372 an object of type <em>&lt;type&gt;</em> is found or the object cannot be
1373 dereferenced anymore (in which case, barf).
1374 For example, if <em>&lt;rev&gt;</em> is a commit-ish, <em>&lt;rev&gt;&#94;{commit}</em>
1375 describes the corresponding commit object.
1376 Similarly, if <em>&lt;rev&gt;</em> is a tree-ish, <em>&lt;rev&gt;&#94;{tree}</em>
1377 describes the corresponding tree object.
1378 <em>&lt;rev&gt;&#94;0</em>
Junio C Hamanoee3adc32011-04-06 19:53:381379 is a short-hand for <em>&lt;rev&gt;&#94;{commit}</em>.
Junio C Hamano1a4e8412005-12-27 08:17:231380</p>
Junio C Hamanoa6c69e12013-04-03 20:31:101381<div class="paragraph"><p><em>rev&#94;{object}</em> can be used to make sure <em>rev</em> names an
1382object that exists, without requiring <em>rev</em> to be a tag, and
1383without dereferencing <em>rev</em>; because a tag is already an object,
1384it does not have to be dereferenced even once to get to an object.</p></div>
Junio C Hamano79f4c7c2013-09-20 21:03:371385<div class="paragraph"><p><em>rev&#94;{tag}</em> can be used to ensure that <em>rev</em> identifies an
1386existing tag object.</p></div>
Junio C Hamanoee3adc32011-04-06 19:53:381387</dd>
1388<dt class="hdlist1">
1389<em>&lt;rev&gt;&#94;{}</em>, e.g. <em>v0.99.8&#94;{}</em>
1390</dt>
1391<dd>
Junio C Hamano1a4e8412005-12-27 08:17:231392<p>
Junio C Hamanoee3adc32011-04-06 19:53:381393 A suffix <em>&#94;</em> followed by an empty brace pair
1394 means the object could be a tag,
Junio C Hamano1a4e8412005-12-27 08:17:231395 and dereference the tag recursively until a non-tag object is
1396 found.
1397</p>
Junio C Hamanoee3adc32011-04-06 19:53:381398</dd>
1399<dt class="hdlist1">
1400<em>&lt;rev&gt;&#94;{/&lt;text&gt;}</em>, e.g. <em>HEAD^{/fix nasty bug}</em>
1401</dt>
1402<dd>
Junio C Hamanofbe00522006-10-19 05:58:481403<p>
Junio C Hamanoee3adc32011-04-06 19:53:381404 A suffix <em>&#94;</em> to a revision parameter, followed by a brace
1405 pair that contains a text led by a slash,
1406 is the same as the <em>:/fix nasty bug</em> syntax below except that
Junio C Hamano18b5ad52010-12-22 01:57:501407 it returns the youngest matching commit which is reachable from
Junio C Hamanoee3adc32011-04-06 19:53:381408 the <em>&lt;rev&gt;</em> before <em>&#94;</em>.
Junio C Hamano18b5ad52010-12-22 01:57:501409</p>
Junio C Hamanoee3adc32011-04-06 19:53:381410</dd>
1411<dt class="hdlist1">
1412<em>:/&lt;text&gt;</em>, e.g. <em>:/fix nasty bug</em>
1413</dt>
1414<dd>
Junio C Hamano18b5ad52010-12-22 01:57:501415<p>
Junio C Hamanoee3adc32011-04-06 19:53:381416 A colon, followed by a slash, followed by a text, names
Junio C Hamano442206c2010-09-28 05:51:231417 a commit whose commit message matches the specified regular expression.
Junio C Hamano6ac2f142007-03-01 01:24:561418 This name returns the youngest matching commit which is
1419 reachable from any ref. If the commit message starts with a
Junio C Hamanoee3adc32011-04-06 19:53:381420 <em>!</em> you have to repeat that; the special sequence <em>:/!</em>,
1421 followed by something else than <em>!</em>, is reserved for now.
Junio C Hamano442206c2010-09-28 05:51:231422 The regular expression can match any part of the commit message. To
Junio C Hamanoee3adc32011-04-06 19:53:381423 match messages starting with a string, one can use e.g. <em>:/^foo</em>.
Junio C Hamano6ac2f142007-03-01 01:24:561424</p>
Junio C Hamanoee3adc32011-04-06 19:53:381425</dd>
1426<dt class="hdlist1">
1427<em>&lt;rev&gt;:&lt;path&gt;</em>, e.g. <em>HEAD:README</em>, <em>:README</em>, <em>master:./README</em>
1428</dt>
1429<dd>
Junio C Hamano6ac2f142007-03-01 01:24:561430<p>
Junio C Hamanoee3adc32011-04-06 19:53:381431 A suffix <em>:</em> followed by a path names the blob or tree
Junio C Hamanofbe00522006-10-19 05:58:481432 at the given path in the tree-ish object named by the part
1433 before the colon.
Junio C Hamanoee3adc32011-04-06 19:53:381434 <em>:path</em> (with an empty part before the colon)
Junio C Hamano7d449522010-07-01 00:08:511435 is a special case of the syntax described next: content
1436 recorded in the index at the given path.
Junio C Hamanoee3adc32011-04-06 19:53:381437 A path starting with <em>./</em> or <em>../</em> is relative to the current working directory.
1438 The given path will be converted to be relative to the working tree&#8217;s root directory.
Junio C Hamano0d75e872010-12-17 06:57:261439 This is most useful to address a blob or tree from a commit or tree that has
Junio C Hamanoee3adc32011-04-06 19:53:381440 the same tree structure as the working tree.
Junio C Hamanofbe00522006-10-19 05:58:481441</p>
Junio C Hamanoee3adc32011-04-06 19:53:381442</dd>
1443<dt class="hdlist1">
1444<em>:&lt;n&gt;:&lt;path&gt;</em>, e.g. <em>:0:README</em>, <em>:README</em>
1445</dt>
1446<dd>
Junio C Hamanofbe00522006-10-19 05:58:481447<p>
Junio C Hamanoee3adc32011-04-06 19:53:381448 A colon, optionally followed by a stage number (0 to 3) and a
1449 colon, followed by a path, names a blob object in the
1450 index at the given path. A missing stage number (and the colon
1451 that follows it) names a stage 0 entry. During a merge, stage
Junio C Hamano68cf15a2010-11-06 01:01:591452 1 is the common ancestor, stage 2 is the target branch&#8217;s version
Junio C Hamanocae86272007-08-21 02:20:491453 (typically the current branch), and stage 3 is the version from
Junio C Hamanoee3adc32011-04-06 19:53:381454 the branch which is being merged.
Junio C Hamanofbe00522006-10-19 05:58:481455</p>
Junio C Hamanoee3adc32011-04-06 19:53:381456</dd>
1457</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591458<div class="paragraph"><p>Here is an illustration, by Jon Loeliger. Both commit nodes B
Junio C Hamano1c95e9d2008-02-01 10:52:441459and C are parents of commit node A. Parent commits are ordered
Junio C Hamanoba4b9282008-07-06 05:20:311460left-to-right.</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231461<div class="literalblock">
1462<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111463<pre><code>G H I J
Junio C Hamano1a4e8412005-12-27 08:17:231464 \ / \ /
1465 D E F
Junio C Hamano137273f2008-05-27 07:44:331466 \ | / \
1467 \ | / |
Junio C Hamano872c5682006-07-07 06:05:401468 \|/ |
Junio C Hamano1a4e8412005-12-27 08:17:231469 B C
1470 \ /
1471 \ /
Junio C Hamano9d971152012-12-19 00:43:111472 A</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231473</div></div>
1474<div class="literalblock">
1475<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111476<pre><code>A = = A^0
Junio C Hamano1a4e8412005-12-27 08:17:231477B = A^ = A^1 = A~1
1478C = A^2 = A^2
1479D = A^^ = A^1^1 = A~2
1480E = B^2 = A^^2
1481F = B^3 = A^^3
1482G = A^^^ = A^1^1^1 = A~3
1483H = D^2 = B^^2 = A^^^2 = A~2^2
1484I = F^ = B^3^ = A^^3^
Junio C Hamano9d971152012-12-19 00:43:111485J = F^2 = B^3^2 = A^^3^2</code></pre>
Junio C Hamano1a4e8412005-12-27 08:17:231486</div></div>
1487</div>
Junio C Hamano9d971152012-12-19 00:43:111488</div>
1489<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311490<h2 id="_specifying_ranges">SPECIFYING RANGES</h2>
Junio C Hamano872c5682006-07-07 06:05:401491<div class="sectionbody">
Junio C Hamano9d971152012-12-19 00:43:111492<div class="paragraph"><p>History traversing commands such as <code>git log</code> operate on a set
Junio C Hamano872c5682006-07-07 06:05:401493of commits, not just a single commit. To these commands,
1494specifying a single revision with the notation described in the
1495previous section means the set of commits reachable from that
Junio C Hamanoba4b9282008-07-06 05:20:311496commit, following the commit ancestry chain.</p></div>
Junio C Hamanoee3adc32011-04-06 19:53:381497<div class="paragraph"><p>To exclude commits reachable from a commit, a prefix <em>&#94;</em>
1498notation is used. E.g. <em>&#94;r1 r2</em> means commits reachable
1499from <em>r2</em> but exclude the ones reachable from <em>r1</em>.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591500<div class="paragraph"><p>This set operation appears so often that there is a shorthand
Junio C Hamanoee3adc32011-04-06 19:53:381501for it. When you have two commits <em>r1</em> and <em>r2</em> (named according
Junio C Hamanod32738e2008-07-09 19:53:421502to the syntax explained in SPECIFYING REVISIONS above), you can ask
1503for commits that are reachable from r2 excluding those that are reachable
Junio C Hamanoee3adc32011-04-06 19:53:381504from r1 by <em>&#94;r1 r2</em> and it can be written as <em>r1..r2</em>.</p></div>
1505<div class="paragraph"><p>A similar notation <em>r1...r2</em> is called symmetric difference
1506of <em>r1</em> and <em>r2</em> and is defined as
1507<em>r1 r2 --not $(git merge-base --all r1 r2)</em>.
Junio C Hamanoea5dae62007-05-10 23:25:081508It is the set of commits that are reachable from either one of
Junio C Hamanoee3adc32011-04-06 19:53:381509<em>r1</em> or <em>r2</em> but not from both.</p></div>
Junio C Hamanoeccdd4a2012-09-10 23:28:171510<div class="paragraph"><p>In these two shorthands, you can omit one end and let it default to HEAD.
1511For example, <em>origin..</em> is a shorthand for <em>origin..HEAD</em> and asks "What
1512did I do since I forked from the origin branch?" Similarly, <em>..origin</em>
1513is a shorthand for <em>HEAD..origin</em> and asks "What did the origin do since
1514I forked from them?" Note that <em>..</em> would mean <em>HEAD..HEAD</em> which is an
1515empty range that is both reachable and unreachable from HEAD.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591516<div class="paragraph"><p>Two other shorthands for naming a set that is formed by a commit
Junio C Hamanoee3adc32011-04-06 19:53:381517and its parent commits exist. The <em>r1&#94;@</em> notation means all
1518parents of <em>r1</em>. <em>r1&#94;!</em> includes commit <em>r1</em> but excludes
Junio C Hamano15048272008-07-07 22:10:481519all of its parents.</p></div>
Junio C Hamanof5933722012-07-25 23:25:211520<div class="paragraph"><p>To summarize:</p></div>
1521<div class="dlist"><dl>
1522<dt class="hdlist1">
1523<em>&lt;rev&gt;</em>
1524</dt>
1525<dd>
1526<p>
1527 Include commits that are reachable from (i.e. ancestors of)
1528 &lt;rev&gt;.
1529</p>
1530</dd>
1531<dt class="hdlist1">
1532<em>&#94;&lt;rev&gt;</em>
1533</dt>
1534<dd>
1535<p>
1536 Exclude commits that are reachable from (i.e. ancestors of)
1537 &lt;rev&gt;.
1538</p>
1539</dd>
1540<dt class="hdlist1">
1541<em>&lt;rev1&gt;..&lt;rev2&gt;</em>
1542</dt>
1543<dd>
1544<p>
1545 Include commits that are reachable from &lt;rev2&gt; but exclude
Junio C Hamanof26c77e2013-04-27 00:06:041546 those that are reachable from &lt;rev1&gt;. When either &lt;rev1&gt; or
1547 &lt;rev2&gt; is omitted, it defaults to <em>HEAD</em>.
Junio C Hamanof5933722012-07-25 23:25:211548</p>
1549</dd>
1550<dt class="hdlist1">
1551<em>&lt;rev1&gt;...&lt;rev2&gt;</em>
1552</dt>
1553<dd>
1554<p>
1555 Include commits that are reachable from either &lt;rev1&gt; or
Junio C Hamanof26c77e2013-04-27 00:06:041556 &lt;rev2&gt; but exclude those that are reachable from both. When
1557 either &lt;rev1&gt; or &lt;rev2&gt; is omitted, it defaults to <em>HEAD</em>.
Junio C Hamanof5933722012-07-25 23:25:211558</p>
1559</dd>
1560<dt class="hdlist1">
1561<em>&lt;rev&gt;&#94;@</em>, e.g. <em>HEAD&#94;@</em>
1562</dt>
1563<dd>
1564<p>
1565 A suffix <em>&#94;</em> followed by an at sign is the same as listing
1566 all parents of <em>&lt;rev&gt;</em> (meaning, include anything reachable from
1567 its parents, but not the commit itself).
1568</p>
1569</dd>
1570<dt class="hdlist1">
1571<em>&lt;rev&gt;&#94;!</em>, e.g. <em>HEAD&#94;!</em>
1572</dt>
1573<dd>
1574<p>
1575 A suffix <em>&#94;</em> followed by an exclamation mark is the same
1576 as giving commit <em>&lt;rev&gt;</em> and then all its parents prefixed with
1577 <em>&#94;</em> to exclude them (and their ancestors).
1578</p>
1579</dd>
1580</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591581<div class="paragraph"><p>Here are a handful of examples:</p></div>
Junio C Hamano872c5682006-07-07 06:05:401582<div class="literalblock">
1583<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111584<pre><code>D G H D
Junio C Hamano3aa81822007-03-30 08:52:261585D F G H I J D F
1586^G D H D
1587^D B E I J F B
Junio C Hamanof5933722012-07-25 23:25:211588B..C C
Junio C Hamano3aa81822007-03-30 08:52:261589B...C G H D E B C
1590^D B C E I J F B C
Junio C Hamanof5933722012-07-25 23:25:211591C I J F C
Junio C Hamano3aa81822007-03-30 08:52:261592C^@ I J F
Junio C Hamanof5933722012-07-25 23:25:211593C^! C
Junio C Hamano9d971152012-12-19 00:43:111594F^! D G H D F</code></pre>
Junio C Hamano872c5682006-07-07 06:05:401595</div></div>
1596</div>
Junio C Hamano9d971152012-12-19 00:43:111597</div>
1598<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311599<h2 id="_parseopt">PARSEOPT</h2>
Junio C Hamanoe1258662007-11-19 05:03:191600<div class="sectionbody">
Junio C Hamano9d971152012-12-19 00:43:111601<div class="paragraph"><p>In <code>--parseopt</code> mode, <em>git rev-parse</em> helps massaging options to bring to shell
Junio C Hamanoe1258662007-11-19 05:03:191602scripts the same facilities C builtins have. It works as an option normalizer
Junio C Hamano9d971152012-12-19 00:43:111603(e.g. splits single switches aggregate values), a bit like <code>getopt(1)</code> does.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591604<div class="paragraph"><p>It takes on the standard input the specification of the options to parse and
Junio C Hamano9d971152012-12-19 00:43:111605understand, and echoes on the standard output a string suitable for <code>sh(1)</code> <code>eval</code>
Junio C Hamanoe1258662007-11-19 05:03:191606to replace the arguments with normalized ones. In case of error, it outputs
Junio C Hamanoba4b9282008-07-06 05:20:311607usage on the standard error stream, and exits with code 129.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111608<div class="paragraph"><p>Note: Make sure you quote the result when passing it to <code>eval</code>. See
Junio C Hamanoa9788762010-08-03 15:15:541609below for an example.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111610<div class="sect2">
1611<h3 id="_input_format">Input Format</h3>
Junio C Hamano68cf15a2010-11-06 01:01:591612<div class="paragraph"><p><em>git rev-parse --parseopt</em> input format is fully text based. It has two parts,
Junio C Hamano9d971152012-12-19 00:43:111613separated by a line that contains only <code>--</code>. The lines before the separator
Junio C Hamanoe1258662007-11-19 05:03:191614(should be more than one) are used for the usage.
Junio C Hamanoba4b9282008-07-06 05:20:311615The lines after the separator describe the options.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591616<div class="paragraph"><p>Each line of options has this format:</p></div>
Junio C Hamanoe1258662007-11-19 05:03:191617<div class="listingblock">
1618<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111619<pre><code>&lt;opt_spec&gt;&lt;flags&gt;* SP+ help LF</code></pre>
Junio C Hamanoe1258662007-11-19 05:03:191620</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591621<div class="dlist"><dl>
1622<dt class="hdlist1">
Junio C Hamano9d971152012-12-19 00:43:111623<code>&lt;opt_spec&gt;</code>
Junio C Hamanoe1258662007-11-19 05:03:191624</dt>
1625<dd>
1626<p>
1627 its format is the short option character, then the long option name
1628 separated by a comma. Both parts are not required, though at least one
Junio C Hamano9d971152012-12-19 00:43:111629 is necessary. <code>h,help</code>, <code>dry-run</code> and <code>f</code> are all three correct
1630 <code>&lt;opt_spec&gt;</code>.
Junio C Hamanoe1258662007-11-19 05:03:191631</p>
1632</dd>
Junio C Hamano68cf15a2010-11-06 01:01:591633<dt class="hdlist1">
Junio C Hamano9d971152012-12-19 00:43:111634<code>&lt;flags&gt;</code>
Junio C Hamanoe1258662007-11-19 05:03:191635</dt>
1636<dd>
1637<p>
Junio C Hamano9d971152012-12-19 00:43:111638 <code>&lt;flags&gt;</code> are of <code>*</code>, <code>=</code>, <code>?</code> or <code>!</code>.
Junio C Hamanoe1258662007-11-19 05:03:191639</p>
Junio C Hamano68cf15a2010-11-06 01:01:591640<div class="ulist"><ul>
Junio C Hamanobb343172008-03-09 10:39:091641<li>
1642<p>
Junio C Hamano9d971152012-12-19 00:43:111643Use <code>=</code> if the option takes an argument.
Junio C Hamanobb343172008-03-09 10:39:091644</p>
1645</li>
1646<li>
1647<p>
Junio C Hamano9d971152012-12-19 00:43:111648Use <code>?</code> to mean that the option is optional (though its use is discouraged).
Junio C Hamanobb343172008-03-09 10:39:091649</p>
1650</li>
1651<li>
1652<p>
Junio C Hamano9d971152012-12-19 00:43:111653Use <code>*</code> to mean that this option should not be listed in the usage
1654 generated for the <code>-h</code> argument. It&#8217;s shown for <code>--help-all</code> as
Junio C Hamanoa28a9202012-06-21 07:08:231655 documented in <a href="gitcli.html">gitcli(7)</a>.
Junio C Hamanobb343172008-03-09 10:39:091656</p>
1657</li>
1658<li>
1659<p>
Junio C Hamano9d971152012-12-19 00:43:111660Use <code>!</code> to not make the corresponding negated long option available.
Junio C Hamanobb343172008-03-09 10:39:091661</p>
1662</li>
Junio C Hamanoba4b9282008-07-06 05:20:311663</ul></div>
Junio C Hamanoe1258662007-11-19 05:03:191664</dd>
Junio C Hamanoba4b9282008-07-06 05:20:311665</dl></div>
Junio C Hamano68cf15a2010-11-06 01:01:591666<div class="paragraph"><p>The remainder of the line, after stripping the spaces, is used
Junio C Hamanoba4b9282008-07-06 05:20:311667as the help associated to the option.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591668<div class="paragraph"><p>Blank lines are ignored, and lines that don&#8217;t match this specification are used
Junio C Hamanoe1258662007-11-19 05:03:191669as option group headers (start the line with a space to create such
Junio C Hamanoba4b9282008-07-06 05:20:311670lines on purpose).</p></div>
Junio C Hamano9d971152012-12-19 00:43:111671</div>
1672<div class="sect2">
1673<h3 id="_example">Example</h3>
Junio C Hamanoe1258662007-11-19 05:03:191674<div class="listingblock">
1675<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111676<pre><code>OPTS_SPEC="\
Junio C Hamanoe1258662007-11-19 05:03:191677some-command [options] &lt;args&gt;...
1678
1679some-command does foo and bar!
1680--
1681h,help show the help
1682
1683foo some nifty option --foo
1684bar= some cool option --bar with an argument
1685
1686 An option group Header
1687C? option C with an optional argument"
1688
Junio C Hamano9d971152012-12-19 00:43:111689eval "$(echo "$OPTS_SPEC" | git rev-parse --parseopt -- "$@" || echo exit $?)"</code></pre>
Junio C Hamanoe1258662007-11-19 05:03:191690</div></div>
1691</div>
Junio C Hamano9d971152012-12-19 00:43:111692</div>
1693</div>
1694<div class="sect1">
Junio C Hamano7ae18252009-05-23 09:53:321695<h2 id="_sq_quote">SQ-QUOTE</h2>
1696<div class="sectionbody">
Junio C Hamano9d971152012-12-19 00:43:111697<div class="paragraph"><p>In <code>--sq-quote</code> mode, <em>git rev-parse</em> echoes on the standard output a
1698single line suitable for <code>sh(1)</code> <code>eval</code>. This line is made by
1699normalizing the arguments following <code>--sq-quote</code>. Nothing other than
Junio C Hamano7ae18252009-05-23 09:53:321700quoting the arguments is done.</p></div>
Junio C Hamano68cf15a2010-11-06 01:01:591701<div class="paragraph"><p>If you want command input to still be interpreted as usual by
Junio C Hamano9d971152012-12-19 00:43:111702<em>git rev-parse</em> before the output is shell quoted, see the <code>--sq</code>
Junio C Hamano7ae18252009-05-23 09:53:321703option.</p></div>
Junio C Hamano9d971152012-12-19 00:43:111704<div class="sect2">
1705<h3 id="_example_2">Example</h3>
Junio C Hamano7ae18252009-05-23 09:53:321706<div class="listingblock">
1707<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111708<pre><code>$ cat &gt;your-git-script.sh &lt;&lt;\EOF
Junio C Hamano7ae18252009-05-23 09:53:321709#!/bin/sh
1710args=$(git rev-parse --sq-quote "$@") # quote user-supplied arguments
1711command="git frotz -n24 $args" # and use it inside a handcrafted
1712 # command line
1713eval "$command"
1714EOF
1715
Junio C Hamano9d971152012-12-19 00:43:111716$ sh your-git-script.sh "a b'c"</code></pre>
Junio C Hamano7ae18252009-05-23 09:53:321717</div></div>
1718</div>
Junio C Hamano9d971152012-12-19 00:43:111719</div>
1720</div>
1721<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311722<h2 id="_examples">EXAMPLES</h2>
Junio C Hamanofeeb1be2008-05-22 00:53:351723<div class="sectionbody">
Junio C Hamano68cf15a2010-11-06 01:01:591724<div class="ulist"><ul>
Junio C Hamanofeeb1be2008-05-22 00:53:351725<li>
1726<p>
1727Print the object name of the current commit:
1728</p>
1729<div class="listingblock">
1730<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111731<pre><code>$ git rev-parse --verify HEAD</code></pre>
Junio C Hamanofeeb1be2008-05-22 00:53:351732</div></div>
1733</li>
1734<li>
1735<p>
1736Print the commit object name from the revision in the $REV shell variable:
1737</p>
1738<div class="listingblock">
1739<div class="content">
Junio C Hamanoedf80bd2013-04-05 22:14:361740<pre><code>$ git rev-parse --verify $REV^{commit}</code></pre>
Junio C Hamanofeeb1be2008-05-22 00:53:351741</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591742<div class="paragraph"><p>This will error out if $REV is empty or not a valid revision.</p></div>
Junio C Hamanofeeb1be2008-05-22 00:53:351743</li>
1744<li>
1745<p>
Junio C Hamanoedf80bd2013-04-05 22:14:361746Similar to above:
Junio C Hamanofeeb1be2008-05-22 00:53:351747</p>
1748<div class="listingblock">
1749<div class="content">
Junio C Hamano9d971152012-12-19 00:43:111750<pre><code>$ git rev-parse --default master --verify $REV</code></pre>
Junio C Hamanofeeb1be2008-05-22 00:53:351751</div></div>
Junio C Hamano68cf15a2010-11-06 01:01:591752<div class="paragraph"><p>but if $REV is empty, the commit object name from master will be printed.</p></div>
Junio C Hamanofeeb1be2008-05-22 00:53:351753</li>
Junio C Hamanoba4b9282008-07-06 05:20:311754</ul></div>
Junio C Hamanofeeb1be2008-05-22 00:53:351755</div>
Junio C Hamano9d971152012-12-19 00:43:111756</div>
1757<div class="sect1">
Junio C Hamanoba4b9282008-07-06 05:20:311758<h2 id="_git">GIT</h2>
Junio C Hamano1a4e8412005-12-27 08:17:231759<div class="sectionbody">
Junio C Hamanoa28a9202012-06-21 07:08:231760<div class="paragraph"><p>Part of the <a href="git.html">git(1)</a> suite</p></div>
Junio C Hamano1a4e8412005-12-27 08:17:231761</div>
Junio C Hamano7bd050f2011-09-22 06:32:221762</div>
Junio C Hamano9d971152012-12-19 00:43:111763</div>
Junio C Hamano7bd050f2011-09-22 06:32:221764<div id="footnotes"><hr /></div>
Junio C Hamano1a4e8412005-12-27 08:17:231765<div id="footer">
1766<div id="footer-text">
Junio C Hamano0241d052013-08-30 23:52:171767Last updated 2013-08-30 16:51:59 PDT
Junio C Hamano1a4e8412005-12-27 08:17:231768</div>
1769</div>
1770</body>
1771</html>