Skip to content

Git index version 3 support #1960

Description

@sebastianst

Using git python to add files to an index fails at an index head assertion if the local repo is being otherwise worked on with git 2.46.0:

GitPython/git/index/fun.py

Lines 209 to 210 in cfadd9e

# TODO: Handle version 3: extended data, see read-cache.c.
assert version in (1, 2)

Is it planned to add support for version 3 soon?

I couldn't find any ticket tracking this, so apologies if this is a duplicate.

Activity

  1. Byron commented on Sep 6, 2024

    @Byron
    Member

    There is no plan to add support for extended index flag in V3, even though it would probably be quite easy to add if someone wanted to contribute support for it.

    Generally, I probably wouldn't trust the index implementation as it is here and if possible, repo.git might be able to do the same with a decent amount of convenience.

  2. mgorny commented on Nov 4, 2024

    @mgorny
    Contributor

    For the record, the workaround is to set:

    git config --global feature.manyFiles false
    

    and clone the repo again (or use -c feature.manyFiles=false when cloning it).

  3. tombedor commented on Jun 17, 2025

    @tombedor
    Contributor

    Made a PR to make errors from using an unsupported version a bit easier to debug: #2055

  4. Byron commented on Jun 18, 2025

    @Byron
    Member

    It's a bit sad that the custom index implementation is half-baked only, and a little wonder that people can use it at all. In retrospect, it would have been better to only use Git for index manipulation. Maybe it's possible to workaround with repo.git as well.

  5. misrasaurabh1 commented on Nov 15, 2025

    @misrasaurabh1

    thank you, index v3 support will help fix a crash for us.

  6. added theissue type on Jul 20, 2026
  7. Byron commented on Jul 20, 2026

    @Byron
    Member

    --- agent

    This has been implemented by merged PR #2081, “Preliminary support for index format v3,” merged on November 9, 2025. Current GitPython code accepts index versions 1–3 and writes version 3 when extended flags are present. Closing this issue as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions