Bug 565774 - JGit does not support index version 4
Summary: JGit does not support index version 4
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 5.8   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 5.9   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-03 04:13 EDT by Christian De Angelis CLA
Modified: 2020-08-15 08:35 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian De Angelis CLA 2020-08-03 04:13:27 EDT
When attempting to perform certain commands on a repository using index version 4, JGit fails to be able to read the index, as it only supports up to version 3.

Caused by: org.eclipse.jgit.errors.CorruptObjectException: Unknown DIRC version 4
	at org.eclipse.jgit.dircache.DirCache.readFrom(DirCache.java:453)
	at org.eclipse.jgit.dircache.DirCache.read(DirCache.java:396)
	at org.eclipse.jgit.dircache.DirCache.read(DirCache.java:188)
	at org.eclipse.jgit.dircache.DirCache.read(DirCache.java:160)
	at org.eclipse.jgit.lib.Repository.readDirCache(Repository.java:1239)
	at org.eclipse.jgit.lib.IndexDiff.diff(IndexDiff.java:444)
	at org.eclipse.jgit.lib.IndexDiff.diff(IndexDiff.java:379)
	at org.eclipse.jgit.lib.IndexDiff.diff(IndexDiff.java:354)
	at org.eclipse.jgit.api.StatusCommand.call(StatusCommand.java:122)
	... 14 more

Is support for version 4 going to be coming soon? Git documentation says that support for index version 4 was been released almost 8 years ago:

> Version 4 performs a simple pathname compression that reduces index size by 30%-50% on large repositories, which results in faster load time. Version 4 is relatively young (first released in 1.8.0 in October 2012)

https://git-scm.com/docs/git-update-index#Documentation/git-update-index.txt---index-versionltngt
Comment 1 Eclipse Genie CLA 2020-08-10 15:40:32 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/167503
Comment 2 Thomas Wolf CLA 2020-08-10 15:42:50 EDT
(In reply to Eclipse Genie from comment #1)
> New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/167503

(In reply to Christian De Angelis from comment #0)
> Is support for version 4 going to be coming soon?

There it is, but I don't know how soon it'll be reviewed and merged.