1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!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">
6 <meta http-equiv=
"Content-Type" content=
"application/xhtml+xml; charset=UTF-8" />
7 <meta name=
"generator" content=
"AsciiDoc 10.2.0" />
8 <title>gitformat-index(
5)
</title>
9 <style type=
"text/css">
10 /* Shared CSS for AsciiDoc xhtml11 and html5 backends */
14 font-family: Georgia,serif;
18 h1, h2, h3, h4, h5, h6,
19 div.title, caption.title,
20 thead, p.table.header,
22 #author, #revnumber, #revdate, #revremark,
24 font-family: Arial,Helvetica,sans-serif;
28 margin:
1em
5%
1em
5%;
33 text-decoration: underline;
49 h1, h2, h3, h4, h5, h6 {
57 border-bottom:
2px solid silver;
77 border:
1px solid silver;
88 ul
> li { color: #aaa; }
89 ul
> li
> * { color: black; }
91 .monospaced, code, pre {
92 font-family:
"Courier New", Courier, monospace;
99 white-space: pre-wrap;
109 #revnumber, #revdate, #revremark {
114 border-top:
2px solid silver;
120 padding-bottom:
0.5em;
124 padding-bottom:
0.5em;
129 margin-bottom:
1.5em;
131 div.imageblock, div.exampleblock, div.verseblock,
132 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
133 div.admonitionblock {
135 margin-bottom:
1.5em;
137 div.admonitionblock {
139 margin-bottom:
2.0em;
144 div.content { /* Block element content. */
148 /* Block element titles. */
149 div.title, caption.title {
154 margin-bottom:
0.5em;
160 td div.title:first-child {
163 div.content div.title:first-child {
166 div.content + div.title {
170 div.sidebarblock
> div.content {
172 border:
1px solid #dddddd;
173 border-left:
4px solid #f0f0f0;
177 div.listingblock
> div.content {
178 border:
1px solid #dddddd;
179 border-left:
5px solid #f0f0f0;
184 div.quoteblock, div.verseblock {
188 border-left:
5px solid #f0f0f0;
192 div.quoteblock
> div.attribution {
197 div.verseblock
> pre.content {
198 font-family: inherit;
201 div.verseblock
> div.attribution {
205 /* DEPRECATED: Pre version
8.2.7 verse style literal block. */
206 div.verseblock + div.attribution {
210 div.admonitionblock .icon {
214 text-decoration: underline;
216 padding-right:
0.5em;
218 div.admonitionblock td.content {
220 border-left:
3px solid #dddddd;
223 div.exampleblock
> div.content {
224 border-left:
3px solid #dddddd;
228 div.imageblock div.content { padding-left:
0; }
229 span.image img { border-style: none; vertical-align: text-bottom; }
230 a.image:visited { color: white; }
234 margin-bottom:
0.8em;
247 list-style-position: outside;
250 list-style-type: decimal;
253 list-style-type: lower-alpha;
256 list-style-type: upper-alpha;
259 list-style-type: lower-roman;
262 list-style-type: upper-roman;
265 div.compact ul, div.compact ol,
266 div.compact p, div.compact p,
267 div.compact div, div.compact div {
269 margin-bottom:
0.1em;
281 margin-bottom:
0.8em;
284 padding-bottom:
15px;
286 dt.hdlist1.strong, td.hdlist1.strong {
292 padding-right:
0.8em;
298 div.hdlist.compact tr {
307 .footnote, .footnoteref {
311 span.footnote, span.footnoteref {
312 vertical-align: super;
316 margin:
20px
0 20px
0;
320 #footnotes div.footnote {
326 border-top:
1px solid silver;
335 padding-right:
0.5em;
336 padding-bottom:
0.3em;
344 #footer-badges { display: none; }
348 margin-bottom:
2.5em;
356 margin-bottom:
0.1em;
359 div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
376 span.aqua { color: aqua; }
377 span.black { color: black; }
378 span.blue { color: blue; }
379 span.fuchsia { color: fuchsia; }
380 span.gray { color: gray; }
381 span.green { color: green; }
382 span.lime { color: lime; }
383 span.maroon { color: maroon; }
384 span.navy { color: navy; }
385 span.olive { color: olive; }
386 span.purple { color: purple; }
387 span.red { color: red; }
388 span.silver { color: silver; }
389 span.teal { color: teal; }
390 span.white { color: white; }
391 span.yellow { color: yellow; }
393 span.aqua-background { background: aqua; }
394 span.black-background { background: black; }
395 span.blue-background { background: blue; }
396 span.fuchsia-background { background: fuchsia; }
397 span.gray-background { background: gray; }
398 span.green-background { background: green; }
399 span.lime-background { background: lime; }
400 span.maroon-background { background: maroon; }
401 span.navy-background { background: navy; }
402 span.olive-background { background: olive; }
403 span.purple-background { background: purple; }
404 span.red-background { background: red; }
405 span.silver-background { background: silver; }
406 span.teal-background { background: teal; }
407 span.white-background { background: white; }
408 span.yellow-background { background: yellow; }
410 span.big { font-size:
2em; }
411 span.small { font-size:
0.6em; }
413 span.underline { text-decoration: underline; }
414 span.overline { text-decoration: overline; }
415 span.line-through { text-decoration: line-through; }
417 div.unbreakable { page-break-inside: avoid; }
427 margin-bottom:
1.5em;
429 div.tableblock
> table {
430 border:
3px solid #
527bbd;
432 thead, p.table.header {
439 /* Because the table frame attribute is overridden by CSS in most browsers. */
440 div.tableblock
> table[
frame=
"void"] {
443 div.tableblock
> table[
frame=
"hsides"] {
444 border-left-style: none;
445 border-right-style: none;
447 div.tableblock
> table[
frame=
"vsides"] {
448 border-top-style: none;
449 border-bottom-style: none;
460 margin-bottom:
1.5em;
462 thead, p.tableblock.header {
473 border-color: #
527bbd;
474 border-collapse: collapse;
476 th.tableblock, td.tableblock {
480 border-color: #
527bbd;
483 table.tableblock.frame-topbot {
484 border-left-style: hidden;
485 border-right-style: hidden;
487 table.tableblock.frame-sides {
488 border-top-style: hidden;
489 border-bottom-style: hidden;
491 table.tableblock.frame-none {
492 border-style: hidden;
495 th.tableblock.halign-left, td.tableblock.halign-left {
498 th.tableblock.halign-center, td.tableblock.halign-center {
501 th.tableblock.halign-right, td.tableblock.halign-right {
505 th.tableblock.valign-top, td.tableblock.valign-top {
508 th.tableblock.valign-middle, td.tableblock.valign-middle {
509 vertical-align: middle;
511 th.tableblock.valign-bottom, td.tableblock.valign-bottom {
512 vertical-align: bottom;
523 padding-bottom:
0.5em;
524 border-top:
2px solid silver;
525 border-bottom:
2px solid silver;
530 body.manpage div.sectionbody {
535 body.manpage div#toc { display: none; }
540 <script type=
"text/javascript">
542 var asciidoc = { // Namespace.
544 /////////////////////////////////////////////////////////////////////
545 // Table Of Contents generator
546 /////////////////////////////////////////////////////////////////////
548 /* Author: Mihai Bazon, September
2002
549 * http://students.infoiasi.ro/~mishoo
551 * Table Of Content generator
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.
558 /* modified by Troy D. Hanson, September
2006. License: GPL */
559 /* modified by Stuart Rackham,
2006,
2009. License: GPL */
562 toc: function (toclevels) {
564 function getText(el) {
566 for (var i = el.firstChild; i != null; i = i.nextSibling) {
567 if (i.nodeType ==
3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
569 else if (i.firstChild != null)
575 function TocEntry(el, text, toclevel) {
578 this.toclevel = toclevel;
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
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);
602 var toc = document.getElementById(
"toc");
607 // Delete existing TOC entries in case we're reloading the TOC.
608 var tocEntriesToRemove = [];
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);
617 for (i =
0; i < tocEntriesToRemove.length; i++) {
618 toc.removeChild(tocEntriesToRemove[i]);
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");
632 div.className =
"toclevel" + entry.toclevel;
633 toc.appendChild(div);
635 if (entries.length ==
0)
636 toc.parentNode.removeChild(toc);
640 /////////////////////////////////////////////////////////////////////
641 // Footnotes generator
642 /////////////////////////////////////////////////////////////////////
644 /* Based on footnote generation code from:
645 * http://www.brandspankingnew.net/archive/
2005/
07/format_footnote.html
648 footnotes: function () {
649 // Delete existing footnote entries in case we're reloading the footnodes.
651 var noteholder = document.getElementById(
"footnotes");
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);
661 for (i =
0; i < entriesToRemove.length; i++) {
662 noteholder.removeChild(entriesToRemove[i]);
665 // Rebuild footnote entries.
666 var cont = document.getElementById(
"content");
667 var spans = cont.getElementsByTagName(
"span");
670 for (i=
0; i
<spans.length; i++) {
671 if (spans[i].className ==
"footnote") {
673 var note = spans[i].getAttribute(
"data-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];
679 "[<a id='_footnoteref_" + n +
"' href='#_footnote_" + n +
680 "' title='View footnote' class='footnote'>" + n +
"</a>]";
681 spans[i].setAttribute(
"data-note", note);
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;
692 noteholder.parentNode.removeChild(noteholder);
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.
701 "[<a href='#_footnote_" + n +
702 "' title='View footnote' class='footnote'>" + n +
"</a>]";
708 install: function(toclevels) {
711 function reinstall() {
712 asciidoc.footnotes();
714 asciidoc.toc(toclevels);
718 function reinstallAndRemoveTimer() {
719 clearInterval(timerId);
723 timerId = setInterval(reinstall,
500);
724 if (document.addEventListener)
725 document.addEventListener(
"DOMContentLoaded", reinstallAndRemoveTimer, false);
727 window.onload = reinstallAndRemoveTimer;
735 <body class=
"manpage">
738 gitformat-index(
5) Manual Page
741 <div class=
"sectionbody">
749 <h2 id=
"_synopsis">SYNOPSIS
</h2>
750 <div class=
"sectionbody">
751 <div class=
"verseblock">
752 <pre class=
"content">$GIT_DIR/index
</pre>
753 <div class=
"attribution">
758 <h2 id=
"_description">DESCRIPTION
</h2>
759 <div class=
"sectionbody">
760 <div class=
"paragraph"><p>Git index format
</p></div>
764 <h2 id=
"_the_git_index_file_has_the_following_format">The Git index file has the following format
</h2>
765 <div class=
"sectionbody">
766 <div class=
"literalblock">
767 <div class=
"content">
768 <pre><code>All binary numbers are in network byte order.
769 In a repository using the traditional SHA-
1, checksums and object IDs
770 (object names) mentioned below are all computed using SHA-
1. Similarly,
771 in SHA-
256 repositories, these values are computed using SHA-
256.
772 Version
2 is described here unless stated otherwise.
</code></pre>
774 <div class=
"ulist"><ul>
777 A
12-byte header consisting of
779 <div class=
"literalblock">
780 <div class=
"content">
781 <pre><code>4-byte signature:
782 The signature is { 'D', 'I', 'R', 'C' } (stands for
"dircache")
</code></pre>
784 <div class=
"literalblock">
785 <div class=
"content">
786 <pre><code>4-byte version number:
787 The current supported versions are
2,
3 and
4.
</code></pre>
789 <div class=
"literalblock">
790 <div class=
"content">
791 <pre><code>32-bit number of index entries.
</code></pre>
796 A number of sorted index entries (see below).
803 <div class=
"literalblock">
804 <div class=
"content">
805 <pre><code>Extensions are identified by signature. Optional extensions can
806 be ignored if Git does not understand them.
</code></pre>
808 <div class=
"literalblock">
809 <div class=
"content">
810 <pre><code>4-byte extension signature. If the first byte is 'A'..'Z' the
811 extension is optional and can be ignored.
</code></pre>
813 <div class=
"literalblock">
814 <div class=
"content">
815 <pre><code>32-bit size of the extension
</code></pre>
817 <div class=
"literalblock">
818 <div class=
"content">
819 <pre><code>Extension data
</code></pre>
824 Hash checksum over the content of the index file before this checksum.
831 <h2 id=
"_index_entry">Index entry
</h2>
832 <div class=
"sectionbody">
833 <div class=
"literalblock">
834 <div class=
"content">
835 <pre><code>Index entries are sorted in ascending order on the name field,
836 interpreted as a string of unsigned bytes (i.e. memcmp() order, no
837 localization, no special casing of directory separator '/'). Entries
838 with the same name are sorted by their stage field.
</code></pre>
840 <div class=
"literalblock">
841 <div class=
"content">
842 <pre><code>An index entry typically represents a file. However, if sparse-checkout
843 is enabled in cone mode (`core.sparseCheckoutCone` is enabled) and the
844 `extensions.sparseIndex` extension is enabled, then the index may
845 contain entries for directories outside of the sparse-checkout definition.
846 These entries have mode `
040000`, include the `SKIP_WORKTREE` bit, and
847 the path ends in a directory separator.
</code></pre>
849 <div class=
"literalblock">
850 <div class=
"content">
851 <pre><code>32-bit ctime seconds, the last time a file's metadata changed
852 this is stat(
2) data
</code></pre>
854 <div class=
"literalblock">
855 <div class=
"content">
856 <pre><code>32-bit ctime nanosecond fractions
857 this is stat(
2) data
</code></pre>
859 <div class=
"literalblock">
860 <div class=
"content">
861 <pre><code>32-bit mtime seconds, the last time a file's data changed
862 this is stat(
2) data
</code></pre>
864 <div class=
"literalblock">
865 <div class=
"content">
866 <pre><code>32-bit mtime nanosecond fractions
867 this is stat(
2) data
</code></pre>
869 <div class=
"literalblock">
870 <div class=
"content">
871 <pre><code>32-bit dev
872 this is stat(
2) data
</code></pre>
874 <div class=
"literalblock">
875 <div class=
"content">
876 <pre><code>32-bit ino
877 this is stat(
2) data
</code></pre>
879 <div class=
"literalblock">
880 <div class=
"content">
881 <pre><code>32-bit mode, split into (high to low bits)
</code></pre>
883 <div class=
"literalblock">
884 <div class=
"content">
885 <pre><code>4-bit object type
886 valid values in binary are
1000 (regular file),
1010 (symbolic link)
887 and
1110 (gitlink)
</code></pre>
889 <div class=
"literalblock">
890 <div class=
"content">
891 <pre><code>3-bit unused
</code></pre>
893 <div class=
"literalblock">
894 <div class=
"content">
895 <pre><code>9-bit unix permission. Only
0755 and
0644 are valid for regular files.
896 Symbolic links and gitlinks have value
0 in this field.
</code></pre>
898 <div class=
"literalblock">
899 <div class=
"content">
900 <pre><code>32-bit uid
901 this is stat(
2) data
</code></pre>
903 <div class=
"literalblock">
904 <div class=
"content">
905 <pre><code>32-bit gid
906 this is stat(
2) data
</code></pre>
908 <div class=
"literalblock">
909 <div class=
"content">
910 <pre><code>32-bit file size
911 This is the on-disk size from stat(
2), truncated to
32-bit.
</code></pre>
913 <div class=
"literalblock">
914 <div class=
"content">
915 <pre><code>Object name for the represented object
</code></pre>
917 <div class=
"literalblock">
918 <div class=
"content">
919 <pre><code>A
16-bit 'flags' field split into (high to low bits)
</code></pre>
921 <div class=
"literalblock">
922 <div class=
"content">
923 <pre><code>1-bit assume-valid flag
</code></pre>
925 <div class=
"literalblock">
926 <div class=
"content">
927 <pre><code>1-bit extended flag (must be zero in version
2)
</code></pre>
929 <div class=
"literalblock">
930 <div class=
"content">
931 <pre><code>2-bit stage (during merge)
</code></pre>
933 <div class=
"literalblock">
934 <div class=
"content">
935 <pre><code>12-bit name length if the length is less than
0xFFF; otherwise
0xFFF
936 is stored in this field.
</code></pre>
938 <div class=
"literalblock">
939 <div class=
"content">
940 <pre><code>(Version
3 or later) A
16-bit field, only applicable if the
941 "extended flag" above is
1, split into (high to low bits).
</code></pre>
943 <div class=
"literalblock">
944 <div class=
"content">
945 <pre><code>1-bit reserved for future
</code></pre>
947 <div class=
"literalblock">
948 <div class=
"content">
949 <pre><code>1-bit skip-worktree flag (used by sparse checkout)
</code></pre>
951 <div class=
"literalblock">
952 <div class=
"content">
953 <pre><code>1-bit intent-to-add flag (used by
"git add -N")
</code></pre>
955 <div class=
"literalblock">
956 <div class=
"content">
957 <pre><code>13-bit unused, must be zero
</code></pre>
959 <div class=
"literalblock">
960 <div class=
"content">
961 <pre><code>Entry path name (variable length) relative to top level directory
962 (without leading slash). '/' is used as path separator. The special
963 path components
".",
".." and
".git" (without quotes) are disallowed.
964 Trailing slash is also disallowed.
</code></pre>
966 <div class=
"literalblock">
967 <div class=
"content">
968 <pre><code>The exact encoding is undefined, but the '.' and '/' characters
969 are encoded in
7-bit ASCII and the encoding cannot contain a NUL
970 byte (iow, this is a UNIX pathname).
</code></pre>
972 <div class=
"literalblock">
973 <div class=
"content">
974 <pre><code>(Version
4) In version
4, the entry path name is prefix-compressed
975 relative to the path name for the previous entry (the very first
976 entry is encoded as if the path name for the previous entry is an
977 empty string). At the beginning of an entry, an integer N in the
978 variable width encoding (the same encoding as the offset is encoded
979 for OFS_DELTA pack entries; see linkgit:gitformat-pack[
5]) is stored, followed
980 by a NUL-terminated string S. Removing N bytes from the end of the
981 path name for the previous entry, and replacing it with the string S
982 yields the path name for this entry.
</code></pre>
984 <div class=
"literalblock">
985 <div class=
"content">
986 <pre><code>1-
8 nul bytes as necessary to pad the entry to a multiple of eight bytes
987 while keeping the name NUL-terminated.
</code></pre>
989 <div class=
"literalblock">
990 <div class=
"content">
991 <pre><code>(Version
4) In version
4, the padding after the pathname does not
994 <div class=
"literalblock">
995 <div class=
"content">
996 <pre><code>Interpretation of index entries in split index mode is completely
997 different. See below for details.
</code></pre>
1002 <h2 id=
"_extensions">Extensions
</h2>
1003 <div class=
"sectionbody">
1005 <h3 id=
"_cache_tree">Cache tree
</h3>
1006 <div class=
"literalblock">
1007 <div class=
"content">
1008 <pre><code>Since the index does not record entries for directories, the cache
1009 entries cannot describe tree objects that already exist in the object
1010 database for regions of the index that are unchanged from an existing
1011 commit. The cache tree extension stores a recursive tree structure that
1012 describes the trees that already exist and completely match sections of
1013 the cache entries. This speeds up tree object generation from the index
1014 for a new commit by only computing the trees that are
"new" to that
1015 commit. It also assists when comparing the index to another tree, such
1016 as `HEAD^{tree}`, since sections of the index can be skipped when a tree
1017 comparison demonstrates equality.
</code></pre>
1019 <div class=
"literalblock">
1020 <div class=
"content">
1021 <pre><code>The recursive tree structure uses nodes that store a number of cache
1022 entries, a list of subnodes, and an object ID (OID). The OID references
1023 the existing tree for that node, if it is known to exist. The subnodes
1024 correspond to subdirectories that themselves have cache tree nodes. The
1025 number of cache entries corresponds to the number of cache entries in
1026 the index that describe paths within that tree's directory.
</code></pre>
1028 <div class=
"literalblock">
1029 <div class=
"content">
1030 <pre><code>The extension tracks the full directory structure in the cache tree
1031 extension, but this is generally smaller than the full cache entry list.
</code></pre>
1033 <div class=
"literalblock">
1034 <div class=
"content">
1035 <pre><code>When a path is updated in index, Git invalidates all nodes of the
1036 recursive cache tree corresponding to the parent directories of that
1037 path. We store these tree nodes as being
"invalid" by using
"-1" as the
1038 number of cache entries. Invalid nodes still store a span of index
1039 entries, allowing Git to focus its efforts when reconstructing a full
1040 cache tree.
</code></pre>
1042 <div class=
"literalblock">
1043 <div class=
"content">
1044 <pre><code>The signature for this extension is { 'T', 'R', 'E', 'E' }.
</code></pre>
1046 <div class=
"literalblock">
1047 <div class=
"content">
1048 <pre><code>A series of entries fill the entire extension; each of which
1049 consists of:
</code></pre>
1051 <div class=
"ulist"><ul>
1054 NUL-terminated path component (relative to its parent directory);
1059 ASCII decimal number of entries in the index that is covered by the
1060 tree this entry represents (entry_count);
1070 ASCII decimal number that represents the number of subtrees this
1076 A newline (ASCII
10); and
1081 Object name for the object that would result from writing this span
1084 <div class=
"literalblock">
1085 <div class=
"content">
1086 <pre><code>An entry can be in an invalidated state and is represented by having
1087 a negative number in the entry_count field. In this case, there is no
1088 object name and the next entry starts immediately after the newline.
1089 When writing an invalid entry, -
1 should always be used as entry_count.
</code></pre>
1091 <div class=
"literalblock">
1092 <div class=
"content">
1093 <pre><code>The entries are written out in the top-down, depth-first order. The
1094 first entry represents the root level of the repository, followed by the
1095 first subtree--let's call this A--of the root level (with its name
1096 relative to the root level), followed by the first subtree of A (with
1097 its name relative to A), and so on. The specified number of subtrees
1098 indicates when the current level of the recursive stack is complete.
</code></pre>
1104 <h3 id=
"_resolve_undo">Resolve undo
</h3>
1105 <div class=
"literalblock">
1106 <div class=
"content">
1107 <pre><code>A conflict is represented in the index as a set of higher stage entries.
1108 When a conflict is resolved (e.g. with
"git add path"), these higher
1109 stage entries will be removed and a stage-
0 entry with proper resolution
1110 is added.
</code></pre>
1112 <div class=
"literalblock">
1113 <div class=
"content">
1114 <pre><code>When these higher stage entries are removed, they are saved in the
1115 resolve undo extension, so that conflicts can be recreated (e.g. with
1116 "git checkout -m"), in case users want to redo a conflict resolution
1117 from scratch.
</code></pre>
1119 <div class=
"literalblock">
1120 <div class=
"content">
1121 <pre><code>The signature for this extension is { 'R', 'E', 'U', 'C' }.
</code></pre>
1123 <div class=
"literalblock">
1124 <div class=
"content">
1125 <pre><code>A series of entries fill the entire extension; each of which
1126 consists of:
</code></pre>
1128 <div class=
"ulist"><ul>
1131 NUL-terminated pathname the entry describes (relative to the root of
1132 the repository, i.e. full pathname);
1137 Three NUL-terminated ASCII octal numbers, entry mode of entries in
1138 stage
1 to
3 (a missing stage is represented by
"0" in this field);
1144 At most three object names of the entry in stages from
1 to
3
1145 (nothing is written for a missing stage).
1151 <h3 id=
"_split_index">Split index
</h3>
1152 <div class=
"literalblock">
1153 <div class=
"content">
1154 <pre><code>In split index mode, the majority of index entries could be stored
1155 in a separate file. This extension records the changes to be made on
1156 top of that to produce the final index.
</code></pre>
1158 <div class=
"literalblock">
1159 <div class=
"content">
1160 <pre><code>The signature for this extension is { 'l', 'i', 'n', 'k' }.
</code></pre>
1162 <div class=
"literalblock">
1163 <div class=
"content">
1164 <pre><code>The extension consists of:
</code></pre>
1166 <div class=
"ulist"><ul>
1169 Hash of the shared index file. The shared index file path
1170 is $GIT_DIR/sharedindex.
<hash
>. If all bits are zero, the
1171 index does not require a shared index file.
1176 An ewah-encoded delete bitmap, each bit represents an entry in the
1177 shared index. If a bit is set, its corresponding entry in the
1178 shared index will be removed from the final index. Note, because
1179 a delete operation changes index entry positions, but we do need
1180 original positions in replace phase, it
’s best to just mark
1181 entries for removal, then do a mass deletion after replacement.
1186 An ewah-encoded replace bitmap, each bit represents an entry in
1187 the shared index. If a bit is set, its corresponding entry in the
1188 shared index will be replaced with an entry in this index
1189 file. All replaced entries are stored in sorted order in this
1190 index. The first
"1" bit in the replace bitmap corresponds to the
1191 first index entry, the second
"1" bit to the second entry and so
1192 on. Replaced entries may have empty path names to save space.
1194 <div class=
"literalblock">
1195 <div class=
"content">
1196 <pre><code>The remaining index entries after replaced ones will be added to the
1197 final index. These added entries are also sorted by entry name then
1206 <h2 id=
"_untracked_cache">Untracked cache
</h2>
1207 <div class=
"sectionbody">
1208 <div class=
"literalblock">
1209 <div class=
"content">
1210 <pre><code>Untracked cache saves the untracked file list and necessary data to
1211 verify the cache. The signature for this extension is { 'U', 'N',
1212 'T', 'R' }.
</code></pre>
1214 <div class=
"literalblock">
1215 <div class=
"content">
1216 <pre><code>The extension starts with
</code></pre>
1218 <div class=
"ulist"><ul>
1221 A sequence of NUL-terminated strings, preceded by the size of the
1222 sequence in variable width encoding. Each string describes the
1223 environment where the cache can be used.
1228 Stat data of $GIT_DIR/info/exclude. See
"Index entry" section from
1229 ctime field until
"file size".
1234 Stat data of core.excludesFile
1239 32-bit dir_flags (see struct dir_struct)
1244 Hash of $GIT_DIR/info/exclude. A null hash means the file
1250 Hash of core.excludesFile. A null hash means the file does
1256 NUL-terminated string of per-dir exclude file name. This usually
1262 The number of following directory blocks, variable width
1263 encoding. If this number is zero, the extension ends here with a
1269 A number of directory blocks in depth-first-search order, each
1275 The number of untracked entries, variable width encoding.
1280 The number of sub-directory blocks, variable width encoding.
1285 The directory name terminated by NUL.
1290 A number of untracked file/dir names terminated by NUL.
1294 <div class=
"paragraph"><p>The remaining data of each directory block is grouped by type:
</p></div>
1295 <div class=
"ulist"><ul>
1298 An ewah bitmap, the n-th bit marks whether the n-th directory has
1299 valid untracked cache entries.
1304 An ewah bitmap, the n-th bit records
"check-only" bit of
1305 read_directory_recursive() for the n-th directory.
1310 An ewah bitmap, the n-th bit indicates whether hash and stat data
1311 is valid for the n-th directory and exists in the next data.
1316 An array of stat data. The n-th data corresponds with the n-th
1317 "one" bit in the previous ewah bitmap.
1322 An array of hashes. The n-th hash corresponds with the n-th
"one" bit
1323 in the previous ewah bitmap.
1335 <h2 id=
"_file_system_monitor_cache">File System Monitor cache
</h2>
1336 <div class=
"sectionbody">
1337 <div class=
"literalblock">
1338 <div class=
"content">
1339 <pre><code>The file system monitor cache tracks files for which the core.fsmonitor
1340 hook has told us about changes. The signature for this extension is
1341 { 'F', 'S', 'M', 'N' }.
</code></pre>
1343 <div class=
"literalblock">
1344 <div class=
"content">
1345 <pre><code>The extension starts with
</code></pre>
1347 <div class=
"ulist"><ul>
1350 32-bit version number: the current supported versions are
1 and
2.
1356 64-bit time: the extension data reflects all changes through the given
1357 time which is stored as the nanoseconds elapsed since midnight,
1364 A null terminated string: an opaque token defined by the file system
1365 monitor application. The extension data reflects all changes relative
1371 32-bit bitmap size: the size of the CE_FSMONITOR_VALID bitmap.
1376 An ewah bitmap, the n-th bit indicates whether the n-th index entry
1377 is not CE_FSMONITOR_VALID.
1384 <h2 id=
"_end_of_index_entry">End of Index Entry
</h2>
1385 <div class=
"sectionbody">
1386 <div class=
"literalblock">
1387 <div class=
"content">
1388 <pre><code>The End of Index Entry (EOIE) is used to locate the end of the variable
1389 length index entries and the beginning of the extensions. Code can take
1390 advantage of this to quickly locate the index extensions without having
1391 to parse through all of the index entries.
</code></pre>
1393 <div class=
"literalblock">
1394 <div class=
"content">
1395 <pre><code>Because it must be able to be loaded before the variable length cache
1396 entries and other index extensions, this extension must be written last.
1397 The signature for this extension is { 'E', 'O', 'I', 'E' }.
</code></pre>
1399 <div class=
"literalblock">
1400 <div class=
"content">
1401 <pre><code>The extension consists of:
</code></pre>
1403 <div class=
"ulist"><ul>
1406 32-bit offset to the end of the index entries
1411 Hash over the extension types and their sizes (but not
1412 their contents). E.g. if we have
"TREE" extension that is N-bytes
1413 long,
"REUC" extension that is M-bytes long, followed by
"EOIE",
1414 then the hash would be:
1416 <div class=
"literalblock">
1417 <div class=
"content">
1418 <pre><code>Hash(
"TREE" +
<binary representation of N
> +
1419 "REUC" +
<binary representation of M
>)
</code></pre>
1426 <h2 id=
"_index_entry_offset_table">Index Entry Offset Table
</h2>
1427 <div class=
"sectionbody">
1428 <div class=
"literalblock">
1429 <div class=
"content">
1430 <pre><code>The Index Entry Offset Table (IEOT) is used to help address the CPU
1431 cost of loading the index by enabling multi-threading the process of
1432 converting cache entries from the on-disk format to the in-memory format.
1433 The signature for this extension is { 'I', 'E', 'O', 'T' }.
</code></pre>
1435 <div class=
"literalblock">
1436 <div class=
"content">
1437 <pre><code>The extension consists of:
</code></pre>
1439 <div class=
"ulist"><ul>
1442 32-bit version (currently
1)
1447 A number of index offset entries each consisting of:
1452 32-bit offset from the beginning of the file to the first cache entry
1453 in this block of entries.
1458 32-bit count of cache entries in this block
1465 <h2 id=
"_sparse_directory_entries">Sparse Directory Entries
</h2>
1466 <div class=
"sectionbody">
1467 <div class=
"literalblock">
1468 <div class=
"content">
1469 <pre><code>When using sparse-checkout in cone mode, some entire directories within
1470 the index can be summarized by pointing to a tree object instead of the
1471 entire expanded list of paths within that tree. An index containing such
1472 entries is a
"sparse index". Index format versions
4 and less were not
1473 implemented with such entries in mind. Thus, for these versions, an
1474 index containing sparse directory entries will include this extension
1475 with signature { 's', 'd', 'i', 'r' }. Like the split-index extension,
1476 tools should avoid interacting with a sparse index unless they understand
1477 this extension.
</code></pre>
1482 <h2 id=
"_git">GIT
</h2>
1483 <div class=
"sectionbody">
1484 <div class=
"paragraph"><p>Part of the
<a href=
"git.html">git(
1)
</a> suite
</p></div>
1488 <div id=
"footnotes"><hr /></div>
1490 <div id=
"footer-text">
1492 2022-
08-
18 14:
11:
07 PDT