Hi -
I installed and starting using git bug on a repo back in November or so of last year. Today I upgraded to the latest git bug and it seems most commands yield this error:
✔ danl@Dans-iMac 11:43 [~/proj/myproject master]
└─ $ git bug ls
A lock file is present but the corresponding process is not, removing it.
Building identity cache... Done.
Building bug cache... Error: failed to decode OperationPack json: invalid character '+' looking for beginning of value
Usage:
git-bug ls [<query>] [flags]
[...]
I understand there've been changes that aren't be backwards compatible so I do not have the expectation that my bug db is recoverable. My 2 questions:
- How can I fix this error (if it is indeed fixable)...
- And if it isn't, how can I remove the bug db and start a new one?
Thanks!
Dan
Interesting, the data model should be backward compatible. I can't really fully garantee it until we reach 1.0, but the last update should not have broken anything. Would you be able to run git-bug in a debugger and see where that breaks ? What the bug data looks like ? You can also inspect the data structure with a git client.
Or maybe you could push the bug somewhere i can access it ?
I had a look at this issue. I didn't realize that you were using such a early version ...
So what is happening is that I changed the data model format in version 0.3.0 back in september, to use JSON instead of the go-only gob serialization format. Here is the issue as to why: https://github.com/MichaelMure/git-bug/issues/5
Due to the very early nature of the project at that time (it was basically a prototype)I considered that I could make breaking changes for the sake of pushing the project forward. Hopefully you understand. The project right now is in a much better shape. The last updates introduced a radical changes in how identities are stored in the data model, while still being backward compatible, so I have good hopes that there will be no more data model breakage and that the 1.0 version, where I can actually guarantee that users can safely rely on git-bug, is not far away.
So, in short, there is no automated migration path available for this change. The best solution that I can give you would be to use an old binary to read your old bugs, and use a new one to insert them in the new format using copy/pastes.
Now a problem you will have is that you can't run both version on the same repo, and the new version will fail to start properly if you have bugs considered invalid in your database. So you will need to copy you repository and clean all the bugs data to get a clean repo where you can run the new version. To remove all the bugs, you can run the following commands:
git for-each-ref refs/bugs/ | cut -f 2 | xargs -r -n 1 git update-ref -d
git for-each-ref refs/remotes/origin/bugs/ | cut -f 2 | xargs -r -n 1 git update-ref -d
If there is still an error, you can also delete the .git/git-bug folder.
Sorry for the inconvenience :-|