Home Explore Blog CI



git

5th chunk of `Documentation/gitformat-index.adoc`
e343362a5dd71a44378d83653d0d2c55ff01b6d907e3d7420000000100000801
 directory blocks, variable width
    encoding. If this number is zero, the extension ends here with a
    following NUL.

  - A number of directory blocks in depth-first-search order, each
    consists of

    - The number of untracked entries, variable width encoding.

    - The number of sub-directory blocks, variable width encoding.

    - The directory name terminated by NUL.

    - A number of untracked file/dir names terminated by NUL.

The remaining data of each directory block is grouped by type:

  - An ewah bitmap, the n-th bit marks whether the n-th directory has
    valid untracked cache entries.

  - An ewah bitmap, the n-th bit records "check-only" bit of
    read_directory_recursive() for the n-th directory.

  - 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.

  - An array of stat data. The n-th data corresponds with the n-th
    "one" bit in the previous ewah bitmap.

  - An array of hashes. The n-th hash corresponds with the n-th "one" bit
    in the previous ewah bitmap.

  - One NUL.

== File System Monitor cache

  The file system monitor cache tracks files for which the core.fsmonitor
  hook has told us about changes.  The signature for this extension is
  { 'F', 'S', 'M', 'N' }.

  The extension starts with

  - 32-bit version number: the current supported versions are 1 and 2.

  - (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.

  - (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.

  - 32-bit bitmap size: the size of the CE_FSMONITOR_VALID bitmap.

  - An ewah bitmap, the n-th bit indicates whether the n-th index entry
    is not CE_FSMONITOR_VALID.

== End of Index Entry

  The End of Index Entry (EOIE) is used to locate the end of the variable
  length index

Title: Git Index Extensions: Directory Blocks and File System Monitor Cache
Summary
This section describes the structure of directory blocks in the untracked cache extension, including the use of ewah bitmaps and stat data, and introduces the File System Monitor cache extension, which tracks file changes reported by the core.fsmonitor hook, with versions 1 and 2 supporting different data formats.