protegeproject / protege

Protege Desktop
http://protege.stanford.edu
Other
971 stars 229 forks source link

Problem with Git folder: Caused by: org.eclipse.jgit.errors.CorruptObjectException: Unknown DIRC version 4 #1115

Open SimonBin opened 1 year ago

SimonBin commented 1 year ago
  ERROR  18:02:36  [GitRepo] An error occurred: Unknown DIRC version 4
org.eclipse.jgit.api.errors.JGitInternalException: Unknown DIRC version 4
    at org.eclipse.jgit.api.StatusCommand.call(StatusCommand.java:161) ~[na:na]
    at org.protege.editor.owl.model.git.GitRepositoryManager.getModifiedOntologyDocumentPaths(GitRepositoryManager.java:168) ~[na:na]
    at org.protege.editor.owl.model.git.GitRepositoryManager.isAnyOntologyDocumentModified(GitRepositoryManager.java:153) ~[na:na]
    at org.protege.editor.owl.model.git.GitRepoStatusPresenter.updateStatusView(GitRepoStatusPresenter.java:76) ~[na:na]
    at org.protege.editor.owl.model.git.GitRepoStatusPresenter.handleModelManagerEvent(GitRepoStatusPresenter.java:58) ~[na:na]
    at org.protege.editor.owl.model.OWLModelManagerImpl.lambda$fireEvent$1(OWLModelManagerImpl.java:196) ~[na:na]
gouttegd commented 1 year ago

It seems the version of org.eclipse.jgit that Protégé is using (4.8.0) does not support Git’s index format v4. This support was added in JGit 5.9.0, so I guess we need to update our dependency to at least that version.

In the meantime, a workaround is to have Git rewrite its index using the v2 or v3 format, with

$ git update-index --index-version 3

(This may decrease Git’s performances, as the main advantage of format v4 is a smaller index allowing for faster loading.)