git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [JGIT PATCH 00/10] Support writing pack index version 2

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jun 25, 2008, 03:54 UTC
Message-ID
<20080625035409.GY11793@spearce.org>
In-Reply-To
<200806250048.29892.robin.rosenberg.lists@dewire.com>
Robin Rosenberg <robin.rosenberg.lists@dewire.com> wrote:
> 
> Ocular review looks fine, but nevertheless some tests break.
Dammit.
 
> org.spearce.jgit.lib.PackIndexV2Test
> testIteratorMethodsContract(org.spearce.jgit.lib.PackIndexV2Test)
> java.io.IOException: Unreadable pack index: /home/me/SW/EGIT.contrib/org.spearce.jgit.test/tst/pack-34be9032ac282b11fa9babdc2b2a93ca996c9c2f.idxV2
> 	at org.spearce.jgit.lib.PackIndex.open(PackIndex.java:95)
...
> 	at org.spearce.jgit.lib.PackIndexV1.<init>(PackIndexV1.java:75)
Yea, OK, I know what that is.  I busted PackIndex.isTOC.

I asked it to compare a 4 byte array (TOC only) to an 8 byte array (TOC + version) and of course 4 != 8 so it fails. Thus all V2 index files look like V1 files. Only they aren't; and then all hell breaks loose when we start treating parts of the V2 index as different sections of the V1 index.

I'll post a replacement patch in a minute.
> Together with Marek's packwrite patches the list gets even longer (his patches alone are "green"). I'm
> not including them here.

That's because Marek's branch includes additional tests for features he added to PackIndexV2. But all PackIndexV2 reading is busted.

-- 
Shawn.
Previous: Robin Rosenberg
Message 14 of 14 in “Support writing pack index version 2”
  1. 00/10 Support writing pack index version 2Shawn O. Pearce, Jun 24, 2008
  2. 01/10 Extract inner ObjectEntry from IndexPack classShawn O. Pearce, Jun 24, 2008
  3. 02/10 Make ObjectEntry's position field privateShawn O. Pearce, Jun 24, 2008
  4. 03/10 Rename ObjectEntry to PackedObjectInfoShawn O. Pearce, Jun 24, 2008
  5. 04/10 Document PackedObjectInfo and make it public for reuseShawn O. Pearce, Jun 24, 2008
  6. 05/10 Refactor pack index writing to a common APIShawn O. Pearce, Jun 24, 2008
  7. 06/10 Reuse the magic tOc constant for pack index headersShawn O. Pearce, Jun 24, 2008
  8. 07/10 Add 64 bit network byte order encoding to NBShawn O. Pearce, Jun 24, 2008
  9. 08/10 Compute packed object entry CRC32 data during IndexPackShawn O. Pearce, Jun 24, 2008
  10. 09/10 Add support for writing pack index v2 filesShawn O. Pearce, Jun 24, 2008
  11. 10/10 Default IndexPack to honor pack.indexversion configurationShawn O. Pearce, Jun 24, 2008
  12. 06/10 Reuse the magic tOc constant for pack index headersShawn O. Pearce, Jun 25, 2008
  13. Robin RosenbergJun 24, 2008
  14. Shawn O. PearceJun 25, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.