• Jonathan Nieder's avatar
    index: make index.threads=true enable ieot and eoie · 2a9dedef
    Jonathan Nieder authored
    If a user explicitly sets
    		threads = true
    to read the index using multiple threads, ensure that index writes
    include the offset table by default to make that possible.  This
    ensures that the user's intent of turning on threading is respected.
    In other words, permit the following configurations:
    - index.threads and index.recordOffsetTable unspecified: do not write
      the offset table yet (to avoid alarming the user with "ignoring IEOT
      extension" messages when an older version of Git accesses the
      repository) but do make use of multiple threads to read the index if
      the supporting offset table is present.
      This can also be requested explicitly by setting index.threads=true,
      0, or >1 and index.recordOffsetTable=false.
    - index.threads=false or 1: do not write the offset table, and do not
      make use of the offset table.
      One can set index.recordOffsetTable=false as well, to be more
    - index.threads=true, 0, or >1 and index.recordOffsetTable unspecified:
      write the offset table and make use of threads at read time.
      This can also be requested by setting index.threads=true, 0, >1, or
      unspecified and index.recordOffsetTable=true.
    Fortunately the complication is temporary: once most Git installations
    have upgraded to a version with support for the IEOT and EOIE
    extensions, we can flip the defaults for index.recordEndOfIndexEntries
    and index.recordOffsetTable to true and eliminate the settings.
    Helped-by: default avatarBen Peart <benpeart@microsoft.com>
    Signed-off-by: default avatarJonathan Nieder <jrnieder@gmail.com>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
config.h 10.8 KB