Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Preliminary support for index format v3#2081

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
blahgeek wants to merge2 commits intogitpython-developers:main
base:main
Choose a base branch
Loading
fromblahgeek:support-index-v3

Conversation

@blahgeek
Copy link

Copy link
Member

@ByronByron left a comment

Choose a reason for hiding this comment

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

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.

deftest_index_version_v3(self,tmp_dir):
tmp_dir=Path(tmp_dir)
withcwd(tmp_dir):
subprocess.run(["git","init","-q"],check=True)
Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
Author

Choose a reason for hiding this comment

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

OK done


repo=Repo(tmp_dir)

assertlen(repo.index.entries)==1
Copy link
Member

Choose a reason for hiding this comment

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

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

Copy link
Author

Choose a reason for hiding this comment

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

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
Author

Choose a reason for hiding this comment

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

index.version

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

Currently, theversion field ofIndexFile is always set to2 after__init__. Since it's lazy loaded, it's only after its first read ofentries when itsversion field is set correctly. Do you think we can keep it this way?

@blahgeek
Copy link
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

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

Reviewers

@ByronByronAwaiting requested review from Byron

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@blahgeek@Byron

[8]ページ先頭

©2009-2025 Movatter.jp