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

[JGIT PATCH 0/9] Misc. pack code cleanups

From
Shawn O. Pearce <spearce@spearce.org>
Date
Feb 12, 2009, 02:36 UTC
Message-ID
<1234406219-19547-1-git-send-email-spearce@spearce.org>

This is a short batch of misc. cleanups related to pack handling. I'm trying to work towards making it safer to run "git gc" while JGit has a repository open.

Currently:
  - when a new pack is added we don't notice it;
  - when a previously listed pack is removed, we crash;
  - if a pack stays but its offsets change, we crash;
  - objects can go *poof* if they were loose and get packed;

This series doesn't fix any of these issues, but it cleans up the code enough that I can start to consider this more.

The last patch is perhaps a bit more controversial. It sets core.packindex to 2 by default, which was done in C Git back when 1.6.0 shipped.

Shawn O. Pearce (9):
  Remove the Repository parameter from PackFile's constructor
  Remove dead stats code from WindowCache
  Document why WindowFile's hash is *31
  Allow PackFile to lazily load its PackIndex on first demand
  Arrange pack files in recency order to improve quick hits
  Rename readPackHeader() to be onOpenPack()
  Validate the pack's footer checksum matches that in the index
  Remove yet another legacy StGit utility function
  Make pack.indexversion config option default to version 2
 .../src/org/spearce/jgit/pgm/IndexPack.java        |    4 +-
 .../tst/org/spearce/jgit/lib/PackWriterTest.java   |    2 +-
 .../tst/org/spearce/jgit/lib/T0004_PackReader.java |    2 +-
 .../org/spearce/jgit/transport/IndexPackTest.java  |    4 +-
 .../src/org/spearce/jgit/lib/CoreConfig.java       |    3 +-
 .../src/org/spearce/jgit/lib/PackFile.java         |   95 +++++++++++++------
 .../src/org/spearce/jgit/lib/PackIndex.java        |    3 +
 .../src/org/spearce/jgit/lib/PackIndexV1.java      |    3 +
 .../src/org/spearce/jgit/lib/PackIndexV2.java      |    3 +
 .../src/org/spearce/jgit/lib/PackWriter.java       |    1 +
 .../org/spearce/jgit/lib/PackedObjectLoader.java   |    4 +-
 .../src/org/spearce/jgit/lib/Repository.java       |   41 +++------
 .../src/org/spearce/jgit/lib/WindowCache.java      |   31 +------
 .../src/org/spearce/jgit/lib/WindowedFile.java     |    4 +
 14 files changed, 106 insertions(+), 94 deletions(-)
Next: Shawn O. Pearce
Message 1 of 10 in “Misc. pack code cleanups”
  1. 0/9 Misc. pack code cleanupsShawn O. Pearce, Feb 12, 2009
  2. 1/9 Remove the Repository parameter from PackFile's constructorShawn O. Pearce, Feb 12, 2009
  3. 2/9 Remove dead stats code from WindowCacheShawn O. Pearce, Feb 12, 2009
  4. 3/9 Document why WindowFile's hash is *31Shawn O. Pearce, Feb 12, 2009
  5. 4/9 Allow PackFile to lazily load its PackIndex on first demandShawn O. Pearce, Feb 12, 2009
  6. 5/9 Arrange pack files in recency order to improve quick hitsShawn O. Pearce, Feb 12, 2009
  7. 6/9 Rename readPackHeader() to be onOpenPack()Shawn O. Pearce, Feb 12, 2009
  8. 7/9 Validate the pack's footer checksum matches that in the indexShawn O. Pearce, Feb 12, 2009
  9. 8/9 Remove yet another legacy StGit utility functionShawn O. Pearce, Feb 12, 2009
  10. 9/9 Make pack.indexversion config option default to version 2Shawn O. Pearce, Feb 12, 2009

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.