FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Preliminary support for index format v3 by blahgeek · Pull Request #2081 · gitpython-developers/GitPython · GitHub

Preliminary support for index format v3 - #2081

Merged
Byron merged 3 commits into
gitpython-developers:mainfrom
blahgeek:support-index-v3
Nov 9, 2025
Merged

Preliminary support for index format v3#2081
Byron merged 3 commits into
gitpython-developers:mainfrom
blahgeek:support-index-v3

Conversation

blahgeek commented Nov 2, 2025

Copy link
Copy Markdown
Contributor

Byron left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks a lot for tackling this!

I think it would be useful to add a small test-index directly, one that is known to be V3. The Gitoxide repository definitely has them: https://github.com/GitoxideLabs/gitoxide/blob/ecd354119c3a8b150a06df7205ddf022a825d6cd/gix-index/tests/fixtures/loose_index/extended-flags.git-index

Thanks again.

Comment thread test/test_index.py Outdated
def test_index_version_v3(self, tmp_dir):
tmp_dir = Path(tmp_dir)
with cwd(tmp_dir):
subprocess.run(["git", "init", "-q"], check=True)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Would it be possible to use the Git type instead? That way one would benefit from all the 'extras', especially around finding the right Git binary.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

OK done

Comment thread test/test_index.py Outdated

repo = Repo(tmp_dir)

assert len(repo.index.entries) == 1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

To test this, I think the index.version must be exposed and validated here.
I don't see at all why it would use index version 3 here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

To test this, I think the index.version must be exposed and validated here.

Done.

I don't see at all why it would use index version 3 here.

git add -N (--intent-to-add) would produce version 3 index. I added a comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

index.version

There's this minor thing that I'm not sure if it's an issue:

Currently, the version field of IndexFile is always set to 2 after __init__. Since it's lazy loaded, it's only after its first read of entries when its version field is set correctly. Do you think we can keep it this way?

blahgeek commented Nov 8, 2025

Copy link
Copy Markdown
Contributor Author

I think it would be useful to add a small test-index directly, one that is known to be V3. The Gitoxide repository definitely has them: https://github.com/GitoxideLabs/gitoxide/blob/ecd354119c3a8b150a06df7205ddf022a825d6cd/gix-index/tests/fixtures/loose_index/extended-flags.git-index

OK. I've copied the file here and added a test case

Comment thread test/test_index.py Fixed
blahgeek requested a review from Byron November 8, 2025 06:08
Comment thread test/test_index.py Outdated

Byron left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks a lot for adding the tests, it looks great now!

Byron merged commit 564a043 into gitpython-developers:main Nov 9, 2025
27 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL