952bee47201e87b0b0e851bcbe6c8940d429cda0 doesn't exist in the repository at /usr/local/git/libexec/git-core/git-svn line 3787
Failed to read object 952bee47201e87b0b0e851bcbe6c8940d429cda0 at /usr/local/git/libexec/git-core/git-svn line 480
In my case the submodule was created indirectly because of the script/plugin install in Rails. I went ahead and dug myself in an even bigger hole:
- I deleted the .submodules file
- I deleted the content of the submodule itself
- I used a tar file instead to install the plugin.
- I generated a new commit
- the HEAD of my repository became a valid git svn commit
Do NOT do the above. Git svn goes back and translates each of your commits. Just cleaning up the HEAD is not good enough because git svn still bombs on the old commit. You need to go back and
rewrite history. If you did not dug yourself in a bigger hole, as I did, you should be able to use git commit --amend. Otherwise you need to do something like the following:
$ git tag bad mywork~5
$ git checkout bad
$ # make changes here and update the index
$ git commit --amend
$ git rebase --onto HEAD bad mywork
Amazingly the above works, although maybe not from the first time :-) With git and git svn is it REALLY worthwhile reading the documentation. For example another gotcha is that you should not merge too much on the git side of things. Read the CAVEATS under the git svn docs.