logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

gitformat-index.5 (23410B)


  1. '\" t
  2. .\" Title: gitformat-index
  3. .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author]
  4. .\" Generator: DocBook XSL Stylesheets v1.79.2 <http://docbook.sf.net/>
  5. .\" Date: 2025-03-14
  6. .\" Manual: Git Manual
  7. .\" Source: Git 2.49.0
  8. .\" Language: English
  9. .\"
  10. .TH "GITFORMAT\-INDEX" "5" "2025-03-14" "Git 2\&.49\&.0" "Git Manual"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. gitformat-index \- Git index format
  32. .SH "SYNOPSIS"
  33. .sp
  34. .nf
  35. $GIT_DIR/index
  36. .fi
  37. .SH "DESCRIPTION"
  38. .sp
  39. Git index format
  40. .SH "THE GIT INDEX FILE HAS THE FOLLOWING FORMAT"
  41. .sp
  42. .if n \{\
  43. .RS 4
  44. .\}
  45. .nf
  46. All binary numbers are in network byte order\&.
  47. In a repository using the traditional SHA\-1, checksums and object IDs
  48. (object names) mentioned below are all computed using SHA\-1\&. Similarly,
  49. in SHA\-256 repositories, these values are computed using SHA\-256\&.
  50. Version 2 is described here unless stated otherwise\&.
  51. .fi
  52. .if n \{\
  53. .RE
  54. .\}
  55. .sp
  56. .RS 4
  57. .ie n \{\
  58. \h'-04'\(bu\h'+03'\c
  59. .\}
  60. .el \{\
  61. .sp -1
  62. .IP \(bu 2.3
  63. .\}
  64. A 12\-byte header consisting of
  65. .sp
  66. .if n \{\
  67. .RS 4
  68. .\}
  69. .nf
  70. 4\-byte signature:
  71. The signature is { \*(AqD\*(Aq, \*(AqI\*(Aq, \*(AqR\*(Aq, \*(AqC\*(Aq } (stands for "dircache")
  72. .fi
  73. .if n \{\
  74. .RE
  75. .\}
  76. .sp
  77. .if n \{\
  78. .RS 4
  79. .\}
  80. .nf
  81. 4\-byte version number:
  82. The current supported versions are 2, 3 and 4\&.
  83. .fi
  84. .if n \{\
  85. .RE
  86. .\}
  87. .sp
  88. .if n \{\
  89. .RS 4
  90. .\}
  91. .nf
  92. 32\-bit number of index entries\&.
  93. .fi
  94. .if n \{\
  95. .RE
  96. .\}
  97. .RE
  98. .sp
  99. .RS 4
  100. .ie n \{\
  101. \h'-04'\(bu\h'+03'\c
  102. .\}
  103. .el \{\
  104. .sp -1
  105. .IP \(bu 2.3
  106. .\}
  107. A number of sorted index entries (see below)\&.
  108. .RE
  109. .sp
  110. .RS 4
  111. .ie n \{\
  112. \h'-04'\(bu\h'+03'\c
  113. .\}
  114. .el \{\
  115. .sp -1
  116. .IP \(bu 2.3
  117. .\}
  118. Extensions
  119. .sp
  120. .if n \{\
  121. .RS 4
  122. .\}
  123. .nf
  124. Extensions are identified by signature\&. Optional extensions can
  125. be ignored if Git does not understand them\&.
  126. .fi
  127. .if n \{\
  128. .RE
  129. .\}
  130. .sp
  131. .if n \{\
  132. .RS 4
  133. .\}
  134. .nf
  135. 4\-byte extension signature\&. If the first byte is \*(AqA\*(Aq\&.\&.\*(AqZ\*(Aq the
  136. extension is optional and can be ignored\&.
  137. .fi
  138. .if n \{\
  139. .RE
  140. .\}
  141. .sp
  142. .if n \{\
  143. .RS 4
  144. .\}
  145. .nf
  146. 32\-bit size of the extension
  147. .fi
  148. .if n \{\
  149. .RE
  150. .\}
  151. .sp
  152. .if n \{\
  153. .RS 4
  154. .\}
  155. .nf
  156. Extension data
  157. .fi
  158. .if n \{\
  159. .RE
  160. .\}
  161. .RE
  162. .sp
  163. .RS 4
  164. .ie n \{\
  165. \h'-04'\(bu\h'+03'\c
  166. .\}
  167. .el \{\
  168. .sp -1
  169. .IP \(bu 2.3
  170. .\}
  171. Hash checksum over the content of the index file before this checksum\&.
  172. .RE
  173. .SH "INDEX ENTRY"
  174. .sp
  175. .if n \{\
  176. .RS 4
  177. .\}
  178. .nf
  179. Index entries are sorted in ascending order on the name field,
  180. interpreted as a string of unsigned bytes (i\&.e\&. memcmp() order, no
  181. localization, no special casing of directory separator \*(Aq/\*(Aq)\&. Entries
  182. with the same name are sorted by their stage field\&.
  183. .fi
  184. .if n \{\
  185. .RE
  186. .\}
  187. .sp
  188. .if n \{\
  189. .RS 4
  190. .\}
  191. .nf
  192. An index entry typically represents a file\&. However, if sparse\-checkout
  193. is enabled in cone mode (`core\&.sparseCheckoutCone` is enabled) and the
  194. `extensions\&.sparseIndex` extension is enabled, then the index may
  195. contain entries for directories outside of the sparse\-checkout definition\&.
  196. These entries have mode `040000`, include the `SKIP_WORKTREE` bit, and
  197. the path ends in a directory separator\&.
  198. .fi
  199. .if n \{\
  200. .RE
  201. .\}
  202. .sp
  203. .if n \{\
  204. .RS 4
  205. .\}
  206. .nf
  207. 32\-bit ctime seconds, the last time a file\*(Aqs metadata changed
  208. this is stat(2) data
  209. .fi
  210. .if n \{\
  211. .RE
  212. .\}
  213. .sp
  214. .if n \{\
  215. .RS 4
  216. .\}
  217. .nf
  218. 32\-bit ctime nanosecond fractions
  219. this is stat(2) data
  220. .fi
  221. .if n \{\
  222. .RE
  223. .\}
  224. .sp
  225. .if n \{\
  226. .RS 4
  227. .\}
  228. .nf
  229. 32\-bit mtime seconds, the last time a file\*(Aqs data changed
  230. this is stat(2) data
  231. .fi
  232. .if n \{\
  233. .RE
  234. .\}
  235. .sp
  236. .if n \{\
  237. .RS 4
  238. .\}
  239. .nf
  240. 32\-bit mtime nanosecond fractions
  241. this is stat(2) data
  242. .fi
  243. .if n \{\
  244. .RE
  245. .\}
  246. .sp
  247. .if n \{\
  248. .RS 4
  249. .\}
  250. .nf
  251. 32\-bit dev
  252. this is stat(2) data
  253. .fi
  254. .if n \{\
  255. .RE
  256. .\}
  257. .sp
  258. .if n \{\
  259. .RS 4
  260. .\}
  261. .nf
  262. 32\-bit ino
  263. this is stat(2) data
  264. .fi
  265. .if n \{\
  266. .RE
  267. .\}
  268. .sp
  269. .if n \{\
  270. .RS 4
  271. .\}
  272. .nf
  273. 32\-bit mode, split into (high to low bits)
  274. .fi
  275. .if n \{\
  276. .RE
  277. .\}
  278. .sp
  279. .if n \{\
  280. .RS 4
  281. .\}
  282. .nf
  283. 16\-bit unused, must be zero
  284. .fi
  285. .if n \{\
  286. .RE
  287. .\}
  288. .sp
  289. .if n \{\
  290. .RS 4
  291. .\}
  292. .nf
  293. 4\-bit object type
  294. valid values in binary are 1000 (regular file), 1010 (symbolic link)
  295. and 1110 (gitlink)
  296. .fi
  297. .if n \{\
  298. .RE
  299. .\}
  300. .sp
  301. .if n \{\
  302. .RS 4
  303. .\}
  304. .nf
  305. 3\-bit unused, must be zero
  306. .fi
  307. .if n \{\
  308. .RE
  309. .\}
  310. .sp
  311. .if n \{\
  312. .RS 4
  313. .\}
  314. .nf
  315. 9\-bit unix permission\&. Only 0755 and 0644 are valid for regular files\&.
  316. Symbolic links and gitlinks have value 0 in this field\&.
  317. .fi
  318. .if n \{\
  319. .RE
  320. .\}
  321. .sp
  322. .if n \{\
  323. .RS 4
  324. .\}
  325. .nf
  326. 32\-bit uid
  327. this is stat(2) data
  328. .fi
  329. .if n \{\
  330. .RE
  331. .\}
  332. .sp
  333. .if n \{\
  334. .RS 4
  335. .\}
  336. .nf
  337. 32\-bit gid
  338. this is stat(2) data
  339. .fi
  340. .if n \{\
  341. .RE
  342. .\}
  343. .sp
  344. .if n \{\
  345. .RS 4
  346. .\}
  347. .nf
  348. 32\-bit file size
  349. This is the on\-disk size from stat(2), truncated to 32\-bit\&.
  350. .fi
  351. .if n \{\
  352. .RE
  353. .\}
  354. .sp
  355. .if n \{\
  356. .RS 4
  357. .\}
  358. .nf
  359. Object name for the represented object
  360. .fi
  361. .if n \{\
  362. .RE
  363. .\}
  364. .sp
  365. .if n \{\
  366. .RS 4
  367. .\}
  368. .nf
  369. A 16\-bit \*(Aqflags\*(Aq field split into (high to low bits)
  370. .fi
  371. .if n \{\
  372. .RE
  373. .\}
  374. .sp
  375. .if n \{\
  376. .RS 4
  377. .\}
  378. .nf
  379. 1\-bit assume\-valid flag
  380. .fi
  381. .if n \{\
  382. .RE
  383. .\}
  384. .sp
  385. .if n \{\
  386. .RS 4
  387. .\}
  388. .nf
  389. 1\-bit extended flag (must be zero in version 2)
  390. .fi
  391. .if n \{\
  392. .RE
  393. .\}
  394. .sp
  395. .if n \{\
  396. .RS 4
  397. .\}
  398. .nf
  399. 2\-bit stage (during merge)
  400. .fi
  401. .if n \{\
  402. .RE
  403. .\}
  404. .sp
  405. .if n \{\
  406. .RS 4
  407. .\}
  408. .nf
  409. 12\-bit name length if the length is less than 0xFFF; otherwise 0xFFF
  410. is stored in this field\&.
  411. .fi
  412. .if n \{\
  413. .RE
  414. .\}
  415. .sp
  416. .if n \{\
  417. .RS 4
  418. .\}
  419. .nf
  420. (Version 3 or later) A 16\-bit field, only applicable if the
  421. "extended flag" above is 1, split into (high to low bits)\&.
  422. .fi
  423. .if n \{\
  424. .RE
  425. .\}
  426. .sp
  427. .if n \{\
  428. .RS 4
  429. .\}
  430. .nf
  431. 1\-bit reserved for future
  432. .fi
  433. .if n \{\
  434. .RE
  435. .\}
  436. .sp
  437. .if n \{\
  438. .RS 4
  439. .\}
  440. .nf
  441. 1\-bit skip\-worktree flag (used by sparse checkout)
  442. .fi
  443. .if n \{\
  444. .RE
  445. .\}
  446. .sp
  447. .if n \{\
  448. .RS 4
  449. .\}
  450. .nf
  451. 1\-bit intent\-to\-add flag (used by "git add \-N")
  452. .fi
  453. .if n \{\
  454. .RE
  455. .\}
  456. .sp
  457. .if n \{\
  458. .RS 4
  459. .\}
  460. .nf
  461. 13\-bit unused, must be zero
  462. .fi
  463. .if n \{\
  464. .RE
  465. .\}
  466. .sp
  467. .if n \{\
  468. .RS 4
  469. .\}
  470. .nf
  471. Entry path name (variable length) relative to top level directory
  472. (without leading slash)\&. \*(Aq/\*(Aq is used as path separator\&. The special
  473. path components "\&.", "\&.\&." and "\&.git" (without quotes) are disallowed\&.
  474. Trailing slash is also disallowed\&.
  475. .fi
  476. .if n \{\
  477. .RE
  478. .\}
  479. .sp
  480. .if n \{\
  481. .RS 4
  482. .\}
  483. .nf
  484. The exact encoding is undefined, but the \*(Aq\&.\*(Aq and \*(Aq/\*(Aq characters
  485. are encoded in 7\-bit ASCII and the encoding cannot contain a NUL
  486. byte (iow, this is a UNIX pathname)\&.
  487. .fi
  488. .if n \{\
  489. .RE
  490. .\}
  491. .sp
  492. .if n \{\
  493. .RS 4
  494. .\}
  495. .nf
  496. (Version 4) In version 4, the entry path name is prefix\-compressed
  497. relative to the path name for the previous entry (the very first
  498. entry is encoded as if the path name for the previous entry is an
  499. empty string)\&. At the beginning of an entry, an integer N in the
  500. variable width encoding (the same encoding as the offset is encoded
  501. for OFS_DELTA pack entries; see linkgit:gitformat\-pack[5]) is stored, followed
  502. by a NUL\-terminated string S\&. Removing N bytes from the end of the
  503. path name for the previous entry, and replacing it with the string S
  504. yields the path name for this entry\&.
  505. .fi
  506. .if n \{\
  507. .RE
  508. .\}
  509. .sp
  510. .if n \{\
  511. .RS 4
  512. .\}
  513. .nf
  514. 1\-8 nul bytes as necessary to pad the entry to a multiple of eight bytes
  515. while keeping the name NUL\-terminated\&.
  516. .fi
  517. .if n \{\
  518. .RE
  519. .\}
  520. .sp
  521. .if n \{\
  522. .RS 4
  523. .\}
  524. .nf
  525. (Version 4) In version 4, the padding after the pathname does not
  526. exist\&.
  527. .fi
  528. .if n \{\
  529. .RE
  530. .\}
  531. .sp
  532. .if n \{\
  533. .RS 4
  534. .\}
  535. .nf
  536. Interpretation of index entries in split index mode is completely
  537. different\&. See below for details\&.
  538. .fi
  539. .if n \{\
  540. .RE
  541. .\}
  542. .SH "EXTENSIONS"
  543. .SS "Cache tree"
  544. .sp
  545. .if n \{\
  546. .RS 4
  547. .\}
  548. .nf
  549. Since the index does not record entries for directories, the cache
  550. entries cannot describe tree objects that already exist in the object
  551. database for regions of the index that are unchanged from an existing
  552. commit\&. The cache tree extension stores a recursive tree structure that
  553. describes the trees that already exist and completely match sections of
  554. the cache entries\&. This speeds up tree object generation from the index
  555. for a new commit by only computing the trees that are "new" to that
  556. commit\&. It also assists when comparing the index to another tree, such
  557. as `HEAD^{tree}`, since sections of the index can be skipped when a tree
  558. comparison demonstrates equality\&.
  559. .fi
  560. .if n \{\
  561. .RE
  562. .\}
  563. .sp
  564. .if n \{\
  565. .RS 4
  566. .\}
  567. .nf
  568. The recursive tree structure uses nodes that store a number of cache
  569. entries, a list of subnodes, and an object ID (OID)\&. The OID references
  570. the existing tree for that node, if it is known to exist\&. The subnodes
  571. correspond to subdirectories that themselves have cache tree nodes\&. The
  572. number of cache entries corresponds to the number of cache entries in
  573. the index that describe paths within that tree\*(Aqs directory\&.
  574. .fi
  575. .if n \{\
  576. .RE
  577. .\}
  578. .sp
  579. .if n \{\
  580. .RS 4
  581. .\}
  582. .nf
  583. The extension tracks the full directory structure in the cache tree
  584. extension, but this is generally smaller than the full cache entry list\&.
  585. .fi
  586. .if n \{\
  587. .RE
  588. .\}
  589. .sp
  590. .if n \{\
  591. .RS 4
  592. .\}
  593. .nf
  594. When a path is updated in index, Git invalidates all nodes of the
  595. recursive cache tree corresponding to the parent directories of that
  596. path\&. We store these tree nodes as being "invalid" by using "\-1" as the
  597. number of cache entries\&. Invalid nodes still store a span of index
  598. entries, allowing Git to focus its efforts when reconstructing a full
  599. cache tree\&.
  600. .fi
  601. .if n \{\
  602. .RE
  603. .\}
  604. .sp
  605. .if n \{\
  606. .RS 4
  607. .\}
  608. .nf
  609. The signature for this extension is { \*(AqT\*(Aq, \*(AqR\*(Aq, \*(AqE\*(Aq, \*(AqE\*(Aq }\&.
  610. .fi
  611. .if n \{\
  612. .RE
  613. .\}
  614. .sp
  615. .if n \{\
  616. .RS 4
  617. .\}
  618. .nf
  619. A series of entries fill the entire extension; each of which
  620. consists of:
  621. .fi
  622. .if n \{\
  623. .RE
  624. .\}
  625. .sp
  626. .RS 4
  627. .ie n \{\
  628. \h'-04'\(bu\h'+03'\c
  629. .\}
  630. .el \{\
  631. .sp -1
  632. .IP \(bu 2.3
  633. .\}
  634. NUL\-terminated path component (relative to its parent directory);
  635. .RE
  636. .sp
  637. .RS 4
  638. .ie n \{\
  639. \h'-04'\(bu\h'+03'\c
  640. .\}
  641. .el \{\
  642. .sp -1
  643. .IP \(bu 2.3
  644. .\}
  645. ASCII decimal number of entries in the index that is covered by the tree this entry represents (entry_count);
  646. .RE
  647. .sp
  648. .RS 4
  649. .ie n \{\
  650. \h'-04'\(bu\h'+03'\c
  651. .\}
  652. .el \{\
  653. .sp -1
  654. .IP \(bu 2.3
  655. .\}
  656. A space (ASCII 32);
  657. .RE
  658. .sp
  659. .RS 4
  660. .ie n \{\
  661. \h'-04'\(bu\h'+03'\c
  662. .\}
  663. .el \{\
  664. .sp -1
  665. .IP \(bu 2.3
  666. .\}
  667. ASCII decimal number that represents the number of subtrees this tree has;
  668. .RE
  669. .sp
  670. .RS 4
  671. .ie n \{\
  672. \h'-04'\(bu\h'+03'\c
  673. .\}
  674. .el \{\
  675. .sp -1
  676. .IP \(bu 2.3
  677. .\}
  678. A newline (ASCII 10); and
  679. .RE
  680. .sp
  681. .RS 4
  682. .ie n \{\
  683. \h'-04'\(bu\h'+03'\c
  684. .\}
  685. .el \{\
  686. .sp -1
  687. .IP \(bu 2.3
  688. .\}
  689. Object name for the object that would result from writing this span of index as a tree\&.
  690. .sp
  691. .if n \{\
  692. .RS 4
  693. .\}
  694. .nf
  695. An entry can be in an invalidated state and is represented by having
  696. a negative number in the entry_count field\&. In this case, there is no
  697. object name and the next entry starts immediately after the newline\&.
  698. When writing an invalid entry, \-1 should always be used as entry_count\&.
  699. .fi
  700. .if n \{\
  701. .RE
  702. .\}
  703. .sp
  704. .if n \{\
  705. .RS 4
  706. .\}
  707. .nf
  708. The entries are written out in the top\-down, depth\-first order\&. The
  709. first entry represents the root level of the repository, followed by the
  710. first subtree\-\-let\*(Aqs call this A\-\-of the root level (with its name
  711. relative to the root level), followed by the first subtree of A (with
  712. its name relative to A), and so on\&. The specified number of subtrees
  713. indicates when the current level of the recursive stack is complete\&.
  714. .fi
  715. .if n \{\
  716. .RE
  717. .\}
  718. .RE
  719. .SS "Resolve undo"
  720. .sp
  721. .if n \{\
  722. .RS 4
  723. .\}
  724. .nf
  725. A conflict is represented in the index as a set of higher stage entries\&.
  726. When a conflict is resolved (e\&.g\&. with "git add path"), these higher
  727. stage entries will be removed and a stage\-0 entry with proper resolution
  728. is added\&.
  729. .fi
  730. .if n \{\
  731. .RE
  732. .\}
  733. .sp
  734. .if n \{\
  735. .RS 4
  736. .\}
  737. .nf
  738. When these higher stage entries are removed, they are saved in the
  739. resolve undo extension, so that conflicts can be recreated (e\&.g\&. with
  740. "git checkout \-m"), in case users want to redo a conflict resolution
  741. from scratch\&.
  742. .fi
  743. .if n \{\
  744. .RE
  745. .\}
  746. .sp
  747. .if n \{\
  748. .RS 4
  749. .\}
  750. .nf
  751. The signature for this extension is { \*(AqR\*(Aq, \*(AqE\*(Aq, \*(AqU\*(Aq, \*(AqC\*(Aq }\&.
  752. .fi
  753. .if n \{\
  754. .RE
  755. .\}
  756. .sp
  757. .if n \{\
  758. .RS 4
  759. .\}
  760. .nf
  761. A series of entries fill the entire extension; each of which
  762. consists of:
  763. .fi
  764. .if n \{\
  765. .RE
  766. .\}
  767. .sp
  768. .RS 4
  769. .ie n \{\
  770. \h'-04'\(bu\h'+03'\c
  771. .\}
  772. .el \{\
  773. .sp -1
  774. .IP \(bu 2.3
  775. .\}
  776. NUL\-terminated pathname the entry describes (relative to the root of the repository, i\&.e\&. full pathname);
  777. .RE
  778. .sp
  779. .RS 4
  780. .ie n \{\
  781. \h'-04'\(bu\h'+03'\c
  782. .\}
  783. .el \{\
  784. .sp -1
  785. .IP \(bu 2.3
  786. .\}
  787. Three NUL\-terminated ASCII octal numbers, entry mode of entries in stage 1 to 3 (a missing stage is represented by "0" in this field); and
  788. .RE
  789. .sp
  790. .RS 4
  791. .ie n \{\
  792. \h'-04'\(bu\h'+03'\c
  793. .\}
  794. .el \{\
  795. .sp -1
  796. .IP \(bu 2.3
  797. .\}
  798. At most three object names of the entry in stages from 1 to 3 (nothing is written for a missing stage)\&.
  799. .RE
  800. .SS "Split index"
  801. .sp
  802. .if n \{\
  803. .RS 4
  804. .\}
  805. .nf
  806. In split index mode, the majority of index entries could be stored
  807. in a separate file\&. This extension records the changes to be made on
  808. top of that to produce the final index\&.
  809. .fi
  810. .if n \{\
  811. .RE
  812. .\}
  813. .sp
  814. .if n \{\
  815. .RS 4
  816. .\}
  817. .nf
  818. The signature for this extension is { \*(Aql\*(Aq, \*(Aqi\*(Aq, \*(Aqn\*(Aq, \*(Aqk\*(Aq }\&.
  819. .fi
  820. .if n \{\
  821. .RE
  822. .\}
  823. .sp
  824. .if n \{\
  825. .RS 4
  826. .\}
  827. .nf
  828. The extension consists of:
  829. .fi
  830. .if n \{\
  831. .RE
  832. .\}
  833. .sp
  834. .RS 4
  835. .ie n \{\
  836. \h'-04'\(bu\h'+03'\c
  837. .\}
  838. .el \{\
  839. .sp -1
  840. .IP \(bu 2.3
  841. .\}
  842. Hash of the shared index file\&. The shared index file path is $GIT_DIR/sharedindex\&.<hash>\&. If all bits are zero, the index does not require a shared index file\&.
  843. .RE
  844. .sp
  845. .RS 4
  846. .ie n \{\
  847. \h'-04'\(bu\h'+03'\c
  848. .\}
  849. .el \{\
  850. .sp -1
  851. .IP \(bu 2.3
  852. .\}
  853. An ewah\-encoded delete bitmap, each bit represents an entry in the shared index\&. If a bit is set, its corresponding entry in the shared index will be removed from the final index\&. Note, because a delete operation changes index entry positions, but we do need original positions in replace phase, it\(cqs best to just mark entries for removal, then do a mass deletion after replacement\&.
  854. .RE
  855. .sp
  856. .RS 4
  857. .ie n \{\
  858. \h'-04'\(bu\h'+03'\c
  859. .\}
  860. .el \{\
  861. .sp -1
  862. .IP \(bu 2.3
  863. .\}
  864. An ewah\-encoded replace bitmap, each bit represents an entry in the shared index\&. If a bit is set, its corresponding entry in the shared index will be replaced with an entry in this index file\&. All replaced entries are stored in sorted order in this index\&. The first "1" bit in the replace bitmap corresponds to the first index entry, the second "1" bit to the second entry and so on\&. Replaced entries may have empty path names to save space\&.
  865. .sp
  866. .if n \{\
  867. .RS 4
  868. .\}
  869. .nf
  870. The remaining index entries after replaced ones will be added to the
  871. final index\&. These added entries are also sorted by entry name then
  872. stage\&.
  873. .fi
  874. .if n \{\
  875. .RE
  876. .\}
  877. .RE
  878. .SH "UNTRACKED CACHE"
  879. .sp
  880. .if n \{\
  881. .RS 4
  882. .\}
  883. .nf
  884. Untracked cache saves the untracked file list and necessary data to
  885. verify the cache\&. The signature for this extension is { \*(AqU\*(Aq, \*(AqN\*(Aq,
  886. \*(AqT\*(Aq, \*(AqR\*(Aq }\&.
  887. .fi
  888. .if n \{\
  889. .RE
  890. .\}
  891. .sp
  892. .if n \{\
  893. .RS 4
  894. .\}
  895. .nf
  896. The extension starts with
  897. .fi
  898. .if n \{\
  899. .RE
  900. .\}
  901. .sp
  902. .RS 4
  903. .ie n \{\
  904. \h'-04'\(bu\h'+03'\c
  905. .\}
  906. .el \{\
  907. .sp -1
  908. .IP \(bu 2.3
  909. .\}
  910. A sequence of NUL\-terminated strings, preceded by the size of the sequence in variable width encoding\&. Each string describes the environment where the cache can be used\&.
  911. .RE
  912. .sp
  913. .RS 4
  914. .ie n \{\
  915. \h'-04'\(bu\h'+03'\c
  916. .\}
  917. .el \{\
  918. .sp -1
  919. .IP \(bu 2.3
  920. .\}
  921. Stat data of $GIT_DIR/info/exclude\&. See "Index entry" section from ctime field until "file size"\&.
  922. .RE
  923. .sp
  924. .RS 4
  925. .ie n \{\
  926. \h'-04'\(bu\h'+03'\c
  927. .\}
  928. .el \{\
  929. .sp -1
  930. .IP \(bu 2.3
  931. .\}
  932. Stat data of core\&.excludesFile
  933. .RE
  934. .sp
  935. .RS 4
  936. .ie n \{\
  937. \h'-04'\(bu\h'+03'\c
  938. .\}
  939. .el \{\
  940. .sp -1
  941. .IP \(bu 2.3
  942. .\}
  943. 32\-bit dir_flags (see struct dir_struct)
  944. .RE
  945. .sp
  946. .RS 4
  947. .ie n \{\
  948. \h'-04'\(bu\h'+03'\c
  949. .\}
  950. .el \{\
  951. .sp -1
  952. .IP \(bu 2.3
  953. .\}
  954. Hash of $GIT_DIR/info/exclude\&. A null hash means the file does not exist\&.
  955. .RE
  956. .sp
  957. .RS 4
  958. .ie n \{\
  959. \h'-04'\(bu\h'+03'\c
  960. .\}
  961. .el \{\
  962. .sp -1
  963. .IP \(bu 2.3
  964. .\}
  965. Hash of core\&.excludesFile\&. A null hash means the file does not exist\&.
  966. .RE
  967. .sp
  968. .RS 4
  969. .ie n \{\
  970. \h'-04'\(bu\h'+03'\c
  971. .\}
  972. .el \{\
  973. .sp -1
  974. .IP \(bu 2.3
  975. .\}
  976. NUL\-terminated string of per\-dir exclude file name\&. This usually is "\&.gitignore"\&.
  977. .RE
  978. .sp
  979. .RS 4
  980. .ie n \{\
  981. \h'-04'\(bu\h'+03'\c
  982. .\}
  983. .el \{\
  984. .sp -1
  985. .IP \(bu 2.3
  986. .\}
  987. The number of following directory blocks, variable width encoding\&. If this number is zero, the extension ends here with a following NUL\&.
  988. .RE
  989. .sp
  990. .RS 4
  991. .ie n \{\
  992. \h'-04'\(bu\h'+03'\c
  993. .\}
  994. .el \{\
  995. .sp -1
  996. .IP \(bu 2.3
  997. .\}
  998. A number of directory blocks in depth\-first\-search order, each consists of
  999. .RE
  1000. .sp
  1001. .RS 4
  1002. .ie n \{\
  1003. \h'-04'\(bu\h'+03'\c
  1004. .\}
  1005. .el \{\
  1006. .sp -1
  1007. .IP \(bu 2.3
  1008. .\}
  1009. The number of untracked entries, variable width encoding\&.
  1010. .RE
  1011. .sp
  1012. .RS 4
  1013. .ie n \{\
  1014. \h'-04'\(bu\h'+03'\c
  1015. .\}
  1016. .el \{\
  1017. .sp -1
  1018. .IP \(bu 2.3
  1019. .\}
  1020. The number of sub\-directory blocks, variable width encoding\&.
  1021. .RE
  1022. .sp
  1023. .RS 4
  1024. .ie n \{\
  1025. \h'-04'\(bu\h'+03'\c
  1026. .\}
  1027. .el \{\
  1028. .sp -1
  1029. .IP \(bu 2.3
  1030. .\}
  1031. The directory name terminated by NUL\&.
  1032. .RE
  1033. .sp
  1034. .RS 4
  1035. .ie n \{\
  1036. \h'-04'\(bu\h'+03'\c
  1037. .\}
  1038. .el \{\
  1039. .sp -1
  1040. .IP \(bu 2.3
  1041. .\}
  1042. A number of untracked file/dir names terminated by NUL\&.
  1043. .RE
  1044. .sp
  1045. The remaining data of each directory block is grouped by type:
  1046. .sp
  1047. .RS 4
  1048. .ie n \{\
  1049. \h'-04'\(bu\h'+03'\c
  1050. .\}
  1051. .el \{\
  1052. .sp -1
  1053. .IP \(bu 2.3
  1054. .\}
  1055. An ewah bitmap, the n\-th bit marks whether the n\-th directory has valid untracked cache entries\&.
  1056. .RE
  1057. .sp
  1058. .RS 4
  1059. .ie n \{\
  1060. \h'-04'\(bu\h'+03'\c
  1061. .\}
  1062. .el \{\
  1063. .sp -1
  1064. .IP \(bu 2.3
  1065. .\}
  1066. An ewah bitmap, the n\-th bit records "check\-only" bit of read_directory_recursive() for the n\-th directory\&.
  1067. .RE
  1068. .sp
  1069. .RS 4
  1070. .ie n \{\
  1071. \h'-04'\(bu\h'+03'\c
  1072. .\}
  1073. .el \{\
  1074. .sp -1
  1075. .IP \(bu 2.3
  1076. .\}
  1077. An ewah bitmap, the n\-th bit indicates whether hash and stat data is valid for the n\-th directory and exists in the next data\&.
  1078. .RE
  1079. .sp
  1080. .RS 4
  1081. .ie n \{\
  1082. \h'-04'\(bu\h'+03'\c
  1083. .\}
  1084. .el \{\
  1085. .sp -1
  1086. .IP \(bu 2.3
  1087. .\}
  1088. An array of stat data\&. The n\-th data corresponds with the n\-th "one" bit in the previous ewah bitmap\&.
  1089. .RE
  1090. .sp
  1091. .RS 4
  1092. .ie n \{\
  1093. \h'-04'\(bu\h'+03'\c
  1094. .\}
  1095. .el \{\
  1096. .sp -1
  1097. .IP \(bu 2.3
  1098. .\}
  1099. An array of hashes\&. The n\-th hash corresponds with the n\-th "one" bit in the previous ewah bitmap\&.
  1100. .RE
  1101. .sp
  1102. .RS 4
  1103. .ie n \{\
  1104. \h'-04'\(bu\h'+03'\c
  1105. .\}
  1106. .el \{\
  1107. .sp -1
  1108. .IP \(bu 2.3
  1109. .\}
  1110. One NUL\&.
  1111. .RE
  1112. .SH "FILE SYSTEM MONITOR CACHE"
  1113. .sp
  1114. .if n \{\
  1115. .RS 4
  1116. .\}
  1117. .nf
  1118. The file system monitor cache tracks files for which the core\&.fsmonitor
  1119. hook has told us about changes\&. The signature for this extension is
  1120. { \*(AqF\*(Aq, \*(AqS\*(Aq, \*(AqM\*(Aq, \*(AqN\*(Aq }\&.
  1121. .fi
  1122. .if n \{\
  1123. .RE
  1124. .\}
  1125. .sp
  1126. .if n \{\
  1127. .RS 4
  1128. .\}
  1129. .nf
  1130. The extension starts with
  1131. .fi
  1132. .if n \{\
  1133. .RE
  1134. .\}
  1135. .sp
  1136. .RS 4
  1137. .ie n \{\
  1138. \h'-04'\(bu\h'+03'\c
  1139. .\}
  1140. .el \{\
  1141. .sp -1
  1142. .IP \(bu 2.3
  1143. .\}
  1144. 32\-bit version number: the current supported versions are 1 and 2\&.
  1145. .RE
  1146. .sp
  1147. .RS 4
  1148. .ie n \{\
  1149. \h'-04'\(bu\h'+03'\c
  1150. .\}
  1151. .el \{\
  1152. .sp -1
  1153. .IP \(bu 2.3
  1154. .\}
  1155. (Version 1) 64\-bit time: the extension data reflects all changes through the given time which is stored as the nanoseconds elapsed since midnight, January 1, 1970\&.
  1156. .RE
  1157. .sp
  1158. .RS 4
  1159. .ie n \{\
  1160. \h'-04'\(bu\h'+03'\c
  1161. .\}
  1162. .el \{\
  1163. .sp -1
  1164. .IP \(bu 2.3
  1165. .\}
  1166. (Version 2) A null terminated string: an opaque token defined by the file system monitor application\&. The extension data reflects all changes relative to that token\&.
  1167. .RE
  1168. .sp
  1169. .RS 4
  1170. .ie n \{\
  1171. \h'-04'\(bu\h'+03'\c
  1172. .\}
  1173. .el \{\
  1174. .sp -1
  1175. .IP \(bu 2.3
  1176. .\}
  1177. 32\-bit bitmap size: the size of the CE_FSMONITOR_VALID bitmap\&.
  1178. .RE
  1179. .sp
  1180. .RS 4
  1181. .ie n \{\
  1182. \h'-04'\(bu\h'+03'\c
  1183. .\}
  1184. .el \{\
  1185. .sp -1
  1186. .IP \(bu 2.3
  1187. .\}
  1188. An ewah bitmap, the n\-th bit indicates whether the n\-th index entry is not CE_FSMONITOR_VALID\&.
  1189. .RE
  1190. .SH "END OF INDEX ENTRY"
  1191. .sp
  1192. .if n \{\
  1193. .RS 4
  1194. .\}
  1195. .nf
  1196. The End of Index Entry (EOIE) is used to locate the end of the variable
  1197. length index entries and the beginning of the extensions\&. Code can take
  1198. advantage of this to quickly locate the index extensions without having
  1199. to parse through all of the index entries\&.
  1200. .fi
  1201. .if n \{\
  1202. .RE
  1203. .\}
  1204. .sp
  1205. .if n \{\
  1206. .RS 4
  1207. .\}
  1208. .nf
  1209. Because it must be able to be loaded before the variable length cache
  1210. entries and other index extensions, this extension must be written last\&.
  1211. The signature for this extension is { \*(AqE\*(Aq, \*(AqO\*(Aq, \*(AqI\*(Aq, \*(AqE\*(Aq }\&.
  1212. .fi
  1213. .if n \{\
  1214. .RE
  1215. .\}
  1216. .sp
  1217. .if n \{\
  1218. .RS 4
  1219. .\}
  1220. .nf
  1221. The extension consists of:
  1222. .fi
  1223. .if n \{\
  1224. .RE
  1225. .\}
  1226. .sp
  1227. .RS 4
  1228. .ie n \{\
  1229. \h'-04'\(bu\h'+03'\c
  1230. .\}
  1231. .el \{\
  1232. .sp -1
  1233. .IP \(bu 2.3
  1234. .\}
  1235. 32\-bit offset to the end of the index entries
  1236. .RE
  1237. .sp
  1238. .RS 4
  1239. .ie n \{\
  1240. \h'-04'\(bu\h'+03'\c
  1241. .\}
  1242. .el \{\
  1243. .sp -1
  1244. .IP \(bu 2.3
  1245. .\}
  1246. Hash over the extension types and their sizes (but not their contents)\&. E\&.g\&. if we have "TREE" extension that is N\-bytes long, "REUC" extension that is M\-bytes long, followed by "EOIE", then the hash would be:
  1247. .sp
  1248. .if n \{\
  1249. .RS 4
  1250. .\}
  1251. .nf
  1252. Hash("TREE" + <binary\-representation\-of\-N> +
  1253. "REUC" + <binary\-representation\-of\-M>)
  1254. .fi
  1255. .if n \{\
  1256. .RE
  1257. .\}
  1258. .RE
  1259. .SH "INDEX ENTRY OFFSET TABLE"
  1260. .sp
  1261. .if n \{\
  1262. .RS 4
  1263. .\}
  1264. .nf
  1265. The Index Entry Offset Table (IEOT) is used to help address the CPU
  1266. cost of loading the index by enabling multi\-threading the process of
  1267. converting cache entries from the on\-disk format to the in\-memory format\&.
  1268. The signature for this extension is { \*(AqI\*(Aq, \*(AqE\*(Aq, \*(AqO\*(Aq, \*(AqT\*(Aq }\&.
  1269. .fi
  1270. .if n \{\
  1271. .RE
  1272. .\}
  1273. .sp
  1274. .if n \{\
  1275. .RS 4
  1276. .\}
  1277. .nf
  1278. The extension consists of:
  1279. .fi
  1280. .if n \{\
  1281. .RE
  1282. .\}
  1283. .sp
  1284. .RS 4
  1285. .ie n \{\
  1286. \h'-04'\(bu\h'+03'\c
  1287. .\}
  1288. .el \{\
  1289. .sp -1
  1290. .IP \(bu 2.3
  1291. .\}
  1292. 32\-bit version (currently 1)
  1293. .RE
  1294. .sp
  1295. .RS 4
  1296. .ie n \{\
  1297. \h'-04'\(bu\h'+03'\c
  1298. .\}
  1299. .el \{\
  1300. .sp -1
  1301. .IP \(bu 2.3
  1302. .\}
  1303. A number of index offset entries each consisting of:
  1304. .RE
  1305. .sp
  1306. .RS 4
  1307. .ie n \{\
  1308. \h'-04'\(bu\h'+03'\c
  1309. .\}
  1310. .el \{\
  1311. .sp -1
  1312. .IP \(bu 2.3
  1313. .\}
  1314. 32\-bit offset from the beginning of the file to the first cache entry in this block of entries\&.
  1315. .RE
  1316. .sp
  1317. .RS 4
  1318. .ie n \{\
  1319. \h'-04'\(bu\h'+03'\c
  1320. .\}
  1321. .el \{\
  1322. .sp -1
  1323. .IP \(bu 2.3
  1324. .\}
  1325. 32\-bit count of cache entries in this block
  1326. .RE
  1327. .SH "SPARSE DIRECTORY ENTRIES"
  1328. .sp
  1329. .if n \{\
  1330. .RS 4
  1331. .\}
  1332. .nf
  1333. When using sparse\-checkout in cone mode, some entire directories within
  1334. the index can be summarized by pointing to a tree object instead of the
  1335. entire expanded list of paths within that tree\&. An index containing such
  1336. entries is a "sparse index"\&. Index format versions 4 and less were not
  1337. implemented with such entries in mind\&. Thus, for these versions, an
  1338. index containing sparse directory entries will include this extension
  1339. with signature { \*(Aqs\*(Aq, \*(Aqd\*(Aq, \*(Aqi\*(Aq, \*(Aqr\*(Aq }\&. Like the split\-index extension,
  1340. tools should avoid interacting with a sparse index unless they understand
  1341. this extension\&.
  1342. .fi
  1343. .if n \{\
  1344. .RE
  1345. .\}
  1346. .SH "GIT"
  1347. .sp
  1348. Part of the \fBgit\fR(1) suite