-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Aider uses GitPython, which doesn't work with index-version 3 git repos #211
Comments
Thanks for trying aider and reporting this issue. It looks like your git repo may be using a newer index format, which might not be supported by GitPython. This GitPython issue has some more info and workarounds. You might want to try |
I tried
|
Ok, I am glad to hear you found a good workaround for your git repo. |
He actually, didn't found a workaround :-) Besides I have the same issue |
Same issue here, @paul-gauthier you might be able to reproduce on your side, the repo is https://github.com/status-im/status-mobile, it's a large repo
|
This works for me:
|
I'm also hitting this issue (see below), but unfortunately none of the workarounds worked for me. Curiously, I don't seem to be getting it in my other repo. Workarounds tried:
Error:
P.S. Just wanna say I love the idea of aider. Thanks for making it as well as open sourcing it |
Update: I was able to fix my issue by updating to the latest version of git (2.44) and running the The latest version of git has the option |
For future reference, I don't believe that downgrading your index version is supported. I ended up deleting my index (while the repo was fully checked in and backed up) and running git reset. Digging into it a little deeper, the issue is because GitPython only supports index version 1 and 2 (relevant code), and since the project is in maintenance mode it seems like there is a decent change that this won't be fixed in near future (though the GitPython maintainer is open to merging feature contributions). Hopefully the authors successor project GitOxide will be stable and have a Python binding at some point soon. |
Having the same issue. |
Did you try updating the index as described earlier in this issue? |
Yes, I'm not sure what the issue is:
However, I can workaround this with |
I should clarify - I know what the issue is, I just haven't looked into how to fix it!
|
No skip worktree works for me, but this isn't a solution, as I have to keep certain files silenced, so they do not keep popping up in Source Control changes. Is there a better workaround? |
Just to mention, this also happens when you've used See this comment. |
Since this was new to me and the official documentation about git index versions is quite dense, I asked Sonnet-3.5 and ChatGPT for clarification, with ChatGPT producing a much better answer in this case (may be helpful for others, hopefully): --- AI slop start --- Git index versions (2, 3, and 4) represent different formats of the index file (also known as the staging area) that Git uses to track the state of your working directory between commits. Here's an explanation of the key points regarding when the index version changes, the default version, and how certain Git features might force an index upgrade. 1. Default Git Index Version
2. Index Upgrades via Git FeaturesGit will upgrade the index version under specific circumstances, often related to optimizations or special features that require newer formats.
Git does not automatically upgrade the index unless you explicitly use features that require a newer version. For example, working with very large repositories or using experimental features (like the SHA-256 transition) may force an upgrade to version 4. 3. How Git Index Version Is Set
4. Ensuring Compatibility with GitPythonSince GitPython only supports version 2, the safest approach is to:
ConclusionIf you're using basic Git features (commits, branches, diffs, etc.), the index will likely stay at version 2. However, advanced features like sparse checkouts, experimental SHA-256 support, or very large repositories may trigger an automatic upgrade to version 4. As long as you avoid these scenarios, the repository should remain compatible with tools that use GitPython. --- AI slop end --- |
Dear community, Explicitly commanding git to change version:
responded with
However, just next call of Then I decided to roll back my action and applied For better precision, my git version is 2.47.0, working on Mac OS X Sequia 15.1 24B83 and installed via homebrew. On other environments it might not be relevant but as far as this is homebrew git, I think it should work. The fix is reproducible reliably and should help you. Just try to find the actual reason (your action) what led to switching the version of git index. OF course, --no-skip-worktree is far not the only thing which might lead to this. |
I am also facing the same problem when working with git repositories created by Qt Creator. I am using aider 0.66.0. But I have faced no problems in repos created by others. |
@fry69's AI slop turned out to be helpful to resolve the issue in my case:
I was using sparse-checkout, which made downgrading the index impossible. after disabling it, downgrading index worked smoothly. :). hope it helps someone! |
@paul-gauthier @daniel-nimptsch
I had this problem when running aider in a very large repo. I had previously had a problem which was fixed by the prune and repack; and when I later encountered the |
Not sure this is related but for one of my repo i have a submodule called |
FYI using I got aider to add a nix flake to my project, ran nix commands, and encountered this bug. I later found out that nix was what upgraded the git repo index version. |
When executing aider in an existing repo with R, Python, and Bash scripts, I get this error. When executing aider in a much smaller repo of only Python files, it works without problems. Thank you very much.
Error
aider
Details
aider --version
ctags --version
The text was updated successfully, but these errors were encountered: