We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GitPython doesn't support git repos with index version newer than v2.
gitpython-developers/GitPython#1075
Newer versions of git can create indexes with v3 and v4:
https://git-scm.com/docs/index-format
You can work around this problem by downgrading the index format of your repo:
git update-index --index-version=2
But it would be nice if aider used a git package that supported new index formats.
It's worth noting that dulwich currently supports v3 but not v4:
https://github.com/jelmer/dulwich/blob/master/dulwich/index.py#L309C3-L309C3
The text was updated successfully, but these errors were encountered:
I’m not sure if perhaps pygit2 might be another option to support v3+
Edit I checked and it seems like it does indeed support a v3 and v4 index:
(pygit2) louis 🚶 ~/dev/seven $ qp >>> import pygit2; r = pygit2.Repository("."); len(r.index) 13 >>> (pygit2) louis 🚶 ~/dev/seven $ git update-index --index-version 3 (pygit2) louis 🚶 ~/dev/seven $ qp >>> import pygit2; r = pygit2.Repository("."); len(r.index) 13 >>> (pygit2) louis 🚶 ~/dev/seven $ git update-index --index-version 4 (pygit2) louis 🚶 ~/dev/seven $ qp >>> import pygit2; r = pygit2.Repository("."); len(r.index) 13
I say assume: I take it the command is doing what it is supposed to. When I use GitPython it reports v2 always
(pygit2) louis 🚶 ~/dev/seven $ git update-index --index-version 2 (pygit2) louis 🚶 ~/dev/seven $ qp >>> import git; r = git.repo.Repo("."); r.index.version 2 >>> (pygit2) louis 🚶 ~/dev/seven $ git update-index --index-version 3 (pygit2) louis 🚶 ~/dev/seven $ qp >>> import git; r = git.repo.Repo("."); r.index.version 2 >>> (pygit2) louis 🚶 ~/dev/seven $ git update-index --index-version 4 (pygit2) louis 🚶 ~/dev/seven $ qp >>> import git; r = git.repo.Repo("."); r.index.version 2
According to the format docs it should be a 4-byte integer at positions 5:8. The version is indeed changing each time (but not reliably it seems!):
(pygit2) louis 🚶 ~/dev/seven $ git update-index --index-version 2 (pygit2) louis 🚶 ~/dev/seven $ qp >>> from pathlib import Path; int.from_bytes(Path('.git/index').read_bytes()[4:8], "big") 2 >>> (pygit2) louis 🚶 ~/dev/seven $ git update-index --index-version 3 (pygit2) louis 🚶 ~/dev/seven $ qp >>> from pathlib import Path; int.from_bytes(Path('.git/index').read_bytes()[4:8], "big") 2 >>> (pygit2) louis 🚶 ~/dev/seven $ git update-index --index-version 4 (pygit2) louis 🚶 ~/dev/seven $ qp >>> from pathlib import Path; int.from_bytes(Path('.git/index').read_bytes()[4:8], "big") 4
Sorry, something went wrong.
No branches or pull requests
GitPython doesn't support git repos with index version newer than v2.
gitpython-developers/GitPython#1075
Newer versions of git can create indexes with v3 and v4:
https://git-scm.com/docs/index-format
You can work around this problem by downgrading the index format of your repo:
But it would be nice if aider used a git package that supported new index formats.
It's worth noting that dulwich currently supports v3 but not v4:
https://github.com/jelmer/dulwich/blob/master/dulwich/index.py#L309C3-L309C3
The text was updated successfully, but these errors were encountered: