blob: 27c17176d77536ef8ae6d1bedf3d8c863fb2a1ae [file] [log] [blame]
Junio C Hamano944ce252018-05-30 22:25:261<?xml version="1.0" encoding="UTF-8"?>
Junio C Hamanof2b74942012-11-20 21:06:262<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
3 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
5<head>
Junio C Hamano9d971152012-12-19 00:43:116<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
Junio C Hamanoa85030a2022-07-27 16:48:217<meta name="generator" content="AsciiDoc 10.2.0" />
Junio C Hamano076ffcc2013-02-06 05:13:218<title>Git index format</title>
Junio C Hamanof2b74942012-11-20 21:06:269<style type="text/css">
Junio C Hamano9d971152012-12-19 00:43:1110/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
11
12/* Default font. */
13body {
14 font-family: Georgia,serif;
15}
16
17/* Title font. */
18h1, h2, h3, h4, h5, h6,
19div.title, caption.title,
20thead, p.table.header,
21#toctitle,
22#author, #revnumber, #revdate, #revremark,
23#footer {
24 font-family: Arial,Helvetica,sans-serif;
Junio C Hamanof2b74942012-11-20 21:06:2625}
26
27body {
28 margin: 1em 5% 1em 5%;
29}
30
31a {
32 color: blue;
33 text-decoration: underline;
34}
35a:visited {
36 color: fuchsia;
37}
38
39em {
40 font-style: italic;
41 color: navy;
42}
43
44strong {
45 font-weight: bold;
46 color: #083194;
47}
48
Junio C Hamanof2b74942012-11-20 21:06:2649h1, h2, h3, h4, h5, h6 {
50 color: #527bbd;
Junio C Hamanof2b74942012-11-20 21:06:2651 margin-top: 1.2em;
52 margin-bottom: 0.5em;
53 line-height: 1.3;
54}
55
56h1, h2, h3 {
57 border-bottom: 2px solid silver;
58}
59h2 {
60 padding-top: 0.5em;
61}
62h3 {
63 float: left;
64}
65h3 + * {
66 clear: left;
67}
Junio C Hamano9d971152012-12-19 00:43:1168h5 {
69 font-size: 1.0em;
70}
Junio C Hamanof2b74942012-11-20 21:06:2671
72div.sectionbody {
Junio C Hamanof2b74942012-11-20 21:06:2673 margin-left: 0;
74}
75
76hr {
77 border: 1px solid silver;
78}
79
80p {
81 margin-top: 0.5em;
82 margin-bottom: 0.5em;
83}
84
85ul, ol, li > p {
86 margin-top: 0;
87}
Junio C Hamano9d971152012-12-19 00:43:1188ul > li { color: #aaa; }
89ul > li > * { color: black; }
Junio C Hamanof2b74942012-11-20 21:06:2690
Junio C Hamanoc14e6ad2014-10-31 20:25:5391.monospaced, code, pre {
92 font-family: "Courier New", Courier, monospace;
93 font-size: inherit;
94 color: navy;
Junio C Hamanof2b74942012-11-20 21:06:2695 padding: 0;
96 margin: 0;
97}
Junio C Hamanoc14e6ad2014-10-31 20:25:5398pre {
99 white-space: pre-wrap;
100}
Junio C Hamanof2b74942012-11-20 21:06:26101
Junio C Hamano9d971152012-12-19 00:43:11102#author {
Junio C Hamanof2b74942012-11-20 21:06:26103 color: #527bbd;
Junio C Hamanof2b74942012-11-20 21:06:26104 font-weight: bold;
105 font-size: 1.1em;
106}
Junio C Hamano9d971152012-12-19 00:43:11107#email {
Junio C Hamanof2b74942012-11-20 21:06:26108}
Junio C Hamano9d971152012-12-19 00:43:11109#revnumber, #revdate, #revremark {
Junio C Hamanof2b74942012-11-20 21:06:26110}
111
Junio C Hamano9d971152012-12-19 00:43:11112#footer {
Junio C Hamanof2b74942012-11-20 21:06:26113 font-size: small;
114 border-top: 2px solid silver;
115 padding-top: 0.5em;
116 margin-top: 4.0em;
117}
Junio C Hamano9d971152012-12-19 00:43:11118#footer-text {
Junio C Hamanof2b74942012-11-20 21:06:26119 float: left;
120 padding-bottom: 0.5em;
121}
Junio C Hamano9d971152012-12-19 00:43:11122#footer-badges {
Junio C Hamanof2b74942012-11-20 21:06:26123 float: right;
124 padding-bottom: 0.5em;
125}
126
Junio C Hamano9d971152012-12-19 00:43:11127#preamble {
Junio C Hamanof2b74942012-11-20 21:06:26128 margin-top: 1.5em;
129 margin-bottom: 1.5em;
130}
Junio C Hamano9d971152012-12-19 00:43:11131div.imageblock, div.exampleblock, div.verseblock,
Junio C Hamanof2b74942012-11-20 21:06:26132div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
133div.admonitionblock {
134 margin-top: 1.0em;
135 margin-bottom: 1.5em;
136}
137div.admonitionblock {
138 margin-top: 2.0em;
139 margin-bottom: 2.0em;
140 margin-right: 10%;
141 color: #606060;
142}
143
144div.content { /* Block element content. */
145 padding: 0;
146}
147
148/* Block element titles. */
149div.title, caption.title {
150 color: #527bbd;
Junio C Hamanof2b74942012-11-20 21:06:26151 font-weight: bold;
152 text-align: left;
153 margin-top: 1.0em;
154 margin-bottom: 0.5em;
155}
156div.title + * {
157 margin-top: 0;
158}
159
160td div.title:first-child {
161 margin-top: 0.0em;
162}
163div.content div.title:first-child {
164 margin-top: 0.0em;
165}
166div.content + div.title {
167 margin-top: 0.0em;
168}
169
170div.sidebarblock > div.content {
171 background: #ffffee;
Junio C Hamano9d971152012-12-19 00:43:11172 border: 1px solid #dddddd;
173 border-left: 4px solid #f0f0f0;
Junio C Hamanof2b74942012-11-20 21:06:26174 padding: 0.5em;
175}
176
177div.listingblock > div.content {
Junio C Hamano9d971152012-12-19 00:43:11178 border: 1px solid #dddddd;
179 border-left: 5px solid #f0f0f0;
180 background: #f8f8f8;
Junio C Hamanof2b74942012-11-20 21:06:26181 padding: 0.5em;
182}
183
184div.quoteblock, div.verseblock {
185 padding-left: 1.0em;
186 margin-left: 1.0em;
187 margin-right: 10%;
Junio C Hamano9d971152012-12-19 00:43:11188 border-left: 5px solid #f0f0f0;
189 color: #888;
Junio C Hamanof2b74942012-11-20 21:06:26190}
191
192div.quoteblock > div.attribution {
193 padding-top: 0.5em;
194 text-align: right;
195}
196
Junio C Hamano9d971152012-12-19 00:43:11197div.verseblock > pre.content {
198 font-family: inherit;
199 font-size: inherit;
Junio C Hamanof2b74942012-11-20 21:06:26200}
201div.verseblock > div.attribution {
202 padding-top: 0.75em;
203 text-align: left;
204}
205/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
206div.verseblock + div.attribution {
207 text-align: left;
208}
209
210div.admonitionblock .icon {
211 vertical-align: top;
212 font-size: 1.1em;
213 font-weight: bold;
214 text-decoration: underline;
215 color: #527bbd;
216 padding-right: 0.5em;
217}
218div.admonitionblock td.content {
219 padding-left: 0.5em;
220 border-left: 3px solid #dddddd;
221}
222
223div.exampleblock > div.content {
224 border-left: 3px solid #dddddd;
225 padding-left: 0.5em;
226}
227
228div.imageblock div.content { padding-left: 0; }
Junio C Hamanoc14e6ad2014-10-31 20:25:53229span.image img { border-style: none; vertical-align: text-bottom; }
Junio C Hamanof2b74942012-11-20 21:06:26230a.image:visited { color: white; }
231
232dl {
233 margin-top: 0.8em;
234 margin-bottom: 0.8em;
235}
236dt {
237 margin-top: 0.5em;
238 margin-bottom: 0;
239 font-style: normal;
240 color: navy;
241}
242dd > *:first-child {
243 margin-top: 0.1em;
244}
245
246ul, ol {
247 list-style-position: outside;
248}
249ol.arabic {
250 list-style-type: decimal;
251}
252ol.loweralpha {
253 list-style-type: lower-alpha;
254}
255ol.upperalpha {
256 list-style-type: upper-alpha;
257}
258ol.lowerroman {
259 list-style-type: lower-roman;
260}
261ol.upperroman {
262 list-style-type: upper-roman;
263}
264
265div.compact ul, div.compact ol,
266div.compact p, div.compact p,
267div.compact div, div.compact div {
268 margin-top: 0.1em;
269 margin-bottom: 0.1em;
270}
271
Junio C Hamanof2b74942012-11-20 21:06:26272tfoot {
273 font-weight: bold;
274}
275td > div.verse {
276 white-space: pre;
277}
Junio C Hamanof2b74942012-11-20 21:06:26278
279div.hdlist {
280 margin-top: 0.8em;
281 margin-bottom: 0.8em;
282}
283div.hdlist tr {
284 padding-bottom: 15px;
285}
286dt.hdlist1.strong, td.hdlist1.strong {
287 font-weight: bold;
288}
289td.hdlist1 {
290 vertical-align: top;
291 font-style: normal;
292 padding-right: 0.8em;
293 color: navy;
294}
295td.hdlist2 {
296 vertical-align: top;
297}
298div.hdlist.compact tr {
299 margin: 0;
300 padding-bottom: 0;
301}
302
303.comment {
304 background: yellow;
305}
306
307.footnote, .footnoteref {
308 font-size: 0.8em;
309}
310
311span.footnote, span.footnoteref {
312 vertical-align: super;
313}
314
315#footnotes {
316 margin: 20px 0 20px 0;
317 padding: 7px 0 0 0;
318}
319
320#footnotes div.footnote {
321 margin: 0 0 5px 0;
322}
323
324#footnotes hr {
325 border: none;
326 border-top: 1px solid silver;
327 height: 1px;
328 text-align: left;
329 margin-left: 0;
330 width: 20%;
331 min-width: 100px;
332}
333
Junio C Hamano9d971152012-12-19 00:43:11334div.colist td {
335 padding-right: 0.5em;
336 padding-bottom: 0.3em;
337 vertical-align: top;
338}
339div.colist td img {
340 margin-top: 0.3em;
Junio C Hamanof2b74942012-11-20 21:06:26341}
342
Junio C Hamano9d971152012-12-19 00:43:11343@media print {
344 #footer-badges { display: none; }
345}
346
347#toc {
Junio C Hamanof2b74942012-11-20 21:06:26348 margin-bottom: 2.5em;
349}
350
Junio C Hamano9d971152012-12-19 00:43:11351#toctitle {
Junio C Hamanof2b74942012-11-20 21:06:26352 color: #527bbd;
Junio C Hamanof2b74942012-11-20 21:06:26353 font-size: 1.1em;
354 font-weight: bold;
355 margin-top: 1.0em;
356 margin-bottom: 0.1em;
357}
358
Junio C Hamanoc14e6ad2014-10-31 20:25:53359div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
Junio C Hamanof2b74942012-11-20 21:06:26360 margin-top: 0;
361 margin-bottom: 0;
362}
363div.toclevel2 {
364 margin-left: 2em;
365 font-size: 0.9em;
366}
367div.toclevel3 {
368 margin-left: 4em;
369 font-size: 0.9em;
370}
371div.toclevel4 {
372 margin-left: 6em;
373 font-size: 0.9em;
374}
Junio C Hamanof2b74942012-11-20 21:06:26375
Junio C Hamano9d971152012-12-19 00:43:11376span.aqua { color: aqua; }
377span.black { color: black; }
378span.blue { color: blue; }
379span.fuchsia { color: fuchsia; }
380span.gray { color: gray; }
381span.green { color: green; }
382span.lime { color: lime; }
383span.maroon { color: maroon; }
384span.navy { color: navy; }
385span.olive { color: olive; }
386span.purple { color: purple; }
387span.red { color: red; }
388span.silver { color: silver; }
389span.teal { color: teal; }
390span.white { color: white; }
391span.yellow { color: yellow; }
392
393span.aqua-background { background: aqua; }
394span.black-background { background: black; }
395span.blue-background { background: blue; }
396span.fuchsia-background { background: fuchsia; }
397span.gray-background { background: gray; }
398span.green-background { background: green; }
399span.lime-background { background: lime; }
400span.maroon-background { background: maroon; }
401span.navy-background { background: navy; }
402span.olive-background { background: olive; }
403span.purple-background { background: purple; }
404span.red-background { background: red; }
405span.silver-background { background: silver; }
406span.teal-background { background: teal; }
407span.white-background { background: white; }
408span.yellow-background { background: yellow; }
409
410span.big { font-size: 2em; }
411span.small { font-size: 0.6em; }
412
413span.underline { text-decoration: underline; }
414span.overline { text-decoration: overline; }
415span.line-through { text-decoration: line-through; }
416
Junio C Hamanoc14e6ad2014-10-31 20:25:53417div.unbreakable { page-break-inside: avoid; }
418
Junio C Hamano9d971152012-12-19 00:43:11419
420/*
421 * xhtml11 specific
422 *
423 * */
424
425div.tableblock {
426 margin-top: 1.0em;
427 margin-bottom: 1.5em;
Junio C Hamanof2b74942012-11-20 21:06:26428}
Junio C Hamano9d971152012-12-19 00:43:11429div.tableblock > table {
430 border: 3px solid #527bbd;
431}
432thead, p.table.header {
Junio C Hamanof2b74942012-11-20 21:06:26433 font-weight: bold;
Junio C Hamano9d971152012-12-19 00:43:11434 color: #527bbd;
435}
436p.table {
437 margin-top: 0;
438}
Junio C Hamano725b0da2020-01-22 22:02:40439/* Because the table frame attribute is overridden by CSS in most browsers. */
Junio C Hamano9d971152012-12-19 00:43:11440div.tableblock > table[frame="void"] {
441 border-style: none;
442}
443div.tableblock > table[frame="hsides"] {
444 border-left-style: none;
445 border-right-style: none;
446}
447div.tableblock > table[frame="vsides"] {
448 border-top-style: none;
449 border-bottom-style: none;
Junio C Hamanof2b74942012-11-20 21:06:26450}
451
Junio C Hamano9d971152012-12-19 00:43:11452
453/*
454 * html5 specific
455 *
456 * */
457
458table.tableblock {
459 margin-top: 1.0em;
460 margin-bottom: 1.5em;
461}
462thead, p.tableblock.header {
463 font-weight: bold;
464 color: #527bbd;
465}
466p.tableblock {
467 margin-top: 0;
468}
469table.tableblock {
470 border-width: 3px;
471 border-spacing: 0px;
472 border-style: solid;
473 border-color: #527bbd;
474 border-collapse: collapse;
475}
476th.tableblock, td.tableblock {
477 border-width: 1px;
478 padding: 4px;
479 border-style: solid;
480 border-color: #527bbd;
Junio C Hamanof2b74942012-11-20 21:06:26481}
482
Junio C Hamano9d971152012-12-19 00:43:11483table.tableblock.frame-topbot {
484 border-left-style: hidden;
485 border-right-style: hidden;
486}
487table.tableblock.frame-sides {
488 border-top-style: hidden;
489 border-bottom-style: hidden;
490}
491table.tableblock.frame-none {
492 border-style: hidden;
493}
494
495th.tableblock.halign-left, td.tableblock.halign-left {
496 text-align: left;
497}
498th.tableblock.halign-center, td.tableblock.halign-center {
499 text-align: center;
500}
501th.tableblock.halign-right, td.tableblock.halign-right {
Junio C Hamanof2b74942012-11-20 21:06:26502 text-align: right;
503}
504
Junio C Hamano9d971152012-12-19 00:43:11505th.tableblock.valign-top, td.tableblock.valign-top {
506 vertical-align: top;
Junio C Hamanof2b74942012-11-20 21:06:26507}
Junio C Hamano9d971152012-12-19 00:43:11508th.tableblock.valign-middle, td.tableblock.valign-middle {
509 vertical-align: middle;
510}
511th.tableblock.valign-bottom, td.tableblock.valign-bottom {
512 vertical-align: bottom;
Junio C Hamanof2b74942012-11-20 21:06:26513}
514
Junio C Hamano9d971152012-12-19 00:43:11515
516/*
517 * manpage specific
518 *
519 * */
520
521body.manpage h1 {
522 padding-top: 0.5em;
523 padding-bottom: 0.5em;
524 border-top: 2px solid silver;
525 border-bottom: 2px solid silver;
526}
527body.manpage h2 {
528 border-style: none;
529}
530body.manpage div.sectionbody {
531 margin-left: 3em;
Junio C Hamanof2b74942012-11-20 21:06:26532}
533
Junio C Hamano9d971152012-12-19 00:43:11534@media print {
535 body.manpage div#toc { display: none; }
536}
Junio C Hamanoc14e6ad2014-10-31 20:25:53537
538
Junio C Hamanof2b74942012-11-20 21:06:26539</style>
540<script type="text/javascript">
541/*<![CDATA[*/
Junio C Hamano2b153182021-12-15 21:00:31542var asciidoc = { // Namespace.
543
544/////////////////////////////////////////////////////////////////////
545// Table Of Contents generator
546/////////////////////////////////////////////////////////////////////
547
548/* Author: Mihai Bazon, September 2002
549 * http://students.infoiasi.ro/~mishoo
550 *
551 * Table Of Content generator
552 * Version: 0.4
553 *
554 * Feel free to use this script under the terms of the GNU General Public
555 * License, as long as you do not remove or alter this notice.
556 */
557
558 /* modified by Troy D. Hanson, September 2006. License: GPL */
559 /* modified by Stuart Rackham, 2006, 2009. License: GPL */
560
561// toclevels = 1..4.
562toc: function (toclevels) {
563
564 function getText(el) {
565 var text = "";
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
568 text += i.data;
569 else if (i.firstChild != null)
570 text += getText(i);
571 }
572 return text;
573 }
574
575 function TocEntry(el, text, toclevel) {
576 this.element = el;
577 this.text = text;
578 this.toclevel = toclevel;
579 }
580
581 function tocEntries(el, toclevels) {
582 var result = new Array;
583 var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
584 // Function that scans the DOM tree for header elements (the DOM2
585 // nodeIterator API would be a better technique but not supported by all
586 // browsers).
587 var iterate = function (el) {
588 for (var i = el.firstChild; i != null; i = i.nextSibling) {
589 if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
590 var mo = re.exec(i.tagName);
591 if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
592 result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
593 }
594 iterate(i);
595 }
596 }
597 }
598 iterate(el);
599 return result;
600 }
601
602 var toc = document.getElementById("toc");
603 if (!toc) {
604 return;
605 }
606
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
609 var i;
610 for (i = 0; i < toc.childNodes.length; i++) {
611 var entry = toc.childNodes[i];
612 if (entry.nodeName.toLowerCase() == 'div'
613 && entry.getAttribute("class")
614 && entry.getAttribute("class").match(/^toclevel/))
615 tocEntriesToRemove.push(entry);
616 }
617 for (i = 0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
619 }
620
621 // Rebuild TOC entries.
622 var entries = tocEntries(document.getElementById("content"), toclevels);
623 for (var i = 0; i < entries.length; ++i) {
624 var entry = entries[i];
625 if (entry.element.id == "")
626 entry.element.id = "_toc_" + i;
627 var a = document.createElement("a");
628 a.href = "#" + entry.element.id;
629 a.appendChild(document.createTextNode(entry.text));
630 var div = document.createElement("div");
631 div.appendChild(a);
632 div.className = "toclevel" + entry.toclevel;
633 toc.appendChild(div);
634 }
635 if (entries.length == 0)
636 toc.parentNode.removeChild(toc);
637},
638
639
640/////////////////////////////////////////////////////////////////////
641// Footnotes generator
642/////////////////////////////////////////////////////////////////////
643
644/* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
646 */
647
648footnotes: function () {
649 // Delete existing footnote entries in case we're reloading the footnodes.
650 var i;
651 var noteholder = document.getElementById("footnotes");
652 if (!noteholder) {
653 return;
654 }
655 var entriesToRemove = [];
656 for (i = 0; i < noteholder.childNodes.length; i++) {
657 var entry = noteholder.childNodes[i];
658 if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
659 entriesToRemove.push(entry);
660 }
661 for (i = 0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
663 }
664
665 // Rebuild footnote entries.
666 var cont = document.getElementById("content");
667 var spans = cont.getElementsByTagName("span");
668 var refs = {};
669 var n = 0;
670 for (i=0; i<spans.length; i++) {
671 if (spans[i].className == "footnote") {
672 n++;
673 var note = spans[i].getAttribute("data-note");
674 if (!note) {
675 // Use [\s\S] in place of . so multi-line matches work.
676 // Because JavaScript has no s (dotall) regex flag.
677 note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
678 spans[i].innerHTML =
679 "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
680 "' title='View footnote' class='footnote'>" + n + "</a>]";
681 spans[i].setAttribute("data-note", note);
682 }
683 noteholder.innerHTML +=
684 "<div class='footnote' id='_footnote_" + n + "'>" +
685 "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
686 n + "</a>. " + note + "</div>";
687 var id =spans[i].getAttribute("id");
688 if (id != null) refs["#"+id] = n;
689 }
690 }
691 if (n == 0)
692 noteholder.parentNode.removeChild(noteholder);
693 else {
694 // Process footnoterefs.
695 for (i=0; i<spans.length; i++) {
696 if (spans[i].className == "footnoteref") {
697 var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
698 href = href.match(/#.*/)[0]; // Because IE return full URL.
699 n = refs[href];
700 spans[i].innerHTML =
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n + "</a>]";
703 }
704 }
705 }
706},
707
708install: function(toclevels) {
709 var timerId;
710
711 function reinstall() {
712 asciidoc.footnotes();
713 if (toclevels) {
714 asciidoc.toc(toclevels);
715 }
716 }
717
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
720 reinstall();
721 }
722
723 timerId = setInterval(reinstall, 500);
724 if (document.addEventListener)
725 document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
726 else
727 window.onload = reinstallAndRemoveTimer;
728}
729
730}
Junio C Hamano9d971152012-12-19 00:43:11731asciidoc.install();
Junio C Hamanof2b74942012-11-20 21:06:26732/*]]>*/
733</script>
734</head>
Junio C Hamano9d971152012-12-19 00:43:11735<body class="article">
Junio C Hamanof2b74942012-11-20 21:06:26736<div id="header">
Junio C Hamano076ffcc2013-02-06 05:13:21737<h1>Git index format</h1>
Junio C Hamanof2b74942012-11-20 21:06:26738</div>
739<div id="content">
Junio C Hamano9d971152012-12-19 00:43:11740<div class="sect1">
Junio C Hamano076ffcc2013-02-06 05:13:21741<h2 id="_the_git_index_file_has_the_following_format">The Git index file has the following format</h2>
Junio C Hamanof2b74942012-11-20 21:06:26742<div class="sectionbody">
743<div class="literalblock">
744<div class="content">
Junio C Hamano779537c2020-08-19 23:48:51745<pre><code>All binary numbers are in network byte order.
746In a repository using the traditional SHA-1, checksums and object IDs
747(object names) mentioned below are all computed using SHA-1. Similarly,
748in SHA-256 repositories, these values are computed using SHA-256.
749Version 2 is described here unless stated otherwise.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26750</div></div>
751<div class="ulist"><ul>
752<li>
753<p>
754A 12-byte header consisting of
755</p>
756<div class="literalblock">
757<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53758<pre><code>4-byte signature:
759 The signature is { 'D', 'I', 'R', 'C' } (stands for "dircache")</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26760</div></div>
761<div class="literalblock">
762<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53763<pre><code>4-byte version number:
764 The current supported versions are 2, 3 and 4.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26765</div></div>
766<div class="literalblock">
767<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53768<pre><code>32-bit number of index entries.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26769</div></div>
770</li>
771<li>
772<p>
773A number of sorted index entries (see below).
774</p>
775</li>
776<li>
777<p>
778Extensions
779</p>
780<div class="literalblock">
781<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53782<pre><code>Extensions are identified by signature. Optional extensions can
783be ignored if Git does not understand them.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26784</div></div>
785<div class="literalblock">
786<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53787<pre><code>4-byte extension signature. If the first byte is 'A'..'Z' the
788extension is optional and can be ignored.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26789</div></div>
790<div class="literalblock">
791<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53792<pre><code>32-bit size of the extension</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26793</div></div>
794<div class="literalblock">
795<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53796<pre><code>Extension data</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26797</div></div>
798</li>
799<li>
800<p>
Junio C Hamano779537c2020-08-19 23:48:51801Hash checksum over the content of the index file before this checksum.
Junio C Hamanof2b74942012-11-20 21:06:26802</p>
803</li>
804</ul></div>
805</div>
Junio C Hamano9d971152012-12-19 00:43:11806</div>
807<div class="sect1">
Junio C Hamanof2b74942012-11-20 21:06:26808<h2 id="_index_entry">Index entry</h2>
809<div class="sectionbody">
810<div class="literalblock">
811<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53812<pre><code>Index entries are sorted in ascending order on the name field,
Junio C Hamanof2b74942012-11-20 21:06:26813interpreted as a string of unsigned bytes (i.e. memcmp() order, no
814localization, no special casing of directory separator '/'). Entries
Junio C Hamanoc14e6ad2014-10-31 20:25:53815with the same name are sorted by their stage field.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26816</div></div>
817<div class="literalblock">
818<div class="content">
Junio C Hamano4078a552021-04-30 06:08:10819<pre><code>An index entry typically represents a file. However, if sparse-checkout
820is enabled in cone mode (`core.sparseCheckoutCone` is enabled) and the
821`extensions.sparseIndex` extension is enabled, then the index may
822contain entries for directories outside of the sparse-checkout definition.
823These entries have mode `040000`, include the `SKIP_WORKTREE` bit, and
824the path ends in a directory separator.</code></pre>
825</div></div>
826<div class="literalblock">
827<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53828<pre><code>32-bit ctime seconds, the last time a file's metadata changed
829 this is stat(2) data</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26830</div></div>
831<div class="literalblock">
832<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53833<pre><code>32-bit ctime nanosecond fractions
834 this is stat(2) data</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26835</div></div>
836<div class="literalblock">
837<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53838<pre><code>32-bit mtime seconds, the last time a file's data changed
839 this is stat(2) data</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26840</div></div>
841<div class="literalblock">
842<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53843<pre><code>32-bit mtime nanosecond fractions
844 this is stat(2) data</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26845</div></div>
846<div class="literalblock">
847<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53848<pre><code>32-bit dev
849 this is stat(2) data</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26850</div></div>
851<div class="literalblock">
852<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53853<pre><code>32-bit ino
854 this is stat(2) data</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26855</div></div>
856<div class="literalblock">
857<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53858<pre><code>32-bit mode, split into (high to low bits)</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26859</div></div>
860<div class="literalblock">
861<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53862<pre><code>4-bit object type
Junio C Hamanof2b74942012-11-20 21:06:26863 valid values in binary are 1000 (regular file), 1010 (symbolic link)
Junio C Hamanoc14e6ad2014-10-31 20:25:53864 and 1110 (gitlink)</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26865</div></div>
866<div class="literalblock">
867<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53868<pre><code>3-bit unused</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26869</div></div>
870<div class="literalblock">
871<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53872<pre><code>9-bit unix permission. Only 0755 and 0644 are valid for regular files.
873Symbolic links and gitlinks have value 0 in this field.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26874</div></div>
875<div class="literalblock">
876<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53877<pre><code>32-bit uid
878 this is stat(2) data</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26879</div></div>
880<div class="literalblock">
881<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53882<pre><code>32-bit gid
883 this is stat(2) data</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26884</div></div>
885<div class="literalblock">
886<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53887<pre><code>32-bit file size
888 This is the on-disk size from stat(2), truncated to 32-bit.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26889</div></div>
890<div class="literalblock">
891<div class="content">
Junio C Hamano779537c2020-08-19 23:48:51892<pre><code>Object name for the represented object</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26893</div></div>
894<div class="literalblock">
895<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53896<pre><code>A 16-bit 'flags' field split into (high to low bits)</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26897</div></div>
898<div class="literalblock">
899<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53900<pre><code>1-bit assume-valid flag</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26901</div></div>
902<div class="literalblock">
903<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53904<pre><code>1-bit extended flag (must be zero in version 2)</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26905</div></div>
906<div class="literalblock">
907<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53908<pre><code>2-bit stage (during merge)</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26909</div></div>
910<div class="literalblock">
911<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53912<pre><code>12-bit name length if the length is less than 0xFFF; otherwise 0xFFF
913is stored in this field.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26914</div></div>
915<div class="literalblock">
916<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53917<pre><code>(Version 3 or later) A 16-bit field, only applicable if the
918"extended flag" above is 1, split into (high to low bits).</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26919</div></div>
920<div class="literalblock">
921<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53922<pre><code>1-bit reserved for future</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26923</div></div>
924<div class="literalblock">
925<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53926<pre><code>1-bit skip-worktree flag (used by sparse checkout)</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26927</div></div>
928<div class="literalblock">
929<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53930<pre><code>1-bit intent-to-add flag (used by "git add -N")</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26931</div></div>
932<div class="literalblock">
933<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53934<pre><code>13-bit unused, must be zero</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26935</div></div>
936<div class="literalblock">
937<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53938<pre><code>Entry path name (variable length) relative to top level directory
Junio C Hamanof2b74942012-11-20 21:06:26939 (without leading slash). '/' is used as path separator. The special
940 path components ".", ".." and ".git" (without quotes) are disallowed.
Junio C Hamanoc14e6ad2014-10-31 20:25:53941 Trailing slash is also disallowed.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26942</div></div>
943<div class="literalblock">
944<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53945<pre><code>The exact encoding is undefined, but the '.' and '/' characters
Junio C Hamanof2b74942012-11-20 21:06:26946are encoded in 7-bit ASCII and the encoding cannot contain a NUL
Junio C Hamanoc14e6ad2014-10-31 20:25:53947byte (iow, this is a UNIX pathname).</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26948</div></div>
949<div class="literalblock">
950<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53951<pre><code>(Version 4) In version 4, the entry path name is prefix-compressed
Junio C Hamanof2b74942012-11-20 21:06:26952 relative to the path name for the previous entry (the very first
953 entry is encoded as if the path name for the previous entry is an
954 empty string). At the beginning of an entry, an integer N in the
955 variable width encoding (the same encoding as the offset is encoded
956 for OFS_DELTA pack entries; see pack-format.txt) is stored, followed
957 by a NUL-terminated string S. Removing N bytes from the end of the
958 path name for the previous entry, and replacing it with the string S
Junio C Hamanoc14e6ad2014-10-31 20:25:53959 yields the path name for this entry.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26960</div></div>
961<div class="literalblock">
962<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53963<pre><code>1-8 nul bytes as necessary to pad the entry to a multiple of eight bytes
964while keeping the name NUL-terminated.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26965</div></div>
966<div class="literalblock">
967<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53968<pre><code>(Version 4) In version 4, the padding after the pathname does not
969exist.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26970</div></div>
Junio C Hamano6f0c9442014-07-16 21:51:32971<div class="literalblock">
972<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:53973<pre><code>Interpretation of index entries in split index mode is completely
974different. See below for details.</code></pre>
Junio C Hamano6f0c9442014-07-16 21:51:32975</div></div>
Junio C Hamanof2b74942012-11-20 21:06:26976</div>
Junio C Hamano9d971152012-12-19 00:43:11977</div>
978<div class="sect1">
Junio C Hamanof2b74942012-11-20 21:06:26979<h2 id="_extensions">Extensions</h2>
980<div class="sectionbody">
Junio C Hamano9d971152012-12-19 00:43:11981<div class="sect2">
Junio C Hamano8c860d62021-02-06 01:37:47982<h3 id="_cache_tree">Cache tree</h3>
Junio C Hamanof2b74942012-11-20 21:06:26983<div class="literalblock">
984<div class="content">
Junio C Hamano8c860d62021-02-06 01:37:47985<pre><code>Since the index does not record entries for directories, the cache
986entries cannot describe tree objects that already exist in the object
987database for regions of the index that are unchanged from an existing
988commit. The cache tree extension stores a recursive tree structure that
989describes the trees that already exist and completely match sections of
990the cache entries. This speeds up tree object generation from the index
991for a new commit by only computing the trees that are "new" to that
992commit. It also assists when comparing the index to another tree, such
993as `HEAD^{tree}`, since sections of the index can be skipped when a tree
994comparison demonstrates equality.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:26995</div></div>
996<div class="literalblock">
997<div class="content">
Junio C Hamano8c860d62021-02-06 01:37:47998<pre><code>The recursive tree structure uses nodes that store a number of cache
999entries, a list of subnodes, and an object ID (OID). The OID references
1000the existing tree for that node, if it is known to exist. The subnodes
1001correspond to subdirectories that themselves have cache tree nodes. The
1002number of cache entries corresponds to the number of cache entries in
1003the index that describe paths within that tree's directory.</code></pre>
1004</div></div>
1005<div class="literalblock">
1006<div class="content">
1007<pre><code>The extension tracks the full directory structure in the cache tree
1008extension, but this is generally smaller than the full cache entry list.</code></pre>
1009</div></div>
1010<div class="literalblock">
1011<div class="content">
1012<pre><code>When a path is updated in index, Git invalidates all nodes of the
1013recursive cache tree corresponding to the parent directories of that
1014path. We store these tree nodes as being "invalid" by using "-1" as the
1015number of cache entries. Invalid nodes still store a span of index
1016entries, allowing Git to focus its efforts when reconstructing a full
1017cache tree.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261018</div></div>
1019<div class="literalblock">
1020<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531021<pre><code>The signature for this extension is { 'T', 'R', 'E', 'E' }.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261022</div></div>
1023<div class="literalblock">
1024<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531025<pre><code>A series of entries fill the entire extension; each of which
1026consists of:</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261027</div></div>
1028<div class="ulist"><ul>
1029<li>
1030<p>
1031NUL-terminated path component (relative to its parent directory);
1032</p>
1033</li>
1034<li>
1035<p>
1036ASCII decimal number of entries in the index that is covered by the
1037 tree this entry represents (entry_count);
1038</p>
1039</li>
1040<li>
1041<p>
1042A space (ASCII 32);
1043</p>
1044</li>
1045<li>
1046<p>
1047ASCII decimal number that represents the number of subtrees this
1048 tree has;
1049</p>
1050</li>
1051<li>
1052<p>
1053A newline (ASCII 10); and
1054</p>
1055</li>
1056<li>
1057<p>
Junio C Hamano779537c2020-08-19 23:48:511058Object name for the object that would result from writing this span
1059 of index as a tree.
Junio C Hamanof2b74942012-11-20 21:06:261060</p>
1061<div class="literalblock">
1062<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531063<pre><code>An entry can be in an invalidated state and is represented by having
Junio C Hamanodb81b992012-12-21 23:49:121064a negative number in the entry_count field. In this case, there is no
1065object name and the next entry starts immediately after the newline.
Junio C Hamanoc14e6ad2014-10-31 20:25:531066When writing an invalid entry, -1 should always be used as entry_count.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261067</div></div>
1068<div class="literalblock">
1069<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531070<pre><code>The entries are written out in the top-down, depth-first order. The
Junio C Hamanof2b74942012-11-20 21:06:261071first entry represents the root level of the repository, followed by the
Junio C Hamanoee615802015-10-29 21:45:261072first subtree--let's call this A--of the root level (with its name
Junio C Hamanof2b74942012-11-20 21:06:261073relative to the root level), followed by the first subtree of A (with
Junio C Hamano8c860d62021-02-06 01:37:471074its name relative to A), and so on. The specified number of subtrees
1075indicates when the current level of the recursive stack is complete.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261076</div></div>
1077</li>
1078</ul></div>
Junio C Hamano9d971152012-12-19 00:43:111079</div>
1080<div class="sect2">
1081<h3 id="_resolve_undo">Resolve undo</h3>
Junio C Hamanof2b74942012-11-20 21:06:261082<div class="literalblock">
1083<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531084<pre><code>A conflict is represented in the index as a set of higher stage entries.
Junio C Hamanof2b74942012-11-20 21:06:261085When a conflict is resolved (e.g. with "git add path"), these higher
Junio C Hamanod7fccbf2013-07-25 03:24:571086stage entries will be removed and a stage-0 entry with proper resolution
Junio C Hamanoc14e6ad2014-10-31 20:25:531087is added.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261088</div></div>
1089<div class="literalblock">
1090<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531091<pre><code>When these higher stage entries are removed, they are saved in the
Junio C Hamanof2b74942012-11-20 21:06:261092resolve undo extension, so that conflicts can be recreated (e.g. with
1093"git checkout -m"), in case users want to redo a conflict resolution
Junio C Hamanoc14e6ad2014-10-31 20:25:531094from scratch.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261095</div></div>
1096<div class="literalblock">
1097<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531098<pre><code>The signature for this extension is { 'R', 'E', 'U', 'C' }.</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261099</div></div>
1100<div class="literalblock">
1101<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531102<pre><code>A series of entries fill the entire extension; each of which
1103consists of:</code></pre>
Junio C Hamanof2b74942012-11-20 21:06:261104</div></div>
1105<div class="ulist"><ul>
1106<li>
1107<p>
1108NUL-terminated pathname the entry describes (relative to the root of
1109 the repository, i.e. full pathname);
1110</p>
1111</li>
1112<li>
1113<p>
1114Three NUL-terminated ASCII octal numbers, entry mode of entries in
1115 stage 1 to 3 (a missing stage is represented by "0" in this field);
1116 and
1117</p>
1118</li>
1119<li>
1120<p>
Junio C Hamano779537c2020-08-19 23:48:511121At most three object names of the entry in stages from 1 to 3
Junio C Hamanof2b74942012-11-20 21:06:261122 (nothing is written for a missing stage).
1123</p>
1124</li>
1125</ul></div>
1126</div>
Junio C Hamano6f0c9442014-07-16 21:51:321127<div class="sect2">
1128<h3 id="_split_index">Split index</h3>
1129<div class="literalblock">
1130<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531131<pre><code>In split index mode, the majority of index entries could be stored
Junio C Hamano6f0c9442014-07-16 21:51:321132in a separate file. This extension records the changes to be made on
Junio C Hamanoc14e6ad2014-10-31 20:25:531133top of that to produce the final index.</code></pre>
Junio C Hamano6f0c9442014-07-16 21:51:321134</div></div>
1135<div class="literalblock">
1136<div class="content">
Junio C Hamano6df93d92014-12-22 22:48:091137<pre><code>The signature for this extension is { 'l', 'i', 'n', 'k' }.</code></pre>
Junio C Hamano6f0c9442014-07-16 21:51:321138</div></div>
1139<div class="literalblock">
1140<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531141<pre><code>The extension consists of:</code></pre>
Junio C Hamano6f0c9442014-07-16 21:51:321142</div></div>
1143<div class="ulist"><ul>
1144<li>
1145<p>
Junio C Hamano779537c2020-08-19 23:48:511146Hash of the shared index file. The shared index file path
1147 is $GIT_DIR/sharedindex.&lt;hash&gt;. If all bits are zero, the
Junio C Hamano6f0c9442014-07-16 21:51:321148 index does not require a shared index file.
1149</p>
1150</li>
1151<li>
1152<p>
1153An ewah-encoded delete bitmap, each bit represents an entry in the
1154 shared index. If a bit is set, its corresponding entry in the
1155 shared index will be removed from the final index. Note, because
1156 a delete operation changes index entry positions, but we do need
1157 original positions in replace phase, it&#8217;s best to just mark
1158 entries for removal, then do a mass deletion after replacement.
1159</p>
1160</li>
1161<li>
1162<p>
1163An ewah-encoded replace bitmap, each bit represents an entry in
1164 the shared index. If a bit is set, its corresponding entry in the
1165 shared index will be replaced with an entry in this index
1166 file. All replaced entries are stored in sorted order in this
1167 index. The first "1" bit in the replace bitmap corresponds to the
1168 first index entry, the second "1" bit to the second entry and so
1169 on. Replaced entries may have empty path names to save space.
1170</p>
1171<div class="literalblock">
1172<div class="content">
Junio C Hamanoc14e6ad2014-10-31 20:25:531173<pre><code>The remaining index entries after replaced ones will be added to the
Junio C Hamanofb5ffde2014-11-04 22:38:561174final index. These added entries are also sorted by entry name then
Junio C Hamanoc14e6ad2014-10-31 20:25:531175stage.</code></pre>
Junio C Hamano6f0c9442014-07-16 21:51:321176</div></div>
1177</li>
1178</ul></div>
1179</div>
Junio C Hamanof2b74942012-11-20 21:06:261180</div>
Junio C Hamano9d971152012-12-19 00:43:111181</div>
Junio C Hamanoc4e2a202015-05-26 21:38:471182<div class="sect1">
1183<h2 id="_untracked_cache">Untracked cache</h2>
1184<div class="sectionbody">
1185<div class="literalblock">
1186<div class="content">
1187<pre><code>Untracked cache saves the untracked file list and necessary data to
1188verify the cache. The signature for this extension is { 'U', 'N',
1189'T', 'R' }.</code></pre>
1190</div></div>
1191<div class="literalblock">
1192<div class="content">
1193<pre><code>The extension starts with</code></pre>
1194</div></div>
1195<div class="ulist"><ul>
1196<li>
1197<p>
1198A sequence of NUL-terminated strings, preceded by the size of the
1199 sequence in variable width encoding. Each string describes the
1200 environment where the cache can be used.
1201</p>
1202</li>
1203<li>
1204<p>
1205Stat data of $GIT_DIR/info/exclude. See "Index entry" section from
1206 ctime field until "file size".
1207</p>
1208</li>
1209<li>
1210<p>
Junio C Hamanoa372d5b2021-02-26 01:34:371211Stat data of core.excludesFile
Junio C Hamanoc4e2a202015-05-26 21:38:471212</p>
1213</li>
1214<li>
1215<p>
121632-bit dir_flags (see struct dir_struct)
1217</p>
1218</li>
1219<li>
1220<p>
Junio C Hamano779537c2020-08-19 23:48:511221Hash of $GIT_DIR/info/exclude. A null hash means the file
Junio C Hamanoc4e2a202015-05-26 21:38:471222 does not exist.
1223</p>
1224</li>
1225<li>
1226<p>
Junio C Hamanoa372d5b2021-02-26 01:34:371227Hash of core.excludesFile. A null hash means the file does
Junio C Hamanoc4e2a202015-05-26 21:38:471228 not exist.
1229</p>
1230</li>
1231<li>
1232<p>
1233NUL-terminated string of per-dir exclude file name. This usually
1234 is ".gitignore".
1235</p>
1236</li>
1237<li>
1238<p>
1239The number of following directory blocks, variable width
1240 encoding. If this number is zero, the extension ends here with a
1241 following NUL.
1242</p>
1243</li>
1244<li>
1245<p>
1246A number of directory blocks in depth-first-search order, each
1247 consists of
1248</p>
1249</li>
1250<li>
1251<p>
1252The number of untracked entries, variable width encoding.
1253</p>
1254</li>
1255<li>
1256<p>
1257The number of sub-directory blocks, variable width encoding.
1258</p>
1259</li>
1260<li>
1261<p>
1262The directory name terminated by NUL.
1263</p>
1264</li>
1265<li>
1266<p>
Junio C Hamanob6aa12e2015-08-19 22:40:171267A number of untracked file/dir names terminated by NUL.
Junio C Hamanoc4e2a202015-05-26 21:38:471268</p>
1269</li>
1270</ul></div>
1271<div class="paragraph"><p>The remaining data of each directory block is grouped by type:</p></div>
1272<div class="ulist"><ul>
1273<li>
1274<p>
1275An ewah bitmap, the n-th bit marks whether the n-th directory has
1276 valid untracked cache entries.
1277</p>
1278</li>
1279<li>
1280<p>
1281An ewah bitmap, the n-th bit records "check-only" bit of
1282 read_directory_recursive() for the n-th directory.
1283</p>
1284</li>
1285<li>
1286<p>
Junio C Hamano779537c2020-08-19 23:48:511287An ewah bitmap, the n-th bit indicates whether hash and stat data
Junio C Hamanoc4e2a202015-05-26 21:38:471288 is valid for the n-th directory and exists in the next data.
1289</p>
1290</li>
1291<li>
1292<p>
1293An array of stat data. The n-th data corresponds with the n-th
1294 "one" bit in the previous ewah bitmap.
1295</p>
1296</li>
1297<li>
1298<p>
Junio C Hamano779537c2020-08-19 23:48:511299An array of hashes. The n-th hash corresponds with the n-th "one" bit
Junio C Hamanoc4e2a202015-05-26 21:38:471300 in the previous ewah bitmap.
1301</p>
1302</li>
1303<li>
1304<p>
1305One NUL.
1306</p>
1307</li>
1308</ul></div>
1309</div>
1310</div>
Junio C Hamanod7105602017-11-21 05:32:501311<div class="sect1">
1312<h2 id="_file_system_monitor_cache">File System Monitor cache</h2>
1313<div class="sectionbody">
1314<div class="literalblock">
1315<div class="content">
1316<pre><code>The file system monitor cache tracks files for which the core.fsmonitor
1317hook has told us about changes. The signature for this extension is
1318{ 'F', 'S', 'M', 'N' }.</code></pre>
1319</div></div>
1320<div class="literalblock">
1321<div class="content">
1322<pre><code>The extension starts with</code></pre>
1323</div></div>
1324<div class="ulist"><ul>
1325<li>
1326<p>
Junio C Hamano53d7d1e2020-12-17 23:44:21132732-bit version number: the current supported versions are 1 and 2.
Junio C Hamanod7105602017-11-21 05:32:501328</p>
1329</li>
1330<li>
1331<p>
Junio C Hamano53d7d1e2020-12-17 23:44:211332(Version 1)
1333 64-bit time: the extension data reflects all changes through the given
Junio C Hamanod7105602017-11-21 05:32:501334 time which is stored as the nanoseconds elapsed since midnight,
1335 January 1, 1970.
1336</p>
1337</li>
1338<li>
1339<p>
Junio C Hamano53d7d1e2020-12-17 23:44:211340(Version 2)
1341 A null terminated string: an opaque token defined by the file system
1342 monitor application. The extension data reflects all changes relative
1343 to that token.
1344</p>
1345</li>
1346<li>
1347<p>
Junio C Hamanod7105602017-11-21 05:32:50134832-bit bitmap size: the size of the CE_FSMONITOR_VALID bitmap.
1349</p>
1350</li>
1351<li>
1352<p>
1353An ewah bitmap, the n-th bit indicates whether the n-th index entry
1354 is not CE_FSMONITOR_VALID.
1355</p>
1356</li>
1357</ul></div>
1358</div>
1359</div>
Junio C Hamanoabe2c592018-10-19 05:42:531360<div class="sect1">
1361<h2 id="_end_of_index_entry">End of Index Entry</h2>
1362<div class="sectionbody">
1363<div class="literalblock">
1364<div class="content">
1365<pre><code>The End of Index Entry (EOIE) is used to locate the end of the variable
Junio C Hamano8ef91f32019-12-01 22:58:271366length index entries and the beginning of the extensions. Code can take
Junio C Hamanoabe2c592018-10-19 05:42:531367advantage of this to quickly locate the index extensions without having
1368to parse through all of the index entries.</code></pre>
1369</div></div>
1370<div class="literalblock">
1371<div class="content">
1372<pre><code>Because it must be able to be loaded before the variable length cache
1373entries and other index extensions, this extension must be written last.
1374The signature for this extension is { 'E', 'O', 'I', 'E' }.</code></pre>
1375</div></div>
1376<div class="literalblock">
1377<div class="content">
1378<pre><code>The extension consists of:</code></pre>
1379</div></div>
1380<div class="ulist"><ul>
1381<li>
1382<p>
138332-bit offset to the end of the index entries
1384</p>
1385</li>
1386<li>
1387<p>
Junio C Hamano779537c2020-08-19 23:48:511388Hash over the extension types and their sizes (but not
Junio C Hamanoabe2c592018-10-19 05:42:531389 their contents). E.g. if we have "TREE" extension that is N-bytes
1390 long, "REUC" extension that is M-bytes long, followed by "EOIE",
1391 then the hash would be:
1392</p>
1393<div class="literalblock">
1394<div class="content">
Junio C Hamano779537c2020-08-19 23:48:511395<pre><code>Hash("TREE" + &lt;binary representation of N&gt; +
Junio C Hamanoabe2c592018-10-19 05:42:531396 "REUC" + &lt;binary representation of M&gt;)</code></pre>
1397</div></div>
1398</li>
1399</ul></div>
1400</div>
1401</div>
1402<div class="sect1">
1403<h2 id="_index_entry_offset_table">Index Entry Offset Table</h2>
1404<div class="sectionbody">
1405<div class="literalblock">
1406<div class="content">
1407<pre><code>The Index Entry Offset Table (IEOT) is used to help address the CPU
1408cost of loading the index by enabling multi-threading the process of
1409converting cache entries from the on-disk format to the in-memory format.
1410The signature for this extension is { 'I', 'E', 'O', 'T' }.</code></pre>
1411</div></div>
1412<div class="literalblock">
1413<div class="content">
1414<pre><code>The extension consists of:</code></pre>
1415</div></div>
1416<div class="ulist"><ul>
1417<li>
1418<p>
141932-bit version (currently 1)
1420</p>
1421</li>
1422<li>
1423<p>
1424A number of index offset entries each consisting of:
1425</p>
1426</li>
1427<li>
1428<p>
Junio C Hamano8ef91f32019-12-01 22:58:27142932-bit offset from the beginning of the file to the first cache entry
Junio C Hamanoabe2c592018-10-19 05:42:531430 in this block of entries.
1431</p>
1432</li>
1433<li>
1434<p>
143532-bit count of cache entries in this block
1436</p>
1437</li>
1438</ul></div>
1439</div>
1440</div>
Junio C Hamano4078a552021-04-30 06:08:101441<div class="sect1">
1442<h2 id="_sparse_directory_entries">Sparse Directory Entries</h2>
1443<div class="sectionbody">
1444<div class="literalblock">
1445<div class="content">
1446<pre><code>When using sparse-checkout in cone mode, some entire directories within
1447the index can be summarized by pointing to a tree object instead of the
1448entire expanded list of paths within that tree. An index containing such
1449entries is a "sparse index". Index format versions 4 and less were not
1450implemented with such entries in mind. Thus, for these versions, an
1451index containing sparse directory entries will include this extension
1452with signature { 's', 'd', 'i', 'r' }. Like the split-index extension,
1453tools should avoid interacting with a sparse index unless they understand
1454this extension.</code></pre>
1455</div></div>
1456</div>
1457</div>
Junio C Hamano9d971152012-12-19 00:43:111458</div>
Junio C Hamanof2b74942012-11-20 21:06:261459<div id="footnotes"><hr /></div>
1460<div id="footer">
1461<div id="footer-text">
Junio C Hamano2ef0ba32018-01-26 23:13:531462Last updated
Junio C Hamanoa85030a2022-07-27 16:48:211463 2022-07-27 09:46:08 PDT
Junio C Hamanof2b74942012-11-20 21:06:261464</div>
1465</div>
1466</body>
1467</html>