Thanks to visit codestin.com
Credit goes to github.com

Skip to content

support git 2.21's multi-pack-index #5399

Closed
@lhchavez

Description

@lhchavez

Starting from version 2.21, git supports multi-pack-index, which allows for O(log n) scan of n objects among m packfiles (instead of O(m log n/m)) without needing to do a garbage collection to compact all the objects into a single .pack file. This is desirable in cases where there are lots of Delta islands or it is otherwise undesirable to merge large numbers of packfiles.

This should be relatively straightforward to implement. odb_pack.c would need to be modified so that the multi-pack-index's index is consulted first. Only if an OID is not found there, it should fall back to the current behavior of iterating over all the .pack files, although packfile_load__cb() should be modified to ignore any files that are indexed in multi-pack-index (to avoid degenerating back into O(m log n/m) complexity).

This can be split in four chunks for easier reviewing:

Relevant documentation:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions